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 


Doing a "cheat engine" for linux.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source
View previous topic :: View next topic  
Author Message
lilezek
Newbie cheater
Reputation: 0

Joined: 30 Jun 2009
Posts: 13

PostPosted: Wed Mar 09, 2011 10:12 am    Post subject: Doing a "cheat engine" for linux. Reply with quote

Hi everyone. I would like to do a program similar to cheat engine for linux. I can't port it directly as I don't know pascal (but c++), so I'm here to ask a few questions about the functionality of this program, not to ask for help to port it.

1º: How CE stores information? It uses a structure with the pointer, memory, and size of chunk? I mean:

[Pointer | Memory | Size of chunk]
0x00001|Whatever|4 bytes (for instance)

2º: What does CE when the ram memory becomes not enough to store those structures? This is like when you are looking for a value you doesn't know at start, so you need to get an snapshot of the whole readable memory.

3º: What exactly does unrandomize and speed hack to work? I would like to implement in linux if it is possible, but I can't imagine how it works.

This is the basic question I have. As I continue I'll ask more questions.

Thank you for read.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Mar 09, 2011 12:03 pm    Post subject: Reply with quote

1:
It stores it in a file in the format of
Address (4 bytes)

and a separate memory file build up based on the used type (e.g byte scan is an array of 1 byte, 2 byte: array of words, etc...)

2:
It doesn't store them in ram, it stores them on the disk. The addresslist is just a view into the file. If you scroll down the filepointer is updated instead

3:
unrandomize scans for code signatures often used in unrandomize routines and rewrites those so they return a more predictable value

speedhack hooks the api's that games make use of to find out how much time has passed and makes them return a different value, depending on the speed you gave

_________________
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
lilezek
Newbie cheater
Reputation: 0

Joined: 30 Jun 2009
Posts: 13

PostPosted: Wed Mar 09, 2011 12:19 pm    Post subject: Reply with quote

Dark Byte wrote:
1:
2:
It doesn't store them in ram, it stores them on the disk. The addresslist is just a view into the file. If you scroll down the filepointer is updated instead


And when you try to compare the new value and the old one, do you use the disk? Or, Do you copy it first into ram and compare it?

Thank you for the reply, I'm going to start it now. I'll look for how to hook streaming to /dev/random to do an unrandomize and gettimeofday for the speedhack.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Wed Mar 09, 2011 1:06 pm    Post subject: Reply with quote

it get's read in memory depending on the blocksize in the settings
e.g 512kb worth of addresses each time, compare against that and continue with the next block

_________________
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
lilezek
Newbie cheater
Reputation: 0

Joined: 30 Jun 2009
Posts: 13

PostPosted: Thu Mar 10, 2011 10:13 am    Post subject: Reply with quote

How does CE update the value list? It is constant checking the program and storing it into disk? Or just the address that are visible on the address list?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Mar 12, 2011 7:40 am    Post subject: Reply with quote

Only the addresses currently visible in the list, and when you scroll it updates imeadiatly
_________________
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
lilezek
Newbie cheater
Reputation: 0

Joined: 30 Jun 2009
Posts: 13

PostPosted: Tue Mar 15, 2011 10:58 am    Post subject: Reply with quote

Alright, I finished the Speed Hack cpp. Here is the pastebin and some instructions. It is not automatic, but it works and it will be implemented in final version of the program for linux:

If someone wants to optimize it is welcome.

http://pastebin.com/ZLryd20D

Compile it as shared library with -ldl option enabled. Then use LD_PRELOAD =./nameoflibrary.so and open the program you want to modify the speed.

If you want to modify the speed of speed hack, check at int M; and int N; values:

Code:
    // Multiply speed:
    int M = 1;
    // Divide speed:
    int N = 2;
    // That means 1/2 speed;

If you want, for instance, 6x speed, just do:
Code:
M = 6; N = 1;


Or 0.2 speed (2/10 = 1/5) do:
Code:
M = 1; N = 5;


Thank you for read!
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Tue Mar 15, 2011 6:57 pm    Post subject: Reply with quote

interesting method of function hooking. (stuff like this also explains why there aren't many proprietary games for linux)
_________________
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
lilezek
Newbie cheater
Reputation: 0

Joined: 30 Jun 2009
Posts: 13

PostPosted: Wed Mar 16, 2011 8:48 am    Post subject: Reply with quote

Do you mean the ability to modify a function?

Well, this makes you to be able to easily modify functions of a video game. But that is not the objective.

The real objective of LD_PRELOAD is to load functions from another library that might be better than the library you are using. It is like a program is using DirectX 7 and you want to use DirectX 11.
Back to top
View user's profile Send private message
lilezek
Newbie cheater
Reputation: 0

Joined: 30 Jun 2009
Posts: 13

PostPosted: Sun Apr 03, 2011 8:11 am    Post subject: Reply with quote

I just finished many useful functions, the last one: snapshot. It returns a temporary FILE with the snapshot of the program. I'm still implementing more and more functions, but it is going well. If anyone is interested to help me:

(I can't post urls. Please, admin fix this:)
h t t p : // code.goo gle.co m/p/xeat-engine/

I named it Xeat Engine so you can difference it to Cheat Engine (written in Delphi for both Windows and Mac Os X) and Xeat Engine, written in C++ just for LinuX.

PD: I have another question. Why are many values in CE green?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sun Apr 03, 2011 1:49 pm    Post subject: Reply with quote

Green values in ce mean that they can be found using modulename+offset notation, so if a module is loaded at a different memory location ce will find it back.

Also a tip: I see you use ptrace. This means that it will crawl like nothing you've seen before. It might be faster to use another way of memory access (perhaps reading /proc/xxx/mem )

_________________
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
lilezek
Newbie cheater
Reputation: 0

Joined: 30 Jun 2009
Posts: 13

PostPosted: Sun Apr 03, 2011 2:32 pm    Post subject: Reply with quote

I use ptrace for writing, not for reading. For reading I'm using the mem access. By the way, I tried to use the mem filesystem to write too, but that only works in kernel mode with the kernel patched as far as I know.
Back to top
View user's profile Send private message
kir
How do I cheat?
Reputation: 0

Joined: 11 Apr 2011
Posts: 1

PostPosted: Mon Apr 11, 2011 8:32 am    Post subject: Compile Reply with quote

I'm interested in trying it out.
Would you like to make it more compilable?
A list of package dependencies would be helpful.
Maybe a script or Makefile or such to compile it too.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Mon Apr 11, 2011 4:43 pm    Post subject: Reply with quote

O still say it would be easier to just use lazarus and port the sourcecode of ce to linux the same way I did for mac (one unit which implements the functions that are missing)
_________________
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
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Source All times are GMT - 6 Hours
Page 1 of 1

 
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