You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Win32 applications, the entrypoint present in PE headers and invoked on program start does not have any parameters. Functions like WinMain are not the real entrypoint of the program - instead, a function (usually provided by the compiler) like WinMainCRTStartup is used to get things like command line arguments, initialise the C/C++ runtime, and to call the "higher-level entrypoint".
Judging by function names, programs compiled for WinCE seem to have a CRT startup routines, but they expect the arguments from the operating system. Because no arguments are provided by the OS, the program, for example, has no access to the command line arguments.
Compare stack traces with debug symbols between a Win32 application, and a WinCE one:
Win32:
WinCE (not showing anything above that in that stacktrace, as it seems that at least for solitaire.exe, CRT startup function is the only entrypoint - the main program loop is there):
Using a dirty hack that violates many best practices to call the entrypoint from COREDLL!DllMain, implementing some functions, clicking through a few stub messages, and making some other minor tweaks, it is possible to run WinCE cmd.exe, albeit it doesn't really work that great.
The text was updated successfully, but these errors were encountered:
In Win32 applications, the entrypoint present in PE headers and invoked on program start does not have any parameters. Functions like
WinMain
are not the real entrypoint of the program - instead, a function (usually provided by the compiler) likeWinMainCRTStartup
is used to get things like command line arguments, initialise the C/C++ runtime, and to call the "higher-level entrypoint".Judging by function names, programs compiled for WinCE seem to have a CRT startup routines, but they expect the arguments from the operating system. Because no arguments are provided by the OS, the program, for example, has no access to the command line arguments.
Compare stack traces with debug symbols between a Win32 application, and a WinCE one:
Win32:
![obraz](https://private-user-images.githubusercontent.com/24442148/322214688-456b7037-4135-4724-9020-66caa786a54a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNzE1ODgsIm5iZiI6MTczOTA3MTI4OCwicGF0aCI6Ii8yNDQ0MjE0OC8zMjIyMTQ2ODgtNDU2YjcwMzctNDEzNS00NzI0LTkwMjAtNjZjYWE3ODZhNTRh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mWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.NaiaE9eKpA5YL-C29saVGuPqyQngyS7lXbrt41gzx6A)
WinCE (not showing anything above that in that stacktrace, as it seems that at least for
solitaire.exe
, CRT startup function is the only entrypoint - the main program loop is there):Using a dirty hack that violates many best practices to call the entrypoint from
![obraz](https://private-user-images.githubusercontent.com/24442148/322215154-a08fc467-6963-4e98-9066-0b4db1ec13eb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNzE1ODgsIm5iZiI6MTczOTA3MTI4OCwicGF0aCI6Ii8yNDQ0MjE0OC8zMjIyMTUxNTQtYTA4ZmM0NjctNjk2My00ZTk4LTkwNjYtMGI0ZGIxZWMxM2ViLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMDklMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjA5VDAzMjEyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWViZWUyYjkyMGQ5ODg1MDE4M2RmY2NiZjEzNWY0ZTM0MWI4ZTM5MmQ3ZGIxM2Q4ZjdiODUwNTlhZDBjMWJjMTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.SHAe4sq0Eq6OfdcIEaUUtfnPcvf6PeJn3nlwaaVVaKo)
COREDLL!DllMain
, implementing some functions, clicking through a few stub messages, and making some other minor tweaks, it is possible to run WinCEcmd.exe
, albeit it doesn't really work that great.The text was updated successfully, but these errors were encountered: