Re:Microsoft introduces Universal Windows apps
by voltagex_ on Wednesday April 02, 2014 @08:24PM
(#7520017)
I've tried to do programs with /nostdlib before, how did you implement the startup and shutdown functions that are required?
Re:Microsoft introduces Universal Windows apps
by shadowwolf007 on Thursday April 03, 2014 @11:29AM
(#7523490)
Sorry about that I didn't see your reply! Because I have to use phone it's challenging to type out all I did. While I achieved it, I wouldn't say it's sensible or easy!
Anyway, you have to turn off c++, c++ exceptions, security checks in compiler options. In linker set the entry point to main and turn off error reporting. From there it's finding the right lib which is dependent on arch, etc.
To be honest it's not worth doing. I only knew of it because I had to patch a vs2010 exe to run on windows 2000.
No win main or other similar concepts here and built using vs2012.
Microsoft (R) COFF/PE Dumper Version 11.00.61030.0 Copyright (C) Microsoft Corporation. All rights reserved.
Dump of file consoleapplication6.exe
File Type: EXECUTABLE IMAGE
_main: 00401000: 68 48 20 40 00 push offset ??_C@_0M@KIBDPGDE@Hello?5world?$AA@ 00401005: FF 15 00 20 40 00 call dword ptr [__imp__puts] 0040100B: 83 C4 04 add esp,4 0040100E: 33 C0 xor eax,eax 00401010: C3 ret