I'm trying to reverse engineer an ages-old game compiled with Borland C++ in 1995. So far, I have found out that start @0x401000 passes to __startup in cw3220.dll (which apparently is Borland's C++ runtime dll) the following:
pointer to the begin of a list of global static constructors (
{ char flag0; char flag1; void* fun}
)pointer to end of said list
- pointer to begin of a list of destructors (as above)
- pointer to end of dtor list
- int flag - GUI app or not (should __startup call
main(argc,argv,env)
orWinMain(hInstance,hPrevInstance,lpCmdLine,nShowCmd)
) - unknown int flag1
- pointer to entry function
- pointer to a function which IDA has automagically named
matherr
- pointer to a function
matherrl
- unknown int flag2
- unknown int flag3
Is there any documentation available which tells the meaning of flag1/2/3 in the info struct, flag0/1 in the ctor list entries and how Borland C++ handles exceptions - functions using classes always call __InitExceptBlock
, but I never see checks for exceptions after function calls, how is try/catch handled?