| View previous topic :: View next topic |
| Author |
Message |
iRiot Master Cheater
Reputation: 0
Joined: 03 Jul 2007 Posts: 395 Location: Aka RIOT
|
Posted: Fri Oct 05, 2007 8:28 pm Post subject: {Help} Creating Form Dll {delphi} |
|
|
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 |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Sat Oct 06, 2007 12:28 am Post subject: |
|
|
new thread. _________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Sat Oct 06, 2007 12:32 am Post subject: |
|
|
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 |
|
 |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Sat Oct 06, 2007 10:30 am Post subject: |
|
|
| 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 |
|
 |
sponge I'm a spammer
Reputation: 1
Joined: 07 Nov 2006 Posts: 6009
|
Posted: Sat Oct 06, 2007 12:55 pm Post subject: |
|
|
she just told you to make it in a new thread. _________________
|
|
| Back to top |
|
 |
slippppppppp Grandmaster Cheater
Reputation: 0
Joined: 08 Aug 2006 Posts: 929
|
Posted: Sat Oct 06, 2007 9:10 pm Post subject: |
|
|
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 |
|
 |
|