C# + C++ Injection menu

Shout-Out

User Tag List

Results 1 to 6 of 6
  1. #1
    peterwurst's Avatar Member
    Reputation
    11
    Join Date
    Jul 2006
    Posts
    31
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C# + C++ Injection

    Heya

    I started to develop my program in pure C# with the managed_fasm library.
    But while reading stuff and programming things I thought about writing the low level stuff in C++.

    Now I'm a bit stuck and want to ask two questions:

    1) I want to handle my stuff with EndScene detouring to my function.
    First of all how do I find the "EndScene" offset through IDA, can't seem to find it.

    2) After I inject my C++ .dll to WoW how do I call it functions with C#?
    (Is there a way to check wether the function was called in process?)


    Would a simple:
    Code:
         [DllImport("MyLib")]
          static extern void Target(ulong guid);
    be enough?

    Thanks for your thoughts

    C# + C++ Injection
  2. #2
    Shynd's Avatar Contributor
    Reputation
    97
    Join Date
    May 2008
    Posts
    393
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do a google search on "Inter-process Communication." There are many ways of doing it: socket communication, named pipes, a shared memory region, etc. Using a named pipe is probably my favorite way of doing it, but it's entirely up to you.

  3. #3
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    EndScene is a virtual function in a D3D device.

    You have two choices, the easy, and the better:
    Easy: Always make your loader launch WoW and hook D3DCreate9, from there you can hook CreateDevice, and from there you can hook EndScene.
    Better: Create a custom device upon injection, pull out the EndScene function pointer from there, then discard it.

    I say the former is easier because there's already copypaste code available. The latter isn't hard though, I got it working fairly quickly. I will probably be posting the class when I get time to finish cleaning it up.

  4. #4
    barthen's Avatar Contributor Authenticator enabled
    Reputation
    94
    Join Date
    Apr 2007
    Posts
    112
    Thanks G/R
    4/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You may want to take a look at the Wowsharp source code. They did what you want, inject a C++ dll and call its functions from C#.

  5. #5
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1358
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/6
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    WoWSharp's implementation was pretty awful from memory. It was limited to a single instance because it used a shared segment in the DLL rather than something more robust like named pipes.

  6. #6
    Link_S's Avatar Member
    Reputation
    125
    Join Date
    Dec 2008
    Posts
    293
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by peterwurst View Post
    2) After I inject my C++ .dll to WoW how do I call it functions with C#?
    (Is there a way to check wether the function was called in process?)
    Using COM Interopability you can call language to language.
    C# in C++ - Through Dll
    C++ in C# - Through Dll
    VB in C++ - Through Dll

    The only downside is that you have to register the path you're going to call your Dll from. Google COM Interop and I think you will find pretty useful threads and hints.
    Why do I need a signature?

Similar Threads

  1. [Guide] Model Injection Guide
    By Glitchy in forum WoW ME Tools & Guides
    Replies: 109
    Last Post: 05-27-2010, 08:16 AM
  2. [Model Injection] Bobble Head
    By Glitchy in forum World of Warcraft Model Editing
    Replies: 16
    Last Post: 02-18-2008, 08:17 PM
  3. Packet Injecting Items
    By yungen2003 in forum World of Warcraft General
    Replies: 7
    Last Post: 08-07-2007, 07:02 AM
  4. Using DLL's to inject values without CE.
    By Matsy in forum World of Warcraft Bots and Programs
    Replies: 7
    Last Post: 06-29-2007, 02:26 PM
  5. [Bot] Anti-AFK Bot (No Injection & Focus not Needed)
    By Cypher in forum World of Warcraft Bots and Programs
    Replies: 12
    Last Post: 09-10-2006, 11:14 AM
All times are GMT -5. The time now is 12:45 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search