Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
update to GTAV-1.54
Browse files Browse the repository at this point in the history
  • Loading branch information
AmazingPP committed Mar 29, 2021
1 parent cc2526c commit eede685
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 55 deletions.
78 changes: 39 additions & 39 deletions subVersion/hack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,13 @@ void hack::getWaypoint()

void hack::getObjective()
{
static int ColorYellowMission = 66;
static int ColorYellow = 5;
static int ColorWhite = 0;
static int ColorGreen = 2;
static int SpriteCrateDrop = 306;
static int SpriteStandard = 1;
static int SpriteRaceFinish = 38;
constexpr static int ColorYellowMission = 66;
constexpr static int ColorYellow = 5;
constexpr static int ColorWhite = 0;
constexpr static int ColorGreen = 2;
constexpr static int SpriteCrateDrop = 306;
constexpr static int SpriteStandard = 1;
constexpr static int SpriteRaceFinish = 38;

DWORD_PTR a = (DWORD_PTR)m_hModule + ADDRESS_BLIP;
for (size_t i = 2000; i > 1; i--)
Expand Down Expand Up @@ -1041,7 +1041,7 @@ void hack::unlockClothes()

void hack::intoPV()
{
if (scriptGlobal(2540384).at(298).as<int>() != -1)
if (scriptGlobal(GLOBAL_MERRYWEATHER).at(298).as<int>() != -1)
scriptGlobal(2409291).at(8).as<int>() = 1;
}

Expand Down Expand Up @@ -1181,7 +1181,7 @@ void hack::callMerryweather(std::ptrdiff_t index)

int hack::getPlayerId()
{
return scriptGlobal(2440049).as<int>().value();
return scriptGlobal(2440277).as<int>().value();
}

int hack::getNetworkTime()
Expand All @@ -1191,22 +1191,22 @@ int hack::getNetworkTime()

void hack::setCasinoHeistCut(int playerIndex, int cut)
{
scriptGlobal(1701666).at(getPlayerId(), 68).at(12).at(1).at(playerIndex).as<int>() = cut;
scriptGlobal(1701669).at(getPlayerId(), 68).at(12).at(1).at(playerIndex).as<int>() = cut;
}

int hack::getCasinoHeistCut(int playerIndex)
{
return scriptGlobal(1701666).at(getPlayerId(), 68).at(12).at(1).at(playerIndex).as<int>().value();
return scriptGlobal(1701669).at(getPlayerId(), 68).at(12).at(1).at(playerIndex).as<int>().value();
}

void hack::createAmbientPickup(unsigned int pickupHash, float posX, float posY, float posZ, int value, unsigned int modelHash)
{
scriptGlobal(2515202).at(1).as<int>() = value;
scriptGlobal(2515202).at(3).as<float>() = posX;
scriptGlobal(2515202).at(4).as<float>() = posY;
scriptGlobal(2515202).at(5).as<float>() = posZ;
scriptGlobal(4264051).at(scriptGlobal(2515202).as<int>().value(), 85).at(66).at(2).as<int>() = 2;
scriptGlobal(2515208).as<int>() = 1;
scriptGlobal(2515430).at(1).as<int>() = value;
scriptGlobal(2515430).at(3).as<float>() = posX;
scriptGlobal(2515430).at(4).as<float>() = posY;
scriptGlobal(2515430).at(5).as<float>() = posZ;
scriptGlobal(4264051).at(scriptGlobal(2515430).as<int>().value(), 85).at(66).at(2).as<int>() = 2;
scriptGlobal(2515436).as<int>() = 1;

m_unkModel.getModelHash();
if (m_unkModel.m_dwModelHash != modelHash)
Expand Down Expand Up @@ -1282,7 +1282,7 @@ void hack::consumeStatQueue()
{
g_pD3D9Render->m_bMBShowing = false;
}
Sleep(1);
Sleep(500);
}
});
tConsumeStatQueue.detach();
Expand Down Expand Up @@ -1709,15 +1709,15 @@ void hack::godMode(feat* feature)

void hack::frameFlags(feat* featSuperJump, feat* featExplosiveMelee, feat* featFireAmmo, feat* featExplosiveAmmo)
{
BYTE cur[2] = {};
BYTE cur[5] = {};
if (!featSuperJump->m_bOn && !featExplosiveMelee->m_bOn && !featFireAmmo->m_bOn && !featExplosiveAmmo->m_bOn)
{
if (!featSuperJump->m_bRestored || !featExplosiveMelee->m_bRestored || !featFireAmmo->m_bRestored || !featExplosiveAmmo->m_bRestored)
{
g_pMemMan->readMem<BYTE>((DWORD_PTR)m_hModule + ADDRESS_FRAME_FLAGS, cur, sizeof(BYTE) * 2, PAGE_EXECUTE_READWRITE);
BYTE value[2] = { 0x89, 0x0B };
g_pMemMan->readMem<BYTE>((DWORD_PTR)m_hModule + ADDRESS_FRAME_FLAGS, cur, sizeof(cur), PAGE_EXECUTE_READWRITE);
BYTE value[5] = { 0xE8, 0x90, 0x7B, 0xF3, 0xFF };
if (cur[0] != value[0])
g_pMemMan->writeMem<BYTE>((DWORD_PTR)m_hModule + ADDRESS_FRAME_FLAGS, value, sizeof(BYTE) * 2, PAGE_EXECUTE_READWRITE);
g_pMemMan->writeMem<BYTE>((DWORD_PTR)m_hModule + ADDRESS_FRAME_FLAGS, value, sizeof(value), PAGE_EXECUTE_READWRITE);

featSuperJump->m_bRestored = true;
featExplosiveMelee->m_bRestored = true;
Expand All @@ -1736,10 +1736,10 @@ void hack::frameFlags(feat* featSuperJump, feat* featExplosiveMelee, feat* featF
if (featExplosiveAmmo->m_bOn)
dwValue += 8;

g_pMemMan->readMem<BYTE>((DWORD_PTR)m_hModule + ADDRESS_FRAME_FLAGS, cur, sizeof(BYTE) * 2, PAGE_EXECUTE_READWRITE);
BYTE value[2] = { 0x90, 0x90 };
g_pMemMan->readMem<BYTE>((DWORD_PTR)m_hModule + ADDRESS_FRAME_FLAGS, cur, sizeof(cur), PAGE_EXECUTE_READWRITE);
BYTE value[5] = { 0x90, 0x90, 0x90, 0x90, 0x90 };
if (cur[0] != value[0])
g_pMemMan->writeMem<BYTE>((DWORD_PTR)m_hModule + ADDRESS_FRAME_FLAGS, value, sizeof(BYTE) * 2, PAGE_EXECUTE_READWRITE);
g_pMemMan->writeMem<BYTE>((DWORD_PTR)m_hModule + ADDRESS_FRAME_FLAGS, value, sizeof(value), PAGE_EXECUTE_READWRITE);
m_player.getFrameFlags();
if (m_player.m_dwFrameFlags != dwValue)
m_player.setFrameFlags(dwValue);
Expand Down Expand Up @@ -2352,8 +2352,8 @@ void hack::removeSuicideCooldown(feat* feature)
}
return;
}
if (scriptGlobal(2540384).at(6672).as<int>() != -1)
scriptGlobal(2540384).at(6672).as<int>() = -1;
if (scriptGlobal(GLOBAL_MERRYWEATHER).at(6672).as<int>() != -1)
scriptGlobal(GLOBAL_MERRYWEATHER).at(6672).as<int>() = -1;

return;
}
Expand All @@ -2368,8 +2368,8 @@ void hack::removePassiveModeCooldown(feat* feature)
}
return;
}
if (scriptGlobal(2540384).at(4456).as<int>() != 0)
scriptGlobal(2540384).at(4456).as<int>() = 0;
if (scriptGlobal(GLOBAL_MERRYWEATHER).at(4456).as<int>() != 0)
scriptGlobal(GLOBAL_MERRYWEATHER).at(4456).as<int>() = 0;
if (scriptGlobal(1697106).as<int>() != 0)
scriptGlobal(1697106).as<int>() = 0;

Expand All @@ -2382,13 +2382,13 @@ void hack::allowSellOnNonPublic(feat* feature)
{
if (!feature->m_bRestored)
{
scriptGlobal(2451787).at(742).as<int>() = 1;
scriptGlobal(2452015).at(742).as<int>() = 1;
feature->m_bRestored = true;
}
return;
}
if (scriptGlobal(2451787).at(742).as<int>() != 0)
scriptGlobal(2451787).at(742).as<int>() = 0;
if (scriptGlobal(2452015).at(742).as<int>() != 0)
scriptGlobal(2452015).at(742).as<int>() = 0;

return;
}
Expand All @@ -2399,13 +2399,13 @@ void hack::instantBullShark(feat* feature)
{
if (!feature->m_bRestored)
{
scriptGlobal(2440049).at(4006).as<int>() = 5;
scriptGlobal(2440277).at(4006).as<int>() = 5;
feature->m_bRestored = true;
}
return;
}
if (scriptGlobal(2440049).at(4006).as<int>() == 0)
scriptGlobal(2440049).at(4006).as<int>() = 5;
if (scriptGlobal(2440277).at(4006).as<int>() == 0)
scriptGlobal(2440277).at(4006).as<int>() = 5;

return;
}
Expand Down Expand Up @@ -2451,15 +2451,15 @@ void hack::offRadar(feat* feature)
{
if (!feature->m_bRestored)
{
scriptGlobal(2425869).at(getPlayerId(), 443).at(204).as<int>() = 0;
scriptGlobal(2426097).at(getPlayerId(), 443).at(204).as<int>() = 0;
feature->m_bRestored = true;
}
return;
}
if (scriptGlobal(2425869).at(getPlayerId(), 443).at(204).as<int>() == 0)
if (scriptGlobal(2426097).at(getPlayerId(), 443).at(204).as<int>() == 0)
{
scriptGlobal(2425869).at(getPlayerId(), 443).at(204).as<int>() = 1;
scriptGlobal(2440049).at(70).as<int>() = getNetworkTime();
scriptGlobal(2426097).at(getPlayerId(), 443).at(204).as<int>() = 1;
scriptGlobal(2440277).at(70).as<int>() = getNetworkTime();
}

return;
Expand Down
4 changes: 2 additions & 2 deletions subVersion/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ int __stdcall WinMain( HINSTANCE hInstance,
g_pHack = new hack;

LPCSTR szWindowTitleTarget = "Grand Theft Auto V";
LPCWSTR szWindowTitle = L"subVersion mAsk°重制版 v1.3.5.2";
LPCWSTR szWindowTitle = L"subVersion mAsk°重制版 v1.3.6";
g_pMemMan->setWindowName(szWindowTitleTarget);
g_pD3D9Render->m_szWindowTitle = szWindowTitle;

Expand Down Expand Up @@ -643,7 +643,7 @@ DWORD __stdcall threadHack(LPVOID lpParam)
g_pHack->consumeStatQueue();
}
}
Sleep(10);
Sleep(100);
}
g_bKillHack = true;
return 0;
Expand Down
4 changes: 2 additions & 2 deletions subVersion/memManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ void memManager::initPtr()
ADDRESS_UNK_MODEL = rip(offset);
});

patternMain.add("Frame flags zero writer dec code", "89 0B 48 8B 7B 10 32 D2 EB 19 39 0F 74 11 84 D2 75 09 8B 17 E8 47 C8 FF FF", [](uintptr_t offset)
patternMain.add("Frame flags zero writer dec code", "48 81 C1 ? ? ? ? E8 ? ? ? ? 48 8B 5C 24 ? 0F 28 74 24 ?", [](uintptr_t offset)
{
ADDRESS_FRAME_FLAGS = offset;
ADDRESS_FRAME_FLAGS = offset + 0x7;
});

patternMain.run();
Expand Down
3 changes: 3 additions & 0 deletions subVersion/settings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,6 @@ disableThePhone=0
SuicideCD=0
triggerBot=0
waterProof=0
forceOnPed=0
forceOnVeh=0
forceOnHeli=0
22 changes: 10 additions & 12 deletions subVersion/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,20 @@
#define OFFSET_PLAYER_VEHICLE 0xD30 //ptr to last used vehicle
#define OFFSET_NET_PLAYER_INFO 0xB0
#define OFFSET_PLAYER_INFO 0x10C8 //playerInfo struct
#define OFFSET_PLAYER_INFO_NAME 0x84
#define OFFSET_PLAYER_INFO_SWIM_SPD 0x150 //swim speed; def 1; float
#define OFFSET_PLAYER_INFO_RUN_SPD 0xCD0 //run speed; def 1; float
#define OFFSET_PLAYER_INFO_FRAMEFLAGS 0x1F9 //frame flags; DWORD
#define OFFSET_PLAYER_INFO_WANTED_CAN_CHANGE 0x71C //fWantedCanChange
#define OFFSET_PLAYER_INFO_NAME 0xA4
#define OFFSET_PLAYER_INFO_SWIM_SPD 0x170 //swim speed; def 1; float
#define OFFSET_PLAYER_INFO_RUN_SPD 0xCF0 //run speed; def 1; float
#define OFFSET_PLAYER_INFO_FRAMEFLAGS 0x219 //frame flags; DWORD
#define OFFSET_PLAYER_INFO_WANTED_CAN_CHANGE 0x73C //fWantedCanChange
#define OFFSET_PLAYER_INFO_NPC_IGNORE 0x850 //npc ignore; DWORD; everyone = 0x450000;
#define OFFSET_PLAYER_INFO_WANTED 0x868 //wanted level; DWORD
#define OFFSET_PLAYER_INFO_WANTED 0x888 //wanted level; DWORD
#define OFFSET_PLAYER_INFO_STAMINA 0xCD4 //fStamina, fStaminaMax
#define OFFSET_PLAYER_RAGDOLL 0x10B8 //byte; CPed.noRagdoll: 0x20 = off; 0x00/0x01 = on
#define OFFSET_PLAYER_SEATBELT 0x140C //byte; CPed.seatBelt: 0xC8 = off; 0xC9 = on
#define OFFSET_PLAYER_INVEHICLE 0x1477
#define OFFSET_PLAYER_ARMOR 0x14E0 //armour
#define OFFSET_PLAYER_WATER_PROOF 0x188 //water proof; DWORD; +0x1000000 = on
#define OFFSET_PLAYER_VEHICLE_DAMAGE_MP 0xCFC //super punck/kick;float;
#define OFFSET_PLAYER_VEHICLE_DAMAGE_MP 0xD1C //super punck/kick;float;

//vehicle offsets
#define OFFSET_VEHICLE_HEALTH 0x908 //vehicle health; 0.f-1000.f
Expand Down Expand Up @@ -186,11 +186,9 @@

//globals
#define GLOBAL_TUNEABLES 0x40001
#define GLOBAL_CREATE_VEHICLE 2462286
#define GLOBAL_MERRYWEATHER 2540384
#define GLOBAL_CREATE_VEHICLE 2462514
#define GLOBAL_MERRYWEATHER 2540612
#define GLOBAL_BLOCK_SCRIPT_EVENTS 1391942
#define GLOBAL_BUSINESS 1590535
#define GLOBAL_SESSION 1312443

//feature indexing
#define FEATURE_P_GOD 0x00
Expand Down Expand Up @@ -340,5 +338,5 @@ extern uintptr_t ADDRESS_GLOBAL; //4C 8D 05 ? ? ? ? 4D 8B 08 4D 85 C9 74 11
extern uintptr_t ADDRESS_PLAYER_LIST; //48 8B 0D ? ? ? ? E8 ? ? ? ? 48 8B C8 E8 ? ? ? ? 48 8B CF
extern uintptr_t ADDRESS_REPLAY_INTERFACE; //48 8D 0D ? ? ? ? 48 8B D7 E8 ? ? ? ? 48 8D 0D ? ? ? ? 8A D8 E8 ? ? ? ? 84 DB 75 13 48 8D 0D ? ? ? ?
extern uintptr_t ADDRESS_UNK_MODEL; //4C 8B 15 ? ? ? ? 49 8B 04 D2 44 39 40 08
extern uintptr_t ADDRESS_FRAME_FLAGS; //Frame flags 0 writer dec code; 89 0B 48 8B 7B 10 32 D2 EB 19 39 0F 74 11 84 D2 75 09 8B 17 E8 47 C8 FF FF; 90 90
extern uintptr_t ADDRESS_FRAME_FLAGS; //Frame flags 0 writer call; (+0x7) 48 81 C1 ? ? ? ? E8 ? ? ? ? 48 8B 5C 24 ? 0F 28 74 24 ?; 90 90 90 90 90
#endif

0 comments on commit eede685

Please sign in to comment.