View Single Post
Old 02-03-2003, 09:11 AM   #4
Vaskez
Takhisis Follower
 

Join Date: April 30, 2001
Location: szép Magyarország (well not right now)
Posts: 5,089
Why don't you just set up file objects....the following example is from my old BG2 XP Patcher:

FILE *f = fopen("BGMain.exe","rb+wb");
FILE *f2 = fopen("VKXPPatcher.log","rb+wb");
fread(&d,8,1,f2);

location = (int)d;
fsetpos(f,&location);
fread(&e,4,1,f);

as you can see I open 2 files for binary read and binary write and then read into the address of the variable "d" 8 bits from the file f2. You can set the read position with fsetpos....those are C methods though, which would of course work in C++ but I guess you have to do it with C++ methods?
__________________
Too set in his ways to ever relate
If he could set that aside, there'd be heaven to pay
But weathered and aged, time swept him to grave
Love conquers all? Damn, I'd say that area's gray
Vaskez is offline