 |
Cheat Engine The Official Site of Cheat Engine
|
| View previous topic :: View next topic |
| Author |
Message |
4jax_cheater Cheater
Reputation: 0
Joined: 14 Apr 2009 Posts: 31
|
Posted: Tue Aug 02, 2011 1:18 pm Post subject: Delphi Thread DLL creating error inject process |
|
|
Hello, I have a problem with the day, and I've been researching much more I can not find anything, and the next I'm good with a serious problem for the continuation of my project, let's go
the problem and the following dll and inject ..
I am using the following code:
| Code: | | CreateThread (nil, 0, @ FormShow, nil, 0, ThreadId) |
is working perfectly .. inject form, but when I create a form in new thread to use a function of the access violation
thread creation code error form:
| Code: | METhread function (P: Pointer): LongInt;
begin
function
end;
|
using:
| Code: |
var
hThreadID: THandle;
ThreadID: DWord;
begin
{Creates the thread, where @ is the MinhaThread created Function Pointer}
hThreadID: = CreateThread (nil, 0, @ METhread, nil, 0, ThreadID); |
and this problem when I create a new thread to use a function without the access violation crashes someone knows how to solve?
thanks
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 471
Joined: 09 May 2003 Posts: 25859 Location: The netherlands
|
Posted: Tue Aug 02, 2011 2:43 pm Post subject: |
|
|
Try that code in a normal application first and make sure you do not have the debugger attached.
Anyhow, one tip: Keep all gui access in one thread, the gui components are not thread safe and if you create a second form in another thread you might be accidentally overwriting some global variables that designate the main thread ID
Because you have injected your dll syncronize will not work, so implement this using postmessage and a procedure that watches that event in the main form, or just don't use another thread
and of course, use showmodal or application.run, just using show will cause the thread to exit
_________________
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 |
|
 |
|
|
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
|
|