use .label/.address in xbox client functions

This commit is contained in:
Martin Michelsen
2025-06-09 10:00:11 -07:00
parent 9bc9e219b5
commit 54acd931da
4 changed files with 34 additions and 20 deletions
+10 -8
View File
@@ -4012,17 +4012,19 @@ struct G_SymbolChat_6x07 {
// 6x08: Invalid subcommand
// 6x09: Unknown
// 6x09: Kill enemy (broken/unused)
// header.entity_id is expected to be an enemy ID, but is also expected to be
// in the range [0x00, 0x80) since it writes to an array of 0x80 entries. This
// duality makes no sense because enemy IDs are greater than or equal to
// 0x1000, so any valid enemy ID would be far outside the array's range, and
// the write is not bounds-checked. For this reason, newserv unconditionally
// blocks this command.
// in the range [0x00, 0x80) since the command handler writes to an array of
// 0x80 entries. This duality is nonsense because enemy IDs are greater than or
// equal to 0x1000, so any valid enemy ID would be far outside the array's
// range. newserv unconditionally blocks this command because it appears never
// to be used, and the array write is not bounds-checked, so it could be used
// to cause undefined behavior on other clients. It seems that this broken
// logic predates even DC NTE.
struct G_Unknown_6x09 {
struct G_LegacyKillEnemy_6x09 {
G_EntityIDHeader header;
} __packed_ws__(G_Unknown_6x09, 4);
} __packed_ws__(G_LegacyKillEnemy_6x09, 4);
// 6x0A: Update enemy state
// In Ultimate mode, the low 6 bits of game_flags are ignored, and 6x9C is used
@@ -14,8 +14,11 @@ start:
.include WriteCodeBlocksXB
.data <VERS 0x00184160 0x00184350 0x00184400 0x00184340 0x00184310 0x00184360 0x001842D0>
.deltaof code_start, code_end
.address <VERS 0x00184160 0x00184350 0x00184400 0x00184340 0x00184310 0x00184360 0x001842D0>
code_start:
mov eax, 0x88888888 # eax = &player_compute_implied_stats (the value is overwritten by the including patch)
.label player_compute_implied_stats, <VERS 0x001FD3D0 0x001FD530 0x001FD7B0 0x001FD5E0 0x001FD5E0 0x001FD600 0x001FD670>
lea edx, [ecx + 0x78]
cmp byte [edx + 0x76], 11 # this->data1[2] (item+0xEE) ?= 0x0B
jne skip_all
@@ -43,7 +46,7 @@ next_stat:
jne next_stat
mov ecx, ebx
call eax # player_compute_implied_stats
call player_compute_implied_stats
lea ecx, [ebx + 0x0330]
@@ -62,8 +65,5 @@ skip_all:
ret
code_end:
.data <VERS 0x00184161 0x00184351 0x00184401 0x00184341 0x00184311 0x00184361 0x001842D1>
.data 0x00000004
.data <VERS 0x001FD3D0 0x001FD530 0x001FD7B0 0x001FD5E0 0x001FD5E0 0x001FD600 0x001FD670>
.data 0x00000000
.data 0x00000000
@@ -11,7 +11,8 @@ start:
.data <VERS 0x002C0AEE 0x002C167E 0x002C2BEE 0x002C272E 0x002C291E 0x002C275E 0x002C2A7E>
.data 0x00000004
.binary 31C9EB03
xor ecx, ecx
jmp +3
.data 0x00000000
.data 0x00000000
@@ -15,12 +15,14 @@ start:
.data <VERS 0x001737C2 0x001737D2 0x00173692 0x00173782 0x00173862 0x001737E2 0x00173792> # From 3OE1:80100B8C
.deltaof p1_1s, p1_1e
.address <VERS 0x001737C2 0x001737D2 0x00173692 0x00173782 0x00173862 0x001737E2 0x00173792> # From 3OE1:80100B8C
p1_1s:
.binary E87B020000 # call p1_2s
call p1_2s
nop
p1_1e:
.data <VERS 0x00173A42 0x00173A52 0x00173912 0x00173A02 0x00173AE2 0x00173A62 0x00173A12>
.deltaof p1_2s, p1_2e
.address <VERS 0x00173A42 0x00173A52 0x00173912 0x00173A02 0x00173AE2 0x00173A62 0x00173A12>
p1_2s:
fld st0, dword [esp + 0x1C]
fadd st0, st0
@@ -30,11 +32,13 @@ p1_2e:
.data <VERS 0x001A3DEF 0x001A3EEF 0x001A3BBF 0x001A3DBF 0x001A3FDF 0x001A3E0F 0x001A3ECF> # From 3OE1:80156AD8
.deltaof p2_1s, p2_1e
.address <VERS 0x001A3DEF 0x001A3EEF 0x001A3BBF 0x001A3DBF 0x001A3FDF 0x001A3E0F 0x001A3ECF> # From 3OE1:80156AD8
p2_1s:
.binary E844000000 # call p2_2s
call p2_2s
p2_1e:
.data <VERS 0x001A3E38 0x001A3F38 0x001A3C08 0x001A3E08 0x001A4028 0x001A3E58 0x001A3F18>
.deltaof p2_2s, p2_2e
.address <VERS 0x001A3E38 0x001A3F38 0x001A3C08 0x001A3E08 0x001A4028 0x001A3E58 0x001A3F18>
p2_2s:
fld st0, dword [ecx + 0x1C]
fadd st0, st0
@@ -44,12 +48,14 @@ p2_2e:
.data <VERS 0x002D2DC8 0x002D3148 0x002D0E68 0x002D1A28 0x002D32F8 0x002D2DF8 0x002D31C8> # From 3OE1:801A2040
.deltaof p3_1s, p3_1e
.address <VERS 0x002D2DC8 0x002D3148 0x002D0E68 0x002D1A28 0x002D32F8 0x002D2DF8 0x002D31C8> # From 3OE1:801A2040
p3_1s:
.binary E8DA000000 # call p3_2s
call p3_2s
nop
p3_1e:
.data <VERS 0x002D2EA7 0x002D3227 0x002D0F47 0x002D1B07 0x002D33D7 0x002D2ED7 0x002D32A7>
.deltaof p3_2s, p3_2e
.address <VERS 0x002D2EA7 0x002D3227 0x002D0F47 0x002D1B07 0x002D33D7 0x002D2ED7 0x002D32A7>
p3_2s:
fld st0, dword [esp + 0x24]
fadd st0, st0
@@ -59,12 +65,14 @@ p3_2e:
.data <VERS 0x00156AC8 0x002D32A8 0x001569E8 0x00156A78 0x00156AB8 0x00156AE8 0x002D3328> # From 3OE1:801A2240
.deltaof p4_1s, p4_1e
.address <VERS 0x00156AC8 0x002D32A8 0x001569E8 0x00156A78 0x00156AB8 0x00156AE8 0x002D3328> # From 3OE1:801A2240
p4_1s:
.binary <VERS E877010000 E807010000 E877010000 E877010000 E877010000 E877010000 E807010000> # call p4_2s
call p4_2s
nop
p4_1e:
.data <VERS 0x00156C44 0x002D33B4 0x00156B64 0x00156BF4 0x00156C34 0x00156C64 0x002D3434>
.deltaof p4_2s, p4_2e
.address <VERS 0x00156C44 0x002D33B4 0x00156B64 0x00156BF4 0x00156C34 0x00156C64 0x002D3434>
p4_2s:
fld st0, dword [esp + 0x28]
fadd st0, st0
@@ -74,16 +82,19 @@ p4_2e:
.data <VERS 0x002E2B93 0x002E2E8C 0x002E0C33 0x002E17B3 0x002E2E6C 0x002E2BC3 0x002E2EBC> # From 3OE1:80205840
.deltaof p5_1s, p5_1e
.address <VERS 0x002E2B93 0x002E2E8C 0x002E0C33 0x002E17B3 0x002E2E6C 0x002E2BC3 0x002E2EBC> # From 3OE1:80205840
p5_1s:
.binary <VERS E8EA000000 E840010000 E8EA000000 E8EA000000 E840010000 E8EA000000 E840010000> # call p5_3s
call p5_3s
p5_1e:
.data <VERS 0x002E1FD1 0x002E2404 0x002E0071 0x002E0BF1 0x002E23E4 0x002E2001 0x002E2434> # From 3OE1:80205FE4
.deltaof p5_2s, p5_2e
.address <VERS 0x002E1FD1 0x002E2404 0x002E0071 0x002E0BF1 0x002E23E4 0x002E2001 0x002E2434> # From 3OE1:80205FE4
p5_2s:
.binary <VERS E8AC0C0000 E8C80B0000 E8AC0C0000 E8AC0C0000 E8C80B0000 E8AC0C0000 E8C80B0000> # call p5_3s
call p5_3s
p5_2e:
.data <VERS 0x002E2C82 0x002E2FD1 0x002E0D22 0x002E18A2 0x002E2FB1 0x002E2CB2 0x002E3001>
.deltaof p5_3s, p5_3e
.address <VERS 0x002E2C82 0x002E2FD1 0x002E0D22 0x002E18A2 0x002E2FB1 0x002E2CB2 0x002E3001>
p5_3s:
fld st0, dword [eax + 0x0C]
fadd st0, st0