add item pickup patch

This commit is contained in:
Martin Michelsen
2024-12-07 17:29:10 -08:00
parent 3424d6481b
commit 4b3dcbb6f4
28 changed files with 656 additions and 20 deletions
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the Z button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksGC
.data 0x8000B938
.data 0x00000020
.data 0x387C0550
.data 0x38800100
.data 0x4834428D
.data 0x2C030000
.data 0x4182000C
.data 0x7F83E378
.data 0x481AA150
.data 0x481AA15C
.data 0x801B5A9C
.data 0x00000004
.data 0x4BE55E9C
.data 0x8024CC0C
.data 0x00000004
.data 0x38800008
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the Z button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksGC
.data 0x8000B938
.data 0x00000020
.data 0x387C0550
.data 0x38800100
.data 0x483442D1
.data 0x2C030000
.data 0x4182000C
.data 0x7F83E378
.data 0x481AA150
.data 0x481AA15C
.data 0x801B5A9C
.data 0x00000004
.data 0x4BE55E9C
.data 0x8024CC0C
.data 0x00000004
.data 0x38800008
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the Z button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksGC
.data 0x8000B938
.data 0x00000020
.data 0x387C0550
.data 0x38800100
.data 0x48345EB9
.data 0x2C030000
.data 0x4182000C
.data 0x7F83E378
.data 0x481AA2E8
.data 0x481AA2F4
.data 0x801B5C34
.data 0x00000004
.data 0x4BE55D04
.data 0x8024DD88
.data 0x00000004
.data 0x38800008
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the Z button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksGC
.data 0x8000B938
.data 0x00000020
.data 0x387C0550
.data 0x38800100
.data 0x483433D9
.data 0x2C030000
.data 0x4182000C
.data 0x7F83E378
.data 0x481A9D64
.data 0x481A9D70
.data 0x801B56B0
.data 0x00000004
.data 0x4BE56288
.data 0x8024C384
.data 0x00000004
.data 0x38800008
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the Z button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksGC
.data 0x8000B938
.data 0x00000020
.data 0x387C0550
.data 0x38800100
.data 0x483447DD
.data 0x2C030000
.data 0x4182000C
.data 0x7F83E378
.data 0x481AA1B8
.data 0x481AA1C4
.data 0x801B5B04
.data 0x00000004
.data 0x4BE55E34
.data 0x8024CDD0
.data 0x00000004
.data 0x38800008
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the Z button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksGC
.data 0x8000B938
.data 0x00000020
.data 0x387C0550
.data 0x38800100
.data 0x48345D45
.data 0x2C030000
.data 0x4182000C
.data 0x7F83E378
.data 0x481AC370
.data 0x481AC37C
.data 0x801B7CBC
.data 0x00000004
.data 0x4BE53C7C
.data 0x8024DD28
.data 0x00000004
.data 0x38800008
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the Z button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksGC
.data 0x8000B938
.data 0x00000020
.data 0x387C0550
.data 0x38800100
.data 0x48345AED
.data 0x2C030000
.data 0x4182000C
.data 0x7F83E378
.data 0x481AA284
.data 0x481AA290
.data 0x801B5BD0
.data 0x00000004
.data 0x4BE55D68
.data 0x8024DAC4
.data 0x00000004
.data 0x38800008
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the Z button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksGC
.data 0x8000B938
.data 0x00000020
.data 0x387C0550
.data 0x38800100
.data 0x483452AD
.data 0x2C030000
.data 0x4182000C
.data 0x7F83E378
.data 0x481AA7A4
.data 0x481AA7B0
.data 0x801B60F0
.data 0x00000004
.data 0x4BE55848
.data 0x8024D5D0
.data 0x00000004
.data 0x38800008
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the white or\nblack button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
# Xbox port by fuzziqersoftware
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
.data 0x001FDC99
.data 0x07
.binary E8880100009090
.data 0x001FDE26
.data 0x0A
.binary 8B866C05000085C0EB46
.data 0x001FDE76
.data 0x09
.binary 74038A40013408EB46
.data 0x001FDEC5
.data 0x0A
.binary 7507F68624030000E0C3
.data 0x0025ADAD
.data 0x01
.binary 00
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the white or\nblack button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
# Xbox port by fuzziqersoftware
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
.data 0x001FDC99
.data 0x07
.binary E8880100009090
.data 0x001FDE26
.data 0x0A
.binary 8B866C05000085C0EB46
.data 0x001FDE76
.data 0x09
.binary 74038A40013408EB46
.data 0x001FDEC5
.data 0x0A
.binary 7507F68624030000E0C3
.data 0x0025AEED
.data 0x01
.binary 00
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the white or\nblack button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
# Xbox port by fuzziqersoftware
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
.data 0x001FDA89
.data 0x07
.binary E8880100009090
.data 0x001FDC16
.data 0x0A
.binary 8B866C05000085C0EB46
.data 0x001FDC66
.data 0x09
.binary 74038A40013408EB46
.data 0x001FDCB5
.data 0x0A
.binary 7507F68624030000E0C3
.data 0x0025A94D
.data 0x01
.binary 00
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the white or\nblack button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
# Xbox port by fuzziqersoftware
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
.data 0x001FDBE9
.data 0x07
.binary E8880100009090
.data 0x001FDD76
.data 0x0A
.binary 8B866C05000085C0EB46
.data 0x001FDDC6
.data 0x09
.binary 74038A40013408EB46
.data 0x001FDE15
.data 0x0A
.binary 7507F68624030000E0C3
.data 0x0025ACCD
.data 0x01
.binary 00
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the white or\nblack button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
# Xbox port by fuzziqersoftware
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
.data 0x001FDE69
.data 0x07
.binary E8880100009090
.data 0x001FDFF6
.data 0x0A
.binary 8B866C05000085C0EB46
.data 0x001FE046
.data 0x09
.binary 74038A40013408EB46
.data 0x001FE095
.data 0x0A
.binary 7507F68624030000E0C3
.data 0x0025B07D
.data 0x01
.binary 00
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the white or\nblack button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
# Xbox port by fuzziqersoftware
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
.data 0x001FDCB9
.data 0x07
.binary E8880100009090
.data 0x001FDE46
.data 0x0A
.binary 8B866C05000085C0EB46
.data 0x001FDE96
.data 0x09
.binary 74038A40013408EB46
.data 0x001FDEE5
.data 0x0A
.binary 7507F68624030000E0C3
.data 0x0025ADCD
.data 0x01
.binary 00
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,29 @@
.meta name="Item pickup"
.meta description="Prevents picking\nup items unless you\nhold the white or\nblack button"
# Original code by Ralf @ GC-Forever
# https://www.gc-forever.com/forums/viewtopic.php?t=2050
# https://www.gc-forever.com/forums/viewtopic.php?t=2049
# Xbox port by fuzziqersoftware
entry_ptr:
reloc0:
.offsetof start
start:
.include WriteCodeBlocksXB
.data 0x001FDD29
.data 0x07
.binary E8880100009090
.data 0x001FDEB6
.data 0x0A
.binary 8B866C05000085C0EB46
.data 0x001FDF06
.data 0x09
.binary 74038A40013408EB46
.data 0x001FDF55
.data 0x0A
.binary 7507F68624030000E0C3
.data 0x0025AF1D
.data 0x01
.binary 00
.data 0x00000000
.data 0x00000000
@@ -0,0 +1,13 @@
entry_ptr:
reloc0:
.offsetof start
start:
mova r0, [address]
mov.l r0, [r0]
rets
mov.l r0, [r0]
.align 4
address:
.data 0
@@ -0,0 +1,13 @@
entry_ptr:
reloc0:
.offsetof start
start:
call resume
address:
.data 0
resume:
pop eax
mov eax, [eax]
mov eax, [eax]
ret
@@ -0,0 +1,33 @@
.meta name="Write memory"
.meta description="Writes data to any location in memory"
entry_ptr:
reloc0:
.offsetof start
start:
mova r0, [dest_addr]
mov r4, r0
mov.l r0, [r4]
mov.l r5, [r4 + 4]
add r4, 8
again:
test r5, r5
bt done
mov.b r6, [r4]
mov.b [r0], r6
add r4, 1
add r0, 1
bs again
add r5, -1
done:
rets
nop
.align 4
dest_addr:
.data 0
size:
.data 0
data_to_write:
@@ -3,7 +3,7 @@
# This is also the file I've chosen to document how to write code for newserv's
# functions subsystem. There are three kinds of functions: includes, patches,
# and general functions. This file, WriteMemory, is a general function. It
# and general functions. This file, WriteMemoryGC, is a general function. It
# writes a variable-length block of data to a specified address in the client's
# memory.
@@ -28,7 +28,7 @@
# For example, to use this function to write the bytes 38 00 00 05 to the
# address 8010521C, send_function_call could be called like this:
# auto fn = s->function_code_index->name_to_function.at("WriteMemory");
# auto fn = s->function_code_index->name_to_function.at("WriteMemoryGC");
# unordered_map<string, uint32_t> label_writes(
# {{"dest_addr", 0x8010521C}, {"size", 4}});
# string suffix("\x38\x00\x00\x05", 4);
@@ -52,8 +52,8 @@
# when sending the B2 command. This is needed if the server needs to do
# something when the B3 response is received. If specified, the index must be in
# the range 01-FF. The DOL loading functionality, which this function is a part
# of, uses indexes E0, E1, and E2, but the WriteMemory function can also be used
# for other purposes.
# of, uses indexes E0, E1, and E2, but the WriteMemoryGC function can also be
# used for other purposes.
.meta index=E1
# To hide a patch from the Patches menu (so it can only be used with the $patch
@@ -0,0 +1,37 @@
.meta name="Write memory"
.meta description="Writes data to any location in memory"
entry_ptr:
reloc0:
.offsetof start
start:
jmp get_block_ptr
get_block_ptr_ret:
xchg ebx, [esp]
mov eax, [ebx]
mov ecx, [ebx + 4]
add ebx, 8
again:
test ecx, ecx
jz done
mov dl, [ebx]
mov [eax], dl
inc ebx
inc eax
dec ecx
jmp again
done:
pop ebx
ret
get_block_ptr:
call get_block_ptr_ret
dest_addr:
.data 0
size:
.data 0
data_to_write: