Results 1 to 21 of 21

Thread: Address Pointers

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Address Pointers

    My 1st question is are there such things as address pointers in VB6

    If yes, can I send the address of a Sub in one running process to another running process and have that other running process call the sub and pass arguments using an address pointer.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: Address Pointers

    I know it is possible to use VB6 to change the data of a particular address in order to change the button text/display in "calc.exe" for example. Not sure about sending a whole sub or function although.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3
    PowerPoster
    Join Date
    Feb 2012
    Location
    West Virginia
    Posts
    14,205

    Re: Address Pointers

    I don't think so

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Address Pointers

    I believe that when it comes to changing text of a button you are using the handle of the button and SendMessage API but I'm not asking about that. I'm asking about one process calls a sub in another process if it has the address of the sub.

    Example: Some APIs require a callback sub so in order for it to do that you need to pass the address of that sub to the API using AddressOf. I'm asking something similar to that but instead of an API it would be another application running in it's own address space.
    Last edited by jmsrickland; Jul 7th, 2014 at 10:22 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  5. #5
    Addicted Member Wolfgang Enzinger's Avatar
    Join Date
    Apr 2014
    Location
    Munich, Germany
    Posts
    160

    Re: Address Pointers

    Quote Originally Posted by jmsrickland View Post
    I'm asking about one process calls a sub in another process if it has the address of the sub.

    Example: Some APIs require a callback sub so in order for it to do that you need to pass the address of that sub to the API using AddressOf. I'm asking something similar to that but instead of an API it would be another application running in it's own address space.
    Not possible IMHO. That function address would be meaningless to the calling process because it belongs to a different address space.

    Wolfgang

  6. #6
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Address Pointers

    You're better off using some form of IPC.

    The most trivial to do in VB6 are COM, TCP/IP via Winsock controls, and DDE. However there are tons of other options such as Mailslots, Named Pipes, mapped memory, WM_COPYDATA, etc.

    Interprocess Communications gievs an overview. Those articles are in the MSDN Library CDs that come with VB6 as well.
    Last edited by dilettante; Jul 8th, 2014 at 12:25 PM.

  7. #7

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Address Pointers

    OK, then, I've used one or more of the other options so I was just brainstorming about this. Thanks for the info anyway.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  8. #8
    Hyperactive Member
    Join Date
    Oct 2013
    Posts
    389

    Re: Address Pointers

    It is possible, in theory, and most likely in practice.
    although when it comes to pointers and memory, VB6 is really not the way to go, C++ would be far better.

    On topic, i believe it can be done, in a messy way, by allocating new memory and injecting the assembly code representing the sub to the process, then creating a new thread to execute that code.

    it will require heavy leeching on google and a lot of patience (i tried it once and gave up after a few hours)

    in short,i'm 100% sure it can be done, i've seen it done before, just not by VB6.
    those are my 2 cents anyway.

  9. #9
    Junior Member
    Join Date
    Jan 2014
    Posts
    16

    Re: Address Pointers

    Visit http://vb.mvps.org/hardcore/ and take a read of Chapter 2, in the section "Dealing with Pointers".

    From the page;

    "Dealing with pointers in Basic is kind of like getting in a hatchet fight without a hatchet. If you’re going to hack into places where you’re not supposed to go, you’d better arm yourself appropriately."

    Elias

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Address Pointers

    How do you get to Chapter 2

    EDIT: Never mind I found it. Why no index I have to click >> until I get it
    Last edited by jmsrickland; Jul 8th, 2014 at 04:51 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  11. #11

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: Address Pointers

    Given that you cannot do this using VB no one has said you can't do it using C/C+. So, if it can be done using C/C+ then why not two VB applications each with it's own C/C++ DLL and use these to pass the address of a Sub. Is this possible


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  12. #12
    Junior Member
    Join Date
    Jan 2014
    Posts
    16

    Re: Address Pointers

    Quote Originally Posted by jmsrickland View Post
    How do you get to Chapter 2

    EDIT: Never mind I found it. Why no index I have to click >> until I get it
    The index is on the left side of the page, but you need to have the latest Java stuff installed for your browser in order for the index to appear.

    Elias

  13. #13
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Address Pointers

    From the context it sounds like you really mean "function pointer" which is a real thing unlike "address pointer." No, it makes no sense to pass them between processes.

    There is no magical unicorn language in which this works. Function pointers are offsets from the base of a process' address space, not absolute memory addresses valid for all processes.

  14. #14
    Hyperactive Member
    Join Date
    Oct 2013
    Posts
    389

    Re: Address Pointers

    dilettante, it actually makes sense, depending on what you're trying to do.

    if i have a 3rd party software for example, to which i wish my application to sync with, and i would like to invoke a function in that software for whatever reason, assuming i can't do so using Sendmessage\Postmessage, or any dll \ command prompt \ or such, for that matter, my only option is to invoke that function straight from memory.

    again, it can be done, it has many uses, and its a very important issue you've raised here, if you found a solution please post back to us.

  15. #15
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Address Pointers

    Quote Originally Posted by stum View Post
    if i have a 3rd party software for example, to which i wish my application to sync with, and i would like to invoke a function in that software for whatever reason, assuming i can't do so using Sendmessage\Postmessage, or any dll \ command prompt \ or such, for that matter, my only option is to invoke that function straight from memory.
    What you have described is the odious practice known as application hijacking. It is sometimes used to try to get away with a freeware application instead of forking over the cash for a non-free library from the same vendor.

    While you might sometimes feel you have no option don't expect software vendors to make it easy for you.

    Quote Originally Posted by stum View Post
    again, it can be done, it has many uses, and its a very important issue you've raised here, if you found a solution please post back to us.
    If you are still talking about making calls on a function pointer of another process then no, it can't be done. I'm not sure why you keep insisting that it can.


    See Virtual Address Space

    The virtual address space for a process is the set of virtual memory addresses that it can use. The address space for each process is private and cannot be accessed by other processes unless it is shared.
    And shared memory can only be mapped for data segments, not code segments.

  16. #16
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Address Pointers

    Also see Harden Your Applications Against Hijacking which presents additional techniques to make hijacking even more difficult.

  17. #17
    Hyperactive Member
    Join Date
    Oct 2013
    Posts
    389

    Re: Address Pointers

    Quote Originally Posted by dilettante View Post
    The address space for each process is private and cannot be accessed by other processes unless it is shared.
    You are correct it is declared private, but you're forgetting that in that method you are not directly accessing the code from your software, but nicely forcing the other program to invoke that function for you.

    Quote Originally Posted by dilettante View Post
    If you are still talking about making calls on a function pointer of another process then no, it can't be done. I'm not sure why you keep insisting that it can.
    allow me to show you an example,
    This youtube video, shows an example of how it can be done using some sort of IDA to reverse engineer, find the 'About popup sub routine code' on a known windows game, allocate memory for it and create a thread to execute that particular memory section.

    it is not the ideal solution to get something done. but it is a solution.
    Last edited by stum; Jul 10th, 2014 at 05:06 AM.

  18. #18
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Address Pointers

    Those sorts of burglar tools use techniques such as DLL injection to accomplish such things. This site has a policy of not discussing game cheat topics at all.

    There is no legitimate programming technique involved there. It abuses some of the debugger APIs to hack into a process.

    Programmers should make at least a minimal effort to defeat such things anyway. Follow the link in post #16 above for things a programmer can do to help defeat those kinds of hacker utilities.

  19. #19
    Hyperactive Member
    Join Date
    Oct 2013
    Posts
    389

    Re: Address Pointers

    Quote Originally Posted by dilettante View Post
    Those sorts of burglar tools use techniques such as DLL injection to accomplish such things. This site has a policy of not discussing game cheat topics at all.

    There is no legitimate programming technique involved there. It abuses some of the debugger APIs to hack into a process.

    Programmers should make at least a minimal effort to defeat such things anyway. Follow the link in post #16 above for things a programmer can do to help defeat those kinds of hacker utilities.
    Well, you are wrong here, there can be a legitimate programming behind the concept, but youre entitled to your own opinion, though, it's irelevant, your'e focusing on the micro rather than the macro, i am expanding the concept, not its uses.
    it might as well been Microsoft Word, and you would use the method to print the document youre viewing or something like that (i assume you know where i'm going with this ...)

    The idea of the topic should remain as it is, the capability to invoke routines from another software is possible.

  20. #20
    PowerPoster
    Join Date
    Feb 2006
    Posts
    24,482

    Re: Address Pointers

    We'll have to wait and see the working example you post later I guess.

  21. #21
    PowerPoster
    Join Date
    Jul 2002
    Location
    Dublin, Ireland
    Posts
    2,148

    Re: Address Pointers

    You can invoke operations of a third party application if they are exposed - either through a COM interface or through the application front end (e.g. menus etc.)
    If they aren't you basically can't...by design.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width