From Telegram
Useful Notes On Data types
With Patches of arm32/64
These notes are made for those people who not much familiar with coding and for those lazy modders that don't dig in depth.
โโโโโโโโโโโโโโโโโโโโโโ
Boolean = 8-bit, C bool
true or false
arm32
mov r0, 1
bx lr
Patch = 0100A0E31EFF2FE1
mov r0, 0
bx lr
Patch = 0000A0E31EFF2FE1
arm64
mov w0, 1
ret
Patch = 20008052C0035FD6
mov w0, 0
ret
Patch = 00008052C0035FD6
โโโโโโโโโโโโโโโโโโโโโโ
Void = type with an empty set of values
arm32
nop
bx lr
Patch = 00F020E31EFF2FE1
arm64
nop
ret
Patch = 1F2003D5C0035FD6
โโโโโโโโโโโโโโโโโโโโโโ
void* pointer = addresses to data or code.
A void* pointer can be converted into any other type of data pointer.
en.cppreference.com
โโโโโโโโโโโโโโโโโโโโโโ
HalfByte = 4-bit (Nibble)
Range = -8 to 7 (signed)
Hexadecimal = 0x7
Decimal = 7
Binary = 111
arm32
mov r0, 7
Patch = 0700A0E3
arm64
mov w0, 7
Patch = E0008052
โโโโโโโโโโโโโโโโโโโโโโ
Byte = 8-bit, C char, Swift Int8
Range = -128 to 127 (signed)
Hexadecimal = 0x7f
Decimal = 127
Binary = 1111111
arm32
mov r0, #127
bx lr
Patch = 7F00A0E31EFF2FE1
Or
movs r0, 0x7f
bx lr
Patch = 7F00B0E31EFF2FE1
arm64
mov w0, 0x7f
ret
Patch = E00F8052C0035FD6
โโโโโโโโโโโโโโโโโโโโโโ
Halfword = 16-bit, C short, Swift Int16
Range = -32,768 to 32,767 (signed)
Hexadecimal = 0x7fff
Decimal = 32767
Binary = 111111111111111
arm32
mov r0, #32767
bx lr
Patch = FF0F07E31EFF2FE1
Or
movt r0, 0x7fff
bx lr
Patch = FF0F47E31EFF2FE1
arm64
mov w0, 0x7fff
ret
Patch = E0FF8F52C0035FD6
โโโโโโโโโโโโโโโโโโโโโโ
Word = 32-bit, C int, Swift Int32
Range = -2,147,483,648 to 2,147,483,647 (signed)
Hexadecimal = 0x7fffffff
Decimal = 2147483647
Binary = 1111111111111111111111111111111
Note: If parameter is larger than 16 bytes then it is passed by address.
For passing this value 0x7fffffff
arm32
mvn r0, #2147483647
bx lr
Patch = 0201A0E31EFF2FE1
Or
movw r0, 0xffff
movt r0, 0x7fff
bx lr
Patch = FF0F0FE3FF0F47E31EFF2FE1
arm64
mov w0, 0xffff
movk w0, 0x7fff, lsl 16
ret
Patch = E0FF9F52E0FFAF72C0035FD6
Or
mov w0, 0x7fffffff
ret
Patch = 0000B012C0035FD6
โโโโโโโโโโโโโโโโโโโโโโ
Doubleword = 64-bit, C long, Swift Int
Range = -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807 (signed)
Hexadecimal = 0x7fffffffffffffff
Decimal = 9223372036854775807
Binary = 111111111111111111111111111111111111111111111111111111111111111
Note: Remember, If parameter is larger than 16 bytes then it is passed by address.
For passing this value 0xffffffff
arm32
mvn r1, #2147483648
bx lr
Patch = 0211E0E31EFF2FE1
Or
movw r0, 0xffff
movt r0, 0xffff
bx lr
Patch = FF0F0FE3FF0F4FE31EFF2FE1
arm64
Note: Use "x" ragister for 64-bit values
For passing this value 0x7fffffffff
mov x0, 0xffff
movk x0, 0xffff, lsl 16
movk x0, 0x7f, lsl 32
ret
Patch = E0FF9FD2E0FFBFF2E00FC0F2C0035FD6
Or
orr x0, xzr, 0x7fffffffff
ret
Patch = E09B40B2C0035FD6