Calling function from another process

This is a discussion on Calling function from another process within the Windows Programming forums, part of the Platform Specific Boards category; I have injected a dll into a process and I have a seperate process, which is my program, that I ...

  1. #1
    Registered User
    Join Date
    Aug 2004
    Posts
    731

    Calling function from another process

    I have injected a dll into a process and I have a seperate process, which is my program, that I want to call a function that is in the dll (which is now injected into a seperate process). I am very confused as to how I would go about doing this.

    Edit: Just realized this probably belongs in the Windows forum.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    There's absolutely no simple way that you can do that.

    Edit: thinking about it, you could of course fake a call to your process by stopping the process, and by modifying the stopped process's debug info, insert a call to your function [stuff your arguments on the stack, then the current instruction pointer, and then set the instruction pointer to the start address of your function].

    It may help us if you explain what you actually are trying to do... But of course, it's probably making an auto-player for some game or some such.

    --
    Mats
    Last edited by matsp; 03-30-2008 at 05:35 PM.
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Aug 2004
    Posts
    731
    That's what I thought. Well off to do it some other way, thanks.

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Rune Hunter View Post
    That's what I thought. Well off to do it some other way, thanks.
    See my edit above.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    You can always VirtualAllocEx & CreateRemoteThread a new function into that process but I don't see the use of it since you already have your buddy (DLL) infecting that process, why not just call the function from DLL?
    "The Internet treats censorship as damage and routes around it." - John Gilmore

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. In over my head
    By Shelnutt2 in forum C Programming
    Replies: 1
    Last Post: 07-08-2008, 06:54 PM
  2. dllimport function not allowed
    By steve1_rm in forum C++ Programming
    Replies: 5
    Last Post: 03-11-2008, 03:33 AM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 01:53 AM
  4. passing counters between function
    By BungleSpice in forum C Programming
    Replies: 18
    Last Post: 02-21-2004, 05:16 PM
  5. Question on function syntax and calling function
    By cbrman in forum C Programming
    Replies: 10
    Last Post: 10-05-2003, 05:32 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21