Skip to content

Commit

Permalink
Add more cheats for Fallout 2
Browse files Browse the repository at this point in the history
  • Loading branch information
visuve committed Mar 24, 2024
1 parent 8b5eb82 commit d623c5f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Fallout2/Fallout2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ int IWillNotUseHackLibForEvil(const std::vector<std::string>& givenArguments)
const CommandLine args(givenArguments,
{
{ "charpoints", typeid(int), "Set character points" },
{ "hitpoints", typeid(int), "Set hitpoints" },
{ "actionpoints", typeid(int), "Set action points" },
{ "skillpoints", typeid(int), "Set skill points" },
{ "money", typeid(int), "Set money" },
{ "godmode", typeid(std::nullopt), "God mode. NOTE: not tested much." },
});

DWORD pid = System::WaitForExe(L"fallout2HR.exe");
Expand All @@ -30,6 +32,12 @@ int IWillNotUseHackLibForEvil(const std::vector<std::string>& givenArguments)
process.Write<int32_t>(0x118538, charpoints);
}

if (args.Contains("hitpoints"))
{
int hitpoints = args.Value<int>("hitpoints");
process.Write<int32_t>(0x11902C, hitpoints);
}

if (args.Contains("actionpoints"))
{
int actionpoints = args.Value<int>("actionpoints");
Expand All @@ -45,7 +53,7 @@ int IWillNotUseHackLibForEvil(const std::vector<std::string>& givenArguments)

if (args.Contains("money"))
{
Pointer moneyPtr = process.ResolvePointer(0x119058, 0x34, 0x1C);
Pointer moneyPtr = process.ResolvePointer(0x11D6E59C, 0x34, 0x1C);

int before = process.Read<int32_t>(moneyPtr);
int after = args.Value<int>("money");
Expand All @@ -54,5 +62,12 @@ int IWillNotUseHackLibForEvil(const std::vector<std::string>& givenArguments)
LogInfo << "Money:" << before << "->" << after;
}

if (args.Contains("godmode"))
{
process.ChangeBytes(0x2D1D1,
ByteStream("89 43 2C"), // mov [ebx+2C], eax
ByteStream("01 7B 2C")); // add [ebx+2X], edi
}

return 0;
}

0 comments on commit d623c5f

Please sign in to comment.