Thread: C++ pointers?

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    67

    C++ pointers?

    Hello, I'm writing a DLL to inject into VisualBoyAdvance (gameboy emulator. Yes I actually have a gameboy, and yes I actually own the game. It's legal), and I was trying to figure something out. The thing has a base pointer which contains the dynamic base address for the game, which changes with every loading of the game. I want to be able to do something like this:

    Code:
    // 0059EC80 is the base pointer
    int dynamic_base_address = *(0059EC8);
    // hp is the dynamic base address + 0x98
    Int16 hp = dynamic_base_address+0x98;
    Int16 maxhp = dynamic_base_address+0x9A;
    
    *hp = *maxhp;
    is there any sort of way to accomplish this? Basically I want to get what the base pointer holds, add offsets, and then be able to manipulate the values at those addresses, or move them into eachother, etc. Any help is appreciated.

  2. #2
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    VBA is open-source, so why do you have to inject a DLL? Besides, I believe it even offers pre-defined interfaces for cheats. Or at least there are utilities that do so.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  3. #3
    Registered User
    Join Date
    Sep 2007
    Posts
    67
    I want a DLL so it's easier to distribute, so I can make it game-specifiic without having to scroll through all the code, and do things with code that the cheat interface doesn't allow.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Using pointers to pointers
    By steve1_rm in forum C Programming
    Replies: 18
    Last Post: 05-29-2008, 05:59 AM
  2. Replies: 4
    Last Post: 12-10-2006, 07:08 PM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 10:33 AM
  4. Staticly Bound Member Function Pointers
    By Polymorphic OOP in forum C++ Programming
    Replies: 29
    Last Post: 11-28-2002, 01:18 PM