Skip to content

Commit

Permalink
Static assert stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
krystalgamer committed Nov 5, 2023
1 parent cac3b52 commit 75c3cf5
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions texture_loader/patches.c
Expand Up @@ -6,7 +6,7 @@
*/

#include "patches.h"
#include "stdint.h"
#include <assert.h>

#define Nop(add, size, reason) if(!NopMemory(add, size, reason)) return FALSE;
#define Set(add, size, buffer, reason) if(!SetMemory(add, size, buffer, reason)) return FALSE;
Expand Down Expand Up @@ -289,16 +289,20 @@ BOOL FrameCounter() {
************************************************/

int* current_frame = (int*)0x006B4CA8;
int* firstFrameUpdater = (int*)0x005FAE98;
int* secondFrameUpdater = (int*)0x0060CFB0;
DWORD* current_frame = (DWORD*)0x006B4CA8;
DWORD* firstFrameUpdater = (DWORD*)0x005FAE98;
DWORD* secondFrameUpdater = (DWORD*)0x0060CFB0;

typedef int (__fastcall *CBody_EveryFrame_t)(int a1);
CBody_EveryFrame_t CBody_EveryFrame_orig = (CBody_EveryFrame_t)0x00460ED0;

int __fastcall CBody_EveryFrame(int a1) {


static_assert(sizeof(int) == 4, "int should be 4b");
static_assert(sizeof(DWORD) == 4, "DWORD should be 4b");
static_assert(sizeof(WORD) == 2, "WORD should be 2b");

WORD val = *(WORD*)(a1 + 70);
if ((val & 4) == 0) {
DWORD v3 = *(DWORD*)(a1 + 124);
Expand Down

0 comments on commit 75c3cf5

Please sign in to comment.