-
Notifications
You must be signed in to change notification settings - Fork 21
Code Types
Cheat Device's engine is borrowed from ps2rd, which closely supports the code types used by CodeBreaker. This page documents each supported code type with any caveats to be aware of.
0aaaaaaa 000000vv
Constantly writes the 8-bit value v to address a.
1aaaaaaa 0000vvvv
Constantly writes the 16-bit value v to address a.
NOTE: a must be short-aligned (a % 2 == 0).
2aaaaaaa vvvvvvvv
Constantly writes the 16-bit value v to address a.
NOTE: a must be word-aligned (a % 4 == 0).
This code has multiple forms:
300000vv 0aaaaaaa
301000vv 0aaaaaaa
3020vvvv 0aaaaaaa
3030vvvv 0aaaaaaa
30400000 0aaaaaaa
vvvvvvvv 00000000
30500000 0aaaaaaa
vvvvvvvv 00000000
Increment or decrement the current value at address a by value v.
4aaaaaaa nnnnssss
vvvvvvvv iiiiiiii
Starting with address a, this code type will write the 32-bit value v to n addreses. In each cycle, the address is incremented by s*4 and the value is incremented by i.
5sssssss nnnnnnnn
0ddddddd 00000000
Copy n bytes from source address s to destination address d.
6aaaaaaa 000000vv
0000nnnn p_0
p_1 p_2
........ ........
p_(n-1) p_n
6aaaaaaa 0000vvvv
0001nnnn p_0
p_1 p_2
........ ........
p_(n-1) p_n
6aaaaaaa vvvvvvvv
0002nnnn p_0
p_1 p_2
........ ........
p_(n-1) p_n
Loads the 32-bit base address from address a, adds offset p_0 to it, and constantly writes the value v to the final address.
Loads the 32-bit base address from address a, adds offset p_0 to it to get an initial pointer address P_0. Dereference P_0 and add p_1 to the result to get the next pointer address P_1. This is done n times until the final address P_n is found, at which point the value v is written to it.
NOTE: Execution of this code type will stop if a NULL pointer is encountered to prevent a crash.
7aaaaaaa 000000vv
7aaaaaaa 0010vvvv
7aaaaaaa 002000vv
7aaaaaaa 0030vvvv
7aaaaaaa 004000vv
7aaaaaaa 0050vvvv
Performs a bitwise logical operation between value v and the value stored at address a.
NOTE: This code type is unique to Cheat Device.
8aaaaaaa nnnnssss
000000vv 000000ii
8aaaaaaa nnnnssss
1000vvvv 0000iiii
Starting with address a, this code type will write the value v to n addresses. In each cycle, the address is incremented by s or s*2 and the value is incremented by i.
Caaaaaaa vvvvvvvv
If the 32-bit value at address a is equal to value v, all subsequent codes will be executed.
Daaaaaaa nnt0vvvv
Daaaaaaa nnt1vvvv
Compares the value at address a to value v, and executes the next n code lines only if the test condition t is true.
t |
Test Condition |
|---|---|
| 0 | == |
| 1 | != |
| 2 | < |
| 3 | > |
| 4 | NAND |
| 5 | AND |
| 6 | NOR |
| 7 | OR |
E0nnvvvv taaaaaaa
E1nnvvvv taaaaaaa
This code-type is equivalent to the D-type and is included for backward compatibility.