@@ -288,51 +288,6 @@ recoverInvalidItem:
288
288
jmp g1g2( 0x66DC47 , 0x69B420 , 0x6AFBB9 , 0x70D6D9 ) + 6
289
289
290
290
291
- global recoverInvalidItem2
292
- recoverInvalidItem2:
293
- resetStackoffset g1g2( 0x110 , 0x110 , 0x158 , 0x15C )
294
- %assign var_numInvSlots - g1g2( 0xB8 , 0xA8 , 0x100 , 0xEC )
295
- %assign var_loopIndex - g1g2( 0xE8 , 0xD8 , 0x138 , 0x140 )
296
- %assign var_used - g1g2( 0x38 , 0x38 , 0x6C , 0x70 )
297
-
298
- mov eax , [ esp + stackoffset + var_loopIndex ] ; Check if first iteration (i.e. index == 0)
299
- test eax , eax
300
- jnz .backOriginal ; If not, jump back as original
301
-
302
- mov eax , [ esi ] ; Read as integer and store it
303
- call [ eax + 0x60 ] ; zCArchive->ReadInt
304
- addStack 4
305
-
306
- movzx ecx , BYTE [ esp + stackoffset + var_used ] ; Take only the lowest byte
307
- cmp ecx , 0x1 ; Check if boolean (i.e. low byte <= 1)
308
- verifyStackoffset g1g2( 0x110 , 0x110 , 0x158 , 0x15C ) - 0x4
309
- jbe .backCorrect ; If so, continue as expected
310
-
311
- mov eax , [ esp + stackoffset + var_used ] ; Fix the misread values
312
- mov [ esp + stackoffset + var_numInvSlots ], eax ; Update maximum loop iterations
313
-
314
- mov ecx , esi ; Read the next (correct) value from archive
315
- lea eax , [ esp + stackoffset + var_used ]
316
- push eax
317
- mov eax , [ esi ]
318
- call [ eax + 0x80 ] ; zCArchive->ReadBool
319
- addStack 4
320
- verifyStackoffset g1g2( 0x110 , 0x110 , 0x158 , 0x15C ) - 0x4
321
- jmp .back
322
-
323
- .backCorrect:
324
- mov [ esp + stackoffset + var_used ], ecx ; Nothing to fix, continue as expected
325
- jmp .back
326
-
327
- .backOriginal:
328
- mov eax , [ esi ] ; Re-write original instruction
329
- call [ eax + 0x80 ] ; zCArchive->ReadBool
330
- addStack 4
331
-
332
- .back:
333
- jmp g1g2( 0x6A3DD9 , 0x6D67BB , 0x6E96C1 , 0x748161 ) + 6
334
-
335
-
336
291
global ninja_injectInfo
337
292
ninja_injectInfo:
338
293
resetStackoffset ; 0xBC
0 commit comments