[Source] C# EndScene hook example menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    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)

    [Source] C# EndScene hook example

    Credits:
    Using bobbysing's dll injector. You can use whatever you like.
    The C# code is 99.99% Apoc's WhiteMagic sample.


    What it is:

    Your typical D3D hook but in C# (for those starting with .NET bots). Attached you can find a Visual Studio 2008 solution with two projects:

    - A C++ dll that launches the .NET Runtime and loads the C# module

    - A C# module that hooks EndScene and calls a Pulse function every frame

    Requires Apoc's WhiteMagic to work (dll included, four source please see Apoc's WhiteMagic thread)


    Download:
    MEGAUPLOAD - The leading online storage and file delivery service



    Hope you find it useful

    [Source] C# EndScene hook example
  2. #2
    caytchen's Avatar Contributor
    Reputation
    138
    Join Date
    Apr 2007
    Posts
    162
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1) Don't create threads in DllMain (see DllMain Callback Function (Windows) Warning). Potential deadlock.
    2) Your mixing of wchar_t and char astonishes me.
    3) You use deprecated CLR hosting functions and will not be able to run .NET Framework 4.0 stuff.

    The C# stuff is fine I guess

  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)
    To add to what caytchen already brought up:
    * You're potentially dereferencing an invalid pointer. Notice that you don't initialize 'pClrHost' except in the call to 'CorBindToRuntimeEx'. If that call fails then the statement 'pClrHost->Start()' will explode with an access violation. Bad mojo. Initialize pClrHost to 0 then do null-checking and error checking. Obviously that's not the only place where you're missing error handling, but it's the most dangerous one.
    * As a solution to caytchen's first point (don't create threads in DllMain), just use an export and have your loader call it remotely.

    P.S. The mixing of wide and narrow strings made me wtf too, lol.

Similar Threads

  1. [C# DLL] aHook, use ASM through EndScene hook
    By JuJuBoSc in forum WoW Memory Editing
    Replies: 81
    Last Post: 04-22-2024, 02:55 PM
  2. Is EndScene hooking detectable?
    By xLeo123 in forum WoW Memory Editing
    Replies: 9
    Last Post: 01-13-2010, 03:49 PM
  3. Custom rendering in endscene hook
    By ggg898 in forum WoW Memory Editing
    Replies: 3
    Last Post: 09-11-2009, 09:38 AM
  4. [Test Theory] EndScene hook without Native Code (Kinda)
    By Apoc in forum WoW Memory Editing
    Replies: 7
    Last Post: 09-04-2009, 12:46 PM
  5. EndScene Hook not changing anything
    By lanman92 in forum WoW Memory Editing
    Replies: 32
    Last Post: 06-01-2009, 11:46 PM
All times are GMT -5. The time now is 10:06 AM. 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