Jump to content
Tuts 4 You

Example Patch Delphi And Source Code


err0r

Recommended Posts

It maybe a stupid question but whats the big deal about size these days? After all I think most people have a broad band connection and could download a vcl app in a matter of seconds right? even if they had dialup still, it would only take them something like 1 minute for a 400kb vcl app. I think I'll stick with the old saying "Bigger is Better" and alot less coding

Well personally, I have a issue with size.

Not that I have broadband, but because of coding standards. I personally feel that coders should try to make thier code as optimized as possible and have no bloat. For instance, I recently started coding trainers, and my C/C++ trainers compile to around 2-4KB in EXE size, because I code directly in native Win32 APIs and not use excess baggage. Plus, I know some nice compiler switches in MSVC6 which help in keeping filesize down.

Link to comment
  • 2 weeks later...
  • 3 months later...

Mhh,

since I do not need the backup thingy, I have the code stripped down to this:

procedure TForm1.btnPatchClick(Sender: TObject);
var
FB : File Of Byte;
b : Byte;
begin
assignfile(FB , 'C:\Program Files\Windows NT\Pinball\pinball.exe');
Reset(FB);
b := $EB;
seek(FB,$00004257); // The Offset in Hex.
Write(FB,b);
closefile(FB);
end;

Though, this is not patching anything, I checked for it. Anyone knows what could be wrong? I'm not getting any errors.

Also, is there a way to 'Read' a byte from a certain offset. insteead of writing FB to $00004257, reading which byte is at $0004257 atm. (After I patched it)

Thanx in Advance,

Gushe.

-- Edit --

Well, I found aa way to check which byte is at the offset. that way I also found that the file Is patching, the patched just aren't saved somehow. Does anyone know how I could fix that..? :)

Thanx in Advance,

Gushe

Edited by Gushe
Link to comment
MFC and that delphi vcl $hit sucks...Look at the exe size....more than 750KB....lol a pretty good app can be coded in that much space...Just learn to use direct api's.

I don't agree! Delphi, VB and so on are very useful to learn programming. They don't suck at all, but of course, it is cooler to make fast programs with ASM... ;)

@Gushe:

Try this:

Reset(FB,1);

instead of:

Reset(FB);
Edited by Peppi
Link to comment

Peppi,

Doesn't seem to be working:

[Pascal Error] Unit1.pas(135): E2034 Too many actual parameters

Other idea?

Thanx in Advance,

~ GuShe.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...