How can I find only real functions not data garbage like section..debug_S_105 ? *
I need to collect function data (assembler code) of Open Source C++ Files which I compile with Visual Studio 19 (sln file was provided).
For example I generated cryptopp library --> opened provided cryptest.sln and built it (Win32, Release, /O2) which produces some files:
- Object files: 3way.obj, adler32.obj, algebra.obj,
- Lib file: cryptlib.lib
- PDB file: cryptlib.pdb
I need to know the function name and get the assembler code:
xxxx ✗ r2 authenc.obj
[0x0000368d]> aaaa
[Cannot analyze at 0x00010bdeg with sym. and entry0 (aa)
Cannot analyze at 0x00010be2
Cannot analyze at 0x00010c08
Cannot analyze at 0x00010c08
Cannot analyze at 0x00010c1a
Cannot analyze at 0x00010c1a
Cannot analyze at 0x00010d28
Cannot analyze at 0x00010d28
Cannot analyze at 0x0001114e
Cannot analyze at 0x0001114e
[...]
Cannot analyze at 0x000111fd
Cannot analyze at 0x000111fd
Cannot analyze at 0x00011211
Cannot analyze at 0x00011211
Cannot analyze at 0x0001126f
Cannot analyze at 0x0001126f
Cannot analyze at 0x00011283
Cannot analyze at 0x00011283
[x] Analyze all flags starting with sym. and entry0 (aa)
[x] Analyze function calls (aac)
[x] Analyze len bytes of instructions for references (aar)
[x] Check for objc references
[x] Check for vtables
[x] Type matching analysis for all functions (aaft)
[x] Propagate noreturn information
[x] Use -AA or aaaa to perform additional experimental analysis.
[x] Finding function preludes
[x] Enable constraint types analysis for variables
[0x0000368d]> afl
0x0000368d 5 63 sym.____HDU__char_traits_D_std__V__allocator_D_1__std__YA_AV__basic_string_DU__char_traits_D_std__V__allocator_D_2__0___QAV10_0_Z
0x00000000 45 877 -> 848 sym._comp.id
0x00001b44 286 1517 -> 1781 sym..drectve
0x00003619 62 851 -> 946 sym..debug_T
0x00003980 25 601 -> 640 section..debug_S_6
0x00003c15 81 872 -> 951 section..debug_S_8
0x000040e7 3 25 sym.__unwindfunclet_____HDU__char_traits_D_std__V__allocator_D_1__std__YA_AV__basic_string_DU__char_traits_D_std__V__allocator_D
0x00004143 5 34 sym.____Allocate__07U_Default_allocate_traits_std___0A__std__YAPAXI_Z
0x00004179 20 447 -> 510 section..debug_S_11
0x000043a7 16 291 -> 307 sym.____Allocate_manually_vector_aligned_U_Default_allocate_traits_std___std__YAPAXI_Z
0x000046a8 3 44 sym.____Deallocate__07_0A__std__YAXPAXI_Z
0x000046e8 19 638 -> 633 section..debug_S_15
0x000049a2 91 1191 -> 1310 section..debug_S_17
0x000051f4 6 134 sym.____Reallocate_grow_by_V_lambda_67d87d4aa1269033985980465fd1d824_____V___basic_string_DU__char_traits_D_std__V__allocator_D_2
0x000052b6 77 2130 -> 2150 section..debug_S_19
0x00005b58 98 1887 -> 1975 section..debug_S_21
0x0000644a 1 46 sym.__0__basic_string_DU__char_traits_D_std__V__allocator_D_2__std__QAE___QAV01__Z
0x00006478 38 1037 -> 1080 section..debug_S_23
0x00006899 14 258 -> 254 fcn.00006899
0x00006a73 1 172 sym.__0BadState_AuthenticatedSymmetricCipher_CryptoPP__QAE_ABV__basic_string_DU__char_traits_D_std__V__allocator_D_2__std__PBD1_Z
0x00006bbf 275 1521 -> 1789 section..debug_S_27
0x000073a9 8 138 -> 140 fcn.000073a9
0x0000743e 1 105 sym.__0BadState_AuthenticatedSymmetricCipher_CryptoPP__QAE_ABV__basic_string_DU__char_traits_D_std__V__allocator_D_2__std__PBD_Z
0x0000750b 152 971 -> 1135 section..debug_S_30
0x00007a6d 4 184 fcn.00007a6d
0x00007b61 37 453 -> 508 section..debug_S_33
0x00007ef3 3 142 sym.__unwindfunclet___0Exception_CryptoPP__QAE_ABV01__Z_0
0x00007fb3 92 797 -> 928 section..debug_S_36
0x00008409 3 106 sym.__unwindfunclet___0Exception_CryptoPP__QAE_W4ErrorType_01_ABV__basic_string_DU__char_traits_D_std__V__allocator_D_2__std___Z
0x00008487 23 491 -> 519 section..debug_S_39
0x00008686 19 559 -> 578 section..debug_S_41
0x000088c9 136 2578 -> 2731 section..debug_S_43
0x0000913c 12 415 -> 432 section..debug_S_53
0x000092f9 64 1036 -> 1135 section..debug_S_55
0x00009817 3 31 sym.___GBadState_AuthenticatedSymmetricCipher_CryptoPP__UAEPAXI_Z
0x0000984a 42 417 -> 504 section..debug_S_57
0x000099ff 26 377 -> 423 section..debug_S_59
0x00009b8c 25 404 -> 418 section..debug_S_61
0x00009d3e 20 355 -> 378 section..debug_S_63
0x00009ec8 16 188 sym._AuthenticateData_AuthenticatedSymmetricCipherBase_CryptoPP__IAEXPBEI_Z
0x00009fa2 64 2101 -> 2160 section..debug_S_65
0x0000a881 204 1185 -> 1293 section..debug_S_67
0x0000b213 8 287 sym.__unwindfunclet__ProcessData_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPAEPBEI_Z_3
0x00000068 51 773 -> 769 fcn.00000068
0x00000008 45 869 -> 840 fcn.00000008
0x0000b38c 69 597 -> 711 section..debug_S_70
0x0000b7e2 8 164 -> 166 sym.__unwindfunclet__Resynchronize_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPBEH_Z_0
0x0000b890 76 1581 -> 1597 section..debug_S_73
0x0000bfd5 596 2248 -> 2834 section..debug_S_75
0x0000cdaf 20 396 sym.__unwindfunclet__TruncatedFinal_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPAEI_Z_7
0x0000cf4c 13 177 sym._Update_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPBEI_Z
0x0000d061 82 625 -> 706 section..debug_S_78
0x0000d53f 42 867 -> 896 sym..text_x
0x0000d8b6 52 818 -> 948 section..debug_S_83
0x0000dbe8 54 928 -> 1018 section..debug_S_85
0x0000df9c 55 1312 -> 1363 section..debug_S_87
0x0000e4c6 26 685 -> 727 section..debug_S_89
0x0000e787 11 165 -> 168 fcn.0000e787
0x0000e8e9 1 11 sym.__Xran____String_val_U___Simple_types_D_std___std__SAXXZ
0x0000e908 19 352 -> 382 section..debug_S_93
0x0000ea72 28 525 -> 551 section..debug_S_95
0x0000ed10 3 31 sym._append___basic_string_DU__char_traits_D_std__V__allocator_D_2__std__QAEAAV12_QBD_Z
0x0000ed39 35 651 -> 697 section..debug_S_97
0x0000efd8 66 968 -> 1055 section..debug_S_99
0x0000f49e 3 30 sym._insert___basic_string_DU__char_traits_D_std__V__allocator_D_2__std__QAEAAV12_IABV12__Z
0x0000f4c6 34 954 -> 976 section..debug_S_101
0x0000f8b2 15 381 -> 395 section..debug_S_103
0x00010050 8 66 sym._reserve___basic_string_DU__char_traits_D_std__V__allocator_D_2__std__QAEXI_Z
0x000100a6 68 958 -> 1063 section..debug_S_105
0x00010464 17 556 -> 578 section..debug_S_107
0x0001069a 9 359 -> 360 section..debug_S_109
0x00004100 6 101 sym.__ehhandler_____HDU__char_traits_D_std__V__allocator_D_1__std__YA_AV__basic_string_DU__char_traits_D_std__V__allocator_D_2__0
0x00010808 1 57 sym.__ehfuncinfo___0Exception_CryptoPP__QAE_W4ErrorType_01_ABV__basic_string_DU__char_traits_D_std__V__allocator_D_2__std___Z
0x00010848 1 57 sym.__ehfuncinfo___0Exception_CryptoPP__QAE_ABV01__Z
0x00010888 1 57 sym.__ehfuncinfo_____HDU__char_traits_D_std__V__allocator_D_1__std__YA_AV__basic_string_DU__char_traits_D_std__V__allocator_D_2
0x000108d0 1 67 fcn.000108d0
0x00010932 1 87 sym.__ehfuncinfo___0BadState_AuthenticatedSymmetricCipher_CryptoPP__QAE_ABV__basic_string_DU__char_traits_D_std__V__allocator_D_2
0x00010990 1 57 sym.__ehfuncinfo__Resynchronize_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPBEH_Z
0x000109d0 1 57 sym.__ehfuncinfo__Update_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPBEI_Z
0x00010a28 1 122 sym.__ehfuncinfo__ProcessData_AuthenticatedSymmetricCipherBase_CryptoPP__UAEXPAEPBEI_Z
0x00010c40 1 12 sym.__CT___R0_AVexception_std___8__0exception_std__QAE_ABV01__Z12
0x00010c70 5 149 sym.___C__02LMMGGCAJ__3_5
0x00010d53 1 12 sym.__CT___R0_AVException_CryptoPP___8__0Exception_CryptoPP__QAE_ABV01__Z40
0x00010d83 22 421 -> 456 section..xdata_x_131
0x00010f4b 1 122 sym.___R4InvalidArgument_CryptoPP__6B
0x00010fe8 24 285 -> 312 sym.___R4BadState_AuthenticatedSymmetricCipher_CryptoPP__6B
0x0001111e 1 12 sym..xdata_x
0x00011292 72 551 -> 631 section..debug_S_169
0x00000e92 3 78 fcn.00000e92
I m using Python for extraction but some of these functions are not real function for example: section..debug_S_105
What do I have to do in detail to avoid the data garbage and just find real functions (like in source code)? Or did I compile the source code wrong?