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 


{Help} Creating Form Dll {delphi}

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
iRiot
Master Cheater
Reputation: 0

Joined: 03 Jul 2007
Posts: 395
Location: Aka RIOT

PostPosted: Fri Oct 05, 2007 8:28 pm    Post subject: {Help} Creating Form Dll {delphi} Reply with quote

Ok well guys i want a dll file to make a form when its injected so this is the following code i use:

Whenever i inject the dll it makes a form but then freezes the program!


So if theres another way of injecting a dll file into a program and letting the form pop up and not interfere with the program plz post? Lol


Code:
function FormCreate : Integer; stdcall;
var
Form : TForm1;
begin
  Form := TForm1.Create(Application);
  Result := Form.ShowModal;
end;


exports
  FormCreate;

begin
FormCreate;
end.

_________________
Back to top
View user's profile Send private message
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Sat Oct 06, 2007 12:28 am    Post subject: Reply with quote

new thread.
_________________
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Sat Oct 06, 2007 12:32 am    Post subject: Reply with quote

you're entering a messageloop on DLL_PROCESS_ATTACH, the windows loader is waiting for DllMain to return (and it won't until your form closes)

don't do stuff at DllMain, if you inject using the CreateRemoteThread method, do a seconary CreateRemoteThread on a function you export from your dll
Back to top
View user's profile Send private message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Sat Oct 06, 2007 10:30 am    Post subject: Reply with quote

I use a different way of loading a Form. And i do have the same problem. Appalsap, can you please explain exactly what i need to do within the DLL so that my form can show up and not have to close it for maple to unfreeze.
Back to top
View user's profile Send private message AIM Address MSN Messenger
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Sat Oct 06, 2007 12:55 pm    Post subject: Reply with quote

she just told you to make it in a new thread.
_________________
Back to top
View user's profile Send private message
slippppppppp
Grandmaster Cheater
Reputation: 0

Joined: 08 Aug 2006
Posts: 929

PostPosted: Sat Oct 06, 2007 9:10 pm    Post subject: Reply with quote

Ok i got it. Just incase you didnt get it yet iriot, this is the code i used.

function CreateThread: boolean;
var
hProcess : Thandle;
initdataaddr, WriteAddr : pointer;
TheadID, TargetProcessID : DWORD;
begin
hProcess := OpenProcess( PROCESS_ALL_ACCESS, FALSE, TargetProcessID );
CreateRemoteThread( hProcess , nil , 0, WriteAddr , InitDataAddr ,0 , TheadID );
end;

Make sure you set it as an export and declare it after your showform declaration
Back to top
View user's profile Send private message AIM Address MSN Messenger
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