============================== Sample 1 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined tti_rnum() PUSH R13 PUSH R12 XOR R12D,R12D PUSH RBP MOV RBP,RDI PUSH RBX SUB RSP,0x8 MOV byte ptr [RDI],0xff NOP dword ptr [RAX + RAX*0x1] LAB_00108968: CALL sim_poll_kbd ;undefined sim_poll_kbd() TEST EAX,EAX JZ LAB_00108968 TEST AH,0x20 JNZ LAB_00108968 CMP EAX,0xfff JLE LAB_001089c2 AND EAX,0x7f CMP AL,0xd JZ LAB_001089d0 CMP AL,0x7e JZ LAB_001089e0 CMP AL,0x60 JZ LAB_001089e0 MOV R13,qword ptr [.data:tti_to_num] ;= 0011d820 MOVSX EBX,AL MOV ESI,EBX MOV RDI=>.rodata:s_0123456789|=@:;}_0011d820,R13 ;= "0123456789|=@:;}" CALL .plt:::strchr ;char * strchr(char * __s, int __c) MOV EDI,0x7 TEST RAX,RAX JZ LAB_001089b5 SUB RAX,R13 MOV EDI,EBX OR EAX,R12D MOV byte ptr [RBP],AL LAB_001089b5: CALL tto_write ;undefined tto_write() CMP byte ptr [RBP],0xff JZ LAB_00108968 XOR EAX,EAX LAB_001089c2: ADD RSP,0x8 POP RBX POP RBP POP R12 POP R13 RET ?? 0Fh ?? 1Fh ?? 00h LAB_001089d0: MOV byte ptr [RBP],0x7f MOV EDI,0xd JMP LAB_001089b5 ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001089e0: MOVSX EDI,AL MOV R12D,0x10 JMP LAB_001089b5 ?? 0Fh Actual src: t_stat tti_rnum (int8 *c) { int8 raw, flg = 0; char *cp; t_stat r; *c = -1; /* no char yet */ do { r = tti_read (&raw); /* get char */ if (r!= SCPE_OK) /* error? */ return r; if (raw == '\r') /* return? mark */ *c = 0x7F; else if ((raw == '~') || (raw == '`')) /* flag? mark */ flg = FLAG; else if (cp = strchr (tti_to_num, raw)) /* legal? */ *c = ((int8) (cp - tti_to_num)) | flg; /* assemble char */ else raw = 007; /* beep! */ tto_write (raw); /* echo */ } while (*c == -1); return SCPE_OK; } Predicted src: static int write_poll_poll(char *buf, int len) { int ret = 0; char *p; p = strchr(buf, len); if (p == NULL) return ret; p[len] = '\0'; p[len] = '\0'; if (p[len] == '\0') p[len] = '\0'; else p[len] = '\0'; return ret; } ============================== Sample 2 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _wrap_event_class_create_with_id() ;local_20 undefined8 -20 ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_40 undefined8 -40 ;local_48 undefined8 -48 PUSH R12 MOV RDI,RSI MOV ECX,0x2 MOV EDX,0x2 PUSH RBP LEA RSI,[.rodata:s_event_class_create_with_id_0018964f] ;= "event_class_create_with_id" XOR R12D,R12D SUB RSP,0x38 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_20+0x48],RAX XOR EAX,EAX LEA R8=>local_38,[RSP + 0x10] MOV qword ptr [RSP]=>local_48,0x0 CALL SWIG_Python_UnpackTuple ;undefined SWIG_Python_UnpackTuple() TEST RAX,RAX JZ LAB_00147beb MOV RDI,qword ptr [RSP + local_38+0x48] MOV RDX,qword ptr [.bss:swig_types[1072]] MOV RSI,RSP CALL SWIG_Python_ConvertPtrAndOwn.constprop.0 ;undefined SWIG_Python_ConvertPtrAndO... MOV EDI,EAX TEST EAX,EAX JS LAB_00147c38 MOV RDI,qword ptr [RSP + local_30+0x48] LEA RSI=>local_40,[RSP + 0x8] MOV RBP,qword ptr [RSP]=>local_48 CALL SWIG_AsVal_unsigned_SS_long_SS_long ;undefined SWIG_AsVal_unsigned_SS_lon... MOV EDI,EAX TEST EAX,EAX JS LAB_00147c10 MOV RSI=>local_40,qword ptr [RSP + 0x8] MOV RDI,RBP CALL .plt:::bt_event_class_create_with_id ;undefined bt_event_class_create_with... MOV RSI,qword ptr [.bss:swig_types[256]] MOV RDI,RAX CALL SWIG_Python_NewPointerObj.constprop.0 ;undefined SWIG_Python_NewPointerObj.... MOV R12,RAX LAB_00147beb: MOV RAX,qword ptr [RSP + local_20+0x48] SUB RAX,qword ptr FS:[0x28] JNZ LAB_00147c59 ADD RSP,0x38 MOV RAX,R12 POP RBP POP R12 RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00147c10: CMP EAX,-0x1 MOV EAX,0xfffffffb LEA RSI,[.rodata:s_in_method_'event_class_create_wi_001749a8] ;= "in method 'event_class_create_wit... CMOVZ EDI,EAX CALL SWIG_Python_ErrorType ;undefined SWIG_Python_ErrorType() MOV RDI,RAX CALL .plt:PyErr_SetString ;undefined PyErr_SetString() JMP LAB_00147beb ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00147c38: CMP EAX,-0x1 MOV EAX,0xfffffffb LEA RSI,[.rodata:s_in_method_'event_class_create_wi_00174958] ;= "in method 'event_class_create_wit... CMOVZ EDI,EAX CALL SWIG_Python_ErrorType ;undefined SWIG_Python_ErrorType() MOV RDI,RAX CALL .plt:PyErr_SetString ;undefined PyErr_SetString() JMP LAB_00147beb LAB_00147c59: CALL .plt:::__stack_chk_fail ;undefined __stack_chk_fail() NOP Actual src: SWIGINTERN PyObject *_wrap_event_class_create_with_id(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; bt_stream_class *arg1 = (bt_stream_class *) 0 ; uint64_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; unsigned long long val2 ; int ecode2 = 0 ; PyObject *swig_obj[2] ; bt_event_class *result = 0 ; if (!SWIG_Python_UnpackTuple(args, "event_class_create_with_id", 2, 2, swig_obj)) SWIG_fail; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_bt_stream_class, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "event_class_create_with_id" "', argument " "1"" of type '" "bt_stream_class *""'"); } arg1 = (bt_stream_class *)(argp1); ecode2 = SWIG_AsVal_unsigned_SS_long_SS_long(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "event_class_create_with_id" "', argument " "2"" of type '" "uint64_t""'"); } arg2 = (uint64_t)(val2); result = (bt_event_class *)bt_event_class_create_with_id(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_bt_event_class, 0 | 0 ); return resultobj; fail: return NULL; } Predicted src: SWIGINTERN PyObject *_wrap_event_class_create_with_class_id(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; bt_event_class *arg1 = (bt_event_class *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; int result; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_bt_event_class, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "event_class_create_with_class_id" "', argument " "1"" of type '" "bt_event_class *""'"); } arg1 = (bt_event_class *)(argp1); result = (int)bt_event_class_create_with_class_id((struct bt_event_class const *)arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_bt_bt_event_class, 0 | 0 ); return resultobj; fail: return NULL; } ============================== Sample 3 ============================== 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: uae_u32 REGPARAM2 op_b1f0_33_ff(uae_u32 opcode) { int count_cycles = 0; uae_u32 real_opcode = opcode; uae_u32 srcreg = (real_opcode & 7); OpcodeFamily = 59; CurrentInstrCycles = 12; uaecptr srca; srca = m68k_areg(regs, srcreg); 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(2); return (1 * 4 * CYCLE_UNIT / 2 + count_cycles) * 4; } ============================== Sample 4 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined fcml_tf_env_memory_alloc_handler_counter() ADD dword ptr [.bss:counter],0x1 JMP qword ptr [.bss:default_alloc] ?? 0Fh Actual src: fcml_ptr fcml_tf_env_memory_alloc_handler_counter( fcml_usize size ) { counter += 1; return default_alloc( size ); } Predicted src: void memory_alloc_memory (void) { memory_alloc_memory (); } ============================== Sample 5 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined conf_setAudioDefaults() SUB RSP,0x8 MOV RDI,qword ptr [.bss:conf[88]] TEST RDI,RDI JZ LAB_0011bdd5 CALL .plt:::free ;void free(void * __ptr) LAB_0011bdd5: LEA RDI,[.rodata:s_openal_001f5946] ;= "openal" CALL .plt:::strdup ;char * strdup(char * __s) MOV dword ptr [.bss:conf[112]],0x0 MOV qword ptr [.bss:conf[88]],RAX MOV RAX,0x100000080 MOV qword ptr [.bss:conf[96]],RAX MOV RAX,0x8000000001 MOV qword ptr [.bss:conf[104]],RAX MOV RAX,qword ptr [.rodata:DAT_001f43c0] ;= 3FE3333333333333h MOV qword ptr [.bss:conf[120]],RAX MOV RAX,qword ptr [.rodata:DAT_001f49a0] ;= 3FE999999999999Ah MOV qword ptr [.bss:conf[128]],RAX ADD RSP,0x8 RET ?? 66h f Actual src: void conf_setAudioDefaults (void) { if (conf.sound_backend!= NULL) { free(conf.sound_backend); conf.sound_backend = NULL; } /* Sound. */ conf.sound_backend = strdup(BACKEND_DEFAULT); conf.snd_voices = VOICES_DEFAULT; conf.snd_pilotrel = PILOT_RELATIVE_DEFAULT; conf.al_efx = USE_EFX_DEFAULT; conf.al_bufsize = BUFFER_SIZE_DEFAULT; conf.nosound = MUTE_SOUND_DEFAULT; conf.sound = SOUND_VOLUME_DEFAULT; conf.music = MUSIC_VOLUME_DEFAULT; } Predicted src: void conf_set_conf(void) { if (conf.conf) conf.conf = strdup(conf.conf); else conf.conf = NULL; conf.conf = NULL; }