summaryrefslogtreecommitdiff
path: root/PE/reinsert.cpp
diff options
context:
space:
mode:
authorpixel <pixel>2003-09-23 15:06:59 +0000
committerpixel <pixel>2003-09-23 15:06:59 +0000
commit6312cf3ac75b203a477d6d1a22ffbb124e5a874b (patch)
tree34deaf8b422149954314d6286ddd60be93cf23ee /PE/reinsert.cpp
parent346915db5aab133b6805cf58680b1378a45f0a40 (diff)
Some backported changes
Diffstat (limited to 'PE/reinsert.cpp')
-rw-r--r--PE/reinsert.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/PE/reinsert.cpp b/PE/reinsert.cpp
index b4b60cf..1c6530b 100644
--- a/PE/reinsert.cpp
+++ b/PE/reinsert.cpp
@@ -24,6 +24,8 @@ virtual int startup() throw (GeneralException) {
delete cd;
delete iw;
delete ir;
+
+ return 0;
ir = new Input("PE2.bin");
iw = new Output("PE2.bin", 0, 0);
@@ -34,8 +36,6 @@ virtual int startup() throw (GeneralException) {
delete cd;
delete iw;
delete ir;
-
- return 0;
}
int patch_img(cdutils * cd) {
@@ -94,7 +94,7 @@ int patch_img(cdutils * cd) {
printm(M_INFO, "Groupe %i...\n", i);
for (c = 0; c < counts[i]; c++) {
int sector, s1, s2, s3, r, size, size2, ptr, tptr, sig, jptr, sizes[2];
- r = groupes[c][i];
+ r = groupes[c][i] - 1;
unsigned char * room;
sector = *((int *) (slus + offset + r * 8));
@@ -109,6 +109,8 @@ int patch_img(cdutils * cd) {
room = (unsigned char *) malloc(size);
cd->read_datas(room, GUESS, d_pe1.Sector + sector + s1 + s2, size);
+
+#if 0
ptr = size - 4;
while (1) {
tptr = *((int *) (room + ptr));
@@ -123,8 +125,11 @@ int patch_img(cdutils * cd) {
}
jptr = *((int *) (room + ptr - 8));
+#else
+ jptr = *((int *) (room + ((*((int *) (room + size2 + 32))) & 0xfffff) + 4));
+#endif
- printm(M_INFO, " Room %i\n", r);
+ printm(M_INFO, " Room %i\n", r + 1);
if (size2 < (jptr + f->GetSize())) {
printm(M_ERROR, "size2 = %i, jptr = %i, f = %i, + = %i - script trop gros.\n", size2, jptr, f->GetSize(), jptr + f->GetSize());