============================== Sample 1 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined symb_destroy() TEST RDI,RDI JZ LAB_00133930 SUB RSP,0x8 MOV EAX,dword ptr [RDI] MOV R8,RDI LEA R9D,[RAX + -0x1] MOV dword ptr [RDI],R9D MOV EAX,R9D TEST R9D,R9D JG LAB_001338c0 TEST EAX,EAX JZ LAB_00133917 LAB_001338b5: MOV dword ptr [R8],R9D XOR EAX,EAX ADD RSP,0x8 RET ?? 90h LAB_001338c0: CALL reset_done_flag.isra.0 ;undefined reset_done_flag.isra.0() MOV RAX,qword ptr [R8 + 0x10] LEA R10,[.data:symb_class] MOV RCX,qword ptr [RAX] TEST RCX,RCX JNZ LAB_001338e8 JMP LAB_00133910 ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001338e0: MOV RCX,qword ptr [RCX] TEST RCX,RCX JZ LAB_00133910 LAB_001338e8: MOV RAX,qword ptr [RCX + 0x30] TEST RAX,RAX JZ LAB_001338e0 CMP qword ptr [RAX],R10 JNZ LAB_001338e0 MOV RDI,qword ptr [RAX + 0x8] TEST RDI,RDI JZ LAB_001338e0 MOV RSI,R8 CALL test_unlink_symtab_item.isra.0 ;undefined test_unlink_symtab_item.is... MOV RCX,qword ptr [RCX] TEST RCX,RCX JNZ LAB_001338e8 NOP LAB_00133910: MOV EAX,dword ptr [R8] TEST EAX,EAX JNZ LAB_001338b5 LAB_00133917: MOV RDI,R8 CALL delete_symtab_item ;undefined delete_symtab_item() XOR EAX,EAX ADD RSP,0x8 RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00133930: XOR EAX,EAX RET ?? 66h f Actual src: static int symb_destroy (void *item) { SYMTAB_ITEM *symtab_item = item; int save_links; SYMBOL *symbol; CLASS_ITEM *class_item; if (symtab_item) { /* If all links are gone then delete now. */ symtab_item-> links--; save_links = symtab_item-> links; if (symtab_item-> links > 0) { /* Try to find a loop that will remove all links */ reset_done_flag (symtab_item); for (symbol = symtab_item-> symtab-> symbols; symbol; symbol = symbol-> next) { class_item = symbol-> data; if (class_item && class_item-> class == & symb_class && class_item-> item) test_unlink_symtab_item (class_item-> item, symtab_item); } } if (symtab_item-> links == 0) delete_symtab_item (symtab_item); else symtab_item-> links = save_links; } return 0; } Predicted src: static int test_item_cleanup(void *arg) { struct test_item *item; struct test_item *item; struct test_item *item; struct test_item *item; item = item; item = item; while (item) { item = item->next; item = item->next; item = item->next; item = item->next; item = item->next; } return 0; } ============================== Sample 2 ============================== ASM: ;************************************************************************************************************************************************************ ;* CDVDInputStreamBluray::IsEOF() * ;************************************************************************************************************************************************************ ;undefined IsEOF(void) XOR EAX,EAX RET ?? 90h Actual src: bool CDVDInputStreamBluray::IsEOF() { return false; } Predicted src: bool CStreamStream::IsStream() { return true; } ============================== Sample 3 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined nm_setting_match_get_path() PUSH RBP MOV EBP,ESI PUSH RBX MOV RBX,RDI SUB RSP,0x8 CALL .plt:nm_setting_match_get_type ;undefined nm_setting_match_get_type() TEST RBX,RBX JZ LAB_001ae810 MOV RSI,RAX MOV RAX,qword ptr [RBX] TEST RAX,RAX JZ LAB_001ae7d5 CMP qword ptr [RAX],RSI JZ LAB_001ae7e1 LAB_001ae7d5: MOV RDI,RBX CALL .plt:::g_type_check_instance_is_a ;undefined g_type_check_instance_is_a() TEST EAX,EAX JZ LAB_001ae810 LAB_001ae7e1: MOV RAX,qword ptr [RBX + 0x30] TEST RAX,RAX JZ LAB_001ae800 CMP dword ptr [RAX + 0x8],EBP JBE LAB_001ae800 MOV RAX,qword ptr [RAX] MOV RAX,qword ptr [RAX + RBP*0x8] LAB_001ae7f6: ADD RSP,0x8 POP RBX POP RBP RET ?? 0Fh ?? 1Fh ?? 00h LAB_001ae800: MOV EDI,0x1f7 CALL _nm_g_return_if_fail_warning.constprop.0 ;undefined _nm_g_return_if_fail_warni... XOR EAX,EAX JMP LAB_001ae7f6 ?? 66h f ?? 90h LAB_001ae810: MOV EDI,0x1f5 CALL _nm_g_return_if_fail_warning.constprop.0 ;undefined _nm_g_return_if_fail_warni... ADD RSP,0x8 XOR EAX,EAX POP RBX POP RBP RET ?? 66h f Actual src: const char * nm_setting_match_get_path(NMSettingMatch *setting, guint idx) { g_return_val_if_fail(NM_IS_SETTING_MATCH(setting), NULL); g_return_val_if_fail(setting->path && idx < setting->path->len, NULL); return nm_strvarray_get_idx(setting->path, idx); } Predicted src: guint nm_setting_setting_get_count(NMSetting *setting) { g_return_val_if_fail(NM_IS_SETTING_SETTING(setting), 0); return NM_SETTING_SETTING_SETTING_GET_PRIVATE(setting)->count; } ============================== Sample 4 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined params_parse_wait() ;local_20 undefined8 -20 ;local_28 undefined8 -28 PUSH R12 PUSH RBP PUSH RBX SUB RSP,0x10 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_20+0x28],RAX XOR EAX,EAX TEST RDI,RDI JZ LAB_00112350 MOV R12,RSI TEST RSI,RSI JZ LAB_00112350 MOVZX EDX,byte ptr [RDI] LEA RCX,[.rodata:char_mask] MOV RBX,RDI TEST byte ptr [RCX + RDX*0x1]=>.rodata:char_mask,0x1 JNZ LAB_001122b5 CMP DL,0x2b JNZ LAB_00112330 LAB_001122b5: CALL .plt:::__errno_location ;int * __errno_location(void) MOV RSI,RSP MOV EDX,0xa MOV RDI,RBX MOV dword ptr [RAX],0x0 MOV RBP,RAX MOV qword ptr [RSP]=>local_28,0x0 CALL .plt:::strtoumax ;uintmax_t strtoumax(char * __nptr, c... CMP dword ptr [RBP],0x22 JZ LAB_00112340 MOV RDX,qword ptr [RSP]=>local_28 CMP RBX,RDX JZ LAB_00112330 CMP byte ptr [RDX],0x0 JNZ LAB_00112330 MOV RCX,RAX SHR RCX,0x20 JNZ LAB_00112340 LEA EDX,[RAX + -0x1] CMP EDX,0x20c49b MOV EDX,0x20c49b CMOVNC RAX,RDX MOV dword ptr [R12],EAX XOR EAX,EAX LAB_00112310: MOV RDX,qword ptr [RSP + local_20+0x28] SUB RDX,qword ptr FS:[0x28] JNZ LAB_0011236c ADD RSP,0x10 POP RBX POP RBP POP R12 RET ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00112330: MOV EAX,0xffffffea JMP LAB_00112310 ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00112340: MOV EAX,0xffffffde JMP LAB_00112310 ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00112350: LEA RSI,[.rodata:__func__.0] ;= "params_parse_wait" LEA RDI,[.rodata:s_;;_DEBUG:_%s:_null_parameter_0011960e] ;= ";; DEBUG: %s: null parameter\n" XOR EAX,EAX CALL msg_debug ;undefined msg_debug(undefined param_... MOV EAX,0xffffffea JMP LAB_00112310 LAB_0011236c: CALL .plt:::__stack_chk_fail ;undefined __stack_chk_fail() NOP word ptr CS:[RAX + RAX*0x1] Actual src: int params_parse_wait(const char *value, int32_t *dst) { if (value == NULL || dst == NULL) { DBG_NULL; return KNOT_EINVAL; } uint32_t num = 0; int ret = str_to_u32(value, &num); if (ret!= KNOT_EOK) { return ret; } if (num < 1 || num > INT32_MAX / 1000) { num = INT32_MAX / 1000; } *dst = num; return KNOT_EOK; } Predicted src: int parse_parse_string(const char *s, size_t len) { char *s; int ret; if (!s ||!s) return -EINVAL; s = s; if (!s) return -EINVAL; s = s; s = s; if (!s) return 0; s[0] = '\0'; s[1] = '\0'; s[2] = '\0'; s[3] = '\0'; s[3] = '\0'; s[3] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; s[5] = '\0'; return ret; } ============================== Sample 5 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined akira_widgets_export_widget_get_image_buffer_size_data_free() PUSH RBP MOV RBP,RDI MOV RDI,qword ptr [RDI + 0x20] TEST RDI,RDI JZ LAB_0017763a CALL .plt.got:::g_object_unref ;undefined g_object_unref() MOV qword ptr [RBP + 0x20],0x0 LAB_0017763a: MOV RSI,RBP MOV EDI,0x48 POP RBP JMP .plt:::g_slice_free1 ;undefined g_slice_free1() ?? 0Fh Actual src: static void akira_widgets_export_widget_get_image_buffer_size_data_free (gpointer _data) { AkiraWidgetsExportWidgetGetImageBufferSizeData* _data_; _data_ = _data; _g_object_unref0 (_data_->self); g_slice_free (AkiraWidgetsExportWidgetGetImageBufferSizeData, _data_); } Predicted src: static void bird_image_image_image_image_image_data_free (gpointer _data) { BirdFontImageImageData* _data_; _data_ = _data; _g_object_unref0 (_data_->self); g_slice_free (BirdFontImageData, _data_); }