-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
819 additions
and
1,420 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// Created by squ1dd13 on 11/01/2021. | ||
// | ||
|
||
#include "hook/Func.h" | ||
#include "user/Touch.h" | ||
#include "scripts/Manager.h" | ||
#include "bridge/Memory.h" | ||
#include "Logging.h" | ||
|
||
functionhook GameLoadHook { | ||
void Original(const char *); | ||
|
||
// FIXME: Probably runs again when the player loads up another game. | ||
void Body(const char *datPath) { | ||
Original(datPath); | ||
|
||
Touch::interceptTouches = true; | ||
Scripts::Manager::Init(); | ||
} | ||
|
||
HookSave(0x100240178) | ||
} | ||
|
||
Constructor { | ||
Log("ASLR slide is 0x%llx (%llu decimal)", Memory::AslrSlide(), Memory::AslrSlide()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#pragma once | ||
|
||
#include "Types.h" | ||
#include <mach-o/dyld.h> | ||
|
||
namespace Memory { | ||
inline uint64 AslrSlide() { | ||
static auto slide = _dyld_get_image_vmaddr_slide(0); | ||
return (uint64)slide; | ||
} | ||
|
||
// Offset pointer by ASLR slide (and also cast the result). | ||
template <typename OutType, typename InType> | ||
inline OutType Slid(InType inValue) { | ||
return OutType(uint64(inValue) + AslrSlide()); | ||
} | ||
|
||
// Offset pointer by ASLR slide, cast it and dereference it. | ||
template <typename OutType, typename InType> | ||
inline OutType Fetch(InType addr) { | ||
return *(OutType *)(Slid<void *>(addr)); | ||
} | ||
|
||
template <typename Return = void, typename... Args> | ||
inline Return Call(uint64 address, Args... args) { | ||
return Memory::Slid<Return (*)(Args...)>(address)(args...); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.