Sysinternals Homepage
Forum Home Forum Home > Windows Discussions > Development
  New Posts New Posts RSS Feed - EXEs created by VisualStudio2008 vs Win4.0
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

EXEs created by VisualStudio2008 vs Win4.0

 Post Reply Post Reply Page  12>
Author
Message Reverse Sort Order
steelbytes View Drop Down
Newbie
Newbie


Joined: 21 April 2008
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote steelbytes Quote  Post ReplyReply Direct Link To This Post Topic: EXEs created by VisualStudio2008 vs Win4.0
    Posted: 27 August 2008 at 2:18pm
Originally posted by steelbytes steelbytes wrote:

I have at last found time to write a patcher to modifiy a compiled .exe/dll. 
 
why not just mod the crt .lib?  umm ... because I feel that is MS's job :-)
 
thinking of releasing on steelbytes.com, but need to test it a bit more first.
 
beta released ExeVersion
 
Louis Solomon
www.SteelBytes.com
Back to Top
takeos View Drop Down
Newbie
Newbie


Joined: 25 August 2008
Location: United States
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote takeos Quote  Post ReplyReply Direct Link To This Post Posted: 25 August 2008 at 5:29pm
The work and posts by steelbytes and molotov are milestones in this fields, nevertheless I'd like to bring to your attention a slightly different approach, implemented as a library containing the missing functions, so that it is compatible with optimization as well:
 
Legacy Extender for Visual Studio 2005/2008
 
The toolkit contains a linkable library and a command to edit the version and recalculate the checksum (similar to editbin.exe once provided by Microsoft).
 
The Legacy Extender library also implements some Unicode functions which are present in Windows 95, but which do not work on an out of the box system (your application will start, but it will fail on these functions). These are also referenced by Visual Studio. Your critical expert opinion is of course most welcome.
Back to Top
steelbytes View Drop Down
Newbie
Newbie


Joined: 21 April 2008
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote steelbytes Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2008 at 1:47pm
I have at last found time to write a patcher to modifiy a compiled .exe/dll. 
 
why not just mod the crt .lib?  umm ... because I feel that is MS's job :-)
 
thinking of releasing on steelbytes.com, but need to test it a bit more first.
Louis Solomon
www.SteelBytes.com
Back to Top
steelbytes View Drop Down
Newbie
Newbie


Joined: 21 April 2008
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote steelbytes Quote  Post ReplyReply Direct Link To This Post Posted: 23 April 2008 at 4:57am
re: 'global opt' vs 'whole prog opt', yeah I typed the wrong thing when I quickly scribbled that post :-)
 
re: updating my page with those steps, that was my intention affter writing them for you - I was just waiting for you to get it working (ie, validate the steps).  page updated :-)
 
 
it's a shame that we have to do this messing around, as it will just keep people from upgrading from VC6 for even longer :-)  a conspirisist would say it's MS attempting to force our hands in dropping support for old windows.  bit of a shame since my programs work fully on win9x/nt4 when compiled with vs2003 and doing my method requires turning off whole prog opt if I use vs2005 - not desirable.
 
 
I have been considering writing an exe patcher to apply these changes to an already compiled .exe (or .dll), but just haven't had the time.  I wonder if I could then get vs2008's remote debugger running on win9x/nt4 ...
 
 
hey, if you have email addy for whomever maintains sysinternals's apps such as handle.exe, then you may want to formard this info to them
 
Louis Solomon
www.SteelBytes.com
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17531
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 23 April 2008 at 3:54am
I have my test program working on 98 and ME now - thanks for your persistence. EmbarrassedThumbs%20Up
 
Quote were you compiling with global optimisation?
I had taken this to mean /Og which the default optimization (/O2) includes.  I had previously changed the optimzation setting to /Od, to no effect.
 
Quote disable whole program optimisation
This made me look at that Whole Program Optimization setting (/GL); disabling that seems to have been the key.
 
EditBin.exe from VS 2003 and the code from Part 1 each worked, in combination with the functions from Part 2 and Part 3.
 
Wonder if it may also be worth including your list of steps on your page...


Edited by molotov - 23 April 2008 at 4:09am
Daily affirmation:
net helpmsg 4006
Back to Top
steelbytes View Drop Down
Newbie
Newbie


Joined: 21 April 2008
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote steelbytes Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2008 at 10:01pm

please past your build log here, as I am interested in reading the warnings that the linker generates when resolving the multiple references to these two functons.

PS, test 5 mins ago with a hello world test from scratch ...
* set progrm to be multibyte
* add forcemultiple to linker
* set crt to be static not dll
* disable whole program optimisation
* use the two funcs from my web page
* and modfy the ver fields (using the method on my page).

Louis Solomon
www.SteelBytes.com
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17531
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2008 at 7:43pm
Even after disabling compiler optimization (/Od), and using the functions in Part 2 and Part 3 from your page (in conjunction with /FORCE:MULTIPLE), and running the binary through the function in Part 1 (or VS2003's EditBin.exe), the executables created in VS 2008 do not function on Windows 98 SE or Windows ME.
 
In the case of EditBin, Dependency Walker verifies the Subsystem Ver is 4.0, and in the case of the function from Part 1 Dependency Walker shows the OS Ver and Subsystem Ver both as 4.0. 
Daily affirmation:
net helpmsg 4006
Back to Top
steelbytes View Drop Down
Newbie
Newbie


Joined: 21 April 2008
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote steelbytes Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2008 at 5:11am
were you compiling with global optimisation? if so, it seems that you can't reliably override the CRT functions.
Louis Solomon
www.SteelBytes.com
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17531
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 22 April 2008 at 4:48am
Quote using older version of EditBin from some older version of VS/VC/SDK _may_ work - I have not explored/tested
I used VS 2003's editbin.exe, and was no longer presented with the following dialog:
Quote =====
Error Starting Program
=====
The X:\Path To\Your.exe file
expects a newer version of Windows.
Upgrade your Windows version.
 
OK
=====
 
I finally made a 98SE and ME VM; the app didn't run, probably due to Part 2 and Part 3 from your page.  Added those functions, and rebuilt, but still no joy... 
Quote LIBCMT.lib(crt0dat.obj) : error LNK2005: __crt_waiting_on_module_handle already defined in objfile.obj
LIBCMT.lib(initcrit.obj) : error LNK2005: ___crtInitCritSecAndSpinCount already defined in objfile.obj
 
Got around those with /FORCE:MULTIPLE to ignore the second definition, but the apps still wouldn't run...  (No warning, and no response from the app.)
Daily affirmation:
net helpmsg 4006
Back to Top
steelbytes View Drop Down
Newbie
Newbie


Joined: 21 April 2008
Location: Australia
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote steelbytes Quote  Post ReplyReply Direct Link To This Post Posted: 21 April 2008 at 8:01pm

thnx for the suggestion (reminder) - updated.

what inspired me to post this thread was, that I saw that sysintnerals had published a new ver of handle.exe that is supposed to work on win9x - it doesn't :-)  It looks like sysinternals have bumped into this set of problems and hadn't realised part 2 and 3 of my post ...
Louis Solomon
www.SteelBytes.com
Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.06
Copyright ©2001-2016 Web Wiz Ltd.