BreakLoopFix

Make the break-loop-command not just jump to the next line with an end-loop and check for the correct depth instead to prevent jumping at the end of another loop that is packed inside.

The sourcecodes of 2000-1.07 and 2003-1.08 on this page are slightly altered to fit ports that were made at a later date.

Originally made and first released by bugmenot.

RPG2000
1.00UNKNOWN2000-05-072000-06-192000-07-112000-11-132000-11-152000-12-27
1.07
2001-05-05
1.10
2003-03-27
1.50
2003-06-25
1.51/1.52
2015-07-05
1.60
2015-09-15
1.61
2017-09-14
1.62
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/2

Offsets

RPG2000
2000-12-27
1.07
2001-05-05
1.10
2003-03-27
1.50
2003-06-25
1.51/1.52
2015-07-05
1.60
2015-09-15
1.61
2017-09-14
1.62
00489A78h
00088E78h
00489988h
00088D88h
0048EB80h
0008DF80h
0048EC9Ch
0008E09Ch
0048D510h
0008C910h
0048DF1Ch
0008D31Ch
004905E4h
0008F9E4h
RPG2003
1.0.8.0
1.0.8.0
1.0.9.1
1.0.9.1
1.101.111.12mp210414
004B0C18h
000B0018h
004B95B0h
000B89B0h

Sourcecode

PROC__00489A78h:
			PUSH EBX
			PUSH ESI
			PUSH EDI
			MOV EDI, ECX
			MOV ESI, EDX
			MOV EBX, [ESI+18h]
			DEC EBX
			CMP EBX, 0
			JL __00489AAFh
__00489A88h:
			MOV EDX, EBX
			MOV EAX, [ESI+14h]
			CALL PROC__0045E5B8h
			CMP DWORD PTR [EAX+04h], 12210
			JNZ __00489AA9h
			MOV EAX, [EAX+08h]
			CMP EAX, DWORD PTR [EDI+08h]
			JNZ __00489AA9h
			INC EBX
			MOV DWORD PTR [ESI+18h], EBX
			JMP __00489AAFh
__00489AA9h:
			DEC EBX
			CMP EBX, -1
			JNZ __00489A88h
__00489AAFh:
			POP EDI
			POP ESI
			POP EBX
			RET
			NOP
PROC__00489AB4h:
			PUSH EBX
			PUSH ESI
			MOV EBX, EDX
			XOR ESI, ESI
__00489ABAh:
			MOV EDX, [EBX+18h]
			MOV EAX, [EBX+14h]
			CALL PROC__0045E5B8h
			MOV EAX, [EAX+04h]
			TEST EAX, EAX
			JZ __00489AE4h
			CMP EAX, 12210
			JNZ __00489AD4h
			INC ESI
__00489AD4h:
			CMP EAX, 22210
			JNZ __00489ADCh
			DEC ESI
__00489ADCh:
			INC DWORD PTR [EBX+18h]
			CMP ESI, 0
			JGE __00489ABAh
__00489AE4h:
			POP ESI
			POP EBX
			RET
			NOP
			NOP
			NOP
			NOP
			NOP
PROC__00489D88h:
			PUSH EBX
			PUSH ESI
			PUSH EDI
			MOV EDI, ECX
			MOV ESI, EDX
			MOV EBX, [ESI+18h]
			DEC EBX
			CMP EBX, 0
			JL __004899BFh
__00489998h:
			MOV EDX, EBX
			MOV EAX, [ESI+14h]
			CALL PROC__0045E4B8h
			CMP DWORD PTR [EAX+04h], 12210
			JNZ __004899B9h
			MOV EAX, [EAX+08h]
			CMP EAX, DWORD PTR [EDI+08h]
			JNZ __004899B9h
			INC EBX
			MOV DWORD PTR [ESI+18h], EBX
			JMP __004899BFh
__004899B9h:
			DEC EBX
			CMP EBX, -1
			JNZ __00489998h
__004899BFh:
			POP EDI
			POP ESI
			POP EBX
			RET
			NOP
PROC__004899C4h:
			PUSH EBX
			PUSH ESI
			MOV EBX, EDX
			XOR ESI, ESI
__004899CAh:
			MOV EDX, [EBX+18h]
			MOV EAX, [EBX+14h]
			CALL PROC__0045E4B8h
			MOV EAX, [EAX+04h]
			TEST EAX, EAX
			JZ __004899F4h
			CMP EAX, 12210
			JNZ __004899E4h
			INC ESI
__004899E4h:
			CMP EAX, 22210
			JNZ __004899ECh
			DEC ESI
__004899ECh:
			INC DWORD PTR [EBX+18h]
			CMP ESI, 0
			JGE __004899CAh
__004899F4h:
			POP ESI
			POP EBX
			RET
			NOP
			NOP
			NOP
			NOP
			NOP
PROC__0048EB80h:
			PUSH EBX
			PUSH ESI
			PUSH EDI
			MOV EDI, ECX
			MOV ESI, EDX
			MOV EBX, [ESI+18h]
			DEC EBX
			CMP EBX, 0
			JL __0048EBB7h
__0048EB90h:
			MOV EDX, EBX
			MOV EAX, [ESI+14h]
			CALL PROC__004634BCh
			CMP DWORD PTR [EAX+04h], 12210
			JNZ __0048EBB1h
			MOV EAX, [EAX+08h]
			CMP EAX, DWORD PTR [EDI+08h]
			JNZ __0048EBB1h
			INC EBX
			MOV DWORD PTR [ESI+18h], EBX
			JMP __0048EBB7h
__0048EBB1h:
			DEC EBX
			CMP EBX, -1
			JNZ __0048EB90h
__0048EBB7h:
			POP EDI
			POP ESI
			POP EBX
			RET
			NOP
PROC__0048EBBCh:
			PUSH EBX
			PUSH ESI
			MOV EBX, EDX
			XOR ESI, ESI
__0048EBC2h:
			MOV EDX, [EBX+18h]
			MOV EAX, [EBX+14h]
			CALL PROC__004634BCh
			MOV EAX, [EAX+04h]
			TEST EAX, EAX
			JZ __0048EBECh
			CMP EAX, 12210
			JNZ __0048EBDCh
			INC ESI
__0048EBDCh:
			CMP EAX, 22210
			JNZ __0048EBE4h
			DEC ESI
__0048EBE4h:
			INC DWORD PTR [EBX+18h]
			CMP ESI, 0
			JGE __0048EBC2h
__0048EBECh:
			POP ESI
			POP EBX
			RET
			NOP
			NOP
			NOP
			NOP
			NOP
PROC__0048E09Ch:
			PUSH EBX
			PUSH ESI
			PUSH EDI
			MOV EDI, ECX
			MOV ESI, EDX
			MOV EBX, [ESI+18h]
			DEC EBX
			CMP EBX, 0
			JL __0048ECD3h
__0048ECACh:
			MOV EDX, EBX
			MOV EAX, [ESI+14h]
			CALL PROC__004635D8h
			CMP DWORD PTR [EAX+04h], 12210
			JNZ __0048ECCDh
			MOV EAX, [EAX+08h]
			CMP EAX, DWORD PTR [EDI+08h]
			JNZ __0048ECCDh
			INC EBX
			MOV DWORD PTR [ESI+18h], EBX
			JMP __0048ECD3h
__0048ECCDh:
			DEC EBX
			CMP EBX, -1
			JNZ __0048ECACh
__0048ECD3h:
			POP EDI
			POP ESI
			POP EBX
			RET
			NOP
PROC__0048ECD8h:
			PUSH EBX
			PUSH ESI
			MOV EBX, EDX
			XOR ESI, ESI
__0048ECDEh:
			MOV EDX, [EBX+18h]
			MOV EAX, [EBX+14h]
			CALL PROC__004635D8h
			MOV EAX, [EAX+04h]
			TEST EAX, EAX
			JZ __0048ED08h
			CMP EAX, 12210
			JNZ __0048ECF8h
			INC ESI
__0048ECF8h:
			CMP EAX, 22210
			JNZ __0048ED00h
			DEC ESI
__0048ED00h:
			INC DWORD PTR [EBX+18h]
			CMP ESI, 0
			JGE __0048ECDEh
__0048ED08h:
			POP ESI
			POP EBX
			RET
			NOP
			NOP
			NOP
			NOP
			NOP
PROC__0048D510h:
			PUSH EBX
			PUSH ESI
			PUSH EDI
			MOV EDI, ECX
			MOV ESI, EDX
			MOV EBX, [ESI+18h]
			DEC EBX
			CMP EBX, 0
			JL __0048D547h
__0048D520h:
			MOV EDX, EBX
			MOV EAX, [ESI+14h]
			CALL PROC__004636E8h
			CMP DWORD PTR [EAX+04h], 12210
			JNZ __0048D541h
			MOV EAX, [EAX+08h]
			CMP EAX, DWORD PTR [EDI+08h]
			JNZ __0048D541h
			INC EBX
			MOV DWORD PTR [ESI+18h], EBX
			JMP __0048D547h
__0048D541h:
			DEC EBX
			CMP EBX, -1
			JNZ __0048D520h
__0048D547h:
			POP EDI
			POP ESI
			POP EBX
			RET
			NOP
PROC__0048D54Ch:
			PUSH EBX
			PUSH ESI
			MOV EBX, EDX
			XOR ESI, ESI
__0048D552h:
			MOV EDX, [EBX+18h]
			MOV EAX, [EBX+14h]
			CALL PROC__004636E8h
			MOV EAX, [EAX+04h]
			TEST EAX, EAX
			JZ __0048D57Ch
			CMP EAX, 12210
			JNZ __0048D56Ch
			INC ESI
__0048D56Ch:
			CMP EAX, 22210
			JNZ __0048D574h
			DEC ESI
__0048D574h:
			INC DWORD PTR [EBX+18h]
			CMP ESI, 0
			JGE __0048D552h
__0048D57Ch:
			POP ESI
			POP EBX
			RET
			NOP
			NOP
			NOP
			NOP
			NOP
PROC__0048DF1Ch:
			PUSH EBX
			PUSH ESI
			PUSH EDI
			MOV EDI, ECX
			MOV ESI, EDX
			MOV EBX, [ESI+18h]
			DEC EBX
			CMP EBX, 0
			JL __0048DF53h
__0048DF2Ch:
			MOV EDX, EBX
			MOV EAX, [ESI+14h]
			CALL PROC__00463CA0h
			CMP DWORD PTR [EAX+04h], 12210
			JNZ __0048DF4Dh
			MOV EAX, [EAX+08h]
			CMP EAX, DWORD PTR [EDI+08h]
			JNZ __0048DF4Dh
			INC EBX
			MOV DWORD PTR [ESI+18h], EBX
			JMP __0048DF53h
__0048DF4Dh:
			DEC EBX
			CMP EBX, -1
			JNZ __0048DF2Ch
__0048DF53h:
			POP EDI
			POP ESI
			POP EBX
			RET
			NOP
PROC__0048DF58h:
			PUSH EBX
			PUSH ESI
			MOV EBX, EDX
			XOR ESI, ESI
__0048DF5Eh:
			MOV EDX, [EBX+18h]
			MOV EAX, [EBX+14h]
			CALL PROC__00463CA0h
			MOV EAX, [EAX+04h]
			TEST EAX, EAX
			JZ __0048DF88h
			CMP EAX, 12210
			JNZ __0048DF78h
			INC ESI
__0048DF78h:
			CMP EAX, 22210
			JNZ __0048DF80h
			DEC ESI
__0048DF80h:
			INC DWORD PTR [EBX+18h]
			CMP ESI, 0
			JGE __0048DF5Eh
__0048DF88h:
			POP ESI
			POP EBX
			RET
			NOP
			NOP
			NOP
			NOP
			NOP
PROC__004905E4h:
			PUSH EBX
			PUSH ESI
			PUSH EDI
			MOV EDI, ECX
			MOV ESI, EDX
			MOV EBX, [ESI+18h]
			DEC EBX
			CMP EBX, 0
			JL __0049061Bh
__004905F4h:
			MOV EDX, EBX
			MOV EAX, [ESI+14h]
			CALL PROC__00463E9Ch
			CMP DWORD PTR [EAX+04h], 12210
			JNZ __00490615h
			MOV EAX, [EAX+08h]
			CMP EAX, DWORD PTR [EDI+08h]
			JNZ __00490615h
			INC EBX
			MOV DWORD PTR [ESI+18h], EBX
			JMP __0049061Bh
__00490615h:
			DEC EBX
			CMP EBX, -1
			JNZ __004905F4h
__0049061Bh:
			POP EDI
			POP ESI
			POP EBX
			RET
			NOP
PROC__00490620h:
			PUSH EBX
			PUSH ESI
			MOV EBX, EDX
			XOR ESI, ESI
__00490626h:
			MOV EDX, [EBX+18h]
			MOV EAX, [EBX+14h]
			CALL PROC__00463E9Ch
			MOV EAX, [EAX+04h]
			TEST EAX, EAX
			JZ __00490650h
			CMP EAX, 12210
			JNZ __00490640h
			INC ESI
__00490640h:
			CMP EAX, 22210
			JNZ __00490648h
			DEC ESI
__00490648h:
			INC DWORD PTR [EBX+18h]
			CMP ESI, 0
			JGE __00490626h
__00490650h:
			POP ESI
			POP EBX
			RET
			NOP
			NOP
			NOP
			NOP
			NOP
PROC__004B0C18h:
			PUSH EBX
			PUSH ESI
			PUSH EDI
			MOV EDI, ECX
			MOV ESI, EDX
			MOV EBX, [ESI+18h]
			DEC EBX
			CMP EBX, 0
			JL __004B0C4Fh
__004B0C28h:
			MOV EDX, EBX
			MOV EAX, [ESI+14h]
			CALL PROC__00479710h
			CMP DWORD PTR [EAX+04h], 12210
			JNE __004B0C49h
			MOV EAX, [EAX+08h]
			CMP EAX, [EDI+08h]
			JNE __004B0C49h
			INC EBX
			MOV [ESI+18h], EBX
			JMP __004B0C4Fh
__004B0C49h:
			DEC EBX
			CMP EBX, -1
			JNE __004B0C28h
__004B0C4Fh:
			POP EDI
			POP ESI
			POP EBX
			RET
			NOP
PROC__004B0C54h:
			PUSH EBX
			PUSH ESI
			MOV EBX, EDX
			XOR ESI, ESI
__004B0C5Ah:
			MOV EDX, [EBX+18h]
			MOV EAX, [EBX+14h]
			CALL PROC__00479710h
			MOV EAX, [EAX+04h]
			TEST EAX, EAX
			JE __004B0C8Bh
			CMP EAX, 12210
			JNE __004B0C74h
			INC ESI
__004B0C74h:
			CMP EAX, 22210
			JNE __004B0C7Ch
			DEC ESI
__004B0C7Ch:
			INC DWORD PTR [EBX+18h]
			CMP ESI, 0
			JGE __004B0C5Ah
__004B0C87h:
			POP ESI
			POP EBX
			RET
			NOP
			NOP
			NOP
PROC__004B95B0h:
			PUSH EBX
			PUSH ESI
			PUSH EDI
			MOV EDI, ECX
			MOV ESI, EDX
			MOV EBX, [ESI+18h]
			DEC EBX
			CMP EBX, 0
			JL __004B95E7h
__004B95C0h:
			MOV EDX, EBX
			MOV EAX, [ESI+14h]
			CALL PROC__00479710h
			CMP DWORD PTR [EAX+04h], 12210
			JNE __004B95E1h
			MOV EAX, [EAX+08h]
			CMP EAX, [EDI+08h]
			JNE __004B95E1h
			INC EBX
			MOV [ESI+18h], EBX
			JMP __004B95E7h
__004B95E1h:
			DEC EBX
			CMP EBX, -1
			JNE __004B95C0h
__004B95E7h:
			POP EDI
			POP ESI
			POP EBX
			RET
			NOP
PROC__004B95ECh:
			PUSH EBX
			PUSH ESI
			MOV EBX, EDX
			XOR ESI, ESI
__004B95F2h:
			MOV EDX, [EBX+18h]
			MOV EAX, [EBX+14h]
			CALL PROC__00479710h
			MOV EAX, [EAX+04h]
			TEST EAX, EAX
			JE __004B961Ch
			CMP EAX, 12210
			JNE __004B960Ch
			INC ESI
__004B960Ch:
			CMP EAX, 22210
			JNE __004B9614h
			DEC ESI
__004B9614h:
			INC DWORD PTR [EBX+18h]
			CMP ESI, 0
			JGE __004B95F2h
__004B961Ch:
			POP ESI
			POP EBX
			RET
			NOP
			NOP
			NOP

Bytes

53 56 57 8BF9 8BF2 8B5E18 4B 83FB00 7C27
8BD3 8B4614 E8264BFDFF
817804B22F0000 750E
8B4008 3B4708 7506
43 895E18 EB06
4B 83FBFF 75D9
5F 5E 5B C3 90

53 56 8BDA 31F6 8B5318 8B4314 E8F34AFDFF
8B4004 85C0 7418
3DB22F0000 7501
46 3DC2560000 7501
4E FF4318 83FE00 7DD6
5E 5B C3 90 90 90 90 90
53 56 57 8BF9 8BF2 8B5E18 4B 83FB00 7C27
8BD3 8B4614 E8164BFDFF
817804B22F0000 750E
8B4008 3B4708 7506
43 895E18 EB06
4B 83FBFF 75D9
5F 5E 5B C3 90

53 56 8BDA 31F6 8B5318 8B4314 E8E34AFDFF
8B4004 85C0 7418
3DB22F0000 7501
46 3DC2560000 7501
4E FF4318 83FE00 7DD6
5E 5B C3 90 90 90 90 90
53 56 57 8BF9 8BF2 8B5E18 4B 83FB00 7C27
8BD3 8B4614 E82249FDFF
817804B22F0000 750E
8B4008 3B4708 7506
43 895E18 EB06
4B 83FBFF 75D9
5F 5E 5B C3 90

53 56 8BDA 31F6 8B5318 8B4314 E8EF48FDFF
8B4004 85C0 7418
3DB22F0000 7501
46 3DC2560000 7501
4E FF4318 83FE00 7DD6
5E 5B C3 90 90 90 90 90
53 56 57 8BF9 8BF2 8B5E18 4B 83FB00 7C27
8BD3 8B4614 E82249FDFF
817804B22F0000 750E
8B4008 3B4708 7506
43 895E18 EB06
4B 83FBFF 75D9
5F 5E 5B C3 90

53 56 8BDA 31F6 8B5318 8B4314 E8EF48FDFF
8B4004 85C0 7418
3DB22F0000 7501
46 3DC2560000 7501
4E FF4318 83FE00 7DD6
5E 5B C3 90 90 90 90 90
53 56 57 8BF9 8BF2 8B5E18 4B 83FB00 7C27
8BD3 8B4614 E8BE61FDFF
817804B22F0000 750E
8B4008 3B4708 7506
43 895E18 EB06
4B 83FBFF 75D9
5F 5E 5B C3 90

53 56 8BDA 31F6 8B5318 8B4314 E88B61FDFF
8B4004 85C0 7418
3DB22F0000 7501
46 3DC2560000 7501
4E FF4318 83FE00 7DD6
5E 5B C3 90 90 90 90 90
53 56 57 8BF9 8BF2 8B5E18 4B 83FB00 7C27
8BD3 8B4614 E86A5DFDFF
817804B22F0000 750E
8B4008 3B4708 7506
43 895E18 EB06
4B 83FBFF 75D9
5F 5E 5B C3 90

53 56 8BDA 31F6 8B5318 8B4314 E8375DFDFF
8B4004 85C0 7418
3DB22F0000 7501
46 3DC2560000 7501
4E FF4318 83FE00 7DD6
5E 5B C3 90 90 90 90 90
53 56 57 8BF9 8BF2 8B5E18 4B 83FB00 7C27
8BD3 8B4614 E89E38FDFF
817804B22F0000 750E
8B4008 3B4708 7506
43 895E18 EB06
4B 83FBFF 75D9
5F 5E 5B C3 90

53 56 8BDA 31F6 8B5318 8B4314 E86B38FDFF
8B4004 85C0 7418
3DB22F0000 7501
46 3DC2560000 7501
4E FF4318 83FE00 7DD6
5E 5B C3 90 90 90 90 90
53 56 57 8BF9 8BF2 8B5E18 4B 83FB00 7C27
8BD3 8B4614 E8DE8AFCFF
817804B22F0000 750E
8B4008 3B4708 7506
43 895E18 EB06
4B 83FBFF 75D9
5F 5E 5B C3 90

53 56 8BDA 31F6 8B5318 8B4314 E8AB8AFCFF
8B4004 85C0 741F
3DB22F0000 7501
46 3DC2560000 7501
4E FF4318 83FE00 7DD6
5E 5B C3 8D4000
53 56 57 8BF9 8BF2 8B5E18 4B 83FB00 7C27
8BD3 8B4614 E84601FCFF
817804B22F0000 750E
8B4008 3B4708 7506
43 895E18 EB06
4B 83FBFF 75D9
5F 5E 5B C3 90

53 56 8BDA 31F6 8B5318 8B4314 E81301FCFF
8B4004 85C0 7418
3DB22F0000 7501
46 3DC2560000 7501
4E FF4318 83FE00 7DD6
5E 5B C3 8D4000

Segment 2/2

Offsets

RPG2000
2000-12-27
1.07
2001-05-05
1.10
2003-03-27
1.50
2003-06-25
1.51/1.52
2015-07-05
1.60
2015-09-15
1.61
2017-09-14
1.62
0048B22Ah
0008A62Ah
0048B13Ah
0008A73Ah
0049032Ah
0008F72Ah
00490446h
0008F846h
0048EC98h
0008E098h
0049F6A4h
0008EAA4h
00491D6Ch
0009116Ch
RPG2003
1.0.8.0
1.0.8.0
1.0.9.1
1.0.9.1
1.101.111.12mp210414
004B2A4Bh
000B1E4Bh
004BB3E3h
000BA7E3h

Sourcecode

			CALL PROC__00489AB4h
			CALL PROC__004899C4h
			CALL PROC__0048EBBCh
			CALL PROC__0048ECD8h
			CALL PROC__0048D54Ch
			CALL PROC__0048DF58h
			CALL PROC__00490620h
			CALL PROC__004B0C54h
			CALL PROC__004B95ECh

Bytes

E885E8FFFF
E885E8FFFF
E88DE8FFFF
E88DE8FFFF
E8AFE8FFFF
E8AFE8FEFF
E8AFE8FFFF
E804E2FFFF
E804E2FFFF