Updating Resources on Win9x

Environment: Win9x

Windows NT contains some useful functions for updating resources in executables. Those are, however, not implemented on Windows 9x, so I had to write my own library for doing it. My library works in exactly the same manner as the BeginUpdateResource(), UpdateResource() and EndUpdateResource() API functions, just prepend an underscore to their names. It also provides a new function, _GetRsrcData(), which is used to get the resource data for a resource in a file loaded with _BeginUpdateResource().

The code works, at least on my system, but it has one major drawback: it can't move a section in memory. This means that if the .rsrc section would have to be expanded past its padding, _EndUpdateResource() will return ERROR_CANT_MOVE_SECTION unless .rsrc is the last section (both in the file and in VM space). This is a problem because VC6 puts the .reloc section (relocation info, used in DLLs and debug EXEs) after .rsrc, so you can't use the functions very well on those file types.

Downloads

Download source - 7 Kb


Comments

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • With JRebel, developers get to see their code changes immediately, fine-tune their code with incremental changes, debug, explore and deploy their code with ease (both locally and remotely), and ultimately spend more time coding instead of waiting for the dreaded application redeploy to finish. Every time a developer tests a code change it takes minutes to build and deploy the application. JRebel keeps the app server running at all times, so testing is instantaneous and interactive.

  • Live Event Date: May 6, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT While you likely have very good reasons for remaining on WinXP after end of support -- an estimated 20-30% of worldwide devices still are -- the bottom line is your security risk is now significant. In the absence of security patches, attackers will certainly turn their attention to this new opportunity. Join Lumension Vice President Paul Zimski in this one-hour webcast to discuss risk and, more importantly, 5 pragmatic risk mitigation techniques …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds