Quantcast

Jump to content

» «
Photo

C#

1 reply to this topic
ED-E
  • ED-E

    War. War never changes.

  • Members
  • Joined: 31 May 2010
  • None

#1

Posted 29 December 2011 - 11:55 AM

How would this be done? do you have to open the exe and search for a memory address containing the players current location?

I have no idea, but sanny builder has done it so it can be done.

K^2
  • K^2

    Vidi Vici Veni

  • Moderator
  • Joined: 14 Apr 2004
  • United-States
  • Most Knowledgeable [Web Development/Programming] 2013
    Most Knowledgeable [GTA Series] 2011
    Best Debater 2010

#2

Posted 29 December 2011 - 04:10 PM

What you do is build a dynamic library in any language you're happy with. Rename the .dll file to .asi, and place it in the same directory as SA executable. The .asi files get loaded when the game starts, allowing you to perform some actions with DllMain. Since the library will be loaded in the same virtual memory space as the game, it will have access to all of the variables, including player location. At this point, all you have to do is look up the virtual address for the variable you're interested in and read it.

Of course, the DllMain will only run once. If you want your code executed while the game runs, you must hook into the code. There are several ways to do that. From .asi you can replace callbacks to intercept key strokes and such. So if you want your code executed on key stroke, that's the easiest way. You can also hook into game's function calls, but you need to know a bit of assembly for that. Finally, you can create a fake d3d9.dll, which lets you hook into any graphics call. If you want your code executed per-frame, it's a good way to do that, but you need to understand a bit of DirectX programming for that.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users