============================== Sample 1 ============================== 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: static void init(char *str) { int i; for (i = 0; i < len; i++) { for (i = 0; i < len; i++) { for (i = 0; i < len; i++) { if (str[i] == 0) { if (str[i] == 0) { if (str[i] == 0) { return; } } } } } } ============================== Sample 2 ============================== ASM: ;************************************************************************************************************************************************************ ;* HistogramDockerDock::startUpdateCanvasProjection() * ;************************************************************************************************************************************************************ ;undefined startUpdateCanvasProjection(HistogramDockerDock * this) ;this HistogramDo... RDI MOV RAX,qword ptr [this + 0x28] TEST byte ptr [RAX + 0x9],0x80 JNZ LAB_0010b110 RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_0010b110: MOV this,qword ptr [this + 0x48] JMP .plt:LAB_00108030 ?? 90h Actual src: void HistogramDockerDock::startUpdateCanvasProjection() { if (isVisible()) { m_imageIdleWatcher->startCountdown(); } } Predicted src: void vtks::clear() { if (this->is()) { } else { this->clear(); } } ============================== Sample 3 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined rpmcpioFree() TEST RDI,RDI JZ LAB_00126500 PUSH RBP CMP qword ptr [RDI],0x0 MOV RBP,RDI JZ LAB_001264f4 CALL .plt:rpmcpioClose ;undefined rpmcpioClose() LAB_001264f4: MOV RDI,RBP CALL .plt.got:::free ;void free(void * __ptr) XOR EAX,EAX POP RBP RET LAB_00126500: XOR EAX,EAX RET ?? 66h f Actual src: rpmcpio_t rpmcpioFree(rpmcpio_t cpio) { if (cpio) { if (cpio->fd) (void) rpmcpioClose(cpio); free(cpio); } return NULL; } Predicted src: static void free_free(void *data) { if (data) { free(data); free(data); free(data); free(data); free(data); } } ============================== Sample 4 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined op_907a_33_ff() MOV EAX,dword ptr [.bss:regs[64]] PUSH R12 SHR EDI,0x9 PUSH RBP AND EDI,0x7 PUSH RBX LEA R12D,[RAX + 0x2] MOV EBP,EDI LEA RBX,[.bss:regs] MOV dword ptr [.bss:OpcodeFamily],0x7 MOV EDI,R12D MOV dword ptr [.bss:CurrentInstrCycles],0xc CALL mmu_get_iword.constprop.0 ;undefined mmu_get_iword.constprop.0() MOVSX EDI,AX ADD EDI,R12D CALL uae_mmu060_get_word ;undefined uae_mmu060_get_word() MOV EDI,EBP XOR ESI,ESI MOV EDX,dword ptr [RBX + RDI*0x4]=>.bss:regs MOV R8D,EAX MOVZX EAX,AX MOV R9D,R8D MOVZX ECX,DX SUB ECX,EAX MOV EAX,dword ptr [.bss:regflags] SETZ SIL XOR R9D,EDX SHL ESI,0xe AND EAX,0xffffbffe OR EAX,ESI MOV ESI,EDX XOR ESI,ECX AND ESI,R9D MOVSX ESI,SI SHR ESI,0x1f OR EAX,ESI XOR ESI,ESI AND AH,0xfe CMP R8W,DX SETA SIL XOR DX,DX ADD dword ptr [.bss:regs[64]],0x4 SHL ESI,0x8 OR EAX,ESI MOV ESI,EAX AND AH,0x7f SHR ESI,0x8 MOV dword ptr [.bss:regflags+4],ESI MOV ESI,ECX MOVZX ECX,CX AND ESI,0x8000 OR EDX,ECX OR EAX,ESI MOV dword ptr [RBX + RDI*0x4]=>.bss:regs,EDX POP RBX MOV dword ptr [.bss:regflags],EAX POP RBP MOV EAX,0x1000 POP R12 RET ?? 0Fh Actual src: uae_u32 REGPARAM2 op_907a_33_ff(uae_u32 opcode) { int count_cycles = 0; uae_u32 real_opcode = opcode; uae_u32 dstreg = (real_opcode >> 9) & 7; OpcodeFamily = 7; CurrentInstrCycles = 12; uaecptr srca; srca = m68k_getpci() + 2; srca += (uae_s32)(uae_s16)get_iword_mmu060(2); uae_s16 src = get_word_mmu060(srca); uae_s16 dst = m68k_dreg(regs, dstreg); uae_u32 newv = ((uae_u16)(dst)) - ((uae_u16)(src)); int flgs = ((uae_s16)(src)) < 0; int flgo = ((uae_s16)(dst)) < 0; int flgn = ((uae_s16)(newv)) < 0; SET_ZFLG(((uae_s16)(newv)) == 0); SET_VFLG((flgs ^ flgo) & (flgn ^ flgo)); SET_CFLG(((uae_u16)(src)) > ((uae_u16)(dst))); COPY_CARRY(); SET_NFLG(flgn!= 0); m68k_dreg(regs, dstreg) = (m68k_dreg(regs, dstreg) & ~0xffff) | ((newv) & 0xffff); m68k_incpci(4); return (1 * 4 * CYCLE_UNIT / 2 + count_cycles) * 4; } Predicted src: static void C_ccall trf_ccall trf_ccall trf(C_word c,C_word *av){ C_word tmp; C_word t0=av[0]; C_word t1=av[1]; C_word t2; C_word t2; C_word t2; C_word *a; if(C_unlikely(!C_demand(C_demand(C_demand(C_demand(C_calculate_demand(0,c,c,2)))){ C_save_and_and_and_and_and_reclaim((void *)f_reclaim((void *)f_alloc(3,c,c,c,c,c,c,c,c,c,c,c,av);} t2=C_alloc(4); t2=C_word*)t2=C_word*)t0)[2]=((C_word*)t0)[2],a=C_word*)t0)[2]=((C_word*)t0)[2]=((C_word*)t0)[2]=((C_word*)t0)[3],a[1]=((C_word*)t0)[2]=((C_word*)t0)[2]=((C_word*)t0)[2]=((C_word*)t0)[2],a[1]=((C_word*)t0)[2],a[2]=((C_word*)t0)[2]=((C_word*)t0)[3],tmp=(C_word)a,tmp); ============================== Sample 5 ============================== 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 (void *data, void *data) { struct data_data *data = data; data = data; data = data; data = data; data = data; data = data; data = data; }