USTC ICS(2023Fall) Lab7 LC-3 Assembler

C++代码

#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>using namespace std;vector<string> read_asm_file(const string &filename);
void write_output_file(const string &filename, const vector<string> &output);
vector<string> Assemble(const vector<string>& lines);int npower_16(int n);//return 16^n
int Hex2Num(char ch);//turn a character to the correspond number in hex repreinstructiontation
int atoi_hex(string strInValue);//replace a hex string to it's value
int s_find(string str, char c, int time);//return the position of the time'th character 'c' in the string str
string Pretreat(string line);//delete the label and construct symbol_address table
string dec_to_2com(int n, int digit);//turn a decimical number n to it's "digit" digits 2's complements
string get_first_word(string str);//return the first word(divided by space) in the instructiontence//translate each instrution from a lc-3 code line string to it's machine code string(end with \n)
string translate_instruction(const string &instruction);
string trans_ADD(string instruction);
string trans_AND(string instruction);
string trans_NOT(string instruction);
string trans_BR(string instruction);
string trans_JMP(string instruction);
string trans_JSR(string instruction);
string trans_JSRR(string instruction);
string trans_LD(string instruction);
string trans_LDI(string instruction);
string trans_LDR(string instruction);
string trans_LEA(string instruction);
string trans_RET(string instruction);
string trans_RTI(string instruction);
string trans_ST(string instruction);
string trans_STI(string instruction);
string trans_STR(string instruction);
string trans_TRAP(string instruction);
string trans_FILL(string instruction);
string trans_BLKW(string instruction);
string trans_STRINGZ(string instruction);int start_address;//the address after .ORIG
int current_address;//record the address of the current instruction
map<string, int> SA;//symbol_address table

主函数

int main(int argc, char *argv[]){if (argc != 3){cerr << "Usage: " << argv[0] << " <input_file.asm> <output_file.txt>" << endl;return 1;}string input_filename = argv[1];string output_filename = argv[2];vector<string> input_lines = read_asm_file(input_filename);Pretreat(input_lines[0]);//find the start addressvector<string> output_lines;output_lines.push_back(dec_to_2com(start_address,16));vector<string> pretreated_lines;// use the iterator to skip the first lineauto iter = input_lines.begin();++iter;  // skip the first linefor (; iter != input_lines.end(); ++iter) {string& line = *iter;string pretreated_line = Pretreat(line);if(pretreated_line!="SKIP")pretreated_lines.push_back(pretreated_line);elsebreak;}auto assembled_lines = Assemble(pretreated_lines);output_lines.insert(output_lines.end(), assembled_lines.begin(), assembled_lines.end());write_output_file(output_filename, output_lines);return 0;
}

文件的读取与写入

vector<string> read_asm_file(const string &filename){vector<string> lines;string line;ifstream file(filename);if (file.is_open()){while (getline(file, line))lines.push_back(line);file.close();}elsecerr << "Unable to open file: " << filename << endl;return lines;
}void write_output_file(const string &filename, const vector<string> &output){ofstream file(filename);for(const auto &line:output){string temp;for(int i=0;i<line.length();i++)if(line[i]=='\n'||line[i]=='0'||line[i]=='1')temp+=line[i];file<<temp<<endl;}file.close();
}

汇编

vector<string> Assemble(const vector<string>& lines) {vector<string> mach_codes;current_address = start_address - 1;for (const string& line : lines) {string mach_code = "";mach_code.resize(10000);mach_code[0] = '\0';string fw = get_first_word(line);if (fw == ".BLKW"){int d = s_find(line, '#', 1);int imm16 = atoi(line.substr(d + 1).c_str());current_address += imm16;}else if (fw == ".STRINGZ"){int d1 = s_find(line, '"', 1) + 1;int d2 = s_find(line, '"', 2) - 1;current_address += d2 - d1 + 2;}elsecurrent_address++;string mach_line;//this string is what we finally want to getmach_line.resize(18);mach_line=translate_instruction(line);//translationmach_code.append(mach_line);mach_codes.push_back(mach_code);}return mach_codes;
}

预处理

//Label Deleting and Symbol_Adrress table construction 
string Pretreat(string line){string output_line;output_line.resize(300);int temp_address=-1,j = 0;//notice that .BLKW and .STRINGZ occupies may not only one location in memory.string fw = get_first_word(line);if (fw == ".ORIG"){start_address = atoi_hex(line.substr(s_find(line, 'x', 1)+1).c_str());current_address = start_address-1;}else if (fw == ".END")return "SKIP";else if (fw == ".BLKW" || get_first_word(line.substr(fw.length() + 1, line.length() - fw.length())) == ".BLKW"){int d = s_find(line, '#', 1);int imm16 = atoi(line.substr(d + 1).c_str());temp_address = current_address + 1;current_address += imm16;}else if (fw == ".STRINGZ"||get_first_word(line.substr(fw.length()+1,line.length()-fw.length()))==".STRINGZ"){int d1 = s_find(line, '"', 1) + 1;int d2 = s_find(line, '"', 2) - 1;temp_address = current_address + 1;current_address += d2 - d1+2;}else{current_address++;temp_address = current_address;}//If the first word is not the instruction set, it is listed in symbol_ Address table and deleted in the codeif (fw != ".ORIG" && fw != "ADD" && fw != "AND" && fw != "NOT" && fw != "LD" && fw != "LDR" && fw != "LDI" && fw != "ST" &&fw != "STR" && fw != "STI" && fw != "TRAP" && fw != "LEA" && fw != "RTI" && fw != "JMP" && fw != "JSR" &&fw != "RET" && fw != "JSRR" && fw != ".FILL" && fw != ".STRINGZ" && fw != ".BLKW" && fw != "BR" && fw != "BRN" &&fw != "BRZ" && fw != "BRP" && fw != "BRNZ" && fw != "BRNP" && fw != "BRZP" && fw != "BRNZP" && fw != "TRAP" &&fw != ".END" && fw[0] != '\0'){SA.insert(make_pair(fw, temp_address));line.erase(s_find(line, fw[0], 1), fw.length());line.erase(s_find(line, ' ', 1), 1);}return line;
}

汇编指令转为机器码

string translate_instruction(const string &instruction){string machine_code,fw;fw = get_first_word(instruction);if (fw == "ADD")return trans_ADD(instruction);else if (fw == "AND")return trans_AND(instruction);else if (fw == "NOT")return trans_NOT(instruction);else if (fw == "LD")return trans_LD(instruction);else if (fw == "LDR")return trans_LDR(instruction);else if (fw == "LDI")return trans_LDI(instruction);else if (fw == "LEA")return trans_LEA(instruction);else if (fw == "ST")return trans_ST(instruction);else if (fw == "STR")return trans_STR(instruction);else if (fw == "STI")return trans_STI(instruction);else if (fw == "JMP")return trans_JMP(instruction);else if (fw == "JSRR")return trans_JSRR(instruction);else if (fw == "JSR")return trans_JSR(instruction);else if (fw == "RET")return trans_RET(instruction);else if (fw == "RTI")return trans_RTI(instruction);else if (fw == "BR" || fw == "BRN" || fw == "BRZ" || fw == "BRP" ||fw== "BRNZ" || fw == "BRNP" || fw == "BRZP" || fw == "BRNZP")return trans_BR(instruction);else if (fw == "TRAP" )return trans_TRAP(instruction);else if (fw == ".FILL")return trans_FILL(instruction);else if (fw == ".BLKW")return trans_BLKW(instruction);else if (fw == ".STRINGZ")return trans_STRINGZ(instruction);else if(fw==".END")return "";return "";
}//translate each instrutions(from a lc-3 code line string to it's machine code string(end with \n))
//mainly by handlding the operation on STRING
string trans_ADD(string instruction){string code;code.resize(18);code = "0001";int d1 = s_find(instruction, 'R', 1) + 1;int DR = instruction[d1] - '0';code.append(dec_to_2com(DR, 3));int d2 = s_find(instruction, 'R', 2) + 1;int SR1 = instruction[d2] - '0';code.append(dec_to_2com(SR1, 3));int d3 = s_find(instruction, '#', 1);if (d3 != -1){code.append("1");int imm5 = atoi(instruction.substr(d3 + 1).c_str());code.append(dec_to_2com(imm5, 5));}int d4 = s_find(instruction, 'x', 1);if (d4 != -1){code.append("1");int imm5 = atoi_hex(instruction.substr(d4 + 1).c_str());code.append(dec_to_2com(imm5, 5));}else if (d3 == -1 && d4 == -1){code.append("000");d3 = s_find(instruction, 'R', 3) + 1;int SR3 = instruction[d3] - '0';code.append(dec_to_2com(SR3, 3));}return code;
}string trans_AND(string instruction){string code;code.resize(18);code = "0101";int d1 = s_find(instruction, 'R', 1) + 1;int DR = instruction[d1] - '0';code.append(dec_to_2com(DR, 3));int d2 = s_find(instruction, 'R', 2) + 1;int SR1 = instruction[d2] - '0';code.append(dec_to_2com(SR1, 3));int d3 = s_find(instruction, '#', 1);if (d3 != -1){code.append("1");int imm5 = atoi(instruction.substr(d3 + 1).c_str());code.append(dec_to_2com(imm5, 5));}int d4 = s_find(instruction, 'x', 1);if (d4 != -1){code.append("1");int imm5 = atoi_hex(instruction.substr(d4 + 1).c_str());code.append(dec_to_2com(imm5, 5));}else if (d3 == -1 && d4 == -1){code.append("000");d3 = s_find(instruction, 'R', 3) + 1;int SR3 = instruction[d3] - '0';code.append(dec_to_2com(SR3, 3));}return code;
}string trans_NOT(string instruction){string code;code.resize(18);code = "1001";int d1 = s_find(instruction, 'R', 1) + 1;int DR = instruction[d1] - '0';code.append(dec_to_2com(DR, 3));int d2 = s_find(instruction, 'R', 2) + 1;int SR = instruction[d2] - '0';code.append(dec_to_2com(SR, 3));code.append("111111");return code;
}string trans_LD(string instruction){string code;code.resize(18);code = "0010";int d1 = s_find(instruction, 'R', 1) + 1;int DR = instruction[d1] - '0';code.append(dec_to_2com(DR, 3));int d2 = s_find(instruction, '#', 1);int off9;if (d2 != -1)off9 = atoi(instruction.substr(d2 + 1).c_str());else{int d3 = s_find(instruction, ',', 1) + 1;string last = instruction.substr(d3, instruction.length() - d3);string label = get_first_word(last);int address = 3000;if (SA.find(label) != SA.end())address = SA.find(label)->second;off9 = address - current_address-1;}code.append(dec_to_2com(off9, 9));return code;
}string trans_LDR(string instruction){string code;code.resize(18);code = "0110";int d1 = s_find(instruction, 'R', 2) + 1;int DR = instruction[d1] - '0';code.append(dec_to_2com(DR, 3));int d2 = s_find(instruction, 'R', 3) + 1;int BR = instruction[d2] - '0';code.append(dec_to_2com(BR, 3));int d3 = s_find(instruction, '#', 1);if (d3 != -1){int imm6 = atoi(instruction.substr(d3 + 1).c_str());code.append(dec_to_2com(imm6, 6));}int d4 = s_find(instruction, 'x', 1);if (d4 != -1){int imm6 = atoi_hex(instruction.substr(d4 + 1).c_str());code.append(dec_to_2com(imm6, 6));}return code;
}string trans_LDI(string instruction){string code;code.resize(18);code = "1010";int d1 = s_find(instruction, 'R', 1) + 1;int DR = instruction[d1] - '0';code.append(dec_to_2com(DR, 3));int d2 = s_find(instruction, '#', 1);int off9;if (d2 != -1)off9 = atoi(instruction.substr(d2 + 1).c_str());else{int d3 = s_find(instruction, ',', 1) + 1;string last = instruction.substr(d3, instruction.length() - d3);string label = get_first_word(last);int address = 3000;if (SA.find(label) != SA.end())address = SA.find(label)->second;off9 = address - current_address-1;}code.append(dec_to_2com(off9, 9));return code;
}string trans_LEA(string instruction){string code;code.resize(18);code = "1110";int d1 = s_find(instruction, 'R', 1) + 1;int DR = instruction[d1] - '0';code.append(dec_to_2com(DR, 3));int d2 = s_find(instruction, '#', 1);int off9;if (d2 != -1)off9 = atoi(instruction.substr(d2 + 1).c_str());else{int d3 = s_find(instruction, ',', 1) + 1;string last = instruction.substr(d3, instruction.length() - d3);string label = get_first_word(last);int address = 3000;if (SA.find(label) != SA.end())address = SA.find(label)->second;off9 = address - current_address-1;}code.append(dec_to_2com(off9, 9));return code;
}string trans_ST(string instruction){string code;code.resize(18);code = "0011";int d1 = s_find(instruction, 'R', 1) + 1;int DR = instruction[d1] - '0';code.append(dec_to_2com(DR, 3));int d2 = s_find(instruction, '#', 1);int off9;if (d2 != -1)off9 = atoi(instruction.substr(d2 + 1).c_str());else{int d3 = s_find(instruction, ',', 1) + 1;string last = instruction.substr(d3, instruction.length() - d3);string label = get_first_word(last);int address = 3000;if (SA.find(label) != SA.end())address = SA.find(label)->second;off9 = address - current_address-1;}code.append(dec_to_2com(off9, 9));return code;
}string trans_STR(string instruction){string code;code.resize(18);code = "0111";int d1 = s_find(instruction, 'R', 2) + 1;int DR = instruction[d1] - '0';code.append(dec_to_2com(DR, 3));int d2 = s_find(instruction, 'R', 3) + 1;int BR = instruction[d2] - '0'; code.append(dec_to_2com(BR, 3));int d3 = s_find(instruction, '#', 1);if (d3 != -1){int imm6 = atoi(instruction.substr(d3 + 1).c_str());code.append(dec_to_2com(imm6, 6));}int d4 = s_find(instruction, 'x', 1);if (d4 != -1){int imm6 = atoi_hex(instruction.substr(d4 + 1).c_str());code.append(dec_to_2com(imm6, 6));}return code;
}string trans_STI(string instruction){string code;code.resize(18);code = "1011";int d1 = s_find(instruction, 'R', 1) + 1;int DR = instruction[d1] - '0';code.append(dec_to_2com(DR, 3));int d2 = s_find(instruction, '#', 1);int off9;if (d2 != -1)off9 = atoi(instruction.substr(d2 + 1).c_str());else{int d3 = s_find(instruction, ',', 1) + 1;string last = instruction.substr(d3, instruction.length() - d3);string label = get_first_word(last);int address = 3000;if (SA.find(label) != SA.end())address = SA.find(label)->second;off9 = address - current_address-1;}code.append(dec_to_2com(off9, 9));return code;
}string trans_JMP(string instruction){string code;code.resize(18);code = "1100";code.append("000");int d1 = s_find(instruction, 'R', 1) + 1;int DR = instruction[d1] - '0';code.append(dec_to_2com(DR, 3));code.append("000000");return code;
}string trans_JSRR(string instruction){string code;code.resize(18);code = "0100";code.append("000");int d1 = s_find(instruction, 'R', 3) + 1;int DR = instruction[d1] - '0';code.append(dec_to_2com(DR, 3));code.append("000000");return code;
}string trans_JSR(string instruction){string code;code.resize(18);code = "01001";int off11;int d = s_find(instruction, 'R', 1) + 1;string last = instruction.substr(d, instruction.length() - d);string label = get_first_word(last);int address = 3000;if (SA.find(label) != SA.end())address = SA.find(label)->second;off11 = address - current_address-1;code.append(dec_to_2com(off11, 11));return code;
}string trans_RTI(string instruction){string code= "1000000000000000";return code;
}string trans_RET(string instruction){string code= "1100000111000000";return code;
}string trans_BR(string instruction){string code;code.resize(18);code = "0000";int NZP = 0;string br_part = get_first_word(instruction);if (s_find(br_part, 'N', 1) != -1)NZP += 4;if (s_find(br_part, 'Z', 1) != -1)NZP += 2;if (s_find(br_part, 'P', 1) != -1)NZP += 1;if (s_find(br_part, 'N', 1) == -1 && s_find(br_part, 'Z', 1) == -1 && s_find(br_part, 'P', 1) == -1)NZP = 7;code.append(dec_to_2com(NZP, 3));int d2 = s_find(instruction, '#', 1);int off9;if (d2 != -1)off9 = atoi(instruction.substr(d2 + 1).c_str());else{int d3 = max(max(s_find(br_part, 'R', 1) + 1, s_find(br_part, 'N', 1) + 1), max(s_find(br_part, 'Z', 1) + 1, s_find(br_part, 'P', 1) + 1)) + s_find(instruction, 'B', 1);string last = instruction.substr(d3, instruction.length() - d3);string label = get_first_word(last);int address = 3000;if (SA.find(label) != SA.end())address = SA.find(label)->second;off9 = address - current_address-1;}code.append(dec_to_2com(off9, 9));return code;
}string trans_TRAP(string instruction){string code;code.resize(18);code = "11110000";string fw = get_first_word(instruction);string trap_vector8 = "00000000";//written in "TRAP vector8" formulaint d = s_find(instruction, 'x', 1) + 1;trap_vector8 = dec_to_2com(atoi_hex(instruction.substr(d, instruction.length() - d).c_str()), 8);code.append(trap_vector8);return code;
}string trans_FILL(string instruction){string code = "";code.resize(18);int imm16 = 0;int d = s_find(instruction, '#', 1);if (d != -1)imm16 = atoi(instruction.substr(d + 1, instruction.length()-d).c_str());else if (s_find(instruction, 'x', 1) != -1){d = s_find(instruction, 'x', 1);imm16 = atoi_hex(instruction.substr(d + 1, instruction.length()-d).c_str());}elsereturn NULL;code.append(dec_to_2com(imm16, 16));return code;
}string trans_BLKW(string instruction){string line1 = "",line2="";line1.resize(18);line2.resize(18);line1 = "0000000000000000\n";line2 = "0000000000000000";int d = s_find(instruction, '#', 1);int imm16 = atoi(instruction.substr(d + 1, instruction.length()-d).c_str());string codes = "";codes.resize(d * 17 + 1);for (int i = 1; i < imm16; i++)codes.append(line1);codes.append(line2);return codes;
}string trans_STRINGZ(string instruction){string codes = "";int d1 = s_find(instruction, '"', 1) + 1;int d2 = s_find(instruction, '"', 2) - 1;if (d1 > d2){codes.resize(18);codes.append("0000000000000000");return codes;}string str = instruction.substr(d1, d2 - d1 + 1);codes.resize(str.length() * 17 + 1);string line = "";line.resize(18);int i = 0;while (str[i]){line = "";line.append(dec_to_2com((int)str[i], 16));line.append("\n");codes.append(line);i++;}line = "";line.append("0000000000000000");codes.append(line);return codes;
}

其他一些函数

//return the first word (divided by space) in the instructiontence
string get_first_word(string str){int i = 0, j = 0, k = 0;while (str[i] == ' ')i++;string ret = "";for (k = 0, j = i; str[j] != ' ' && str[j]; k++, j++)ret += str[j];return ret;
}int  npower_16(int n){//return 16^nint i;long total = 1;if (n >= 1)for (i = 0; i < n; i++)total *= 16;return total;
}//turn a character to the correspond number in hex repreinstructiontation
int  Hex2Num(char ch){int value = 0;if (ch >= '0' && ch <= '9')value = ch - 48;if (ch >= 'A' && ch <= 'F')value = ch - 65 + 10;if (ch >= 'a' && ch <= 'f')value = ch - 97 + 10;return  value;
}//translate a hex string to it's value
int atoi_hex(string strInValue){strInValue = get_first_word(strInValue);int j = 0;int flag = 1;if (strInValue[0] == '-'){flag = -1;//negativej++;}char hex[9];char str[9];int  cnt = 0, i = 0;int  sum = 0;while (strInValue[j] != '\0' && strInValue[j] != ' '){hex[cnt] = strInValue[j];cnt++;j++;}hex[cnt] = '\0';for (i = 0; i < cnt; i++)str[i] = hex[cnt - 1 - i];//reversestr[cnt] = '\0';for (i = 0; i < cnt; i++)sum += npower_16(i) * Hex2Num(str[i]);return  flag * sum;
}//This function return the position of the time'th character 'c' in the string str
int s_find(string str, char c, int time){int ret = -1;for (int i = 0; str[i] != '\0'; i++){if (str[i] == c && --time <= 0){ret = i;break;}}return ret;
}//change a decimical number n to it's "digit" digits 2's complements
string dec_to_2com(int n, int digit){string imm(digit, '0');int temp = n;int i = digit - 1;if (temp >= 0){while (n){if (i < 0)return NULL;imm[i--] = n % 2 + '0';n /= 2;}}else if (temp < 0){n = -(temp + 1);while (n){if (i < 0)return NULL;imm[i--] = n % 2 + '0';n /= 2;}for (int r = 0; r < digit; r++)imm[r] = '1' - imm[r] + '0';}return imm;
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/444345.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Epicypher欣博盛生物:Mononucleosomes, Recombinant Human

重组人单核小体&#xff0c;由大肠杆菌中表达的重组人组蛋白组装而成(组蛋白H2A、H2B、H3和H4各2个;Accession numbers:H2A-P04908;H2B-O60814;H3.1-P68431;H4- P62805)&#xff0c;缠绕着147个碱基对包含601序列DNA。核小体是染色质的基本亚基。由Lowary和Widom鉴定的601序列对…

ElasticSearch 应用实践 笔记

概述 介绍 ES 是一个开源的高扩展的分布式全文搜索引擎&#xff0c;是整个Elastic Stack技术栈的核心。它可以近乎实时的存储&#xff0c;检索数据&#xff1b;本身扩展性很好&#xff0c;可以扩展到上百台服务器&#xff0c;处理PB级别的数据。ElasticSearch的底层是开源库Lu…

Backtrader 文档学习- Broker - Cheat-On-Open

Backtrader 文档学习- Broker - Cheat-On-Open 1.概述 V1.9.44.116增加了Cheat On Open的支持。对于全押的人来说&#xff0c;这似乎是一个必需的功能&#xff0c;用bar的收盘价后进行计算&#xff0c;希望与开盘价相匹配。 当开盘价差距&#xff08;上涨或下跌&#xff0c;取…

Ubuntu下如何对文本进行编辑(详解)

前言 本篇文章主要记录我在学习Linux的过程中&#xff0c;有关Ubuntu下对文本进行编辑的相关知识。故在此与大家记录分享。也同时希望我的分享能给你带来不一样的收获&#xff01; 目录 前言 一、Gedit编辑器 二、VI/VIM编辑器 三、结语 一、Gedit编辑器 进行文本编辑是…

【Docker】【深度学习算法】在Docker中使用gunicorn启动多个并行算法服务,优化算法服务:从单进程到并行化

文章目录 优化算法服务&#xff1a;从单进程到并行化单个服务架构多并行服务架构Docker化并指定并行服务数量 扩展知识 优化算法服务&#xff1a;从单进程到并行化 在实际应用中&#xff0c;单个算法服务的并发能力可能无法满足需求。为了提高性能和并发处理能力&#xff0c;我…

递归再认识----【详解】内含迷宫和八皇后问题

目录 一.递归&#xff1a; 1.1什么是递归&#xff1f; 1.2 递归示例&#xff1a; ①.打印问题&#xff1a; ②.阶乘问题&#xff1a; 1.3.递归需要遵守的规则&#xff1a; 二.迷宫问题&#xff1a; 说明&#xff1a; 代码详解&#xff1a; 三.八皇后问题&#xff1a; …

Kotlin 协程:深入理解 ‘lifecycleScope‘

Kotlin 协程&#xff1a;深入理解 ‘lifecycleScope’ Kotlin 协程是一种强大的异步编程工具&#xff0c;它提供了一种简洁、易读的方式来处理并发和异步操作。在 Kotlin 协程库中&#xff0c;lifecycleScope 是一个关键的概念&#xff0c;它允许我们将协程的生命周期绑定到 An…

P1228 地毯填补问题

地毯填补问题 题目描述 相传在一个古老的阿拉伯国家里&#xff0c;有一座宫殿。宫殿里有个四四方方的格子迷宫&#xff0c;国王选择驸马的方法非常特殊&#xff0c;也非常简单&#xff1a;公主就站在其中一个方格子上&#xff0c;只要谁能用地毯将除公主站立的地方外的所有地…

服务攻防-开发组件安全Solr搜索Shiro身份Log4j日志本地CVE环境复现

知识点&#xff1a; 1、J2EE-组件安全-Solr-全文搜索 2、J2EE-组件安全-Shiro-身份验证 3、J2EE-组件安全-Log4J-日志记录 章节点&#xff1a; 1、目标判断-端口扫描&组合判断&信息来源 2、安全问题-配置不当&CVE漏洞&弱口令爆破 3、复现对象-数据库&中间…

idea mapstruct 变量名提示

安装插件 MapStruct support 修改提示快捷键 提示

THREE.JS动态场景开发实战【赛博朋克】

在本教程中&#xff0c;我们将探索如何创建类似 Three.js 的赛博朋克场景&#xff0c;灵感来自 Pipe 网站上的背景动画。 我们将指导你完成使用 Three.js 编码动态场景的过程&#xff0c;包括后处理效果和动态光照&#xff0c;所有这些都不需要任何着色器专业知识。 我用这个场…

猫头虎博主第10期赠书活动:《写给大家看的Midjourney设计书》

博主猫头虎的技术世界 &#x1f31f; 欢迎来到猫头虎的博客 — 探索技术的无限可能&#xff01; 专栏链接&#xff1a; &#x1f517; 精选专栏&#xff1a; 《面试题大全》 — 面试准备的宝典&#xff01;《IDEA开发秘籍》 — 提升你的IDEA技能&#xff01;《100天精通Golang》…