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 


Is there a way to jump into ingame code without injection?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Sat Aug 30, 2008 4:17 am    Post subject: Is there a way to jump into ingame code without injection? Reply with quote

Hi,
I know I can make a dll, use inline asm (c++) to make a jump into an ingame function, for example 0x12341234 and then inject the dll.

But is there a way to do this without any injection?
Something like SendMessage or smth.?
I'm trying to make a bot without any injection..
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sat Aug 30, 2008 4:25 am    Post subject: Reply with quote

If you get the address of the function and it takes one or less parameters then you can use CreateRemoteThread to call it externally I guess.

If you are trying to make a bot, you can use PostMessage without the need to use any injection or DLL at all.
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: Sat Aug 30, 2008 10:28 am    Post subject: Reply with quote

WriteProcessMemory?
_________________
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
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sat Aug 30, 2008 12:32 pm    Post subject: Reply with quote

um...
If u want the dll to jump to an ingame function u can use: (C++)
asm
{
jmp [whereverthefunctionis]
}

If not a dll. Create A Remote Thread into the process and do that ^
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: Sat Aug 30, 2008 1:29 pm    Post subject: Reply with quote

dnsi0 wrote:
um...
If u want the dll to jump to an ingame function u can use: (C++)
asm
{
jmp [whereverthefunctionis]
}

Yes, he can use it if he want to crash, or use "call" instead.
Back to top
View user's profile Send private message
jackyyll
Expert Cheater
Reputation: 0

Joined: 28 Jan 2008
Posts: 143
Location: here

PostPosted: Sat Aug 30, 2008 1:36 pm    Post subject: Reply with quote

Symbol wrote:
dnsi0 wrote:
um...
If u want the dll to jump to an ingame function u can use: (C++)
asm
{
jmp [whereverthefunctionis]
}

Yes, he can use it if he want to crash, or use "call" instead.


But since he doesn't want to inject a DLL, he cant Razz
Back to top
View user's profile Send private message AIM Address MSN Messenger
dnsi0
I post too much
Reputation: 0

Joined: 04 Jan 2007
Posts: 2674

PostPosted: Sat Aug 30, 2008 1:38 pm    Post subject: Reply with quote

CreateRemoteThread???
Back to top
View user's profile Send private message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Sun Aug 31, 2008 10:50 am    Post subject: Reply with quote

Never used CreateRemoteThread before, I tried : (but it not worked ofc.)
Code:
CreateRemoteThread(hopen,NULL,NULL,0x411109,NULL,NULL,NULL)

this code didn't compile.
It compiles, if I change it abit: (but I don't really know, what I'm doing here)
Code:
CreateRemoteThread(hopen,NULL,NULL,(LPTHREAD_START_ROUTINE)0x411109,NULL,NULL,NULL)

That compiles, but it doesn't work.
GetLastError() tells me, error 5.
Already did LoadSeDebug.
0x411109 is hopefully the ptr of the function.
At least it worked, when I called it with code injection via ollydbg.
I think I'm useing CreateRemoteThread wrong, but how to use it correctly?
Back to top
View user's profile Send private message
hcavolsdsadgadsg
I'm a spammer
Reputation: 26

Joined: 11 Jun 2007
Posts: 5801

PostPosted: Sun Aug 31, 2008 11:10 am    Post subject: Reply with quote

You have to create the function that acts as your thread.

You obviously want it to call 0x00411109... so...
Back to top
View user's profile Send private message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Sun Aug 31, 2008 11:25 am    Post subject: Reply with quote

whoops, I'm an idiot.
I open'd the process without the access to create a thread in it..
create_all_access worked fine.
Thx Smile
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Sun Aug 31, 2008 11:27 am    Post subject: Reply with quote

The function you want to call may not match the function signature of LPTHREAD_START_ROUTINE, meaning it may fuck the stack when you use CreateRemoteThread on it. You are best off finding a codecave in the target process and writing a stub there that will handle the arguments and stack issues then call the target function. Then CreateRemoteThread that will originate there. You can then place an ExitThread call at the end to handle it nicely.
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
jackyyll
Expert Cheater
Reputation: 0

Joined: 28 Jan 2008
Posts: 143
Location: here

PostPosted: Sun Aug 31, 2008 2:46 pm    Post subject: Reply with quote

nog_lorp wrote:
The function you want to call may not match the function signature of LPTHREAD_START_ROUTINE, meaning it may fuck the stack when you use CreateRemoteThread on it. You are best off finding a codecave in the target process and writing a stub there that will handle the arguments and stack issues then call the target function. Then CreateRemoteThread that will originate there. You can then place an ExitThread call at the end to handle it nicely.


Shouldn't need the ExitThread, should he? Wont the thread exit on return?
Back to top
View user's profile Send private message AIM Address MSN Messenger
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Mon Sep 01, 2008 2:52 am    Post subject: Reply with quote

True. I thought ExitThread would lead to nicer cleanup than just letting it return, but I was wrong, threads called with CreateThread return to kernel32.7C80B683 which is immediately followed with a call to ExitThread.
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
BanMe
Master Cheater
Reputation: 0

Joined: 29 Nov 2005
Posts: 375
Location: Farmington NH, USA

PostPosted: Mon Sep 01, 2008 2:39 pm    Post subject: Reply with quote

this method would work much more nicely Wink

psuedo code

Code:


SuspendThread()
GetContextThread()
Modify Context
FlushInstructionCache(Modified Registers and Eip)
SetContextThread()
ResumeThread()



greets BanMe
Back to top
View user's profile Send private message MSN Messenger
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Tue Sep 02, 2008 10:33 am    Post subject: Reply with quote

Quote:
Modify Context
GetContextThread()
SetContextThread()

didn't find something really usefull @msdn / google.
An explanation would be nice Smile
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
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