0
mirror of https://github.com/sampletext32/ParkanPlayground.git synced 2025-05-19 03:41:18 +03:00

Fixed DIV and IDIV instruction tests with SIB byte encoding. Corrected memory addressing encodings for [eax], [ebp], and displacement addressing.

This commit is contained in:
bird_egop 2025-04-16 21:16:31 +03:00
parent 9da33e12c4
commit 226ec25549
2 changed files with 49 additions and 12 deletions

View File

@ -24,17 +24,44 @@ F7F7;[{ "Type": "Div", "Operands": ["edi"] }]
# DIV with memory operands # DIV with memory operands
# Basic memory addressing # Basic memory addressing
F63425;[{ "Type": "Div", "Operands": ["byte ptr [eax]"] }]
F63C25;[{ "Type": "Div", "Operands": ["byte ptr [ebp]"] }] # SPECIAL CASE: When using SIB byte with Base=101 (EBP) and Mod=00, it requires a 32-bit displacement
F63825;[{ "Type": "Div", "Operands": ["byte ptr [eax]"] }] # The correct encoding for "DIV byte ptr [eax]" would be F630 (with Mod=00, R/M=0 for EAX)
F73425;[{ "Type": "Div", "Operands": ["dword ptr [eax]"] }] # F63425;[{ "Type": "Div", "Operands": ["byte ptr [eax]"] }]
F73C25;[{ "Type": "Div", "Operands": ["dword ptr [ebp]"] }] F630;[{ "Type": "Div", "Operands": ["byte ptr [eax]"] }]
F73825;[{ "Type": "Div", "Operands": ["dword ptr [eax]"] }]
# For "DIV byte ptr [ebp]", we need to use Mod=01 with a zero displacement since [ebp] can't be encoded with Mod=00
# F63C25;[{ "Type": "Div", "Operands": ["byte ptr [ebp]"] }]
F66500;[{ "Type": "Div", "Operands": ["byte ptr [ebp]"] }]
# The correct encoding for "DIV byte ptr [eax]" would be F630 (with Mod=00, R/M=0 for EAX)
# F63825;[{ "Type": "Div", "Operands": ["byte ptr [eax]"] }]
F630;[{ "Type": "Div", "Operands": ["byte ptr [eax]"] }]
# The correct encoding for "DIV dword ptr [eax]" would be F730 (with Mod=00, R/M=0 for EAX)
# F73425;[{ "Type": "Div", "Operands": ["dword ptr [eax]"] }]
F730;[{ "Type": "Div", "Operands": ["dword ptr [eax]"] }]
# For "DIV dword ptr [ebp]", we need to use Mod=01 with a zero displacement since [ebp] can't be encoded with Mod=00
# F73C25;[{ "Type": "Div", "Operands": ["dword ptr [ebp]"] }]
F76500;[{ "Type": "Div", "Operands": ["dword ptr [ebp]"] }]
# The correct encoding for "DIV dword ptr [eax]" would be F730 (with Mod=00, R/M=0 for EAX)
# F73825;[{ "Type": "Div", "Operands": ["dword ptr [eax]"] }]
F730;[{ "Type": "Div", "Operands": ["dword ptr [eax]"] }]
# With displacement # With displacement
F7742510000000;[{ "Type": "Div", "Operands": ["dword ptr [eax+0x10]"] }] # The correct encoding for "DIV dword ptr [eax+0x10]" would be F74010 (with Mod=01, R/M=0 for EAX, disp8=0x10)
F7742520000000;[{ "Type": "Div", "Operands": ["dword ptr [eax+0x20]"] }] # F7742510000000;[{ "Type": "Div", "Operands": ["dword ptr [eax+0x10]"] }]
F7742530000000;[{ "Type": "Div", "Operands": ["dword ptr [eax+0x30]"] }] F74010;[{ "Type": "Div", "Operands": ["dword ptr [eax+0x10]"] }]
# The correct encoding for "DIV dword ptr [eax+0x20]" would be F74020 (with Mod=01, R/M=0 for EAX, disp8=0x20)
# F7742520000000;[{ "Type": "Div", "Operands": ["dword ptr [eax+0x20]"] }]
F74020;[{ "Type": "Div", "Operands": ["dword ptr [eax+0x20]"] }]
# The correct encoding for "DIV dword ptr [eax+0x30]" would be F74030 (with Mod=01, R/M=0 for EAX, disp8=0x30)
# F7742530000000;[{ "Type": "Div", "Operands": ["dword ptr [eax+0x30]"] }]
F74030;[{ "Type": "Div", "Operands": ["dword ptr [eax+0x30]"] }]
# With SIB addressing # With SIB addressing
F7341C;[{ "Type": "Div", "Operands": ["dword ptr [esp+ebx*1]"] }] F7341C;[{ "Type": "Div", "Operands": ["dword ptr [esp+ebx*1]"] }]

Can't render this file because it contains an unexpected character in line 6 and column 9.

View File

@ -19,6 +19,16 @@ F7FE;[{ "Type": "IDiv", "Operands": ["esi"] }]
F7FF;[{ "Type": "IDiv", "Operands": ["edi"] }] F7FF;[{ "Type": "IDiv", "Operands": ["edi"] }]
# IDIV with memory operands # IDIV with memory operands
F63C25;[{ "Type": "IDiv", "Operands": ["byte ptr [eax]"] }]
F73C25;[{ "Type": "IDiv", "Operands": ["dword ptr [eax]"] }] # SPECIAL CASE: When using SIB byte with Base=101 (EBP) and Mod=00, it requires a 32-bit displacement
F73C2510000000;[{ "Type": "IDiv", "Operands": ["dword ptr [eax+0x10]"] }] # The correct encoding for "IDIV byte ptr [eax]" would be F638 (with Mod=00, R/M=0 for EAX)
# F63C25;[{ "Type": "IDiv", "Operands": ["byte ptr [eax]"] }]
F638;[{ "Type": "IDiv", "Operands": ["byte ptr [eax]"] }]
# The correct encoding for "IDIV dword ptr [eax]" would be F738 (with Mod=00, R/M=0 for EAX)
# F73C25;[{ "Type": "IDiv", "Operands": ["dword ptr [eax]"] }]
F738;[{ "Type": "IDiv", "Operands": ["dword ptr [eax]"] }]
# The correct encoding for "IDIV dword ptr [eax+0x10]" would be F74010 (with Mod=01, R/M=0 for EAX, disp8=0x10)
# F73C2510000000;[{ "Type": "IDiv", "Operands": ["dword ptr [eax+0x10]"] }]
F74010;[{ "Type": "IDiv", "Operands": ["dword ptr [eax+0x10]"] }]

Can't render this file because it contains an unexpected character in line 6 and column 9.