============================== Sample 1 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined vncRandRGetOutputName() PUSH R12 MOVSXD RDI,EDI PUSH RBP SUB RSP,0x8 MOV RSI,qword ptr [.bss:randrGlueContext[8]] MOV RAX,qword ptr [RSI + 0x28] MOV RDX,qword ptr [RAX + RDI*0x8] MOV RDI,qword ptr [.bss:randrGlueContext] CALL .plt:::XRRGetOutputInfo ;undefined XRRGetOutputInfo() TEST RAX,RAX JZ LAB_00139f60 MOV RDI,qword ptr [RAX + 0x10] MOV RBP,RAX CALL .plt:::strdup ;char * strdup(char * __s) MOV RDI,RBP MOV R12,RAX CALL .plt:::XRRFreeOutputInfo ;undefined XRRFreeOutputInfo() ADD RSP,0x8 MOV RAX,R12 POP RBP POP R12 RET ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00139f60: ADD RSP,0x8 LEA RDI,[.rodata:s__00173901+14] ;= "" POP RBP POP R12 JMP .plt:::strdup ;char * strdup(char * __s) ?? 66h f Actual src: char *vncRandRGetOutputName(int outputIdx) { vncGlueContext *ctx = &randrGlueContext; XRROutputInfo *output = XRRGetOutputInfo(ctx->dpy, ctx->res, ctx->res->outputs[outputIdx]); if (!output) { return strdup(""); } char *ret = strdup(output->name); XRRFreeOutputInfo(output); return ret; } Predicted src: static char * NameName(const char *name) { char *s; if (name == NULL) { return NULL; } s = (char *)NameName(name); if (s == NULL) { return NULL; } return (char *)s[0]; } ============================== Sample 2 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined gimp_curves_tool_key_press() PUSH R13 MOV R13,RDX PUSH R12 MOV R12,RSI PUSH RBP MOV RBP,RDI CALL gimp_curves_tool_get_type ;undefined gimp_curves_tool_get_type() MOV RDI,RBP MOV RSI,RAX CALL .plt:::g_type_check_instance_cast ;undefined g_type_check_instance_cast() CMP qword ptr [RBP + 0x58],0x0 JZ LAB_0024f7fd MOV RDI,qword ptr [RAX + 0x2c8] TEST RDI,RDI JZ LAB_0024f7fd MOV RSI,R12 CALL .plt:::gtk_widget_event ;undefined gtk_widget_event() TEST EAX,EAX JNZ LAB_0024f830 LAB_0024f7fd: CALL gimp_tool_get_type ;undefined gimp_tool_get_type() MOV RDI,qword ptr [.bss:gimp_curves_tool_parent_class] MOV RSI,RAX CALL .plt:::g_type_check_class_cast ;undefined g_type_check_class_cast() MOV RDX,R13 MOV RSI,R12 MOV RDI,RBP MOV RAX,qword ptr [RAX + 0xd8] POP RBP POP R12 POP R13 JMP RAX ?? 0Fh ;? -> 00841f0f ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_0024f830: POP RBP MOV EAX,0x1 POP R12 POP R13 RET ?? 0Fh Actual src: static gboolean gimp_curves_tool_key_press (GimpTool *tool, GdkEventKey *kevent, GimpDisplay *display) { GimpCurvesTool *c_tool = GIMP_CURVES_TOOL (tool); if (tool->display && c_tool->graph) { if (gtk_widget_event (c_tool->graph, (GdkEvent *) kevent)) return TRUE; } return GIMP_TOOL_CLASS (parent_class)->key_press (tool, kevent, display); } Predicted src: static gboolean gimp_tool_tool_event_changed (GimpTool *tool, GimpTool *event, GimpTool *event) { GimpTool *tool = GIMP_TOOL_TOOL (tool); GimpTool *tool = GIMP_TOOL_TOOL (tool); if (tool->type == GIMP_TOOL_TOOL_TOOL) { GimpTool *tool = GIMP_TOOL_TOOL (tool); if (tool->type == GIMP_TOOL_TOOL_TOOL) { GimpTool *tool = GIMP_TOOL_TOOL_TOOL (tool); return TRUE; } return FALSE; } return FALSE; } ============================== Sample 3 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined ioe_err_free() PUSH RBX MOV RBX,RDI MOV RDI,qword ptr [RDI] CALL .plt:free ;void free(void * __ptr) MOV RDI,qword ptr [RBX + 0x10] POP RBX JMP .plt:free ;void free(void * __ptr) ?? 66h f Actual src: void ioe_err_free(ioe_err_t *err) { free(err->path); free(err->msg); } Predicted src: void free_free(void *ptr) { free(ptr); free(ptr); } ============================== 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_token (gpointer data, gpointer user_data) { struct data *data = data; data->token = user_data; data->token = user_token; free (data); } ============================== Sample 5 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined cob_intr_test_numval_c() SUB RSP,0x8 XOR ECX,ECX MOV EDX,0x1 CALL .plt:cob_check_numval ;undefined cob_check_numval() MOV EDI,EAX CALL cob_alloc_set_field_int ;undefined cob_alloc_set_field_int() MOV RAX,qword ptr [.bss:curr_field] ;=?? ADD RSP,0x8 RET ?? 66h f Actual src: cob_field * cob_intr_test_numval_c (cob_field *srcfield, cob_field *currency) { cob_alloc_set_field_int (cob_check_numval (srcfield, currency, 1, 0)); return curr_field; } Predicted src: static void test_num_num_num_num(void) { test_num_num_num_num_num_num = 1; test_num_num_num_num_num_num_num = 1; test_num_num_num_num_num_num_num = 1; }