Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


"activateProtection()" in CE Lua.
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Tue Mar 21, 2017 9:34 am    Post subject: "activateProtection()" in CE Lua. Reply with quote

So, in order to activate the protection, I only need to call "activateProtection()" once in my Lua script, right? Is other stuff also required?
_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Tue Mar 21, 2017 9:46 am    Post subject: Reply with quote

make sure the other programs don't run as admin. (it's not that effective these days)
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Tue Mar 21, 2017 10:02 am    Post subject: Reply with quote

Dark Byte wrote:
make sure the other programs don't run as admin. (it's not that effective these days)


What does "other programs" mean? Do you mean the game that I am hacking? Or any other programs, such as Chrome, steam, etc.?

If "other programs" do run as admin, what's the consequence? Is it gonna make the whole trainer unusable or just nullify the protection function?

_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Tue Mar 21, 2017 5:06 pm    Post subject: This post has 1 review(s) Reply with quote

The 'activateProtection' function makes use of the following API: (ConvertStringSecurityDescriptorToSecurityDescriptor)
https://msdn.microsoft.com/en-us/library/windows/desktop/aa376401%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

You can read up on it via Google on why it is less meaningful and useful today with current system/operating system usage etc.

Source of the function can be found here:
https://github.com/cheat-engine/cheat-engine/blob/f31378551a4f4b5ebc601d20dac548fb661e9a63/Cheat%20Engine/CEFuncProc.pas#L3071

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Tue Mar 21, 2017 5:25 pm    Post subject: Reply with quote

for a 'better' protection, use the github's version of CE and use enableDRM()
Not even CE can read the memory then (unless you compile with -Dprivatebuild but that won't be in the public release)

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Tue Mar 21, 2017 7:09 pm    Post subject: Reply with quote

Quote:
So, in order to activate the protection, I only need to call "activateProtection()" once in my Lua script, right? Is other stuff also required?



My question is simple :

"Protection from what ? Smile "

Regards
Back to top
View user's profile Send private message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Tue Mar 21, 2017 8:28 pm    Post subject: Reply with quote

@DB
@atom0s

Thanks for both of you. Smile


@DB, the github version is also 6.6 tho. Smile

_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Wed Mar 22, 2017 2:22 pm    Post subject: This post has 1 review(s) Reply with quote

Corroder wrote:
Quote:
So, in order to activate the protection, I only need to call "activateProtection()" once in my Lua script, right? Is other stuff also required?



My question is simple :

"Protection from what ? Smile "

Regards


It's to prevent people from trying to read/dump memory of the trainer.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Wed Mar 22, 2017 8:19 pm    Post subject: Reply with quote

Quote:
atom0s
It's to prevent people from trying to read/dump memory of the trainer.


Thanks for info....


Code:
main.lua :
activateProtection(): Prevents basic memory scanners from opening the cheat engine process


Testing :
Code:

activeProtection()
print("hello world")


- save as standalone exe = tester.exe
- view memory and search "hello world" as image attach
- also in other test, I've reverse that exe file to CT file and got script inside

I don't know, maybe I was wrong to use activeProtection function.

Regards



Capture.JPG
 Description:
Search result for script on tester.exe
 Filesize:  48.43 KB
 Viewed:  17161 Time(s)

Capture.JPG


Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 457

Joined: 09 May 2003
Posts: 25262
Location: The netherlands

PostPosted: Wed Mar 22, 2017 8:34 pm    Post subject: Reply with quote

that's because you're running CE with admin rights, so therefore you can read the memory (as I said, it's not effective these days)

for a more effective one, use enableDRM() from the gitgub (you need to build the driver as well, and probably sign it too)

Also, alternatively use encodeFunction() / decodeFunction() . A lot easier to use and quite effective against copy/pasters

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Wed Mar 22, 2017 10:43 pm    Post subject: Reply with quote

Dark Byte wrote:
that's because you're running CE with admin rights, so therefore you can read the memory (as I said, it's not effective these days)

for a more effective one, use enableDRM() from the gitgub (you need to build the driver as well, and probably sign it too)

Also, alternatively use encodeFunction() / decodeFunction() . A lot easier to use and quite effective against copy/pasters


I see, thank DB for details info.

Regards
Back to top
View user's profile Send private message
Dr.Disrespect
Grandmaster Cheater
Reputation: 3

Joined: 17 Feb 2016
Posts: 526

PostPosted: Thu Mar 23, 2017 12:13 am    Post subject: Reply with quote

Thanks, DB.

BTW,
1. what programming language is CE written in? C?
2. how to modify and compile CE? What tools do I need? I only have some programming experience in C# and C++ in Visual Studio.

_________________
**************

A simple example is better then ten links. Very Happy
Back to top
View user's profile Send private message
Corroder
Grandmaster Cheater Supreme
Reputation: 75

Joined: 10 Apr 2015
Posts: 1667

PostPosted: Thu Mar 23, 2017 12:41 am    Post subject: Reply with quote

If I am not wrong, CE written in Pascal (eqv. Lazarus for 32/64 bits) and the other version is CE Delphi for 32 bits.

to compile CE need specific lazarus/fpc version. There is also a command line tool using fcup. More infos, let DB or others explain it.

Very Happy
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Thu Mar 23, 2017 1:46 am    Post subject: Reply with quote

Cheat Engine is coded in Lazarus / Delphi and C for the driver.
Source code is found here:
https://github.com/cheat-engine/cheat-engine

A fairly outdated handful of threads about compiling the source can be found here:
http://forum.cheatengine.org/viewforum.php?f=6

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
atom0s
Moderator
Reputation: 198

Joined: 25 Jan 2006
Posts: 8516
Location: 127.0.0.1

PostPosted: Thu Mar 23, 2017 1:52 am    Post subject: Reply with quote

Corroder wrote:
Quote:
atom0s
It's to prevent people from trying to read/dump memory of the trainer.


Thanks for info....


Code:
main.lua :
activateProtection(): Prevents basic memory scanners from opening the cheat engine process


Testing :
Code:

activeProtection()
print("hello world")


- save as standalone exe = tester.exe
- view memory and search "hello world" as image attach
- also in other test, I've reverse that exe file to CT file and got script inside

I don't know, maybe I was wrong to use activeProtection function.

Regards


Aside from what what DB said, keep in mind these are basic forms of anti-ripping / copy+pasting. It is fairly easy to bypass the protections that are within Cheat Engine, even for newbies.

enableDRM is a simple call within the CE framework that makes a driver IO call and returns true or false based on its success. You can simply just patch the function to return true and you have successfully bypassed 'enableDRM'.

encodeFunction/decodeFunction are basic string encoders using base85. Again, something easily bypassed / reversed.

If you are looking to protect your trainer(s) you are best to do so in your own methods and not whats built into Cheat Engine. Given that Cheat Engine is open source, it leaves its protection methods vulnerable to being publicly visible and easily bypassed.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites