public void patch(ByteBuffer data, int offset) {
//int shift = 0;
if (offset >= 0x400000) offset -= 0x400000;
for (ExeSec s : headers) {
if (offset >= s.getPos() &&
offset < s.getPos() + s.getLen()) {
//it's within this section
ByteBuffer d = s.getData();
d.position(offset - s.getPos());
data.position(0);
d.put(data);
modified = true;
break;
}
}
}
*Shortly after double-checking stuff* Ok, now I'm confused - I thought that PE executables had some built-in compression scheme, and that's why on earth adding bytes in places (EDIT: the nice large unused area near start of CS executable memory, absolute 0x4002D0 - putting code in this region in DA did *something* that made using Cave Editor on the file afterward crash stuff, hence my "backup EXE then run DA" procedure) causes all the offsets to change (when if it were flat segments, this wouldn't be the case)1)
yes/no. I load the game assuming an uncompressed PE32 executable. When I load it, I read the PE32 header and separate the segments individually so that I can resize them, but when applying a patch to an address I just drop it in whichever segment it lands according to its address in the assembled file. E.G.
I'm not going to cater to EXE's that have been compressed because that would be like trying to write a text editor that can open compressed C code, arbitrary and useless.Code:public void patch(ByteBuffer data, int offset) { //int shift = 0; if (offset >= 0x400000) offset -= 0x400000; for (ExeSec s : headers) { if (offset >= s.getPos() && offset < s.getPos() + s.getLen()) { //it's within this section ByteBuffer d = s.getData(); d.position(offset - s.getPos()); data.position(0); d.put(data); modified = true; break; } } }
I know that there are 3d printers that make shitty pizza. Once humanity reahes a point where we can 3d print waffles he could probably just send a signal to 3d printer to make wafflesAnd where is my TSC graphic preview along with a side of waffles?
and sample imghi this 4.1.4 ver can't open my mod can you check my mod
https://www.dropbox.com/s/2rjiyf4ffqp1c5v/h_lf_story_-_alpha.zip?dl=0
ps. and 4.1.4 ver make broken koran font