0

Why in dissasemble code in IDA, some programs have func "main" in begin (in start window in IDA) like this:

cseg01:00038460 ; =============== S U B R O U T I N E =======================================
cseg01:00038460
cseg01:00038460 ; Attributes: noreturn
cseg01:00038460
cseg01:00038460 main_           proc near               ; CODE XREF: __CMain+40p
cseg01:00038460                 push    ecx
cseg01:00038461                 push    esi
cseg01:00038462                 push    ebp
cseg01:00038463                 mov     edx, 1

But some programs have func "start" in begin like this:

cseg01:00010124 ; =============== S U B R O U T I N E =======================================
cseg01:00010124
cseg01:00010124
cseg01:00010124                 public start
cseg01:00010124 start           proc near
cseg01:00010124                 jmp     short loc_10186

;--------------------------

cseg01:00010186 loc_10186:                              ; CODE XREF: startj
cseg01:00010186                 sti
cseg01:00010187                 and     esp, 0FFFFFFFCh
cseg01:0001018A                 mov     ebx, esp
cseg01:0001018C                 mov     dword_20110, ebx
cseg01:00010192                 mov     dword_200FC, ebx

And in this second case func "main" located somewhere in code and named just not "main" mere with prefix sub_.

This probably depends on the C++ compiler (linker) settings, how to configure the C++ compiler (linker) always for "main" func show?

2
  • 1
    /link /entry:main be aware no crt init will take place if you use this
    – blabb
    Commented Jan 22 at 17:10
  • I have same problem in WinAPI C++ project, in Visual Studio project settings I added Linker option -> Entry Point-> WinMain and in result of compilation I have many linker errors kind of - unresolved external symbol.
    – black4joss
    Commented Jan 23 at 8:45

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.