Fix Compile

This commit is contained in:
TheBrokenRail 2020-10-02 20:07:08 -04:00
parent e5d1a0578c
commit 7b37b46e9b
2 changed files with 3 additions and 3 deletions

View File

@ -68,6 +68,7 @@ void patch(void *start, unsigned char patch[]) {
}
void patch_address(void *start, void *target) {
unsigned char patch_data[4] = {target & 0xff, (target >> 8) & 0xff, (target >> 16) & 0xff, (target >> 24) & 0xff};
uint32_t addr = (uint32_t) target;
unsigned char patch_data[4] = {addr & 0xff, (addr >> 8) & 0xff, (addr >> 16) & 0xff, (addr >> 24) & 0xff};
patch(start, patch_data);
}

View File

@ -82,7 +82,6 @@ static int has_feature(const char *name) {
// Defined In extra.cpp
extern unsigned char *readAssetFile(unsigned char *app_platform, unsigned char *path);
extern void openTextEdit(unsigned char *local_player, unsigned char *sign);
// Patch Game Mode
static void set_is_survival(int new_is_survival) {
@ -185,5 +184,5 @@ __attribute__((constructor)) static void init() {
// Change Username
const char *username = get_username();
patch_address((void *) 0x18fd4, username);
patch_address((void *) 0x18fd4, (void *) username);
}