Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add BWGameSpy #20

Merged
merged 1 commit into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions black/BWGameSpy.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef BW1_DECOMP_BW_GAME_SPY_INCLUDED_H
#define BW1_DECOMP_BW_GAME_SPY_INCLUDED_H

#include <assert.h> /* For static_assert */
#include <stdint.h> /* For uint32_t */

#include "LayerCommunication.h" /* For struct LayerCommunication */

struct BWGameSpy
{
struct LayerCommunication super; /* 0x0 */
};

static struct LayerCommunicationVftable* const __vt__9BWGameSpy = (struct LayerCommunicationVftable* const)0x008c705c;

// Override methods

// win1.41 0043e290 mac 105d1460 BWGameSpy::Connect(void)
uint32_t __fastcall Connect__9BWGameSpyFv(struct BWGameSpy* this);

#endif /* BW1_DECOMP_BW_GAME_SPY_INCLUDED_H */
6 changes: 1 addition & 5 deletions black/LayerCommunication.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
#include <assert.h> /* For static_assert */
#include <stdint.h> /* For uint32_t, uintptr_t */

// Forward Declares

struct BWLan;

struct LayerCommunicationVftable
{
uintptr_t SendMessageW; /* 0x0 */
Expand All @@ -20,7 +16,7 @@ struct LayerCommunicationVftable
uintptr_t InitialiseLobbyState;
uintptr_t CreateOrJoinRoom; /* 0x20 */
uintptr_t StartGame;
uint32_t (__fastcall* Connect)(struct BWLan* this);
uint32_t (__fastcall* Connect)(struct LayerCommunicationVftable* this);
uintptr_t Disconnect;
uintptr_t KickPlayerFromChannel; /* 0x30 */
uintptr_t BanPlayerInChannel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.extern _jmp_addr_0x0043f980
.extern _jmp_addr_0x0043ff00
.extern _jmp_addr_0x004401f0
.extern _jmp_addr_0x004404c0
.extern _GetNumPeopleInRoom__9BWGameSpyFv
.extern @__ct__14CameraModeNew3FP7GCamera@12
.extern _jmp_addr_0x00463610
.extern _jmp_addr_0x0047c6b0
Expand Down Expand Up @@ -30653,7 +30653,7 @@ _jmp_addr_0x0043f0cb: add esp, 0x04
{disp32} jmp _jmp_addr_0x0043f1c2 // 0x0043f0e5 e9d8000000
_jmp_addr_0x0043f0ea: mov ecx, 0x00c599fc // 0x0043f0ea b9fc99c500
xor.s esi, esi // 0x0043f0ef 33f6
call _jmp_addr_0x004404c0 // 0x0043f0f1 e8ca130000
call _GetNumPeopleInRoom__9BWGameSpyFv // 0x0043f0f1 e8ca130000
test eax, eax // 0x0043f0f6 85c0
{disp8} jle _jmp_addr_0x0043f130 // 0x0043f0f8 7e36
_jmp_addr_0x0043f0fa: {disp32} mov eax, dword ptr [data_bytes + 0x293a04] // 0x0043f0fa a1049ac500
Expand All @@ -30671,7 +30671,7 @@ _jmp_addr_0x0043f0fa: {disp32} mov eax, dword ptr [data_bytes + 0x293a0
{disp32} je _jmp_addr_0x0043f1a8 // 0x0043f11b 0f8487000000
_jmp_addr_0x0043f121: mov ecx, 0x00c599fc // 0x0043f121 b9fc99c500
inc esi // 0x0043f126 46
call _jmp_addr_0x004404c0 // 0x0043f127 e894130000
call _GetNumPeopleInRoom__9BWGameSpyFv // 0x0043f127 e894130000
cmp.s esi, eax // 0x0043f12c 3bf0
{disp8} jl _jmp_addr_0x0043f0fa // 0x0043f12e 7cca
_jmp_addr_0x0043f130: {disp32} mov al, byte ptr [data_bytes + 0x292370] // 0x0043f130 a07083c500
Expand Down Expand Up @@ -30824,7 +30824,7 @@ _jmp_addr_0x0043f2f0: cmp dword ptr [esp + 0x04], 0x02
{disp8} jne _jmp_addr_0x0043f354 // 0x0043f2f5 755d
mov ecx, 0x00c599fc // 0x0043f2f7 b9fc99c500
{disp32} mov dword ptr [data_bytes + 0x2939f8], 0x00000000 // 0x0043f2fc c705f899c50000000000
call _jmp_addr_0x004404c0 // 0x0043f306 e8b5110000
call _GetNumPeopleInRoom__9BWGameSpyFv // 0x0043f306 e8b5110000
{disp32} mov ecx, dword ptr [data_bytes + 0x35a4e4] // 0x0043f30b 8b0de404d200
inc eax // 0x0043f311 40
{disp32} mov dword ptr [data_bytes + 0x293a14], eax // 0x0043f312 a3149ac500
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
.globl _jmp_addr_0x0043f980
.globl _jmp_addr_0x0043ff00
.globl _jmp_addr_0x004401f0
.globl _jmp_addr_0x004404c0
.globl _GetNumPeopleInRoom__9BWGameSpyFv
.globl _jmp_addr_0x004415e0
.globl _jmp_addr_0x00441700
.globl _jmp_addr_0x00441840
Expand Down Expand Up @@ -1159,7 +1159,8 @@ _jmp_addr_0x004404b5: pop edi
pop ebp // 0x004404b6 5d
add esp, 0x00000808 // 0x004404b7 81c408080000
ret 0x0004 // 0x004404bd c20400
_jmp_addr_0x004404c0: {disp32} mov eax, dword ptr [data_bytes + 0x293a04] // 0x004404c0 a1049ac500

_GetNumPeopleInRoom__9BWGameSpyFv: {disp32} mov eax, dword ptr [data_bytes + 0x293a04] // 0x004404c0 a1049ac500
test eax, eax // 0x004404c5 85c0
{disp8} je _jmp_addr_0x004404da // 0x004404c7 7411
push -0x1 // 0x004404c9 6aff
Expand Down