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 


Delphi APIs

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
jeromerocks
How do I cheat?
Reputation: 0

Joined: 27 Mar 2007
Posts: 2

PostPosted: Sun Oct 12, 2008 11:05 pm    Post subject: Delphi APIs Reply with quote

Hi,

I read that I needed to hook GetTickCount, timeGetTime and QueryPerformanceCounter to make a speed hack. But now I'm stuck as to how to code one in delphi.

I can code a process list on a delphi form, but how do I make it like CE, ie the user selects the process and then he can set the speed at which the program runs.

Could anyone help me out?
Thanks a lot!
Back to top
View user's profile Send private message
ups2000ups
I post too much
Reputation: 0

Joined: 31 Jul 2006
Posts: 2471

PostPosted: Sun Oct 12, 2008 11:40 pm    Post subject: Reply with quote

if you already know the API's go to http://msdn.microsoft.com/en-us/library/default.aspx

try to learn yourself something instead of asking for a code. if you really want help to be a better programmer ask real questions but if you dont wanna learn keep going


tip
if you cant fix it try to make an easier project and work your way up until you know how to do it

_________________
dont complain about my english...
1*1 = 2?
Back to top
View user's profile Send private message
jeromerocks
How do I cheat?
Reputation: 0

Joined: 27 Mar 2007
Posts: 2

PostPosted: Mon Oct 13, 2008 12:36 am    Post subject: Reply with quote

Sorry.

I know the APIs but I don't know what to do with them. I'm not begging for the code, I just wish that someone would explain in words, not pascal code, what I should do with the APIs.

Thanks for your reply anyway.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

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

PostPosted: Mon Oct 13, 2008 12:39 am    Post subject: Reply with quote

Write a dll that has alternate versions of those apis and inject it into the target process
In the dll, or using writeprocessmemory, change the first 5 bytes of the original api functions with a jmp to each alternate function

_________________
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
rapion124
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Mar 2007
Posts: 1095

PostPosted: Mon Oct 13, 2008 2:22 pm    Post subject: Reply with quote

You redirect execution flow when an application calls the API. The code will be redirected to your code, where you can modify the results and such. Here's a sample:


Code:

__declspec(naked) DWORD WINAPI _GetTickCount(void)
{
    __asm
    {
        mov edi, edi
        push ebp
        mov ebp, esp
        jmp [GetTickCount_R] //GetTickCount + 5
    }
}

DWORD WINAPI __GetTickCount(void) //Hook procedure
{
    DWORD RET;

    RET = _GetTickCount(); //_GetTickCount() is a trampoline
    RET *= 2;  //twice as fast

    return RET;
}

[/code

That's the hook procedure. Now, you need to install an inline hook at GetTickCount, which basically is a unconditional jump to __GetTickCount. Then, you need to make a trampoline.
Back to top
View user's profile Send private message
smartz993
I post too much
Reputation: 2

Joined: 20 Jun 2006
Posts: 2013
Location: USA

PostPosted: Mon Oct 13, 2008 2:31 pm    Post subject: Reply with quote

rapion124 wrote:
You redirect execution flow when an application calls the API. The code will be redirected to your code, where you can modify the results and such. Here's a sample:


Code:

__declspec(naked) DWORD WINAPI _GetTickCount(void)
{
    __asm
    {
        mov edi, edi
        push ebp
        mov ebp, esp
        jmp [GetTickCount_R] //GetTickCount + 5
    }
}

DWORD WINAPI __GetTickCount(void) //Hook procedure
{
    DWORD RET;

    RET = _GetTickCount(); //_GetTickCount() is a trampoline
    RET *= 2;  //twice as fast

    return RET;
}



That's the hook procedure. Now, you need to install an inline hook at GetTickCount, which basically is a unconditional jump to __GetTickCount. Then, you need to make a trampoline


You already made the trampoline, _GetTickCount.
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Mon Oct 13, 2008 2:35 pm    Post subject: Reply with quote

That wouldn't be twice as fast.

Instead of going: 1 2 3 4 5 6 7 8 9 10...
It would be: 1 2 4 8 16 32 64 128 256 512...
Back to top
View user's profile Send private message
GMZorita
Grandmaster Cheater Supreme
Reputation: 0

Joined: 21 Mar 2007
Posts: 1361

PostPosted: Mon Oct 13, 2008 2:47 pm    Post subject: Reply with quote

Code:

int vs = 2;
int add;

void __declspec(naked) __stdcall hook()
{
         add++;
         GetTickCount();
         _EAX += add;
         _asm ret;
}

_________________
Gone
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