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 


[C#] process.exe+value

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Jan 20, 2008 2:08 pm    Post subject: [C#] process.exe+value Reply with quote

I'm in the process of creating a trainer for a game (GTA - VC), and I'm writing a script for infinite health (AA--I have the parser and whatever, that's not what I need).

However, I found the pointer to the health address, and the base address is

Code:

gta-vc.exe+38F7E4


How would I code that into my trainer? The "gta-vc.exe" mean the base address of the program, correct?

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sun Jan 20, 2008 2:15 pm    Post subject: Reply with quote

Yes, and to get the base entry (in native API) you would take a snapshot of the process (CreateToolhelp32Snapshot) and retrieve (Module32First, Module32Next) MODULEENTRY32.modBaseAddr
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sun Jan 20, 2008 4:09 pm    Post subject: Reply with quote

You can get the module's base address of the main module by calling System.Diagnostics.Process.MainModule.BaseAddress;
To see all the modules you can do
foreach (System.Diagnostics.ProcessModule pm in Process.Modules)
MessageBox.Show(pm.ToString());
But gta-vc.exe+xxxx is actually BaseAddress+xxxx or EntryPoint+xxxx? base address, right?
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Jan 20, 2008 4:19 pm    Post subject: Reply with quote

Thank you both. Yes, Symbol, process+xxxx = EntryPoint + xxxx.
_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Flyte
Peanuts!!!!
Reputation: 6

Joined: 19 Apr 2006
Posts: 1887
Location: Canada

PostPosted: Sun Jan 20, 2008 5:46 pm    Post subject: Reply with quote

samuri25404 wrote:
Create a Cheat Engine [C#.NET]


It would be too slow. Like I said before, make the scanner in another language.

samuri25404 wrote:
Create a rootkit [C++ probably]


C, if you need help, just PM me.
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Jan 20, 2008 6:40 pm    Post subject: Reply with quote

Flyte wrote:
samuri25404 wrote:
Create a Cheat Engine [C#.NET]


It would be too slow. Like I said before, make the scanner in another language.


Well, just FYI, Symbol's written a really nice one (yes, him and I are working together on it). I looked at a "really old" version (according to him), and it didn't work too badly, he said he was going to PM me the newest one, and I'm gonna test it out.

[quote = "Flyte"]
samuri25404 wrote:
Create a rootkit [C++ probably]


C, if you need help, just PM me. [/quote]

Thanks!

I'm currently working on my trainer with the Keyboard hook (I have the Keyboard hook working, I'm just playing around with the actual trainer Razz)

After this, I might make a DLL injector, but I'll probably go ahead and start on the rootkit.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended


Last edited by samuri25404 on Sun Jan 20, 2008 7:03 pm; edited 3 times in total
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sun Jan 20, 2008 6:56 pm    Post subject: Reply with quote

The only problem is writing the addresses into the text file/adding to a list, it takes too much time... I'm scanning the whole memory reigon (lets say 0x00400000 to 0x0050000) and it returns all the bytes in less than a second, I can't think of a way to write them faster or adding them to the list faster...
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Jan 20, 2008 7:05 pm    Post subject: Reply with quote

If nothing else, we can be inefficient and do this:

Code:

//THIS IS PSEUDO-CODE
Scan
    Increment a counter if the value matches
    Do nothing else

Create an Array
    Size = Counter

Scan
     This time, store the values in the array


So yes, we scan twice, but if it returns all the values in less than a second, it probably won't make too much of a difference.

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Sun Jan 20, 2008 7:20 pm    Post subject: Reply with quote

I think storing the values in the array just takes so much time, because I add them to the list/file (now using only a file with the matched addresses) or its the fact its .NET Surprised
So it doesn't matters if you say "this one matchs, this one doesn't" I think adding to the list will take the same time, because comparing is like what, 10 bytes for my compares? (if ((exactscan && value == match) ^ (biggerthan && value >= match) ^ (smallerthan && value <= match) && etc...))
Back to top
View user's profile Send private message
samuri25404
Grandmaster Cheater
Reputation: 7

Joined: 04 May 2007
Posts: 955
Location: Why do you care?

PostPosted: Sun Jan 20, 2008 8:05 pm    Post subject: Reply with quote

Nah, see, arrays are much faster than Lists for assigning.

MyArray[0] = i;

Where i is an int, and MyArray is an int[], one million times goes incredibly quickly (I don't remember the exact number, but I ran a test on it, you should search for it).

Why are they so much faster than lists in that aspects? Doing MyArray[0] = i; is just like doing myvar = i; Whereas with Lists, you have to allocate space every time you add something, then it has to go and let the List know that it has another variable, then it has to store it (this part doesn't take long, but you get the idea).

_________________
Wiccaan wrote:

Oh jeez, watchout I'm a bias person! Locked.


Auto Assembly Tuts:
In Depth Tutorial on AA
Extended
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Mon Jan 21, 2008 5:14 am    Post subject: Reply with quote

I just created a whole new scan so I have to finish it first, but I'll try making another scan only with exact value, 1 byte and see if it works.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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