Console Enabler for Unreal Engine 4.25

Memory scanning, code injection, debugger internals and other gamemodding related discussion
Post Reply
Digika
Noobzor
Noobzor
Posts: 6
Joined: Tue Dec 22, 2020 12:38 pm
Reputation: 0

Console Enabler for Unreal Engine 4.25

Post by Digika »

If someone can make one (or give some advises on what to look for) that works with UE4.25 - that'd be greatly appreciated. I cant use other tools like UUU due to some limiting factors.
I found some existing tools from Sunbeam but it seems like the most recent one was 4.22 max.

User avatar
STN
Founder
Founder
Posts: 4426
Joined: Thu Mar 02, 2017 7:48 pm
Reputation: 3423

Re: Console Enabler for Unreal Engine 4.25

Post by STN »

Digika wrote:
Tue Dec 22, 2020 12:42 pm
If someone can make one (or give some advises on what to look for) that works with UE4.25 - that'd be greatly appreciated. I cant use other tools like UUU due to some limiting factors.
I found some existing tools from Sunbeam but it seems like the most recent one was 4.22 max.
You managed to find a tool based on Sunbeams work but couldn't find Sunbeam countless tutorials? Seems like you did but its not exactly what you want right?

I deleted your thread because it is duplicate of this. Heres a few things

Sunbeam does share his stuff free and writes tutorials. You will not find a tutorial telling you exactly how to unlock console for unreal engine x version. Its not a step by step process, each game is different, that's not learning either but spoon feeding. What you will find is tutorials detailing how console was unlocked for some game countless of them here.

Your request sounded like that of a noob 'i cant find tuts, give a tutorial how to hack health in my game' meanwhile there are countless. Sunbeam has showed me how to unlock console/map engines , i know how to do it for game he showed me but not for others because i didn't learn but saw how to do x. I would learn doing this myself with different games and improving my overall debugging skill but i have no interest in doing console unlocks.

Anyhow, i will point sunbeam to this thread. Your request didn't require another thread but using Search function which you failed.

User avatar
SunBeam
Administration
Administration
Posts: 4702
Joined: Sun Feb 04, 2018 7:16 pm
Reputation: 4287

Re: Console Enabler for Unreal Engine 4.25

Post by SunBeam »

In any UE4 game the console is "enabled" in the same way. The reason I put "" around that word is you don't enable anything. YOU CREATE the Unreal Object called Console. This UObject is initialized internally and has to be written into the GameViewportClient, at a certain offset, so it's being processed. Once it exists, the internal Engine framework will just acknowledge it and make use of it in the Console sub-systems (aka "is the pointer valid?"). That's why the console works then.

If you really want to learn, here's how I got to understand how all of this works: viewtopic.php?p=81072#p81072.

Evaluate what I wrote there, see what you know how to do and what you don't know how to do. Then start learning one at a time to get there. Not interested and looking for a quick copy-paste script? Not gonna happen :) You can always take any of my DLLs and rip out the ASM from them, adjusting offsets to your needs. The "how" is also something you'll have to acquire in terms of knowledge.

Take it or leave it and make the most of it.

BR,
Sun

P.S.: What's your problem with UUU? Don't get it.

Digika
Noobzor
Noobzor
Posts: 6
Joined: Tue Dec 22, 2020 12:38 pm
Reputation: 0

Re: Console Enabler for Unreal Engine 4.25

Post by Digika »

Not interested and looking for a quick copy-paste script?
No, but ideally I was looking for source c++ code to understand what objects and structures and functions were mocked and imported or included and how it was used to inject stuff during LoadLibrary lock after dll injection (the reason for the source is since I dont have massive c++ expertise not do I really want to dedicate/waste too much time since I dont plan to use it extensively/professionally - having these would give me double value, both in understanding how c++ specifics were used and the UE4 specific concepts)
I dont give a flying fuck about cheats, nor I have any interest in steal someone's market (in fact, proficient cheat making has legal consequences), I'm interested in understanding how it was constructed to adapt it to something differrnt - call some blueprint function for modding purposes.
This UObject is initialized internally and has to be written into the GameViewportClient, at a certain offset, so it's being processed
You mean you allocate UObject instance and then write its pointer to the offset of GameViewportClient (instance? static?) object (perhaps member field that is responsive to hold that pointer pointign to the UObject connsole?)
This property:
[Link] ?
You can always take any of my DLLs and rip out the ASM from them
Sure, but that requires spending few years learning ASM first. As you understand, it is simply unreasoble for something that just roadblock for a completely different hobby avenue :P It is easy to throw around pretentious
"Well then you are not interested enough"
But that is arrogant and shortsighted (here is for example [Link] but that does not mean he has to now spend time to learn it and fix it, he has other tasks and interests to spend precious time on)

TimFun13
Expert Cheater
Expert Cheater
Posts: 1354
Joined: Fri Mar 03, 2017 12:31 am
Reputation: 6

Re: Console Enabler for Unreal Engine 4.25

Post by TimFun13 »

Digika wrote:
Wed Apr 21, 2021 2:03 pm
... but that requires spending few years learning ASM first. ...
Welcome to the exciting world of reverse engineering and game hacking.

lampuiho
Expert Cheater
Expert Cheater
Posts: 95
Joined: Sun Jul 16, 2017 6:06 am
Reputation: 55

Re: Console Enabler for Unreal Engine 4.25

Post by lampuiho »

Digika wrote:
Wed Apr 21, 2021 2:03 pm
Not interested and looking for a quick copy-paste script?
No, but ideally I was looking for source c++ code to understand what objects and structures and functions were mocked and imported
No, you won't understand anything from reading those codes if you don't understand the structure of C++ codes in assembly. All those codes are written in assembly and you will have to understand assembly to know how to hook functions for example. And about creating UObjects, etc, you do have to understand how Unreal engine works. And you know how if you're a game dev specialised in UE.

Digika
Noobzor
Noobzor
Posts: 6
Joined: Tue Dec 22, 2020 12:38 pm
Reputation: 0

Re: Console Enabler for Unreal Engine 4.25

Post by Digika »

lampuiho wrote:
Mon Apr 26, 2021 4:07 am
No, you won't understand anything from reading those codes
That's not for you to decide.

GreenHouse
Expert Cheater
Expert Cheater
Posts: 857
Joined: Fri Oct 12, 2018 10:25 pm
Reputation: 889

Re: Console Enabler for Unreal Engine 4.25

Post by GreenHouse »

SunBeam wrote:
Wed Apr 21, 2021 12:44 pm
...
This is amazing. Thanks to this I've been able to re-enable the console myself. It's might sound pretty generic for someone that doesn't know much about UE4, but for those that do this is enough to understand it. I wasn't expecting it to be that simple honestly :lol:

User avatar
SunBeam
Administration
Administration
Posts: 4702
Joined: Sun Feb 04, 2018 7:16 pm
Reputation: 4287

Re: Console Enabler for Unreal Engine 4.25

Post by SunBeam »

GreenHouse wrote:
Mon Apr 26, 2021 10:22 am
SunBeam wrote:
Wed Apr 21, 2021 12:44 pm
...
This is amazing. Thanks to this I've been able to re-enable the console myself. It's might sound pretty generic for someone that doesn't know much about UE4, but for those that do this is enough to understand it. I wasn't expecting it to be that simple honestly :lol:
Well.. when you get the source-code, compile the Engine yourself, then work a bit with it, compiling both the Shipping and Development builds for a demo game, then check them out, especially the functions that make use of the Console.. you realize something's missing in the Shipping build. Then you ask yourself why. Then go into the source-code and see the culprits:

Code: Select all

//G:\GitHub\UnrealEngine\Engine\Source\Runtime\Engine\Private\GameViewportClient.cpp
ULocalPlayer* UGameViewportClient::SetupInitialLocalPlayer(FString& OutError)
{
..
#if ALLOW_CONSOLE
	// Create the viewport's console.
	ViewportConsole = NewObject<UConsole>(this, GetOuterUEngine()->ConsoleClass);
	// register console to get all log messages
	GLog->AddOutputDevice(ViewportConsole);
#endif // !UE_BUILD_SHIPPING
..
}
Because of that "#if ALLOW_CONSOLE ... #endif // !UE_BUILD_SHIPPING", when compiling a Shipping build, the code between the #if and #endif is not compiled in. And that's what's missing.

In the same fashion, I know fly, walk and ghost aren't also implemented in Shipping:

Code: Select all

//G:\GitHub\UnrealEngine\Engine\Source\Runtime\Engine\Private\Character.cpp
void ACharacter::ClientCheatWalk_Implementation()
{
#if !UE_BUILD_SHIPPING
	SetActorEnableCollision(true);
	if (CharacterMovement)
	{
		CharacterMovement->bCheatFlying = false;
		CharacterMovement->SetMovementMode(MOVE_Falling);
	}
#endif
}

//G:\GitHub\UnrealEngine\Engine\Source\Runtime\Engine\Private\Character.cpp
void ACharacter::ClientCheatFly_Implementation()
{
#if !UE_BUILD_SHIPPING
	SetActorEnableCollision(true);
	if (CharacterMovement)
	{
		CharacterMovement->bCheatFlying = true;
		CharacterMovement->SetMovementMode(MOVE_Flying);
	}
#endif
}

//G:\GitHub\UnrealEngine\Engine\Source\Runtime\Engine\Private\Character.cpp
void ACharacter::ClientCheatGhost_Implementation()
{
#if !UE_BUILD_SHIPPING
	SetActorEnableCollision(false);
	if (CharacterMovement)
	{
		CharacterMovement->bCheatFlying = true;
		CharacterMovement->SetMovementMode(MOVE_Flying);
	}
#endif
}
Sure, you can toggle some physics flag that lets you fly anyway, but the intended code execution from the source-code isn't there. My point.

A solution is to restore the missing code in your game. Which is something I've been doing with quite a few titles. Just rip the code out from your target game, splice it in and fix the offsets/pointers to restore functionality (to make that code you added in be compatible with the offsets/structures in your game).

Similarly, developers mark with #if ... #endif most the the cheats/helpers they use in Development. So in Shipping, even if you have the console handy and execute that command for the cheat, it won't do jack shit. That's what MOST people don't understand with regards to console commands: not all of them work. But sure, with no interest to dig into some source-code or even learn something for a change, they'll be limited to those statements: "and if I enable the console, can I activate all cheats???". NO.

User avatar
LeFiXER
LeFixer
LeFixer
Posts: 478
Joined: Wed Mar 24, 2021 9:35 am
Reputation: 242

Re: Console Enabler for Unreal Engine 4.25

Post by LeFiXER »

I don't normally give my input to threads like this, but reading this did bring some level of astonishment in the fact that some people expect to achieve greatness without any effort. You get out of life, what you put in. No effort, no reward.

I'm grateful for the level of information that people in this community are willing to share and that encourages me to try harder even more. The least you can do is try. Learning doesn't have a timeframe, some people learn faster than others but that shouldn't deter you from achieving what you want to do because simply put, you will never succeed if you do not try.
Last edited by LeFiXER on Wed Apr 28, 2021 12:15 am, edited 1 time in total.

lampuiho
Expert Cheater
Expert Cheater
Posts: 95
Joined: Sun Jul 16, 2017 6:06 am
Reputation: 55

Re: Console Enabler for Unreal Engine 4.25

Post by lampuiho »

Digika wrote:
Mon Apr 26, 2021 8:33 am
lampuiho wrote:
Mon Apr 26, 2021 4:07 am
No, you won't understand anything from reading those codes
That's not for you to decide.
Well, it sort of is because it's up to us who know how to do it to release it Lol

User avatar
SunBeam
Administration
Administration
Posts: 4702
Joined: Sun Feb 04, 2018 7:16 pm
Reputation: 4287

Re: Console Enabler for Unreal Engine 4.25

Post by SunBeam »

The problem mostly comes out of the fact that many people think C++ is just straight forward coding. When talking about UE4, an Engine, all structures are intertwined. Similarly, developers simplify code length and turn it into macros, so that when you write 1 line of C++ code, the ASM equivalent is 40 lines.

So yeah, the code to create the Console UObject is the one I mentioned in my previous post:

ViewportConsole = NewObject<UConsole>(this, GetOuterUEngine()->ConsoleClass);

If you think that 1 liner is going to generate the proper code for you, without needing the entire Engine framework included in your VS project, then you're awfully mistaking. Why? Simple. NewObject is something defined in the scope of the Engine. Without its requisites, you won't get the proper output. Then the others are calculated at compile time, not randomly out of thin air. GetOuterUEngine gets a pointer.. from somewhere. If you have the whole framework, then that knows where to get it. Else.. nada. Then -> indicates a property or pointer. Am talking about the ConsoleClass. That's also something the framework knows where to get.

If you take the code above and copy-paste it into your C++ project, it won't do shit. I am not a coder, hence can't tell you how to trim through the framework and extract only those elements you need to get that 1 line compiled. But what I can tell you: a) you need the framework of your game plugged into that code (offsets, structs, etc. from your game, not the public github code); b) you can have MSVS compile x64 ASM code for you, so ripping some piece of code, pasting it in and just adjusting the offsets/calls here and there, to me, is way simpler than trying to simplify the entire Engine code so that 1 piece of interest compiles right, with no ASM knowledge..

Just saying.

Post Reply

Who is online

Users browsing this forum: No registered users