Solved

Patching VB5 Executable

Posted on 2013-11-11
5
328 Views
Last Modified: 2013-11-12
Hello,

I have a VB5 executable in which I need to change some ASCII text strings.  The program executes correctly, but I need to change some text strings on the "About" menu choice.  I cannot rebuild the project (even though I still have the VB5 IDE), because some of the 3rd party controls I used are no longer available / supported, and I cannot get VB5 to compile the project correctly.

Within the program on the "About" page, I have an address that I would like to change:

e.g.:
       111 Fourth Street

to    222 Ninth Street

Is it possible to do this?  I realize that the length of the strings must be exactly the same, so I may need to pad the new string with spaces, if it ends up being too short.  If it ends up being longer, I may have a bigger problem.

Any help / suggestions would be appreciated.

Thanks..Tom
0
Comment
Question by:tpigielski
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 47

Expert Comment

by:Martin Liss
ID: 39640621
Have you opened the VBP file in the VB5 IDE?
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 39640626
I ask because I recompile VB6 projects all the time with controls like some if the Sheridan controls that are no longer available.
0
 
LVL 47

Expert Comment

by:Martin Liss
ID: 39640627
of not if
0
 
LVL 45

Expert Comment

by:aikimark
ID: 39640928
All the string literals will be stored in Unicode format.  You will not find a "111 Fourth Street", but will likely find "1 1 1   F o u r t h   S t r e e t ".

I do not think you will be able to change the lengths of these strings.
0
 
LVL 16

Accepted Solution

by:
HooKooDooKu earned 500 total points
ID: 39642686
You will simply need to get a hex editor and carefully modify the text (an ASCII lookup table will come in handy too.

One that I like to use is Hex Workshop: http://download.cnet.com/Hex-Workshop/3000-2352_4-10004918.html  It comes with a month free trial... I found it useful enough that I got my employer to purchase a copy.

If you have a copy of visual studio, you can also open your exe with that in binary form.

While your string MIGHT be in unicode (in which case, I believe you will likely find your text with each letter padded with a null character) you might also find it as a normal string.

I was able to create a sample EXE in VB6 that simply displays "111 Fourth Street" in a label.  When I edited the EXE with Hex Workshop, I found the text in plain ASCII (rather than Unicode... don't know why though).  Using an ASCII table, I was able to update the text to "222 Ninth Street " and the program executed fine.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
A short article about problems I had with the new location API and permissions in Marshmallow
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question