PC Pals Forum

Technical Help & Discussion => Windows PCs & Software: Help, News & Discussion => Topic started by: daveeb on September 02, 2003, 15:21

Title: modifying exe files
Post by: daveeb on September 02, 2003, 15:21
can't believe i'm bringing work home with me, but here goes.  we have a small, number crunching program at work (in vbasic i think.) we want to modify it to receive data from a different port but dont know how to get to the code of the exe file. how do we do it or is this a really silly question. (clueless on programming stuff). :P

Title: Re:modifying exe files
Post by: Sandra on September 02, 2003, 15:27
Same here unfortunately Dave  :(
Serenity was doing a course on it I think recently so she may be able to tell you failing that its a Sean,Lobo or Dack one to sort out I think :doggie:
Title: Re:modifying exe files
Post by: daveeb on September 02, 2003, 15:30
cheers sandra, btw what kept you, i make that nearly 5 minutes since i posted.   ;) ;)
Title: Re:modifying exe files
Post by: Sandra on September 02, 2003, 15:38
Trying to sort Daz out with his display adaptor Dave  ;D
I wil try and do better next time  :-*
Title: Re:modifying exe files
Post by: WhiteDevil on September 02, 2003, 17:15
Are you totally unable to get the source code for the VB program? It would make like so much easier for you  8)

Quote
It is not possible to decompile all programs, and data and code are difficult to separate, because both are represented similarly in most current computer systems. The meaningful names that programmers give variables and functions (to make them more easily identifiable) are not usually stored in an executable file, so they are not usually recovered in decompiling.


If the file is written in VB3 or earlier try using this: http://members.aol.com/vbdis/ (http://members.aol.com/vbdis/) - failing that, ask another techie  ;)

Title: Re:modifying exe files
Post by: Adept on September 02, 2003, 19:02
I agree with WhiteDevil's comments above. It is possible to decomplie a VB program, but you end up with program code which is almost impossible to work with :(

http://www.tek-tips.com/gfaqs.cfm/lev2/4/lev3/32/pid/222/fid/939
Title: Re:modifying exe files
Post by: daveeb on September 02, 2003, 19:26
thanks people, looks like i'll have to just carry on making the tea instead of a promotion to the boardroom.   ;D
Title: Re:modifying exe files
Post by: daveeb on September 03, 2003, 09:42

If the file is written in VB3 or earlier try using this: http://members.aol.com/vbdis/ (http://members.aol.com/vbdis/) - failing that, ask another techie  ;)




tried that link, but my german isnt too hot unfortunately  :-[
Title: Re:modifying exe files
Post by: daveeb on September 03, 2003, 10:34
turns out this software is in TURBO basic not vbasic, i assume that the same comments that have been made will apply.  all we want to do is a search/replace on all references to COM1 data input and replace it with COM2 data input.  
 ::)
Title: Re:modifying exe files
Post by: WhiteDevil on September 03, 2003, 11:08
Used Google web translator to translate into english, its a little dodgy but you should be able to get the gist:

http://translate.google.com/translate?u=http%3A%2F%2Fmembers.aol.com
%2Fvbdis%2F+&langpair=de%7Cen&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools (http://translate.google.com/translate?u=http%3A%2F%2Fmembers.aol.com%2Fvbdis%2F+&langpair=de%7Cen&hl=en&ie=UTF-8&oe=UTF-8&prev=%2Flanguage_tools)


**Link edited to fit on page.
Title: Re:modifying exe files
Post by: Sandra on September 03, 2003, 12:21
Hi Dave the link called General Format takes you here which is in english,(although it may as well be in chinese for all the sense that it makes to me  :o )

http://www.q1.net/~atari/text/doswin.txt
Title: Re:modifying exe files
Post by: Adept on September 03, 2003, 12:35
Turbo Basic! Oh the memories that brings back :D Is it a DOS program then Dave?

I'd be very surprised if there are any decompilers for Borland Turbo Basic out there. I've done a quick Google and found nothing of interest :(

Title: Re:modifying exe files
Post by: daveeb on September 03, 2003, 13:42

Turbo Basic! Oh the memories that brings back :D Is it a DOS program then Dave?

I'd be very surprised if there are any decompilers for Borland Turbo Basic out there. I've done a quick Google and found nothing of interest :(




er yes i'm afraid its an ancient dos program.  the annoying thing is we've done it before but no-one can remember how.  anyway thanks peeps for all the input     ;D
Title: Re:modifying exe files
Post by: daveeb on September 03, 2003, 13:45

Hi Dave the link called General Format takes you here which is in english,(although it may as well be in chinese for all the sense that it makes to me  :o )

http://www.q1.net/~atari/text/doswin.txt


thanks sandra i think i'd struggle less with some well written mandarin than that but ta for the link. we'va all had a look and decided we know **** all about programming.   :o
Title: Re:modifying exe files
Post by: WhiteDevil on September 03, 2003, 16:20
does the program need to be kept the same, or can a new GUI be used? You could always try and find a C/C++ programmer to re-write the application, only finding one will be the problem  8)
Title: Re:modifying exe files
Post by: daveeb on September 03, 2003, 18:50

does the program need to be kept the same, or can a new GUI be used? You could always try and find a C/C++ programmer to re-write the application, only finding one will be the problem  8)


yup the program doesnt need changing at all apart from the port that the data arrives on.  it currently can only work with data arriving on com1 which is acting up, we want it to look at com2.  of course we could just load the software onto a different pc but we havent got a spare one. they're too strapped for cash to buy one and i think getting a programmer in would give the accountant a heart attack.   :o

Title: Re:modifying exe files
Post by: Dack on September 03, 2003, 19:19
If you don't mind me looking at it - I could probably change it for you.
Title: Re:modifying exe files
Post by: daveeb on September 03, 2003, 19:33
thanks for the offer dack, i'll see what they say, although they tend to be a bit anal*y retentive about official secrets etc, like there's anything to be gained from this crappy old program...NOT.   :)
Title: Re:modifying exe files
Post by: Dack on September 03, 2003, 19:41
No worries - if its as officialy secret as you say then there may still not be a problem ;) (I'm sure Sean would be able to tell you who I work for)

Usually a simple binary hex editor (FRHED is a good one) would be enough to search and replace the COM1 with COM2 messages. That is if they are stored in text format - if they are binary versions then you end up changing values to point to the correct address.

Alternatively I take it you've tried doing a "NAMEOFPROGRAM /?" in case the programmer left in a "which port to run on" function from the command line.
Title: Re:modifying exe files
Post by: WhiteDevil on September 03, 2003, 20:21
i think getting a programmer in would give the accountant a heart attack.


im learning C++ now, if only i were a bit more advanced id write it for nothing...
Title: Re:modifying exe files
Post by: Adept on September 03, 2003, 20:28

No worries - if its as officialy secret as you say then there may still not be a problem ;) (I'm sure Sean would be able to tell you who I work for)


If I tell him, do I get to kill him afterwards Dack? :lol: ;D ;D
Title: Re:modifying exe files
Post by: Dack on September 03, 2003, 20:47
Only via alcohol poisoning ;)

BTW check your mail and try and explain the beard.
Title: Re:modifying exe files
Post by: lobo on September 04, 2003, 21:58
@daveeb
Use this program eXeScope to modify the .exe file
http://hp.vector.co.jp/authors/VA003525/Eindex.htm (http://hp.vector.co.jp/authors/VA003525/Eindex.htm)


Do you want to customize an application ?  For example,
     Change font,
     Change menu,
     Change size or layout of dialog,
     Change Icon,
     etc.,
   but do you think that it is impossible because you have not source files ?
   eXeScope is a resource editor which can edit executable files directly.
   It can analyze and rewrite resources of EXE, DLL, OCX, etc. without source
   files. Almost all resources, that is, Menu, Dialog, String, MessageTable,
   Icon, Cursor, Bitmap, Accelerator, VersionInfo, Delphi Form, WAVE, MIDI,
   AVI, GIF, HTML, JPEG, ToolBar are supported.
   Moreover, eXeScope can analyze and display exported/imported functions
   and TypeLibrary in DLL, OCX, etc.

Brian ;D

Title: Re:modifying exe files
Post by: Adept on September 04, 2003, 22:13
Brian, that program looks interesting, but it looks like it is written with Windows .exe programs in mind not DOS ones. Does it mention whether it will handle a DOS .exe file at all?
Title: Re:modifying exe files
Post by: daveeb on September 04, 2003, 22:25
as i told dack, we've temporarily solved the problem with a different pc that has a fully functioning com1 port, however its a very temporary measure so i might well resurrect this one again soon.  thanks for all the interest and input chaps and chapesses.    ;)
Title: Re:modifying exe files
Post by: Dack on September 05, 2003, 00:14

Brian, that program looks interesting, but it looks like it is written with Windows .exe programs in mind not DOS ones. Does it mention whether it will handle a DOS .exe file at all?



Exescope is quite cute but only really allows the editing of resources for windows apps (though it does it very well - I've used it in conjuction with DeDe (a Delphi Disasembler)). A similar thing can 'almost' be achieved using Visual C++ :) as you can load executables and 'borrow' the resources from them using the default installation (and then edit the bin file to activate buttons etc. but I digress ;) ).


For anyone interested in rev-enging then do a google search for Fravia.