============================== Sample 1 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined __newSnowballStemmer() ;local_28 undefined1[16] -28 PUSH R12 XOR ESI,ESI PUSH RBX SUB RSP,0x18 ; FWD[2,0]: 0017e440,002f4d30 MOVQ XMM0,qword ptr [->__sbstemmer_Stem] ;= 0017e440 MOVHPS XMM0,qword ptr [->__sbstemmer_Free] ;= 0017e510 MOVAPS xmmword ptr [RSP]=>local_28,XMM0 CALL .plt:sb_stemmer_new ;undefined sb_stemmer_new() MOV R12,RAX TEST RAX,RAX JZ LAB_0017e687 MOV EDI,0x18 CALL .plt.got:::malloc ;void * malloc(size_t __size) MOV EDI,0x18 MOV qword ptr [RAX],R12 MOV RBX,RAX MOV qword ptr [RAX + 0x10],0x18 CALL .plt.got:::malloc ;void * malloc(size_t __size) MOV EDI,0x30 MOV byte ptr [RAX],0x2b MOV qword ptr [RBX + 0x8],RAX CALL .plt.got:::malloc ;void * malloc(size_t __size) MOVDQA XMM0,xmmword ptr [RSP]=>local_28 MOV qword ptr [RAX],RBX MOV R12,RAX MOVUPS xmmword ptr [RAX + 0x8],XMM0 LEA RAX,[sbstemmer_Reset] MOV qword ptr [R12 + 0x18],RAX=>sbstemmer_Reset LAB_0017e687: ADD RSP,0x18 MOV RAX,R12 POP RBX POP R12 RET ?? 66h f Actual src: Stemmer *__newSnowballStemmer(const char *language) { struct sb_stemmer *sb = sb_stemmer_new(language, NULL); // No stemmer available for this language if (!sb) { return NULL; } struct sbStemmerCtx *ctx = malloc(sizeof(*ctx)); ctx->sb = sb; ctx->cap = 24; ctx->buf = malloc(ctx->cap); ctx->buf[0] = STEM_PREFIX; Stemmer *ret = malloc(sizeof(Stemmer)); ret->ctx = ctx; ret->Stem = __sbstemmer_Stem; ret->Free = __sbstemmer_Free; ret->Reset = sbstemmer_Reset; return ret; } Predicted src: extern void * X11_new(void) { X11Context *ctx; ctx = (X11Context *) malloc(sizeof(X11Context)); if (!ctx) return NULL; ctx->data = malloc(sizeof(X11Context)); ctx->data = malloc(sizeof(X11Context)); ctx->data = malloc(sizeof(X11Context)); ctx->data = malloc(sizeof(X11Context)); ctx->data = NULL; return ctx; } ============================== 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_class_create_with_class_create_with_class_id(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { PyObject *resultobj = 0; bt_class *arg1 = (bt_class *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject *swig_obj[1] ; bt_class *result = 0 ; if (!args) SWIG_fail; swig_obj[0] = args; res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_bt_class, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "class_create_with_class_create_with_class_id" "', argument " "1"" of type '" "bt_class *""'"); } arg1 = (bt_class *)(argp1); result = (bt_class *)bt_class_create_with_class_create_with_class_id((struct bt_class const *)arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_bt_class, 0 | 0 ); return resultobj; fail: return NULL; } ============================== Sample 3 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined check_build() PUSH R12 MOV R12,RSI PUSH RBP MOV RBP,RDI MOV RDI,RSI PUSH RBX CALL .plt:::strlen ;size_t strlen(char * __s) MOV RDI,RBP MOV RBX,RAX CALL .plt:::lax_json_eof ;undefined lax_json_eof() TEST EAX,EAX JNZ LAB_0010136e CMP dword ptr [.bss:out_buf_index],EBX JNZ LAB_001013c6 MOVSXD RDX,EBX LEA RBX,[.bss:out_buf] MOV RDI,R12 MOV RSI=>.bss:out_buf,RBX CALL .plt:::memcmp ;int memcmp(void * __s1, void * __s2,... TEST EAX,EAX JNZ LAB_0010139c POP RBX MOV RDI,RBP POP RBP POP R12 JMP .plt:LAB_00101070 LAB_0010136e: MOV EDI,EAX CALL .plt:::lax_json_str_err ;undefined lax_json_str_err() MOV RDI,qword ptr [.bss:stderr] MOV ESI,0x1 LEA RDX,[.rodata:s_%s_00103020+22] ;= "%s\n" MOV RCX,RAX XOR EAX,EAX CALL .plt:::__fprintf_chk ;undefined __fprintf_chk() MOV EDI,0x1 CALL .plt:::exit ;void exit(int __status) LAB_0010139c: MOV R8=>.bss:out_buf,RBX MOV RCX,R12 LEA RDX,[.rodata:s_EXPECTED:_---------_%s_RECEIVED:_00103288] ;= "EXPECTED:\n---------\n%s\nRECEIVE... LAB_001013a9: MOV RDI,qword ptr [.bss:stderr] MOV ESI,0x1 XOR EAX,EAX CALL .plt:::__fprintf_chk ;undefined __fprintf_chk() MOV EDI,0x1 CALL .plt:::exit ;void exit(int __status) LAB_001013c6: LEA R8,[.bss:out_buf] MOV RCX,R12 LEA RDX,[.rodata:s__EXPECTED:_---------_%s_RECEIVED_00103258] ;= "\nEXPECTED:\n---------\n%s\nRECEI... JMP LAB_001013a9 ?? 0Fh Actual src: static void check_build(struct LaxJsonContext *context, const char *output) { int expected_len = strlen(output); enum LaxJsonError err = lax_json_eof(context); if (err!= LaxJsonErrorNone) { fprintf(stderr, "%s\n", lax_json_str_err(err)); exit(1); } if (out_buf_index!= expected_len) { fprintf(stderr, "\n" "EXPECTED:\n" "---------\n" "%s\n" "RECEIVED:\n" "---------\n" "%s\n", output, out_buf); exit(1); } if (memcmp(output, out_buf, expected_len)!= 0) { fprintf(stderr, "EXPECTED:\n" "---------\n" "%s\n" "RECEIVED:\n" "---------\n" "%s\n", output, out_buf); exit(1); } lax_json_destroy(context); } Predicted src: static void do_json_out(const char *str, const char *str, size_t len) { const char *s; size_t len; len = strlen(str); if (len == 0) { fprintf(stderr, "%s: %s\n", str, len); exit(1); } len = strlen(str); if (len > 0) { fprintf(stderr, "%s: %s\n", str, len); exit(1); } } ============================== Sample 4 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined gth_tag_new_loop() PUSH RBX MOV RBX,RDI MOV EDI,0x18 CALL .plt:::g_malloc0 ;undefined g_malloc0() MOV EDX,dword ptr [RBX] MOV qword ptr [RAX + 0x8],RBX MOV dword ptr [RAX],EDX POP RBX RET ?? 0Fh Actual src: GthTag * gth_tag_new_loop (GthLoop *loop) { GthTag *tag; tag = g_new0 (GthTag, 1); tag->type = loop->type; if (loop->type == GTH_TAG_FOR_EACH_IN_RANGE) tag->value.range_loop = (GthRangeLoop *) loop; else tag->value.loop = loop; return tag; } Predicted src: static void gth_tag_new (GthFile *tag) { tag->priv = tag; tag->priv->tag = NULL; } ============================== Sample 5 ============================== ASM: ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined sge_generic_cal() PUSH R13 MOV ESI,0x1 PUSH R12 MOV R12,RDI XOR EDI,EDI SUB RSP,0x8 CALL rmon_condition ;undefined rmon_condition() TEST EAX,EAX JNZ LAB_00271be8 LAB_00271b9b: LEA RDI,[.data:CAL_Type] CALL lCreateElem ;undefined lCreateElem() TEST R12,R12 MOV ESI,0x2256a MOV R13,RAX LEA RAX,[.rodata:s_template_00282aed+6] ;= "template" CMOVZ R12,RAX MOV RDI,R13 MOV RDX,R12 CALL lSetString ;undefined lSetString() XOR EDI,EDI MOV ESI,0x1 CALL rmon_condition ;undefined rmon_condition() TEST EAX,EAX JNZ LAB_00271c08 LAB_00271bd8: ADD RSP,0x8 MOV RAX,R13 POP R12 POP R13 RET ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00271be8: CALL cl_thread_get_thread_config ;undefined cl_thread_get_thread_config() TEST RAX,RAX JZ LAB_00271c40 MOV RSI,qword ptr [RAX] LEA RDI,[.rodata:SGE_FUNC.1] ;= "sge_generic_cal" CALL rmon_menter ;undefined rmon_menter() JMP LAB_00271b9b ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00271c08: CALL cl_thread_get_thread_config ;undefined cl_thread_get_thread_config() TEST RAX,RAX JZ LAB_00271c58 MOV RCX,qword ptr [RAX] MOV EDX,0xa1f LEA RSI,[.rodata:s_../libs/sgeobj/sge_calendar.c_002a0a39] ;= "../libs/sgeobj/sge_calendar.c" LEA RDI,[.rodata:SGE_FUNC.1] ;= "sge_generic_cal" CALL rmon_mexit ;undefined rmon_mexit() ADD RSP,0x8 MOV RAX,R13 POP R12 POP R13 RET ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00271c40: XOR ESI,ESI LEA RDI,[.rodata:SGE_FUNC.1] ;= "sge_generic_cal" CALL rmon_menter ;undefined rmon_menter() JMP LAB_00271b9b ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00271c58: XOR ECX,ECX MOV EDX,0xa1f LEA RSI,[.rodata:s_../libs/sgeobj/sge_calendar.c_002a0a39] ;= "../libs/sgeobj/sge_calendar.c" LEA RDI,[.rodata:SGE_FUNC.1] ;= "sge_generic_cal" CALL rmon_mexit ;undefined rmon_mexit() JMP LAB_00271bd8 ?? 66h f Actual src: lListElem* sge_generic_cal(char *cal_name) { lListElem *calp; DENTER(TOP_LAYER, "sge_generic_cal"); calp = lCreateElem(CAL_Type); lSetString(calp, CAL_name, cal_name?cal_name:"template"); DRETURN(calp); } Predicted src: void * thread_config(thread_config_t *config) { thread_config_t *config; if (config == NULL) { return NULL; } config = thread_get_config(config); if (config == NULL) { return NULL; } config = thread_config_get_config(config); if (config == NULL) { return NULL; } return config->config; }