2025-04-13 19:26:08 +03:00
|
|
|
# XOR instruction tests
|
|
|
|
# Format: RawBytes;Instructions
|
|
|
|
RawBytes;Instructions
|
|
|
|
|
|
|
|
# Register-to-register XOR (32-bit)
|
2025-04-15 22:20:46 +03:00
|
|
|
31D8;[{ "Type": "Xor", "Operands": ["eax", "ebx"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# Register-to-memory XOR (32-bit)
|
2025-04-15 22:20:46 +03:00
|
|
|
314B10;[{ "Type": "Xor", "Operands": ["dword ptr [ebx+0x10]", "ecx"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# Memory-to-register XOR (32-bit)
|
2025-04-15 22:20:46 +03:00
|
|
|
33D8;[{ "Type": "Xor", "Operands": ["ebx", "eax"] }]
|
|
|
|
334B10;[{ "Type": "Xor", "Operands": ["ecx", "dword ptr [ebx+0x10]"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# Immediate-to-register XOR (32-bit immediate)
|
2025-04-15 22:20:46 +03:00
|
|
|
81F078563412;[{ "Type": "Xor", "Operands": ["eax", "0x12345678"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# Immediate-to-memory XOR (32-bit immediate)
|
2025-04-15 22:20:46 +03:00
|
|
|
81701078563412;[{ "Type": "Xor", "Operands": ["dword ptr [eax+0x10]", "0x12345678"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# Small immediate XOR (8-bit immediate to 32-bit register with sign extension)
|
2025-04-15 22:20:46 +03:00
|
|
|
83F042;[{ "Type": "Xor", "Operands": ["eax", "0x42"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# Sign-extended immediate XOR (8-bit immediate sign-extended to 32-bit)
|
2025-04-15 22:20:46 +03:00
|
|
|
83F0F0;[{ "Type": "Xor", "Operands": ["eax", "0xFFFFFFF0"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# XOR AL, imm8 (opcode 0x34)
|
2025-04-15 22:20:46 +03:00
|
|
|
3442;[{ "Type": "Xor", "Operands": ["al", "0x42"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# XOR EAX, imm32 (opcode 0x35)
|
2025-04-15 22:20:46 +03:00
|
|
|
3578563412;[{ "Type": "Xor", "Operands": ["eax", "0x12345678"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# XOR with SIB byte addressing (Scale-Index-Base)
|
|
|
|
# XOR [eax+ecx*4], edx (opcode 0x31)
|
2025-04-15 22:20:46 +03:00
|
|
|
311488;[{ "Type": "Xor", "Operands": ["dword ptr [eax+ecx*4]", "edx"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# XOR edx, [eax+ecx*4] (opcode 0x33)
|
2025-04-15 22:20:46 +03:00
|
|
|
331488;[{ "Type": "Xor", "Operands": ["edx", "dword ptr [eax+ecx*4]"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# XOR with displacement-only addressing
|
|
|
|
# XOR [0x12345678], eax (opcode 0x31)
|
2025-04-15 22:20:46 +03:00
|
|
|
310578563412;[{ "Type": "Xor", "Operands": ["dword ptr [0x12345678]", "eax"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# XOR with segment override prefixes
|
|
|
|
# XOR fs:[ebx+0x10], ecx (opcode 0x31 with FS override)
|
2025-04-15 22:20:46 +03:00
|
|
|
64314B10;[{ "Type": "Xor", "Operands": ["dword ptr fs:[ebx+0x10]", "ecx"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# XOR ecx, gs:[ebx+0x10] (opcode 0x33 with GS override)
|
2025-04-15 22:20:46 +03:00
|
|
|
65334B10;[{ "Type": "Xor", "Operands": ["ecx", "dword ptr gs:[ebx+0x10]"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# XOR with complex addressing mode: base + index + scale + displacement
|
|
|
|
# XOR [eax+ecx*4+0x12345678], edx (opcode 0x31)
|
2025-04-15 22:20:46 +03:00
|
|
|
31948878563412;[{ "Type": "Xor", "Operands": ["dword ptr [eax+ecx*4+0x12345678]", "edx"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# Edge cases for immediate values
|
|
|
|
# XOR eax, 0x0 (opcode 0x83 /6 with zero immediate)
|
2025-04-15 22:20:46 +03:00
|
|
|
83F000;[{ "Type": "Xor", "Operands": ["eax", "0x00"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# XOR al, 0xFF (opcode 0x34 with max 8-bit immediate)
|
2025-04-15 22:20:46 +03:00
|
|
|
34FF;[{ "Type": "Xor", "Operands": ["al", "0xFF"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# XOR eax, 0xFFFFFFFF (opcode 0x81 /6 with max 32-bit immediate)
|
2025-04-15 22:20:46 +03:00
|
|
|
81F0FFFFFFFF;[{ "Type": "Xor", "Operands": ["eax", "0xFFFFFFFF"] }]
|
2025-04-13 19:26:08 +03:00
|
|
|
|
|
|
|
# XOR with negative immediate value (sign-extended)
|
2025-04-15 22:20:46 +03:00
|
|
|
83F0FF;[{ "Type": "Xor", "Operands": ["eax", "0xFFFFFFFF"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# 16-bit XOR tests (with 0x66 prefix)
|
|
|
|
# XOR AX, imm16 (opcode 0x35 with 0x66 prefix)
|
2025-04-15 22:20:46 +03:00
|
|
|
6635ABCD;[{ "Type": "Xor", "Operands": ["ax", "0xCDAB"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# XOR r16, r/m16 (opcode 0x33 with 0x66 prefix)
|
2025-04-15 22:20:46 +03:00
|
|
|
6633D8;[{ "Type": "Xor", "Operands": ["bx", "ax"] }]
|
|
|
|
6633C9;[{ "Type": "Xor", "Operands": ["cx", "cx"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# XOR r/m16, r16 (opcode 0x31 with 0x66 prefix)
|
2025-04-15 22:20:46 +03:00
|
|
|
6631D8;[{ "Type": "Xor", "Operands": ["ax", "bx"] }]
|
|
|
|
6631C9;[{ "Type": "Xor", "Operands": ["cx", "cx"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# XOR r/m16, imm16 (opcode 0x81 /6 with 0x66 prefix)
|
2025-04-15 22:20:46 +03:00
|
|
|
6681F0ABCD;[{ "Type": "Xor", "Operands": ["ax", "0xCDAB"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# XOR r/m16, imm8 (sign-extended) (opcode 0x83 /6 with 0x66 prefix)
|
2025-04-15 22:20:46 +03:00
|
|
|
6683F042;[{ "Type": "Xor", "Operands": ["ax", "0x42"] }]
|
|
|
|
6683F0FF;[{ "Type": "Xor", "Operands": ["ax", "0xFFFF"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# 8-bit XOR tests
|
|
|
|
# XOR r/m8, r8 (opcode 0x30)
|
2025-04-15 22:20:46 +03:00
|
|
|
30D8;[{ "Type": "Xor", "Operands": ["al", "bl"] }]
|
|
|
|
30C9;[{ "Type": "Xor", "Operands": ["cl", "cl"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# XOR r8, r/m8 (opcode 0x32)
|
2025-04-15 22:20:46 +03:00
|
|
|
32D8;[{ "Type": "Xor", "Operands": ["bl", "al"] }]
|
|
|
|
32C9;[{ "Type": "Xor", "Operands": ["cl", "cl"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# XOR r/m8, imm8 (opcode 0x80 /6)
|
2025-04-15 22:20:46 +03:00
|
|
|
80F042;[{ "Type": "Xor", "Operands": ["al", "0x42"] }]
|
|
|
|
80F0FF;[{ "Type": "Xor", "Operands": ["al", "0xFF"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# Self-XOR tests (zeroing registers)
|
2025-04-15 22:20:46 +03:00
|
|
|
31C0;[{ "Type": "Xor", "Operands": ["eax", "eax"] }]
|
|
|
|
31DB;[{ "Type": "Xor", "Operands": ["ebx", "ebx"] }]
|
|
|
|
31C9;[{ "Type": "Xor", "Operands": ["ecx", "ecx"] }]
|
|
|
|
31D2;[{ "Type": "Xor", "Operands": ["edx", "edx"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# XOR with different addressing modes
|
|
|
|
# XOR [ebp+0x8], eax (opcode 0x31)
|
2025-04-15 22:20:46 +03:00
|
|
|
314508;[{ "Type": "Xor", "Operands": ["dword ptr [ebp+0x08]", "eax"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# XOR eax, [ebp+0x8] (opcode 0x33)
|
2025-04-15 22:20:46 +03:00
|
|
|
334508;[{ "Type": "Xor", "Operands": ["eax", "dword ptr [ebp+0x08]"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# XOR with other segment overrides
|
|
|
|
# XOR ss:[ebx+0x10], ecx (opcode 0x31 with SS override)
|
2025-04-15 22:20:46 +03:00
|
|
|
36314B10;[{ "Type": "Xor", "Operands": ["dword ptr ss:[ebx+0x10]", "ecx"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# XOR ecx, ds:[ebx+0x10] (opcode 0x33 with DS override)
|
2025-04-15 22:20:46 +03:00
|
|
|
3E334B10;[{ "Type": "Xor", "Operands": ["ecx", "dword ptr ds:[ebx+0x10]"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# XOR ecx, es:[ebx+0x10] (opcode 0x33 with ES override)
|
2025-04-15 22:20:46 +03:00
|
|
|
26334B10;[{ "Type": "Xor", "Operands": ["ecx", "dword ptr es:[ebx+0x10]"] }]
|
2025-04-13 19:55:13 +03:00
|
|
|
|
|
|
|
# XOR ecx, cs:[ebx+0x10] (opcode 0x33 with CS override)
|
2025-04-15 22:20:46 +03:00
|
|
|
2E334B10;[{ "Type": "Xor", "Operands": ["ecx", "dword ptr cs:[ebx+0x10]"] }]
|