flat assembler
Message board for the users of flat assembler.

Index > Windows > Calling a process from an other program.

Author
Thread Post new topic Reply to topic
holdlang



Joined: 10 Aug 2004
Posts: 11
holdlang 23 Apr 2005, 07:34
HI.

I'm now makeing a little project but i have a problem.
I need to call a function from an other running exe file.

Any idea how can i do it?
I know i need to change the process attributes, i do it.
But how can i know the memory adress of the function in the other exe? I can found it's virtual adress with a debugger but how can i calculate the real address? Or i can call with hwnd somehow?

Any ideas pls?

Holdláng
Post 23 Apr 2005, 07:34
View user's profile Send private message Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 23 Apr 2005, 11:18
CreateRemoteThread, or SuspendThread + GetThreadContext + SetThreadContext + ResumeThread + {wait} + SuspendThread + SetThreadContext + ResumeThread (NT is a lot easier than 9x Razz - although you can of course use EliCZ' CreateRemoteThread emulation).
Post 23 Apr 2005, 11:18
View user's profile Send private message Visit poster's website Reply with quote
Madis731



Joined: 25 Sep 2003
Posts: 2139
Location: Estonia
Madis731 23 Apr 2005, 13:23
Wouldn't IPC be more convenient? Like when making threads you have two exes running at base 400000h and how do you address stuff - what is what, confusing I think ^o)
Post 23 Apr 2005, 13:23
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 23 Apr 2005, 13:28
Of course it depends on what you're doing - if you're in control of both applications, IPC is certainly the way to go. Pipes, Memory Mapped File, Shared section, mailslots, ...
Post 23 Apr 2005, 13:28
View user's profile Send private message Visit poster's website Reply with quote
holdlang



Joined: 10 Aug 2004
Posts: 11
holdlang 23 Apr 2005, 14:30
Can you post some example from IPC usage pls?
Thanx for the ideas.

Holdláng
Post 23 Apr 2005, 14:30
View user's profile Send private message Reply with quote
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav 25 Apr 2005, 10:51
this example shows how to execute code from other process, imho, very easy

ps. author - me Smile


Description: hook explorer and give a msgbox
Download
Filename: hook.rar
Filesize: 1023 Bytes
Downloaded: 412 Time(s)


_________________
[not enough memory]
Post 25 Apr 2005, 10:51
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.