-
Notifications
You must be signed in to change notification settings - Fork 0
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
3 changed files
with
66 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
file(GLOB SourceFiles "*.cpp" "*.asm") | ||
|
||
set(Executable "Fallout4Trainer") | ||
add_executable(${Executable} ${SourceFiles}) | ||
target_precompile_headers(${Executable} REUSE_FROM HackLib) | ||
target_link_libraries(${Executable} LINK_PRIVATE HackLib EntryPoint) |
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,25 @@ | ||
.CODE | ||
|
||
InfAmmoFirearms PROC | ||
mov [rsp + 000001E0h], r13 ; stolen | ||
mov [rsp + 000001A0h], r15 ; stolen | ||
|
||
mov r15, [rbp] ; "loan" * | ||
|
||
cmp r15, 0 | ||
je TheEnd | ||
xor r12, r12 ; r12 will be subtracted from the clip ammo | ||
jmp TheEnd | ||
IsEnemy: | ||
; For some odd reason, this do not seem to have any effect | ||
; on the enemies, even though it should. | ||
; mov r12, 255 | ||
TheEnd: | ||
mov r15, [rsp+000001A0h] ; * put back | ||
|
||
int 3 | ||
int 3 | ||
int 3 | ||
InfAmmoFirearms ENDP | ||
|
||
END |
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,35 @@ | ||
#include "HackLib.hpp" | ||
|
||
extern "C" void InfAmmoFirearms(); | ||
|
||
int IWillNotUseHackLibForEvil(const std::vector<std::string>& givenArguments) | ||
{ | ||
const CommandLine args(givenArguments, | ||
{ | ||
{ "infammo", typeid(std::nullopt), "Infinite ammo" }, | ||
}); | ||
|
||
DWORD pid = System::WaitForWindow(L"Fallout4"); | ||
|
||
Process process(pid); | ||
|
||
if (!process.Verify("55f57947db9e05575122fae1088f0b0247442f11e566b56036caa0ac93329c36")) | ||
{ | ||
LogError << "Expected Fallout 4 (Steam)"; | ||
System::BeepBurst(); | ||
return ERROR_REVISION_MISMATCH; | ||
} | ||
|
||
process.WaitForIdle(); | ||
System::BeepUp(); | ||
|
||
if (args.Contains("infammo")) | ||
{ | ||
auto infAmmo = Process::ReadFunction(InfAmmoFirearms); | ||
process.InjectX64(0xDFD8EC, 2, infAmmo); | ||
} | ||
|
||
process.WairForExit(); | ||
|
||
return 0; | ||
} |