diff --git a/src/i18n/locales/en/allMy.i18n.json5 b/src/i18n/locales/en/allMy.i18n.json5 index da5fec27f7823b7ea1cfe97ea38b51a6608c93cb..3fc8089421feb03bbea7919da9961ead02b0e377 100644 --- a/src/i18n/locales/en/allMy.i18n.json5 +++ b/src/i18n/locales/en/allMy.i18n.json5 @@ -1,3 +1,6 @@ { "convert": "Convert", + "stringEscape": "stringEscape", + "codeGenFrida": "codeGenFrida", + "codeGenX64dbgIdaVtable": "X64dbgIdaVtable", } diff --git a/src/i18n/locales/zh_CN/allMy.i18n.json5 b/src/i18n/locales/zh_CN/allMy.i18n.json5 index 15545cac464ccc1e17ec08e65c0215fd91751d61..ecb5973073b76f27edf84a58cec2ec9a29672868 100644 --- a/src/i18n/locales/zh_CN/allMy.i18n.json5 +++ b/src/i18n/locales/zh_CN/allMy.i18n.json5 @@ -1,3 +1,6 @@ { "convert": "转换", + "stringEscape": "字符串转义", + "codeGenFrida": "生成frida代码", + "codeGenX64dbgIdaVtable": "X64dbg断点虚表", } diff --git a/src/views/tool/text.vue b/src/views/tool/text.vue index 326d5ab2dd9d5bb8e60c26ed719677b0fa8ae4dd..0c795be4895175d11bfad003f591f7e3af65f946 100644 --- a/src/views/tool/text.vue +++ b/src/views/tool/text.vue @@ -103,6 +103,12 @@ + + + @@ -202,6 +208,10 @@ export default { this.handle('replace', this.replace.search.split(/\r?\n/), this.replace.replace.split(/\r?\n/)) } this.replace.show = false + }, + handleStringEscape() { + console.log(this.current.content); + this.current.content = this.current.content.replace(/\\/g, `\\\\`); } }, data() { diff --git a/src/views/yeahmao/code_gen/codeGenJson.vue b/src/views/yeahmao/code_gen/codeGenJson.vue index 7810d5bfcf6a8bd6e8b9175f8c558c6f7b656d80..b0245bc3124fe4ca42018ea61e17683b15f008b1 100644 --- a/src/views/yeahmao/code_gen/codeGenJson.vue +++ b/src/views/yeahmao/code_gen/codeGenJson.vue @@ -6,6 +6,8 @@ + + @@ -109,10 +111,82 @@ export default { this.current.output = JSON.stringify(objJson); console.log(Object.keys(objJson).length); }, + codeGenFrida_item(func, params) { + var js = `/*\n` + this.current.input.replace('\n\n', '\n') + `\n*/ +Interceptor.attach(Module.getExportByName('ntdll.dll', '`+ func + `'), { + onEnter(args) { +` + + // var lpExistingFileName = args[0]; + // var lpNewFileName = args[1]; + var lst_params = []; + params.map( (val, index) => { + var pType = val[1]; + var pName = val[2]; + js += ` var ` + pName + ` = args[` + index + `];\n` + lst_params.push(pName); + }); + + // console.log(lpExistingFileName, lpNewFileName, bFailIfExists) + js += ` console.log('>>> ` + func + ' >>> ' + lst_params.join(' ') + ` = ', ` + lst_params.toString() +`);` + + js += ` + }, + onLeave(retval) { + console.log('>>> ` + func + ` >>> retval = ', retval); + } +}); +` + return js; + }, + codeGenFrida() { + /* +NTSYSCALLAPI +NTSTATUS +NTAPI +NtGetContextThread( + _In_ HANDLE ThreadHandle, + _Inout_ PCONTEXT ThreadContext + ); + */ + var r = /\n(.*)\(([\s\S]*)\);/mg; + var input = this.current.input; + var a = r.exec(input); + if (a) { + var func = a[1]; + var params = a[2]; + params = params.split(',').map(v=>{return v.trim().split(' ')}) + console.log(func, params); + this.current.output = this.codeGenFrida_item(func, params); + } + }, resize(height) { this.inputHeight = Math.min(320, Math.ceil(height / 2)) this.outputHeight = height - this.inputHeight // this.outputHeight = 180 + }, + // .rdata:007FB580 dd offset sub_4D8780 + // .rdata:007FB584 dd offset sub_4D8E20 + // ==> + // SetBPX leigod.exe:$0xD8780;SetBPX leigod.exe:$0xD8E20; + codeGenX64dbgIdaVtable() { + var r = /dd offset sub_(\S{6})/mg; + var input = this.current.input; + var a = r.exec(input); + // if (a) { + // var addr = a[1]; + // var addr_int = parseInt(addr, 16); + // var addr_v = '0x' + Number(addr_int-0x400000).toString(16); + // console.log(addr, addr_int, addr_v); + // } + var out = ''; + while ((a = r.exec(this.current.input))) { //循环执行匹配操作 + var addr = a[1]; + var addr_int = parseInt(addr, 16); + var addr_v = '0x' + Number(addr_int-0x400000).toString(16); + out += 'SetBPX leigod.exe:$' + addr_v + '; ' + } + this.current.output = out; } }, }