PhysDamageFix

Battles in back-attack-mode will stop reducing physical damage and hit-accuracy by 25% (caused by interpreting enemies as battlers in the back-row).

Originally made and first released by bugmenot.

RPG2003
1.00UNKNOWN1UNKNOWN21.0.2.1
1.0.2.1
1.0.3.0
1.0.4.0
1.0.5.0
1.0.5.0
1.0.6.0
1.0.6.0
1.0.7.0
1.0.7.0
1.0.8.0
1.0.8.0
1.0.9.1
1.0.9.1
1.101.111.12mp210414

Segment 1/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
0049B03Fh
0009A43Fh

Sourcecode

			CALL PROC__0049B408h

Bytes

E8C4030000

Segment 2/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
0049B048h
0009A448h

Sourcecode

__0049B048h:
			MOV EAX, EBP
			CALL PROC__004BFD5Ch
			DEC EAX
			MOV [ESP+24h], EAX
			FILD DWORD PTR [ESP+24h]
			FMUL DWORD PTR [__0049B7D4h]
			FADD DWORD PTR [__0049B7D8h]
			FMUL QWORD PTR [ESP]
			FSTP QWORD PTR [ESP]
			WAIT
			JMP __0049B501h
__0049B070h:
			MOV EAX, EBP
			MOV EDX, [EAX]
			CALL [EDX+78h]
			RET
__0049B078h:
			MOV EAX, ESI
			MOV EDX, [EAX]
			CALL [EDX+58h]
			FSTP QWORD PTR [ESP+08h]
			WAIT
			FLD QWORD PTR [ESP+08h]
			CALL PROC__00402B64h
			NOP
			NOP
			NOP
			NOP
			NOP
			NOP
			MOV EDX, EBP
			MOV ECX, ESI
			MOV ECX, 100
			MOV [ESP+08h], EAX
			FILD DWORD PTR [ESP+08h]
			FSTP QWORD PTR [ESP+08h]
			WAIT
			JMP __0049B5D3h
PROC__0049B0AEh:
			IMUL EAX, 300
__0049B0B4h:
			CDQ
			IDIV ECX
			XCHG EAX, EBX
			RET
PROC__0049B0B9h:
			IMUL EAX, 200
			PUSH 100
			POP ECX
			JMP __0049B0B4h
			CMP DWORD PTR [EBP+14h], 0
			SETE [ESP+18h]
			MOV EAX, [EBX+48h]
			JMP __0049C694h
__0049B0D5h:
			XOR EAX, EAX
			MOV [ESP+10h], EAX
			NOP
			JMP __004C0BCDh
PROC__0049B0E1h:
			MOV EAX, [004CDD38h]
			MOV EAX, [EAX]
			MOV EAX, [EAX+94h]
			RET
__0049B0EFh:
			TEST AL, AL
			JNZ __0049B0FCh
			XOR EAX, EAX
			MOV [ESP], EAX
			MOV [ESP+04h], EAX
__0049B0FCh:
			JMP __0049B582h
__0049B101h:
			MOV EAX, 10000
			CALL PROC__00403054h
			JMP __0049B594h
__0049B110h:
			FLD QWORD PTR [ESP+10h]
			CALL PROC__00402B70h
			JMP __0049C75Dh

Bytes

8BC5 E80D4D0200
48 89442424 DB442424 D80DD4B74900 D805D8B74900 DC0C24 DD1C24 9B E991040000
8BC5 8B10 FF5278 C3

8BC6 8B10 FF5258 DD5C2408 9B DD442408 E8D77AF6FF
90 90 90 90 90 90 89EA 89F1 B964000000 89442408 DB442408 DD5C2408 9B E925050000
69C02C010000 99 F7F9 93 C3

69C0C8000000 6A64 59 EBF0 837D1400 0F94442418 8B4348 E9BF150000
33C0 89442410 90 E9EC5A0200
A138DD4C00 8B00 8B8094000000 C3

84C0 7509
33C0 890424 89442404 E981040000
B810270000 E8497FF6FF
E984040000
DD442410 E8577AF6FF
E93F160000

Segment 3/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
0049B408h
0009A808h

Sourcecode

PROC__0049B408h:
			PUSH EBX
			PUSH ESI
			PUSH EDI
			PUSH EBP
			ADD ESP, -56
			MOV EBP, ECX
			MOV ESI, EDX
			MOV EDI, EAX
			MOV EAX, ESI
			MOV EDX, [EAX]
			CALL [EDX+8Ch]
			TEST AL, AL
			JNZ __0049B430h
			XOR EAX, EAX
			INC EAX
			MOV [EDI+44h], EAX
			MOV EAX, EDI
			CALL PROC__0049A028h
__0049B430h:
			MOV EAX, EBP
			CALL PROC__004C0504h
			TEST AL, AL
			JZ __0049B45Dh
			MOV EDX, EBP
			MOV EAX, EDI
			CALL PROC__0049CF34h
			MOV EAX, [004CDCB4h]
			MOV EAX, [EAX]
			MOV EDX, [EAX+15Ch]
			MOV EAX, EBP
			CALL PROC__004BF550h
			JMP __0049B7CCh
			MOV EAX, ESI
			MOV EDX, [EAX]
			CALL [EDX+5Ch]
			MOV EBX, EAX
			MOV EAX, ESI
			CALL PROC__004C04A4h
			IMUL EBX, EAX
			MOV EAX, EBX
			PUSH 100
			POP ECX
			CDQ
			IDIV ECX
			PUSH 100
			POP EDX
			SUB EDX, EAX
			MOV [ESP+24h], EDX
			FILD DWORD PTR [ESP+24h]
			FSTP QWORD [ESP]
			WAIT
			MOV EAX, ESI
			MOV EDX, [EAX]
			CALL [EDX+70h]
			TEST AL, AL
			JNZ __0049B576h
			MOV EAX, ESI
			MOV EDX, [EAX]
			CALL [EDX+8Ch]
			TEST AL, AL
			JZ __0049B4AFh
			MOV EAX, ESI
			MOV EDX, [EAX]
			CALL [EDX+40h]
			JMP __0049B4B6h
__0049B4AFh:
			MOV EAX, ESI
			CALL PROC__004BFD5Ch
			DEC EAX
			JGE __0049B4BEh
			JMP __0049B048h
__0049B4BEh:
			NOP
			MOV EAX, EBP
			CALL PROC__004BFD5Ch
			MOV [ESP+24h], EAX
			FILD DWORD PTR [ESP+24h]
			FSTP TBYTE PTR [ESP+28h]
			WAIT
			MOV EAX, ESI
			CALL PROC__004BFD5Ch
			MOV [ESP+34h], EAX
			FILD DWORD PTR [ESP+34h]
			FLD TBYTE PTR [ESP+28h]
			FDIVRP st(1), st(0)
			FSUB DWORD PTR [__0049B7D8h]
			FMUL DWORD PTR [__0049B7D4h]
			FADD DWORD PTR [__0049B7D8h]
			FMUL QWORD PTR [ESP]
			FSTP QWORD PTR [ESP]
			WAIT
			NOP
			CALL PROC__0049B070h
			(...)

Bytes

53 56 57 55 83C4C8 8BE9 8BF2 8BF8 89F0 8B10 FF928C000000 84C0 750D
31C0 40 894744 8BC7 E8F8EBFFFF
8BC5 E8CD500200
84C0 7422
8BD5 8BC7 E8F01A0000
A1B4DC4C00 8B00 8B905C010000 8BC5 E8F8400200
E96F030000
8BC6 8B10 FF525C 8BD8 8BC6 E837500200
0FAFD8 8BC3 6A64 59 99 F7F9 6A64 5A 2BD0 89542424 DB442424 DD1C24 9B 8BC6 8B10 FF5270 84C0 0F85DE000000
89F0 8B10 FF928C000000 84C0 7409
8BC6 8B10 FF5240 EB07
8BC6 E8A6480200
48 7D05
E98AFBFFFF
90 8BC5 E896480200
89442424 DB442424 DB7C2428 9B 8BC6 E882480200
89442434 DB442434 DB6C2428 DEF1 D825D8B74900 D80DD4B74900 D805D8B74900 DC0C24 DD1C24 9B 90 E869FBFFFF

Segment 4/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
0049B526h
0009A926h

Sourcecode

			CALL PROC__0049B0E1h
			NOP
			NOP
			NOP
			NOP
			NOP
			NOP
			XOR ECX, ECX
			SUB EAX, 2
			JC __0049B53Fh
			JZ __0049B540h
			DEC EAX
			JZ __0049B545h
			JMP __0049B576h
__0049B53Fh:
			INC ECX
__0049B540h:
			CMP [EBP+74h], ECX
			JNE __0049B576h
__0049B545h:
			NOP
			NOP
			FLD QWORD PTR [ESP]
			FADD DWORD PTR [0049B7DCh]
			FSTP QWORD PTR [ESP]
			WAIT
			NOP
			NOP
			JMP __0049B576h

Bytes

E8B6FBFFFF
90 90 90 90 90 90 31C9 83E802 7207
7406
48 7408
EB37
41 394D74 7531
90 90 DD0424 D805DCB74900 DD1C24 9B 90 90 EB1E

Segment 5/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
0049B57Dh
0009A97Dh

Sourcecode

			JMP __0049B0EFh
__0049B582h:
			NOP
			NOP
			NOP
			NOP
			MOV EDX, EBP
			MOV ECX, ESI
			MOV EAX, 10000
			JMP __0049B101h

Bytes

E96DFBFFFF
90 90 90 90 89EA 89F1 B810270000 E96DFBFFFF

Segment 6/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
0049B5CEh
0009A9CEh

Sourcecode

__0049B5CEh:
			JMP __0049B078h
__0049B5D3h:
			MOV EAX, EBP
			MOV EDX, [EAX]
			CALL [EDX+74h]
			TEST AL, AL
			JNZ __0049B5EEh
			MOV EDX, EBP
			MOV EAX, ESI
			MOV ECX, [EAX]
			CALL [ECX+88h]
			TEST AL, AL
			JZ __0049B5F8h
__0049B5EEh:
			XOR EAX, EAX
			MOV [ESP+08h], EAX
			MOV [ESP+0Ch], EAX
__0049B5F8h:
			MOV EAX, 10000
			CALL PROC__00403054h
			MOV [ESP+24h], EAX
			FILD DWORD PTR [ESP+24h]
			FLD QWORD PTR [ESP+08h]
			FMUL DWORD PTR [__0049B7E0h]
			FCOMPP st(0), st(1)
			FNSTSW AX
			SAHF
			SETA [ESP+10h]
			CMP BYTE PTR [ESP+10h], 0
			JE __0049B643h
			PUSH 28
			PUSH 20
			PUSH 8
			PUSH 0
			MOV EAX, [004CDDA8h]
			MOV EAX, [EAX]
			MOV ECX, 28
			MOV EDX, 28
			CALL PROC__004C2D68h
			MOV EDX, EBP
			MOV EAX, ESI
			CALL PROC__004C0B2Ch
			JMP __0049B659h
__0049B64Eh:
			XCHG EAX, EBX
			PUSH 100
			POP ECX
			CALL PROC__004B0AEh
			JMP __0049B679h
__0049B659h:
			MOV EBX, EAX
			MOV EDX, EBP
			MOV ECX, ESI
			CMP BYTE PTR [ESP+10h], 0
			CMP BYTE PTR [ESP+10h], 0
			JE __0049B66Dh
			JMP __0049B64Eh
__0049B66Dh:
			CMP BYTE PTR [ESI+40h], 0
			JE __0049B679h
			XCHG EAX, EBX
			CALL PROC__0049B0B9h
__0049B679h:
			(...)

Bytes

E9A5FAFFFF
8BC5 8B10 FF5274 84C0 7510
8BD5 8BC6 8B08 FF9188000000 84C0 740A
33C0 89442408 8944240C B810270000 E8527AF6FF
89442424 DB442424 DD442408 D80DE0B74900 DED9 DFE0 9E 0F97442410
807C241000 741E
6A1C 6A14 6A08 6A00 A1A8DD4C00 8B00 B91C000000 BA1C000000 E825770200
8BD5 8BC6 E8E0540200
EB0B
93 6A64 59 E857FAFFFF
EB20
8BD8 89EA 89F1 807C241000 807C241000 7402
EBE1
807E4000 7406
93 E840FAFFFF

Segment 7/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
0049C662h
0009BA62h

Sourcecode

			PUSH EDX
			MOV EAX, [004CDBC4h]
			MOV EAX, [EAX]
			CALL PROC__0047F0ECh
			XCHG EAX, EBX
			POP EDX
			MOV ECX, EBP
			MOV EAX, ESI
			CALL PROC__004C0D8Ch
			MOV [ESP+04h], EAX
			NOP
			MOV EDX, EBP
			MOV ECX, ESI
			MOV BYTE PTR [ESP+08h], 0
			MOV BYTE PTR [ESP+08h], 0
			NOP
			NOP
			JMP __0049B0C4h

Bytes

52 A1C4DB4C00 8B00 E87D2AFEFF
93 5A 8BCD 8BC6 E842470200
89442404 90 89EA 89F1 C644240800 C644240800 90 90 E930EAFFFF

Segment 8/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
0049C758h
0009BB58h

Sourcecode

__0049C758h:
			JMP __0049B110h
__0049C75Dh:
			MOV EDX, EBP
			MOV ECX, ESI
			(...)

Bytes

E9B3E9FFFF
89EA 89F1

Segment 9/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
004B9834h
000B8C34h

Sourcecode

PROC__004B9834h:
			RET

Bytes

C3

Segment 10/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
004C0B2Ch
000BFF2Ch

Sourcecode

PROC__004C0B2Ch:
			PUSH EBX
			PUSH ESI
			PUSH EDI
			PUSH EBP
			ADD ESP, -20
			MOV EBP, EDX
			MOV EDI, EAX
			MOV EDX, [EAX]
			CALL [EDX+8Ch]
			TEST AL, AL
			JZ __004C0B4Ch
			MOV EAX, EDI
			CALL PROC__004B7250h
			JMP __004C0B53h
__004C0B4Ch:
			MOV EAX, EDI
			CALL PROC__004BFB28h
__004C0B53h:
			SAR EAX, 1
			JNS __004C0B5Ah
			ADC EAX, 0
__004C0B5Ah:
			PUSH EAX
			MOV EAX, EBP
			CALL PROC__004BFBF4h
			TEST EAX, EAX
			JNS __004C0B69h
			ADD EAX, 3
__004C0B69h:
			SAR EAX, 2
			POP EDX
			SUB EDX, EAX
			XOR EAX, EAX
			CALL PROC__0042A2ACh
			MOV [ESP], EAX
			MOV EAX, EDI
			MOV EDX, [EAX]
			CALL [EDX+8Ch]
			TEST AL, AL
			JZ __004C0BC8h
			MOV EAX, [004CDD38h]
			MOV EAX, [EAX]
			MOV EAX, [EAX+94h]
			XOR ECX, ECX
			SUB EAX, 2
			JC __004C0BA3h
			JZ __004C0BA2h
			DEC EAX
			JZ __004C0BA8h
			JMP __004C0BC8h
__004C0BA2h:
			INC ECX
__004C0BA3h:
			CMP [EDI+74h], ECX
			JNE __004C0BC8h
__004C0BA8h:
			IMUL EAX, [ESP], 125
			PUSH 100
			POP ECX
			CDQ
			IDIV ECX
			MOV [ESP], EAX
			NOP
			NOP
			JMP __004C0BC8h

Bytes

53 56 57 55 83C4EC 8BEA 8BF8 8B10 FF928C000000 84C0 7409
8BC7 E80667FFFF
EB07
8BC7 E8D5EFFFFF
D1F8 7903
83D000 50 8BC5 E892F0FFFF 85C0 7903
83C003 C1F802 5A 2BD0 33C0 E83697F6FF
890424 8BC7 8B10 FF928C000000 84C0 7441
A138DD4C00 8B00 8B8094000000 31C9 83E802 7208
7405
48 7408
EB26
41 394F74 7520
6904247D000000 6A64 59 99 F7F9 890424 90 90 EB0C

Segment 11/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
004C0BC8h
000BFFC8h

Sourcecode

__004C0BC8h:
			JMP __0049B0D5h
__004C0BCDh:
			MOV [ESP+0Ch], EAX
			MOV EAX, -9999
			MOV [ESP+04h], EAX
			MOV [ESP+08h], EAX
			MOV EAX, [004CDE44h]
			MOV EAX, [EAX]
			CALL PROC__00475714h
			XCHG EAX, ESI
			TEST ESI, ESI
			JLE __004C0CD0h
			XOR EBX, EBX
			INC EBX
__004C0BF6h:
			MOV EAX, EDI
			MOV EDX, [EAX]
			CALL [EDX+8Ch]
			TEST AL, AL
			JZ __004C0C0Fh
			MOV EDX, EBX
			MOV EAX, EDI
			CALL PROC__004B9500h
			JMP __004C0C18h
__004C0C0Fh:
			MOV EDX, EBX
			MOV EAX, EDI
			MOV ECX, [EAX]
			CALL [ECX+4Ch]
__004C0C18h:
			TEST AL, AL
			JZ __004C0C57h
			MOV EAX, [004CDE44h]
			MOV EAX, [EAX]
			MOV EDX, EBX
			CALL PROC__0047B5D8h
			CMP BYTE PTR [EAX+0Ch], 0
			JNE __004C0C57h
			MOV DWORD PTR [ESP+10h], 1
			PUSH EAX
			MOV EDX, EBX
			MOV EAX, EBP
			CALL PROC__004BFDF8h
			XCHG EAX, EDX
			POP EAX
			CALL PROC__0047B564h
			XCHG EAX, EDX
			MOV EAX, [ESP+04h]
			CALL PROC__0042A2ACh
			MOV [ESP+04h], EAX
			INC EBX
			DEC ESI
			JNZ __004C0BF6h
			MOV EAX, [004CDE44h]
			MOV EAX, [EAX]
			CALL PROC__00475714h
			XCHG EAX, ESI
			XOR EBX, EBX
			INC EBX
__004C0C6Bh:
			MOV EAX, EDI
			MOV EDX, [EAX]
			CALL [EDX+8Ch]
			TEST AL, AL
			JZ __004C0C84h
			MOV EDX, EBX
			MOV EAX, EDI
			CALL PROC__004B9500h
			JMP __004C0C8Dh
__004C0C84h:
			MOV EDX, EBX
			MOV EAX, EDI
			MOV ECX, [EAX]
			CALL [ECX+4Ch]
__004C0C8Dh:
			TEST AL, AL
			JZ __004C0CCCh
			MOV EAX, [004CDE44h]
			MOV EAX, [EAX]
			MOV EDX, EBX
			CALL PROC__0047B5D8h
			CMP BYTE PTR [EAX+0Ch], 1
			JNE __004C0CCCh
			MOV DWORD PTR [ESP+0Ch], 2
			PUSH EAX
			MOV EDX, EBX
			MOV EAX, EBP
			CALL PROC__004BFDF8h
			XCHG EAX, EDX
			POP EAX
			CALL PROC__0047B564h
			XCHG EAX, EDX
			MOV EAX, [ESP+08h]
			CALL PROC__0042A2ACh
			MOV [ESP+08h], EAX
__004C0CCCh:
			INC EBX
			DEC ESI
			JNZ __004C0C6Bh
__004C0CD0h:
			MOV EAX, [ESP+0Ch]
			ADD EAX, [ESP+10h]
			DEC EAX
			JZ __004C0CE3h
			DEC EAX
			JZ __004C0CEDh
			DEC EAX
			JZ __004C0D01h
			JMP __004C0D4Ah
__004C0CE3h:
			MOV EAX, [ESP]
			IMUL [ESP+04h]
			NOP
			JMP __004C0CF4h

Bytes

E908A5FDFF
8944240C B8F1D8FFFF 89442404 89442408 A144DE4C00 8B00 E82A4BFBFF
96 85F6 0F8EDD000000 31DB 43 8BC7 8B10 FF928C000000 84C0 740B
8BD3 8BC7 E8F388FFFF
EB09
8BD3 8BC7 8B08 FF514C
84C0 743B
A144DE4C00 8B00 8BD3 E8AEA9FBFF
80780C00 7527 C744241001000000 50 8BD3 8BC5 E8B6F1FFFF
92 58 E81BA9FBFF
92 8B442404 E85996F6FF
89442404 43 4E 759B
A144DE4C00 8B00 E8AD4AFBFF
96 31DB 43 8BC7 8B10 FF928C000000 84C0 740B
8BD3 8BC7 E87E88FFFF
EB09
8BD3 8BC7 8B08 FF514C 84C0 743B
A144DE4C00 8B00 8BD3 E839A9FBFF 80780C01 7527
C744240C02000000 50 8BD3 8BC5 E841F1FFFF
92 58 E8A6A8FBFF
92 8B442408 E8E495F6FF
89442408 43 4E 759B
8B44240C 03442410 48 7408
48 740F
48 7420
EB67
8B0424 F76C2404 90 EB07

Segment 12/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
004C0D4Ah
000C014Ah

Sourcecode

__004C0D4Ah:
			JMP __004C0D65h

Bytes

EB19

Segment 13/13

Offsets

RPG2003
1.0.8.0
1.0.8.0
004C0D65h
000C0165h

Sourcecode

__004C0D65h:
			MOV EAX, EBP
			MOV EDX, [EAX]
			CALL [EDX+8Ch]
			TEST AL, AL
			JZ __004C0DAEh
			CALL PROC__0049B0E1h
			NOP
			NOP
			XOR ECX, ECX
			SUB EAX, 2
			JC __004C0D88h
			JZ __004C0D89h
			DEC EAX
			JZ __004C0D8Eh
			JMP __004C0DAEh
__004C0D88h:
			INC EAX
__004C0D89h:
			CMP [EBP+74h], ECX
			JNE __004C0DAEh
__004C0D8Eh:
			IMUL EAX, [ESP], 75
			NOP
			MOV ECX, 100
			CDQ
			IDIV ECX
			MOV [ESP], EAX
			JMP __004C0DAEh

Bytes

8BC5 8B10 FF928C000000 84C0 743B
E869A3FDFF
90 90 31C9 83E802 7207
7406
48 7408
EB26
41 394D74 7520
6904244B000000 90 B964000000 99 F7F9
890424 EB0B