============================== Sample 1 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined proto_register_irc() SUB RSP,0x8 LEA RDX,[.rodata:s_irc_03795c22+16] ;= "irc" LEA RSI,[.rodata:DAT_034f9416] ;= 49h I LEA RDI,[.rodata:s_Internet_Relay_Chat_038c6d1f] ;= "Internet Relay Chat" CALL .plt:proto_register_protocol ;undefined proto_register_protocol() MOV EDX,0xc LEA RSI,[.data:hf.2] MOV EDI,EAX MOV dword ptr [.data:proto_irc],EAX ;= FFFFFFFFh CALL .plt:proto_register_field_array ;undefined proto_register_field_array() MOV ESI,0x5 LEA RDI,[.data:ett.1] CALL .plt:proto_register_subtree_array ;undefined proto_register_subtree_arr... MOV EDI,dword ptr [.data:proto_irc] ;= FFFFFFFFh CALL .plt:expert_register_protocol ;undefined expert_register_protocol() LEA RSI,[.data:ei.0] MOV EDX,0x6 MOV RDI,RAX CALL .plt:expert_register_field_array ;undefined expert_register_field_array() LEA RSI,[.rodata:TAG_DELIMITER] ;= 0001h LEA RDI,[.bss:pbrk_tag_delimiter] ;=?? ADD RSP,0x8 JMP .plt:::ws_mempbrk_compile ;undefined ws_mempbrk_compile() ?? 66h f Actual src: void proto_register_irc(void) { static hf_register_info hf[] = { { &hf_irc_response, { "Response", "irc.response", FT_STRING, STR_ASCII, NULL, 0x0, "Line of response message", HFILL }}, { &hf_irc_request, { "Request", "irc.request", FT_STRING, STR_ASCII, NULL, 0x0, "Line of request message", HFILL }}, { &hf_irc_request_prefix, { "Prefix", "irc.request.prefix", FT_STRING, STR_ASCII, NULL, 0x0, "Request prefix", HFILL }}, { &hf_irc_request_command, { "Command", "irc.request.command", FT_STRING, STR_ASCII, NULL, 0x0, "Request command", HFILL }}, { &hf_irc_request_command_param, { "Parameter", "irc.request.command_parameter", FT_STRING, STR_ASCII, NULL, 0x0, "Request command parameter", HFILL }}, { &hf_irc_request_trailer, { "Trailer", "irc.request.trailer", FT_STRING, STR_ASCII, NULL, 0x0, "Request trailer", HFILL }}, { &hf_irc_response_prefix, { "Prefix", "irc.response.prefix", FT_STRING, STR_ASCII, NULL, 0x0, "Response prefix", HFILL }}, { &hf_irc_response_command, { "Command", "irc.response.command", FT_STRING, STR_ASCII, NULL, 0x0, "Response command", HFILL }}, { &hf_irc_response_num_command, { "Command", "irc.response.num_command", FT_UINT16, BASE_DEC, NULL, 0x0, "Response (numeric) command", HFILL }}, { &hf_irc_response_command_param, { "Parameter", "irc.response.command_parameter", FT_STRING, STR_ASCII, NULL, 0x0, "Response command parameter", HFILL }}, { &hf_irc_response_trailer, { "Trailer", "irc.response.trailer", FT_STRING, STR_ASCII, NULL, 0x0, "Response trailer", HFILL }}, { &hf_irc_ctcp, { "CTCP Data", "irc.ctcp", FT_STRING, STR_ASCII, NULL, 0x0, "Placeholder to dissect CTCP data", HFILL }} }; static gint *ett[] = { &ett_irc, &ett_irc_request, &ett_irc_request_command, &ett_irc_response, &ett_irc_response_command }; static ei_register_info ei[] = { { &ei_irc_missing_end_delimiter, { "irc.missing_end_delimiter", PI_MALFORMED, PI_ERROR, "Missing ending tag delimiter (0x01)", EXPFILL }}, { &ei_irc_tag_data_invalid, { "irc.tag_data_invalid", PI_PROTOCOL, PI_WARN, "Tag data outside of NOTICE or PRIVMSG command", EXPFILL }}, { &ei_irc_prefix_missing_ending_space, { "irc.prefix_missing_ending_space", PI_MALFORMED, PI_ERROR, "Prefix missing ending ", EXPFILL }}, { &ei_irc_request_command, { "irc.request.command.missing", PI_MALFORMED, PI_ERROR, "Request has no command", EXPFILL }}, { &ei_irc_numeric_request_command, { "irc.request.command.numeric", PI_PROTOCOL, PI_WARN, "Numeric command not allowed in request", EXPFILL }}, { &ei_irc_response_command, { "irc.response.command.missing", PI_MALFORMED, PI_ERROR, "Response has no command", EXPFILL }}, }; expert_module_t* expert_irc; proto_irc = proto_register_protocol("Internet Relay Chat", "IRC", "irc"); proto_register_field_array(proto_irc, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); expert_irc = expert_register_protocol(proto_irc); expert_register_field_array(expert_irc, ei, array_length(ei)); /* compile patterns */ ws_mempbrk_compile(&pbrk_tag_delimiter, TAG_DELIMITER); } Predicted src: void proto_register_register(void) { static hf_register_info hf[] = { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { { ============================== Sample 2 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined sc_insert() ;local_30 undefined8 -30 ;local_38 undefined8 -38 PUSH R14 PUSH R13 MOV R13,RDI PUSH R12 XOR R12D,R12D PUSH RBP MOV RBP,RSI PUSH RBX SUB RSP,0x10 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_30+0x38],RAX XOR EAX,EAX CALL .plt:::document_get_current ;undefined document_get_current() TEST RAX,RAX JZ LAB_001058fb MOV RBX,RAX MOV RAX,qword ptr [RAX + 0x28] MOV RDI,qword ptr [RAX + 0x8] CALL .plt:::sci_get_current_position ;undefined sci_get_current_position() MOV EDX,0x1 MOV RCX,RSP MOV RSI,RBP MOV R14D,EAX MOV R8D,0xffffffff MOV RDI,R13 XOR EAX,EAX CALL .plt:::gtk_tree_model_get ;undefined gtk_tree_model_get() MOV RDX,qword ptr [RSP]=>local_38 TEST RDX,RDX JZ LAB_001058fb CMP byte ptr [RDX],0x0 JNZ LAB_00105920 LAB_001058fb: MOV RAX,qword ptr [RSP + local_30+0x38] SUB RAX,qword ptr FS:[0x28] JNZ LAB_00105941 ADD RSP,0x10 MOV EAX,R12D POP RBX POP RBP POP R12 POP R13 POP R14 RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00105920: MOV RAX,qword ptr [RBX + 0x28] MOV ESI,R14D MOV R12D,0x1 MOV RDI,qword ptr [RAX + 0x8] CALL .plt:::sci_insert_text ;undefined sci_insert_text() MOV RDI,qword ptr [RSP]=>local_38 CALL .plt:::g_free ;undefined g_free() JMP LAB_001058fb LAB_00105941: CALL .plt:::__stack_chk_fail ;undefined __stack_chk_fail() NOP word ptr CS:[RAX + RAX*0x1] Actual src: static gboolean sc_insert(GtkTreeModel *model, GtkTreeIter *iter) { GeanyDocument *doc = document_get_current(); gboolean result = FALSE; if (doc!= NULL) { gchar *str; gint pos = sci_get_current_position(doc->editor->sci); gtk_tree_model_get(model, iter, COLUMN_HTML_NAME, &str, -1); if (!EMPTY(str)) { sci_insert_text(doc->editor->sci, pos, str); g_free(str); result = TRUE; } } return result; } Predicted src: static gboolean get_current_selected (GtkTreeModel *model, gpointer data) { GtkTreeModel *model; GtkTreeModel *model; GtkTreeModel *model; GtkTreeModel *model; GtkTreeModel *model; model = gtk_tree_model_get_model (model, &model); if (model == NULL) return FALSE; model = gtk_tree_model_get_model (model, &model); if (model == NULL) return FALSE; model = gtk_tree_model_get_model (model, &model); if (model == NULL) return FALSE; model = gtk_tree_model_get_model (model, &model); if (model == NULL) { return FALSE; } return TRUE; } ============================== Sample 3 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined speechd_new() PUSH R12 XOR ECX,ECX XOR EDX,EDX LEA RSI,[.rodata:DAT_00102000] ;= 6Dh m PUSH RBP PUSH RBX MOV RBX,RDI LEA RDI,[.rodata:s_navit_00102005] ;= "navit" CALL .plt:::spd_open ;undefined spd_open() TEST RAX,RAX JZ LAB_001011d0 MOV EDI,0x8 MOV RBP,RAX CALL .plt:g_malloc ;undefined g_malloc() MOV R12,RAX TEST RAX,RAX JZ LAB_001011c3 MOVDQA XMM0,xmmword ptr [.data.rel.ro:speechd_meth] MOV qword ptr [RAX],RBP MOV ESI,0x1 MOV RDI,RBP MOVUPS xmmword ptr [RBX],XMM0 CALL .plt:::spd_set_punctuation ;undefined spd_set_punctuation() LAB_001011c3: MOV RAX,R12 POP RBX POP RBP POP R12 RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001011d0: XOR R12D,R12D POP RBX POP RBP MOV RAX,R12 POP R12 RET ?? 0Fh Actual src: static struct speech_priv *speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *attr) { struct speech_priv *this; SPDConnection *conn; conn = spd_open("navit","main",NULL,SPD_MODE_SINGLE); if (! conn) return NULL; this=g_new(struct speech_priv,1); if (this) { this->conn=conn; *meth=speechd_meth; spd_set_punctuation(conn, SPD_PUNCT_NONE); } return this; } Predicted src: char * data_new(const char *filename) { char *filename; filename = g_new0(char, 1); filename = g_new0(char, 1); if (!filename) return NULL; filename = g_new0(char, 1); if (!filename) return NULL; filename = g_new0(char, 1); if (!filename) return NULL; returnfilename; } ============================== Sample 4 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined op_0218_33_ff() PUSH R13 PUSH R12 PUSH RBP PUSH RBX MOV EBX,EDI AND EBX,0x7 SUB RSP,0x8 MOV EAX,dword ptr [.bss:regs[64]] MOV dword ptr [.bss:OpcodeFamily],0x2 MOV dword ptr [.bss:CurrentInstrCycles],0x10 LEA EDI,[RAX + 0x2] CALL mmu_get_iword.constprop.0 ;undefined mmu_get_iword.constprop.0() LEA RDX,[.bss:regs] MOV dword ptr [.bss:mmufixup],EBX MOV R12D,EAX LEA EAX,[RBX + 0x8] MOV byte ptr [.bss:rmw_cycle],0x1 LEA R13,[RDX + RAX*0x4] MOV EBP,dword ptr [R13]=>.bss:regs MOV EDI,EBP MOV dword ptr [.bss:mmufixup[4]],EBP CALL mmu_get_byte.constprop.0 ;undefined mmu_get_byte.constprop.0() LEA RDX,[.rodata:areg_byteinc] XOR ECX,ECX MOV EDI,EBP AND EAX,R12D MOV EDX=>.rodata:areg_byteinc,dword ptr [RDX + RBX*0x4] ADD dword ptr [R13],EDX=>.bss:regs MOV EDX,EAX MOVZX ESI,AL MOV byte ptr [.bss:rmw_cycle],0x1 SAR DL,0x7 MOVSX EDX,DL SHL EDX,0xf TEST AL,AL SETZ CL MOVZX EDX,DX SHL ECX,0xe OR EDX,ECX MOV dword ptr [.bss:regflags],EDX CALL mmu_put_byte.constprop.0 ;undefined mmu_put_byte.constprop.0() ADD dword ptr [.bss:regs[64]],0x4 MOV EAX,0x2000 MOV byte ptr [.bss:rmw_cycle],0x0 MOV dword ptr [.bss:mmufixup],0xffffffff ADD RSP,0x8 POP RBX POP RBP POP R12 POP R13 RET ?? 66h f Actual src: uae_u32 REGPARAM2 op_0218_33_ff(uae_u32 opcode) { int count_cycles = 0; uae_u32 real_opcode = opcode; uae_u32 dstreg = real_opcode & 7; OpcodeFamily = 2; CurrentInstrCycles = 16; uae_s8 src = get_ibyte_mmu060(2); uaecptr dsta; dsta = m68k_areg(regs, dstreg); mmufixup[0].reg = dstreg | 0x0; mmufixup[0].value = m68k_areg(regs, dstreg); uae_s8 dst = get_rmw_byte_mmu060(dsta); m68k_areg(regs, dstreg) += areg_byteinc[dstreg]; src &= dst; CLEAR_CZNV(); SET_ZFLG(((uae_s8)(src)) == 0); SET_NFLG(((uae_s8)(src)) < 0); put_rmw_byte_mmu060(dsta, src); m68k_incpci(4); mmufixup[0].reg = -1; return (2 * 4 * CYCLE_UNIT / 2 + count_cycles) * 4; } Predicted src: uae_u32 REGPARAM2 op_4c0_33_ff(uae_u32 opcode) { int count_cycles = 0; uae_u32 real_opcode = opcode; uae_u32 srcreg = (real_opcode & 7); OpcodeFamily = 59; CurrentInstrCycles = 12; uaecptr srca; srca = m68k_areg(regs, srcreg); uae_s8 src = get_byte_jit(srca); uaecptr dsta; dsta = m68k_areg(regs, dstreg); CLEAR_CZNV(); SET_ZFLG(((uae_s8)(src)) == 0); SET_NFLG(((uae_s8)(src)) < 0); put_byte_jit(dsta, src); m68k_incpc(2); return (2 * 4 * CYCLE_UNIT / 2 + count_cycles) * 4; } ============================== Sample 5 ============================== ASM: ;************************************************************************************************************************************************************ ;* TreeMap::getNumSeqs() * ;************************************************************************************************************************************************************ ;undefined getNumSeqs(TreeMap * this) ;this TreeMap * RDI MOV RAX,qword ptr [this + 0x8] SUB RAX,qword ptr [this] SAR RAX,0x5 RET ?? 0Fh Actual src: int TreeMap::getNumSeqs() { return namesOfSeqs.size(); } Predicted src: size_t CMapMap::MapMapMapMapMapMapMapMapMapMap() { return m_MapMapMap.size(); }