adjust RakPeer_GetTime

This commit is contained in:
yugecin 2020-04-04 19:38:30 +02:00
parent 3a3b4ab7e2
commit ca282b3258
No known key found for this signature in database
GPG Key ID: BB3591E3D68964DE
4 changed files with 28 additions and 10 deletions

View File

@ -1,6 +1,22 @@
/* vim: set filetype=c ts=8 noexpandtab: */
#define NULL 0
#define _CRT_SECURE_NO_DEPRECATE
#define STATIC_ASSERT(E) typedef char __static_assert_[(E)?1:-1]
#define EXPECT_SIZE(S,SIZE) STATIC_ASSERT(sizeof(S)==(SIZE))
#pragma pack(push, 1)
struct PlayerID {
int binaryAddress;
short port;
short __pad;
};
EXPECT_SIZE(struct PlayerID, 0x8);
struct CRaknetTimeNS {
int lo32;
int hi32;
};
EXPECT_SIZE(struct CRaknetTimeNS, 0x8);
#pragma pack(pop)

View File

@ -89,11 +89,10 @@ int __declspec(naked) RakPeer__OnConnectionRequest(
}
}
static
unsigned int __declspec(naked) RakPeer__GetTime(struct CRakPeer *this)
__declspec(naked)
unsigned int __stdcall RakPeer__GetTime()
{
_asm {
mov ecx, [esp+0x4] /*this*/
mov eax, 0x44E9D0
jmp eax
}
@ -209,7 +208,8 @@ sendimmediateresponse:
playerId,
0,
0,
RakPeer__GetTime(this)
RakPeer__GetTime(),
0
);
remoteSystem->connectMode = DISCONNECT_ASAP_SILENTLY;
ret:

View File

@ -34,12 +34,6 @@
#define UNRELIABLE 0xB
#pragma pack(push,1)
struct PlayerID {
int binaryAddress;
short port;
short __pad;
};
EXPECT_SIZE(struct PlayerID, 0x8);
struct CRemoteSystem {
char _pad0[0x10-0x0];
@ -86,6 +80,11 @@ struct CRakPeer {
};
#pragma pack(pop)
/**
Only seems to fetch lo32
*/
unsigned int __stdcall RakPeer__GetTime();
int __stdcall RakPeer__GetIndexFromPlayerID(
struct CRakPeer *this,
struct PlayerID playerId,

View File

@ -1,6 +1,9 @@
/* vim: set filetype=c ts=8 noexpandtab: */
/**
1 when handled (ptrOutIsPacketFlood might be 1), 0 when invalid
*/
int __stdcall ReliabilityLayer__HandleSocketReceiveFromConnectedPlayer(
struct CReliabilityLayer *this,
char *buffer,