Sniper: Ghost Warrior 3 - Enable CryEngine Console

Upload your cheat tables here (No requests)
Post Reply
User avatar
SunBeam
Trouble Makers
Trouble Makers
Posts: 356
Joined: Thu Mar 02, 2017 10:15 pm
Reputation: 98

Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by SunBeam » Sat Aug 05, 2017 11:53 pm

Hello folks.

Ever since SGW3 went out, soon followed by Prey, I became interested in CryEngine. So much, that I got to study it quite a bit, making use of the available free SDK and various online sources. In time, I've figured out that most games have a working console in release build, but there's a catch: the console is disabled via a BOOL and the rendering text is not processed as some auxiliary rendering functions are not compiled (they're available only in the debug build). However, with proper enabling, the console accepts input from the keyboard (you just won't see the text being typed on screen or the query's response -- e.g.: querying CVars for their status/value).

The reason no text is displayed in the console (although it's there) is GetIRenderAuxGeom member-function in IRenderer class doesn't return the appropriate pointer. Next after this call, another is executed, and the offset to the member-function points to a RETN (thus nothing gets executed, as opposed to the behavior seen while debugging the SDK demo game). The function that should've been executed is called DrawStringImmediate, declared in IRenderAuxGeom.h file. But, as mentioned, it's not compiled in release builds. Smarty developers, eh? :)

I've tried these days to emulate it (rip the SDK code, fix it to work with SGW3 -- although I don't have all sub-helper-functions available -- and call it from the CryFont reference making use of it), but there's too much dilly-dallying that I ended up using it as is.

In short, the attached script:

- disables sys_DeactivateConsole CVar in IConsole (sets it to 0)
- enables a BOOL (sets it to 1) in IConsole I named bUnrestrictCVars (this allows you to query/set CVars through the console -- e.g.: g_godMode 2 [Enter] -- no need to use my other table anymore for this :P)
- patches two locations dealing with console commands whitelisting and CVars considered VF_CHEATS
- allows you to see what you type in Cheat Engine in a referenced buffer (you'll have to use windowed mode to see what you're typing; if sure on your typing skills, don't need to look at it)
- note the console is and will always be "empty", looking like an Unix password input line (you can type, the text is there, but you won't see it)

Demo video of usage, including some nifty console commands/variables:



List of useful console commands/variables:
SpoilerShow
Commands:

pl_health (usage: pl_health value -> e.g.: pl_health 1000)
lock_all_skills ("Locks all skills.")
give_skill_points (usage: give_skill_points path(sniper/ghost/warrior) number(max available points == 255) -> e.g.: give_skill_points sniper 12)
replenish_stamina (e.g.: replenish_stamina 1)
takeDamage (e.g.: takeDamage 10; works with negative values too, as heal -> takeDamage -10)
revive ("Revives player".)
v_kill ("Kills player vehicle.")
kill ("Kills the player.")
unlock_safehouse_and_fasttravel ("Unlocks all safehouses and fast travel points.")
show_loot_items_on_map ("Show all items from Loot category on map.")
items_in_weaponcache_unlock ("Unlock all items in weapon cache.")
complete_current_mission ("Completes current active mission.")
unlock_all_characters_and_factions ("Unlocks all characters and factions.")
unlock_all_missions ("Unlocks all regions, chapters and missions.")
unlock_all_collectibles ("Unlocks all collectibles.")
drone_upgrade ("Add drone upgrade.")
drone_remove ("Remove drone upgrade.")
items_in_weaponcache_reset ("Reset weapon cache.")
pl_unlockSkills ("Unlock all skills.")

CVars:

pl_movement.speedScale (default is 1.200000048)
pl_movement.strafe_SpeedScale (default is 0.8999999762)
pl_movement.sprint_SpeedScale (default is 1.700000048)
pl_movement.crouch_SpeedScale (default is 1.0)
pl_movement.acceleration (default is 13.0)
pl_health.normal_regeneration_rateSP (default is 250.0)
pl_drownRecoveryTime (default is 1)
ai_ignorePlayer (default is 0; set to 1 to make AI ignore the player)
ai_ignoreDrone (default is 0; set to 1 to make the AI ignore the drone)
g_godMode (default is 0; set to 2 to enable)
g_infiniteAmmo (default is 0; set to 1 to enable)
g_infiniteDroneBattery (default is 0; set to 1 to enable)
g_instantKillDamageThreshold (set to 0.1 for instant kill -- untested)

i_staminaConsumptionScale 0 (default is )
i_zoom_sway_scale 0 (default is )
i_enable_aim_assist (default is 1 in normal mode; can be 0 in hard)
i_enable_hb_slomo (default is )
i_enable_red_dot (default is 1; can be 0 in hard
i_enable_ricochet (default is )
g_killstreakTimeLimit (default is )

Enable File Logging:

log_Verbosity 3
log_WriteToFileVerbosity 3
log_VerbosityOverridesWriteToFile 1

Testing:

i_giveammo (and params: e.g.: i_giveammo PistolBullet 999)
i_givedebugitems
i_giveallitems
i_giveitem
p_fly_mode 0/1
p_collision_mode
p_gravity_z
flycam_movedown
flycam_speedup
flycam_turbo
check spread/recoil cvars
recoil_holdBreathActive_m
spread_holdBreathActive_m
Let me know if you have any questions; I strongly encourage you to post feedback.

Soon to follow is the mini-SDK for this game ;) It's based on the logic of the work done here by daemonium, but applied to SGW3 on an x64 CryEngine: https://www.unknowncheats.me/forum/othe ... i-sdk.html. According to Wiki (https://en.wikipedia.org/wiki/List_of_CryEngine_games), SGW2 is running on CryEngine 3 (it's actually 3.4.0 from investigating), x86, while SGW3 is running on CryEngine 4, x64. So yeah, it took a bit to figure out the mapping and order of the class members.

BR,
Sun
Attachments
SGW3.CT
Enable console (1.04)
(10.39 KiB) Downloaded 82 times
SGW3.CT
Enable console (1.03)
(20.05 KiB) Downloaded 128 times

djdrulotus
Noobzor
Noobzor
Posts: 11
Joined: Fri Mar 03, 2017 11:54 pm
Reputation: 3

Re: Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by djdrulotus » Sun Aug 06, 2017 2:06 am

Nice man Thanks

jonasbeckman
Cheater
Cheater
Posts: 25
Joined: Sat May 06, 2017 1:26 pm
Reputation: 3

Re: Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by jonasbeckman » Sun Aug 06, 2017 10:52 am

Nice, I've been using the remote console for Cry-Engine games ( https://www.reddit.com/r/prey/comments/ ... s/dhixszq/ ) but it's a bit flaky depending on just what the game you're using it against might be missing or have locked away in some form, also varies depending on the Cry-Engine version used since cvars and other functions can and will differ.

66Nemesis66
What is cheating?
What is cheating?
Posts: 3
Joined: Tue Aug 01, 2017 1:45 pm
Reputation: 0

Re: Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by 66Nemesis66 » Sun Aug 06, 2017 6:47 pm

hi
I become a Lua Error

Output
Error:Failure determining what SSystemGlobalEnvironment_AOB means
Error:Failure determining what SSystemGlobalEnvironment_AOB means

User avatar
SunBeam
Trouble Makers
Trouble Makers
Posts: 356
Joined: Thu Mar 02, 2017 10:15 pm
Reputation: 98

Re: Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by SunBeam » Sun Aug 06, 2017 7:02 pm

jonasbeckman wrote:
Sun Aug 06, 2017 10:52 am
Nice, I've been using the remote console for Cry-Engine games ( https://www.reddit.com/r/prey/comments/ ... s/dhixszq/ ) but it's a bit flaky depending on just what the game you're using it against might be missing or have locked away in some form, also varies depending on the Cry-Engine version used since cvars and other functions can and will differ.
Hi there. Thanks for the info, well-worth the try. I've downloaded and tested it on SGW3. Of course, you still need to run the table and enable Enable Console script (the various patches I applied to enable VF_CHEATS and disable whitelisting are still required, if you want a fully functional console). After having done that, I can pipe-in the various commands ;)

Here's me typing a CVar starting with "g_go" and the list auto-populating:

Image

And here's "g_godMode 2" entered in the Universal Remote Console field (notice how CVar changed to 2, so it works):

Image

Also, love this little pane with the Sliders :)

Image

You can also query CVars if you set Log Verbosity to 1:

Image

Also, fun part's the remote console lists every command/CVar there is in the game, even the custom ones not available in the SDK:

Image

"items_in_weaponcache_unlock" works only in SGW3 ;)
66Nemesis66 wrote:
Sun Aug 06, 2017 6:47 pm
hi
I become a Lua Error

Output
Error:Failure determining what SSystemGlobalEnvironment_AOB means
Error:Failure determining what SSystemGlobalEnvironment_AOB means
Open game (let it load fully till main menu), then run the table. If you have CE open and load table manually, you'll have to run the Lua code and manually select SGW3.exe, in this order; else Lua code will get stuck in a loop, waiting for SGW3.exe process on attach. So: game first, run table afterwards.

Cheers,
Sun

angelotti
What is cheating?
What is cheating?
Posts: 4
Joined: Wed Sep 06, 2017 10:35 am
Reputation: 0

Re: Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by angelotti » Wed Sep 13, 2017 8:30 am

SunBeam wrote:
Sun Aug 06, 2017 7:02 pm
...
66Nemesis66 wrote:
Sun Aug 06, 2017 6:47 pm
hi
I become a Lua Error

Output
Error:Failure determining what SSystemGlobalEnvironment_AOB means
Error:Failure determining what SSystemGlobalEnvironment_AOB means
Open game (let it load fully till main menu), then run the table. If you have CE open and load table manually, you'll have to run the Lua code and manually select SGW3.exe, in this order; else Lua code will get stuck in a loop, waiting for SGW3.exe process on attach. So: game first, run table afterwards.
I'm getting this error too. I'm executing the table with the game fully loaded (ex: inside a safe house). I also tried loading it manually with CE opened first. But the thing is, it worked when I first tested it, back when you released it. But now, on a new save (and a game update later) I get this error. It might be a conflict of some sorts..

User avatar
SunBeam
Trouble Makers
Trouble Makers
Posts: 356
Joined: Thu Mar 02, 2017 10:15 pm
Reputation: 98

Re: Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by SunBeam » Wed Sep 13, 2017 8:35 am

As explained, the table expects to auto-attach to the game process. You don't need to select it yourself.

So: close CE, run game, run table from your location (it will open CE) and CE will auto-attach to game process (you know this happened when the main GUI title changes).

If you've already selected the process, then re-select it till title changes to Table for Sniper: Ghost Warrior v1.03.

BR,
Sun

P.S.: You're not required to be anywhere in-game for table to work - safe house or whatever - just run the table and that's that.

jonasbeckman
Cheater
Cheater
Posts: 25
Joined: Sat May 06, 2017 1:26 pm
Reputation: 3

Re: Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by jonasbeckman » Wed Sep 13, 2017 9:13 am

Perhaps a compatibility issue with 1.04 which was released a few days ago. (Finally improved the loading times in addition to compatibility with a newly released DLC.)

I haven't tested the table myself yet though with the new version of the game but I'll give it a try to see what happens.

EDIT: Yep, same error as soon as the game is started.

EDIT: Guessing CE can't locate the address for this version of the game even if it's using AOB.
Last edited by jonasbeckman on Wed Sep 13, 2017 9:27 am, edited 1 time in total.

diabloamezon
Cheater
Cheater
Posts: 31
Joined: Fri Mar 03, 2017 3:55 am
Reputation: 1

Re: Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by diabloamezon » Wed Sep 13, 2017 9:24 am

I'm using CPY (1.04) and also got this error. Maybe it because CPY ver.

My order was run the game till main menu, go to desktop and run SGW3.CT and let the table run. After that it get Error:Failure determining what SSystemGlobalEnvironment_AOB means. Re-select the game exe process get the same error.

User avatar
SunBeam
Trouble Makers
Trouble Makers
Posts: 356
Joined: Thu Mar 02, 2017 10:15 pm
Reputation: 98

Re: Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by SunBeam » Wed Sep 13, 2017 10:23 am

Then I'll re-check the array :) Thanks for the info, didn't know game updated.

angelotti
What is cheating?
What is cheating?
Posts: 4
Joined: Wed Sep 06, 2017 10:35 am
Reputation: 0

Re: Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by angelotti » Wed Sep 13, 2017 12:42 pm

SunBeam wrote:
Wed Sep 13, 2017 8:35 am
...
P.S.: You're not required to be anywhere in-game for table to work - safe house or whatever - just run the table and that's that.
I only mentioned the safe house for it to be clear I was in-game and not at the intro videos, so you'll know not to repeat the previous answer. I know the (very) basics of cheat engine, I'm a long time user.
That being said, I am aware how stupid some people are, and what retarded questions they often ask, so your answer was to be expected.

Sorry for the off topic post.

User avatar
SunBeam
Trouble Makers
Trouble Makers
Posts: 356
Joined: Thu Mar 02, 2017 10:15 pm
Reputation: 98

Re: Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by SunBeam » Thu Sep 14, 2017 1:18 am

Looks like FilterConsoleCommands isn't found. Lua returns the not found error, but associates it with the first parameter in the block - in this case "SSystemGlobalEnvironment_AOB":

Code: Select all

autoAssemble([[
aobscanmodule( SSystemGlobalEnvironment_AOB, SGW3.exe, 488B0D????????4885C974??488B0133D2FF5018488B0D ) -- OK
registersymbol( SSystemGlobalEnvironment_AOB )
aobscanmodule( FilterConsoleCommands, SGW3.exe, 4055564154415641574883EC20488BCA ) -- NOT_OK
registersymbol( FilterConsoleCommands )
aobscanmodule( EnableVF_CHEATS_AOB, SGW3.exe, 803D??????????75??488B0D????????488D15????????4D8B07488B01FF5028 ) -- OK
registersymbol( EnableVF_CHEATS_AOB )
aobscanmodule( DisableConsolePaste_AOB, SGW3.exe, 83F82E7516F64314117410488D4EF8E8 ) -- OK
registersymbol( DisableConsolePaste_AOB )
]])
Also, how to tell game version:

Code: Select all

/*
- to find out when file was compiled, search for "Built on" string and look at first reference
- should be followed by "Running 64 bit Windows version"
- 1.2: Built on May 15 2017 23:00:57
- 1.3: Built on Jun 21 2017 09:33:01
- 1.4: Built on Sep  4 2017 12:38:14 <-- NEW :)
*/
Updating.

BR,
Sun

EDIT #1: Updated. Table's attached separately to main post. Fuckers have removed the whitelisting function, that's why array wasn't found ;) Play nice.

EDIT #2: Also added in this nifty script:

Code: Select all

[ENABLE]

aobscanmodule( PBYTE_ResourcesReader, SGW3.exe, F30F10580C41B80A000000488D15????????488B4C2460E8 )
registersymbol( PBYTE_ResourcesReader )
alloc( pHook, 0x1000, SGW3.exe )
label( pResources )
registersymbol( pResources )

pHook:
mov [pResources],rax
@@:
movss xmm3,[rax+0C]
jmp PBYTE_ResourcesReader+5

pResources:
dq 0

PBYTE_ResourcesReader:
jmp pHook

[DISABLE]

PBYTE_ResourcesReader:
db F3 0F 10 58 0C

dealloc( pHook )
unregistersymbol( PBYTE_ResourcesReader )
[pResources]
+00 = Money;
+14 = Food;
+0C = Explosives Parts;
+08 = Mechanical Parts;
+10 = Electronic Parts

Updated table in main post once more.

diabloamezon
Cheater
Cheater
Posts: 31
Joined: Fri Mar 03, 2017 3:55 am
Reputation: 1

Re: Sniper: Ghost Warrior 3 - Enable CryEngine Console

Post by diabloamezon » Thu Sep 14, 2017 7:03 am

Thanks for the update sir!

Edit : Maybe I did something wrong. The table enable and in-game console enable, but it seems I can't type anything to work (resource hook works fine). I'm reassure that I'm typing in English but nothing work.

EDIT2 : I use universal remote console with this table and works fine now :D

Post Reply

Who is online

Users browsing this forum: Bing [Bot], DrummerIX, mkh-pignouf, NotBad