============================== Sample 1 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined ppc32_exec_LWZUX() PUSH R12 MOV EAX,ESI PUSH RBP MOV EBP,ESI SHR EAX,0xb SHR EBP,0x10 AND EAX,0x1f SHR ESI,0x15 PUSH RBX AND EBP,0x1f MOV RBX,RDI MOV EDX,ESI MOV R12D,dword ptr [RDI + RBP*0x4 + 0x4] ADD R12D,dword ptr [RDI + RAX*0x4 + 0x4] AND EDX,0x1f MOV ESI,R12D CALL qword ptr [RDI + 0x208] MOV dword ptr [RBX + RBP*0x4 + 0x4],R12D XOR EAX,EAX POP RBX POP RBP POP R12 RET ?? 66h f Actual src: static fastcall int ppc32_exec_LWZUX(cpu_ppc_t *cpu,ppc_insn_t insn) { int rd = bits(insn,21,25); int ra = bits(insn,16,20); int rb = bits(insn,11,15); m_uint32_t vaddr; vaddr = cpu->gpr[ra] + cpu->gpr[rb]; ppc32_exec_memop(cpu,PPC_MEMOP_LWZ,vaddr,rd); cpu->gpr[ra] = vaddr; return(0); } Predicted src: static uint32_t arm_r3_exec_0(struct cpu *cpu, struct arm_instr_call *ic) { uint32_t tmp; uint32_t tmp; uint32_t tmp; tmp = cpu->cd.arm.r[3]; tmp = cpu->cd.arm.r[3]; tmp = tmp; tmp >>= 7; tmp = tmp; tmp >>= 7; tmp >>= 7; tmp = tmp; tmp >>= 7; tmp = tmp; tmp >>= 7; tmp >>= 7; return tmp; } ============================== Sample 2 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined cmdServerSigChild() MOV RDI,qword ptr [.bss:serverLocal[24]] MOV EAX,dword ptr [RDI] TEST EAX,EAX JZ LAB_0014d0c0 PUSH RBP MOV RBP,RSI PUSH RBX XOR EBX,EBX SUB RSP,0x8 JMP LAB_0014d08e ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_0014d080: MOV RDI,qword ptr [.bss:serverLocal[24]] ADD EBX,0x1 CMP dword ptr [RDI],EBX JBE LAB_0014d0b8 LAB_0014d08e: MOV ESI,EBX CALL lstGet ;undefined lstGet() MOV EDX,dword ptr [RBP + 0x10] CMP dword ptr [RAX],EDX JNZ LAB_0014d080 MOV RDI,qword ptr [.bss:serverLocal[24]] MOV ESI,EBX ADD EBX,0x1 CALL lstRemoveIdx ;undefined lstRemoveIdx() MOV RDI,qword ptr [.bss:serverLocal[24]] CMP dword ptr [RDI],EBX JA LAB_0014d08e LAB_0014d0b8: ADD RSP,0x8 POP RBX POP RBP RET ?? 90h LAB_0014d0c0: RET ?? 66h f Actual src: static void cmdServerSigChild(const int signalType, siginfo_t *signalInfo, void *context) { (void)signalType; (void)context; ASSERT(signalInfo->si_code == CLD_EXITED); // Find the process and remove it for (unsigned int processIdx = 0; processIdx < lstSize(serverLocal.processList); processIdx++) { if (*(int *)lstGet(serverLocal.processList, processIdx) == signalInfo->si_pid) lstRemoveIdx(serverLocal.processList, processIdx); } } Predicted src: static int serverserverserver(const char *server, int argc, char **argv) { int i; for (i = 0; i < argc; i++) { if (serverserverserver[i].server!= NULL) serverserverserver[i].server = NULL; else serverserverserver[i].server = NULL; } return 0; } ============================== 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: struct l_data * l_data_new(const char *filename) { struct l_data *data; data = g_new0(struct l_data, 1); if (!data) return NULL; data->filename = g_new0(struct l_data, 1); data->filename = filename; data->filename = NULL; return data; } ============================== Sample 4 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined tokz_unget_token() PUSH RBP MOV RBP,RDI LEA RDI,[RDI + 0x18] PUSH RBX MOV RBX,RSI PUSH RAX CALL tok_free ;undefined tok_free() MOVUPS XMM0,xmmword ptr [RBX] MOVUPS xmmword ptr [RBP + 0x18],XMM0 MOV dword ptr [RBX],0x0 POP RDX POP RBX POP RBP RET ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined tokz_close() PUSH RBP Actual src: void tokz_unget_token(Tokenizer *tokz, Token *tok) { tok_free(&(tokz->ungettok)); tokz->ungettok=*tok; tok->type=TOK_INVALID; } Predicted src: static void free_token(void *data, void *data) { struct_token *token = data; struct_token *token = data; token_free(&token->token); token->token = NULL; } ============================== Sample 5 ============================== ASM: ;************************************************************************************************************************************************************ ;* strcasestr_len(char const*, int, char const*) * ;************************************************************************************************************************************************************ ;undefined strcasestr_len(char * param_1, int param_2, char * param_3) ;param_1 char * RDI ;param_2 int ESI ;param_3 char * RDX PUSH R15 PUSH R14 MOV R14,param_1 MOV param_1,param_3 PUSH R13 MOV R13,param_3 PUSH R12 PUSH RBP MOVSXD RBP,param_2 PUSH RBX SUB RSP,0x8 CALL .plt:::strlen ;size_t strlen(char * __s) CMP RBP,RAX JL LAB_00135e08 MOV R15,RAX SUB RBP,RAX JS LAB_00135e08 XOR EBX,EBX JMP LAB_00135dd9 LAB_00135dd0: ADD RBX,0x1 CMP RBP,RBX JL LAB_00135e08 LAB_00135dd9: LEA R12,[R14 + RBX*0x1] MOV param_3,R15 MOV param_1,R13 MOV param_2,R12 CALL .plt:::g_ascii_strncasecmp ;undefined g_ascii_strncasecmp() TEST EAX,EAX JNZ LAB_00135dd0 LAB_00135def: ADD RSP,0x8 MOV RAX,R12 POP RBX POP RBP POP R12 POP R13 POP R14 POP R15 RET ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00135e08: XOR R12D,R12D JMP LAB_00135def ?? 0Fh Actual src: char *strcasestr_len(const char *haystack, int haystack_len, const char *needle) { gssize needle_len = (gssize)strlen(needle); int i; if (needle_len > haystack_len) return NULL; i = 0; while (i <= haystack_len - needle_len) { if (g_ascii_strncasecmp(needle, haystack + i, needle_len) == 0) return (char *)haystack + i; i++; } return NULL; } Predicted src: gchar * g_str_len (const gchar *str, int len) { gchar *p; int len; len = strlen (str); for (p = str; *p; p++) { if (len < len) return NULL; len += strlen (p); } return p; }