Search code examples
.netvb.netxfire

Injecting into games (Similar to xFire)


How does xFire place itself inside of games? Thanks if you can. I'm using vb.net so anything .net is helpful!


Solution

  • I'm not familiar with xFire in particular, but, in general, under windows, if you want to inject elements of your app into another, you've only got a few choices.

    1) if the target app provides an API to facilitate it, use that. This is similar to adding buttons and task panes etc to an MSOffice app for instance.

    2) if there's no api, things get a lot more difficult. You can hook into the global Mouse and keyboard events and monitor for specific keys/buttons, even when the game actually has focus. You can also do tricks like using the windows API "SetParent" to effectively "move" a window of yours into another process's window (like the game's). then position your window appropriately and it "looks" like your app is part of the target app. This is pretty tricky business. Not impossible, but there's a lot of get right to keep things from crashing constantly.