-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finding main() function #212
Comments
Could you provide more details what you mean here? Are you thinking about locating / skipping the C runtime boiler-plate code that gets linked into an executable, and try to find the actual user code that the CRT calls (the In order to accomplish this, I need a sample MS-DOS file where the problem is present. At the moment, I'm considering an ad-hoc method where first a match is made against a list of "templates" of CRT entry functions (from various compilers, programming languages, etc). Once a match is found, there will be a second template to identify the entry point into the actual binary. |
In @nemerle 's dcc there is a code for identifying main() functions for MS-DOS executables, and for lib-functions too. |
Yup the code just matches some very simple patterns ( get's confused sometimes too) and calls it a day 😄 |
Such code could be used here to find WinMain() or main() functions? |
absolutely. Boomerang also does some really hacky work to find WinMain. I want a solution that involves as little code as possible, and as much pattern matching as possible. Reko already has a regexp engine that understands hexadecimal patterns. Now it's more about collecting such patterns. For that to happen, I need sample EXE files that have been built with a known compiler. |
Nope, dcc 'main' locator patterns are dos only and pretty simplistic. |
OK, the most recent checkins have added general support for 'main' locator patterns. I've also grabbed some MS-DOS patterns from https://github.com/nemerle/dcc. Users still have to provide specific 'main' patterns if Reko fails to find them. @lab313ru: If you have a binary that doesn't get its 'main' found, could you please forward it to me so I can locate the pattern and add it to Reko? |
So what about Amiga executables?) But, there is no any info about pre-main stub anywhere. I'll try to indentify such stub. |
Getting main detection to work on amiga executables would be a fun task for a binary archaeologist 😄 We'd need to have access to various amiga compiler ( Aztec C/ Lattice/ StormC/ others) libraries |
Some of them is possible to find at eab.abime.net forums, I hope. |
Finding them will be the first step :) The next one depends on the format of available data
|
I'll try to find something. For example, for PPAMI.EXE. |
@nemerle : those Amiga samples you provided to Reko (back when it was called "Decompiler") -- what compiler did you use for them? |
It might have been the open source one - vbcc |
Is it possible to add such feature? For example, I want to find main function in MS-DOS executables.
The text was updated successfully, but these errors were encountered: