?
Solved

Creating PATCH in PASCAL

Posted on 1999-12-19
4
Medium Priority
?
247 Views
Last Modified: 2010-04-16
Hello there, I would like to learn how to create a PATCH file that edit other exe file in PASCAL. Any idea?

I want to open a file and edit its OFFSET...

Example: Let say I have shitten.exe and I want to create a pascal program. and when I click on my pascal program, I want it to edit a sepcific offset in shitten.exe...


Thank!
0
Comment
Question by:SHITTEN
  • 3
4 Comments
 

Author Comment

by:SHITTEN
ID: 2293663
Edited text of question.
0
 
LVL 12

Accepted Solution

by:
Hypo earned 0 total points
ID: 2293697
This is an example of how you could do it...

Program Patch;

uses crt,dos;

const OffsetInFile    : longint = 100;
      NewData         : array[0..3] of byte = (3,5,8,2);
      SizeOfNewData = SizeOf(NewData);

var F        : File;
    Filename : string;

begin
 Assign(F,Filename);
 Reset(F,1);
 Seek(F,OffsetInFile);
 BlockWrite(F,NewData,SizeOfNewData);
 Close(F);
end.
0
 

Author Comment

by:SHITTEN
ID: 2296803
One more thing...

can Seek(F, OffsetInFile) become
    Seek(F, 00018DEF) ???

const
 OffsetInFile : longint = 0081DC8
is that possible? can it use HEX value ???

Thank you for your time being...
0
 

Author Comment

by:SHITTEN
ID: 2296875
Hey, it work! I just tried it.. thank alot man!!!

~muah~~~ !!!
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

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

You have missed a phone call. The number looks like it belongs to the bunch of numbers which your company uses. How to find out who has just called you?
Organisation is organized in a pattern to flow the day to day business, every application and system is interdepended on each other and when very important “Exchange Server downtime” happened.
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.

588 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