easy delphi declartion question..

c++ / delphi package - dll injection and api hooking
Post Reply
bluedragon99
Posts: 87
Joined: Thu Jun 02, 2005 3:46 am

easy delphi declartion question..

Post by bluedragon99 »

When using madshi SendIpcMessage getting this.

[Error] HookProcessCreation.dpr(159): E2029 ';' expected but '.' found
[Error] HookProcessCreation.dpr(161): E2029 Declaration expected but end of file found


in a blank vcl win32 form application... the declare statement

function SendIpcMessage(ipc : pchar;
messageBuf : pointer;
messageLen : dword;
answerBuf : pointer = nil;
answerLen : dword = 0;
answerTimeOut : dword = INFINITE;
handleMessages : bool = true ) : bool; stdcall;



is causing the end. error

Should be an easy one...new to delphi 05
madshi
Site Admin
Posts: 10766
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Do you try to define that in HookProcessCreation? Why? It's already defined in madCodeHook.pas! Or am I misunderstanding you?
bluedragon99
Posts: 87
Joined: Thu Jun 02, 2005 3:46 am

Post by bluedragon99 »

I am using this to define I believe..

This is being used inside of hookcreateprocess

function SendIpcMessage(ipc : pchar;
messageBuf : pointer;
messageLen : dword;
answerBuf : pointer = nil;
answerLen : dword = 0;
answerTimeOut : dword = INFINITE;
handleMessages : bool = true ) : bool; stdcall;



Can I just use without doing any other adding or declaring? If so thats what I need to do! I have put the askapplication call right where hookprocess messagebox's new process created, without the declare...the dll compiles and injects fine but I am not recieving any IPC messages when processes are created. Same IPC pipe name on both sides. Is there a way to trace ipc to see if the dll is sending anything at all? Thanks for you help

function AskApplication(question: string) : boolean;
begin
result := false;
SendIpcMessage('JustAnExample', pchar(question), Length(question), @result, sizeOf(result));
end;
madshi
Site Admin
Posts: 10766
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

bluedragon99 wrote:Can I just use without doing any other adding or declaring?
Of course!
bluedragon99 wrote:I have put the askapplication call right where hookprocess messagebox's new process created, without the declare...the dll compiles and injects fine but I am not recieving any IPC messages when processes are created. Same IPC pipe name on both sides. Is there a way to trace ipc to see if the dll is sending anything at all?
How does the app code look like?

You might want to check out the HookProcessTermination demo. It contains IPC sending.
bluedragon99
Posts: 87
Joined: Thu Jun 02, 2005 3:46 am

Post by bluedragon99 »

Thanks madshi! Do any of the demo's include IPC recieving code so I can take a look?
madshi
Site Admin
Posts: 10766
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Yeah, HookProcessTermination, as I said. Just sending doesn't make sense without receiving, of course, so the demo does both.
bluedragon99
Posts: 87
Joined: Thu Jun 02, 2005 3:46 am

Post by bluedragon99 »

Thanks Madshi...will be purchasing the full version very soon!
Post Reply