============================== Sample 1 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined fatal() SUB RSP,0x8 XOR EAX,EAX CALL error ;undefined error() MOV EDI,0x2 CALL .plt:::exit ;void exit(int __status) NOP dword ptr CS:[RAX + RAX*0x1] Actual src: void fatal(mesg, errnum) #ifdef __STDC__ const #endif char *mesg; int errnum; { error(mesg, errnum); exit(2); } Predicted src: static void exit(int sig) { exit(1); } ============================== Sample 2 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined dhcp6_calc_mac() ;local_30 undefined8 -30 ;local_48 undefined1[16] -48 PUSH R13 PUSH R12 PUSH RBP PUSH RBX SUB RSP,0xc8 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_30+0xe8],RAX XOR EAX,EAX CMP ECX,0x1 JNZ LAB_00112b80 LEA RAX,[R8 + 0x10] MOV RBX,RSI MOV RBP,R8 CMP RAX,RSI JA LAB_00112b80 MOV RSI,qword ptr [R9 + 0x28] MOV EDX,dword ptr [R9 + 0x30] MOV R13,RSP MOV R12,RDI MOV RDI,R13 CALL hmacmd5_init ;undefined hmacmd5_init() MOV EDX,EBX MOV RSI,R12 MOV RDI,R13 CALL md5_update ;undefined md5_update() LEA RSI=>local_48,[RSP + 0xa0] MOV RDI,R13 CALL hmacmd5_sign ;undefined hmacmd5_sign() XOR EAX,EAX MOVDQA XMM0,xmmword ptr [RSP + local_48[0]+0xe8] MOVUPS xmmword ptr [R12 + RBP*0x1],XMM0 LAB_00112b57: MOV RDX,qword ptr [RSP + local_30+0xe8] SUB RDX,qword ptr FS:[0x28] JNZ LAB_00112b87 ADD RSP,0xc8 POP RBX POP RBP POP R12 POP R13 RET ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00112b80: MOV EAX,0xffffffff JMP LAB_00112b57 LAB_00112b87: CALL .plt:::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr [RAX] Actual src: int dhcp6_calc_mac(buf, len, proto, alg, off, key) char *buf; size_t len, off; int proto, alg; struct keyinfo *key; { hmacmd5_t ctx; unsigned char digest[MD5_DIGESTLENGTH]; /* right now, we don't care about the protocol */ if (alg!= DHCP6_AUTHALG_HMACMD5) return (-1); if (off + MD5_DIGESTLENGTH > len) { /* * this should be assured by the caller, but check it here * for safety. */ return (-1); } hmacmd5_init(&ctx, key->secret, key->secretlen); hmacmd5_update(&ctx, buf, len); hmacmd5_sign(&ctx, digest); memcpy(buf + off, digest, MD5_DIGESTLENGTH); return (0); } Predicted src: int main(int argc, char **argv) { int ret; ret = 0; if (argc < 2) { ret = -1; if (argc < 2) { ret = -1; } else { ret = -1; } else { ret = -1; } } return ret; } ============================== Sample 3 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined txn_body_cleanup_txn_changes() MOV R8,RDI MOV RCX,qword ptr [RSI + 0x10] MOV RDI,qword ptr [RSI + 0x8] MOV RDX,RSI MOV RSI,qword ptr [R8] JMP .plt:LAB_00109bc0 ?? 66h f Actual src: static svn_error_t * txn_body_cleanup_txn_changes(void *baton, trail_t *trail) { const char *key = *(const char **)baton; return svn_fs_bdb__changes_delete(trail->fs, key, trail, trail->pool); } Predicted src: static void cleanup_cleanup_cleanup(void *data, void *user_data) { struct rte_context *context = user_data; struct rte_context *context = user_data; struct rte_context *context = user_data; cleanup_cleanup_cleanup_cleanup(context->cleanup); } ============================== Sample 4 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined strv_get_value() MOV RDX,qword ptr [RDI] TEST RDX,RDX JNZ LAB_00116220 XOR EAX,EAX RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00116220: PUSH R12 PUSH RBP MOV RBP,RSI MOV ESI,0x40 SUB RSP,0x8 MOV EAX,dword ptr [RDI + 0x20] MOV RDI,RBP MOV R12,qword ptr [RDX + RAX*0x8] CALL .plt:::g_value_init ;undefined g_value_init() MOV RDI,RBP MOV RSI,R12 CALL .plt:::g_value_set_string ;undefined g_value_set_string() ADD RSP,0x8 MOV EAX,0x1 POP RBP POP R12 RET ?? 66h f Actual src: static gboolean strv_get_value (TmplIterator *iter, GValue *value) { guint index = GPOINTER_TO_INT (iter->data1); if (iter->instance) { gchar **strv = iter->instance; gchar *str = strv[index]; g_value_init (value, G_TYPE_STRING); g_value_set_string (value, str); return TRUE; } return FALSE; } Predicted src: static gboolean value_set_value (gpointer key, gpointer value, gpointer value, gpointer user_data) { const gchar *value = user_data; const gchar *value = user_data; g_value_set_string (value, value); g_value_set_string (value, value); return TRUE; } ============================== Sample 5 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined mdjvu_matcher_options_destroy() JMP .plt:::free ?? 66h f Actual src: void mdjvu_matcher_options_destroy(mdjvu_matcher_options_t opt) { FREE((Options *) opt); } Predicted src: static void destroy_destroy (void *data) { free (data); free (data); }