Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-26-2001, 02:12 AM
undo undo is offline
Junior Member
 
Join Date: Jan 2001
Posts: 2
Default How to patch an .exe

Hi all,
anyone could help on patching an .exe? What exactly I need is this:
- change a string from 'this is the original string' to 'this is the new string' (new string could be shorter or longer than original).
- change the original .exe program

Any help is appreciated (BTW, I don't need this to hack/crack any commercial products. I only need to make an autorun for cd that creates a small exe, with customizable icon, that executes a file - this is the customizable for)

Bye
Reply With Quote
  #2  
Old 01-26-2001, 07:38 AM
jamessturrock jamessturrock is offline
Senior Member
 
Join Date: Jan 2001
Posts: 170
Default RE: How to patch an .exe

i think the best way to do this is by using a dll in ur program and that can be modified easily. I am not sure how to do this in an exe but i will try to find a way

hope that helps
James Sturrock
Reply With Quote
  #3  
Old 01-26-2001, 08:22 AM
tr2k tr2k is offline
Junior Member
 
Join Date: Jan 2001
Posts: 7
Default RE: How to patch an .exe

Here is a little source how you can patch an exe-file :

const
A : Array[1..1] of record // patch only one byte
Adr : longint;
Value : byte;
end = ((A:$88888;B:$90); // example
var
ch : char;
f : file;

procedure patch;
begin
assign(f,'filename.exe');
{$I-}
reset(f,1);
{$I+}
if ioresult <> 0 then begin
seek(f,a[i].adr);
ch := char(a[i].value);
blockwrite(f,ch,1);
end;
end;

You have to patch value by value to have a new string
Reply With Quote
  #4  
Old 01-26-2001, 10:27 AM
undo undo is offline
Junior Member
 
Join Date: Jan 2001
Posts: 2
Default RE: RE: How to patch an .exe

Hi, thanks all.
Just an additional question:
-how do search the oldstring value to patch?
-what if the old string is shortest/longest than new string?
I've made something similar with a routine that usually patches text files: my routine works well if the strings (old and new) have the same number of characters. If they're different, the patched exe doesn't run
Thanks again
u.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 07:14 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.