However you can still move a value/from to those registers in your hacks to store temporarly a value, which can be extremely useful in some cases if you want to avoid loading/writing to the game's memory.The x86 instruction set refers to the set of instructions that x86-compatible microprocessors support. Basically you cannot use those registers directly as they are not part of the 32 first registers. Some of them also uses the hi(high) and lo(low) registers.
Many of them have a signed/unsigned version so make sure you choose the right one depending on your needs. Sa can hold a value from 0x00 to 0x1F inclusively. (Shift Right Logical) SRL shifts rt's bits to the right by sa bits and stores the result in rd.Įxcessive bits will be destroyed. r0 will always be 0x00000000 so you can use it to compare if a value is true or not safely. There are 32 main registers that are directly used by opcodes: r0, r1, r2. Some instructions have the variable form, such as SLLV (Shift Left Logical Variable) which is simply the register version of the SSL (which uses a 5 bit immediate).Ī register is the type of data used by almost all instructions. An immediate is a half-word value that is within the instruction itself and is static. Many instructions have an immediate form, such as addiu (Add Immediate Unsigned) instead of addu (Add Unsigned). Mainly we will work with conditional jumps (branches), jumps, load/write value (from/to memory), and everything else that alters a register’s value. Opcodes will read/write registers depending on what it is supposed to do. Since we started with hexadecimal and binary, we’ll look into the bitwise operands first. Opcodes are the instructions executed by the console’s processor. Of course, the same applies to other variables, except bits.
Remember that the value will only be negative if it exceeds half of its maximum value. You see, while 0x7F is the highest positive value, the value right after which is 0x80 is the lowest negative value.Īn unsigned byte (which is a normal byte) can have values from 0-255 (x00-xFF).Ī signed 0x9B = -101, an unsigned 0x9B = 155 How do we know if a value is signed or not? This all depends on how the value is read/written by opcodes.Ġx7F (maximum positive value of a signed byte) = 127 To search for static data, you can either guess what the data is for, or debug using breakpoints on the data.Ī signed variable can have half of its values positive, and the other half negative. Using the memory editor you scan a first time inputting what you know of the value, change the value in game, and make another search with the known modifications to the value. If you search for static data you’re better off using a simple hex editor. HP of a unit, Max HP of a unit (base max HP calculated, different units, level up, etc.), total gil amount, etc.Ī memory editor will help you finding dynamic data only. You COULD make some opcodes dynamic but this is seriously asking for trouble unless you are a high level hacker, perfectly sure of what you’re doing and know it will use less space (if that is even possible) than conventional coding.Įxamples of static data: the WP of a weapon, the HPM of a job, the coordinates of a move-find item, etc.Ī dynamic value is meant to be changed therefore a new value will overwrite the previous one. All opcodes (which you will see later) are static. While bits and Boolean are stored the exact same way, we use the term Boolean for a value that is either TRUE (1) or FALSE (0) and a bit is simply 1 or 0.Įxample 0x02A7 to decimal (hex is base 16)Ī static value doesn’t change, it is meant to be only loaded. Those nibbles are simply a character from 0 to F. The most commonly used format in hex is a byte.Ī byte is composed of 2 nibbles. You can be sure a number is in hex when it is preceded by 0x, or $ which are commonly used in programming communities: