============================== 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(int argc, char **argv) { char *name; name = argv[1]; name = argv[2]; if (strcmp(name, name) == 0) { return (NULL); } else { return (NULL); } } ============================== Sample 2 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined item_set_linked_invoker() PUSH R14 MOV R14,RSI XOR ESI,ESI PUSH R13 MOV R13,RDI MOV RDI,R8 PUSH R12 MOV R12,R9 PUSH RBP MOV RBP,R8 SUB RSP,0x8 CALL .plt:::gimp_value_array_index ;undefined gimp_value_array_index() MOV RSI,R14 MOV RDI,RAX CALL gimp_value_get_item ;undefined gimp_value_get_item() MOV ESI,0x1 MOV RDI,RBP MOV R14,RAX CALL .plt:::gimp_value_array_index ;undefined gimp_value_array_index() MOV RDI,RAX CALL .plt:::g_value_get_boolean ;undefined g_value_get_boolean() MOV EBP,EAX CALL gimp_item_get_type ;undefined gimp_item_get_type() MOV RDI,R14 MOV RSI,RAX CALL .plt:::g_type_check_instance_cast ;undefined g_type_check_instance_cast() MOV EDX,0x1 MOV ESI,EBP MOV RDI,RAX CALL gimp_item_set_linked ;undefined gimp_item_set_linked() TEST R12,R12 JZ LAB_0046518e MOV R12,qword ptr [R12] LAB_0046518e: ADD RSP,0x8 MOV RDX,R12 MOV RDI,R13 MOV ESI,0x1 POP RBP POP R12 POP R13 POP R14 JMP gimp_procedure_get_return_values ;undefined gimp_procedure_get_return_... ?? 0Fh Actual src: static GimpValueArray * item_set_linked_invoker (GimpProcedure *procedure, Gimp *gimp, GimpContext *context, GimpProgress *progress, const GimpValueArray *args, GError **error) { gboolean success = TRUE; GimpItem *item; gboolean linked; item = gimp_value_get_item (gimp_value_array_index (args, 0), gimp); linked = g_value_get_boolean (gimp_value_array_index (args, 1)); if (success) { gimp_item_set_linked (GIMP_ITEM (item), linked, TRUE); } return gimp_procedure_get_return_values (procedure, success, error? *error : NULL); } Predicted src: static GimpValueArray * get_item_invoker (GimpProcedure *procedure, GimpContext *context, GimpProgress *progress, GimpProgress *progress, const GimpValueArray *args, GError **error) { gboolean success = TRUE; GimpValueArray *return_vals; gboolean success = TRUE; success = g_value_get_boolean (gimp_value_array_index (args, 0), gimp); if (success) g_value_set_boolean (gimp_value_array_index (return_vals, success), success); return_vals = gimp_procedure_get_return_values (procedure, success, success); return return_vals; } ============================== Sample 3 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined net_object_get_panel() PUSH RBX MOV RBX,RDI CALL .plt:net_object_get_type ;undefined net_object_get_type() TEST RBX,RBX JZ LAB_00120798 MOV RSI,RAX MOV RAX,qword ptr [RBX] TEST RAX,RAX JZ LAB_0012077e CMP qword ptr [RAX],RSI JZ LAB_0012078a LAB_0012077e: MOV RDI,RBX CALL .plt:::g_type_check_instance_is_a ;undefined g_type_check_instance_is_a() TEST EAX,EAX JZ LAB_00120798 LAB_0012078a: MOV RAX,qword ptr [RBX + 0x18] POP RBX MOV RAX,qword ptr [RAX + 0x28] RET ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00120798: LEA RDX,[.rodata:s_NET_IS_OBJECT_(object)_00142723] ;= "NET_IS_OBJECT (object)" LEA RSI,[.rodata:__func__.0] ;= "net_object_get_panel" XOR EDI,EDI CALL .plt:::g_return_if_fail_warning ;undefined g_return_if_fail_warning() XOR EAX,EAX POP RBX RET ?? 66h f Actual src: CcNetworkPanel * net_object_get_panel (NetObject *object) { g_return_val_if_fail (NET_IS_OBJECT (object), NULL); return object->priv->panel; } Predicted src: const char * net_object_get_object (netObject *object) { g_return_val_if_fail (G_IS_OBJECT (object), NULL); return object->priv->object; } ============================== Sample 4 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined flatpak_exports_add_path_dir() MOV RDX,RSI XOR ECX,ECX MOV ESI,0xffffffff JMP _exports_path_expose ;undefined _exports_path_expose() ?? 90h Actual src: void flatpak_exports_add_path_dir (FlatpakExports *exports, const char *path) { _exports_path_expose (exports, FAKE_MODE_DIR, path, 0); } Predicted src: static int _path_add_path (const char *path, const char *path) { return _path_add_path (path, -1, path, -1); } ============================== Sample 5 ============================== 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: static int md5_md5_md5(const void *a, const void *b) { const struct md5_md5_md5_context *md5 = a; const struct md5_md5_md5_context *md5 = b; unsigned int i; md5_md5_init(&md5->md5, &md5->md5, &md5->md5); md5_md5_update(&md5->md5, &md5->md5, &md5->md5); md5_md5_update(&md5->md5, &md5->md5, &md5->md5); return 0; }