Easyhook and whitemagic problems & FSM design question menu

Shout-Out

User Tag List

Results 1 to 10 of 10
  1. #1
    !@^^@!'s Avatar Active Member
    Reputation
    23
    Join Date
    Feb 2007
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Easyhook and whitemagic problems & FSM design question

    Hi, i recently managed to inject my code into wow with easyhook and hook up the endscene call with Apoc's whitemagic (thanks for that one btw) however i have problem with wow crashing when closing it, by simply commenting out the code i have in the injected lib i tracked down the error to be comming from the endscene hook or rather the endscene delgate/endscene handler...
    is there a function like ApplicationExit i should hook and do my disposing in or is the problem something else i've overlooked?

    Another thing, I freaking LOVE the new additions in .net 4 and would like to use it for my project BUT easyhook complains when i try to inject a .net 4 assembly but have no problem doing it with .net 3.5 and below assemblies, therefor i've for the last 2 hours been looking through the source code of easyhook...
    I've tracked down the exception to be comming from:
    Code:
     public static void GacInstallAssembly(
                IntPtr InContext,
                String InAssemblyPath,
                String InDescription,
                String InUniqueID)
            {
                Boolean Res;
                if (Is64Bit) Res = NativeAPI_x64.GacInstallAssembly(InContext, InAssemblyPath, InDescription, InUniqueID);
                else Res =  NativeAPI_x86.GacInstallAssembly(InContext, InAssemblyPath, InDescription, InUniqueID);
                if(!Res)
                    throw new ApplicationException("Unable to install assembly in the GAC. This usually indicates either an invalid assembly path or you are not admin.");
            }
    so it's calling a importet function from the c++ easyhook dll:
    Code:
    extern "C" __declspec(dllexport) BOOL __stdcall GacInstallAssembly(
            LPINTERNAL_CONTEXT InContext,
            WCHAR* InAssemblyPath,
            WCHAR* InDescription,
            WCHAR* InUniqueID){
    
        FUSION_INSTALL_REFERENCE InstallInfo;
    
        // setup installation parameters
        memset(&InstallInfo, 0, sizeof(InstallInfo));
    
        InstallInfo.cbSize = sizeof(InstallInfo);
        InstallInfo.dwFlags = 0;
        InstallInfo.guidScheme = FUSION_REFCOUNT_OPAQUE_STRING_GUID;
        InstallInfo.szIdentifier = InUniqueID;
        InstallInfo.szNonCannonicalData = InDescription;
    
        // install assembly with given parameters
        if(!SUCCEEDED(InContext->Cache->InstallAssembly(0, InAssemblyPath, &InstallInfo)))
            return FALSE;
    
        return TRUE;
    }
    So it's not because easyhook does some checks on the .net version of the assembly wich i first assumed therefor im pretty clueless about why it doesn't work, any ideas?

    Last question:
    I've picked up Apoc's http://www.mmowned.com/forums/c/2327...your-bots.html and implemented a few of my own ideas, but regarding the design usage of it, would it be best to "nest" FSM's? like say we have 4 states in the first FSM: BgMode, GrindMode, QuestMode, ProfessionMode
    and inside each these states we have a different FSM with states regarding the state of the previous state...

    Thanks in advance :wave:

    Easyhook and whitemagic problems & FSM design question
  2. #2
    adaephon's Avatar Active Member
    Reputation
    76
    Join Date
    May 2009
    Posts
    167
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For the .NET 4 issues: .NET 2->3.5 all run on the CLR 2.0, but .NET 4.0 also introduces a new version of the CLR, along with various changes to the CLR Hosting API (CorBindToRuntime and associates are deprecated). I was looking into this a bit for my .NET hosting, but the documentation of the new interfaces (given they are in beta) was incomplete and seemed to be leading down a path of a lot of digging around for minimal short term gain so I left it. Read this article for more info: Hosting Changes in the .NET Framework 4

  3. #3
    !@^^@!'s Avatar Active Member
    Reputation
    23
    Join Date
    Feb 2007
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm well then it absolutly makes much more sense...
    But short term gain? being able to use a ObserveableCollection<LogEntry> for my log so i can databind my ipc interface directly seems like a pretty big gain imo so i'll have a look at it and see if i can figure it out myself else i'll request it as a feature for easyhook...
    and thanks btw

  4. #4
    adaephon's Avatar Active Member
    Reputation
    76
    Join Date
    May 2009
    Posts
    167
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ObservableCollection exists in .NET 3.5.

    What I meant by no short term gain was that the code I was injecting didn't use any .NET 4 specific features, so nothing was lost by compiling it to 3.5, and a headache was avoided. I still want to figure out how to do this as there are a lot of cool features in .NET 4 that would be great in injected (and other) apps.

    I'm intending to look into and find out more about the parallel feature, among other things.

  5. #5
    !@^^@!'s Avatar Active Member
    Reputation
    23
    Join Date
    Feb 2007
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it does? 0.o i guess it have another namespace then because i just looked in system.collection.objectmodel oh well thanks and have a +rep back
    although it's no wonder i didn't notice because when i started learning c# a year ago i used 2.0 and winforms, later i discovered wpf and only used 3.5 for a month because the VS2010 came out with .net 4 and idk why but i like experimenting with beta's....

    -edit-

    aha i just needed a reference to WindowsBase
    Last edited by !@^^@!; 02-15-2010 at 08:52 AM.

  6. #6
    Viano's Avatar Active Member
    Reputation
    37
    Join Date
    May 2008
    Posts
    172
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For WoW crashing: maybe you did forget to remove your hooks while closing your app?
    Viano

  7. #7
    !@^^@!'s Avatar Active Member
    Reputation
    23
    Join Date
    Feb 2007
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well idk what was wrong because it's not doing it anymore and i didn't change any code in that section :s

  8. #8
    TOM_RUS's Avatar Legendary
    Reputation
    914
    Join Date
    May 2008
    Posts
    699
    Thanks G/R
    0/52
    Trade Feedback
    0 (0%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    There's an example on how to use new CLR 4.0 hosting interface:
    CLR version for .Net Framework 4 beta 2

  9. #9
    adaephon's Avatar Active Member
    Reputation
    76
    Join Date
    May 2009
    Posts
    167
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ooh cheers thanks for link

  10. #10
    !@^^@!'s Avatar Active Member
    Reputation
    23
    Join Date
    Feb 2007
    Posts
    155
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If anyone have the same problem as me with wpf databinding whining about modification to a databound list from another thread here is a solution that don't block wow's main thread: Quantum Bit Designs Blog Archive WPF Cross-Thread Collection Binding – Part 4 – The Grand Solution
    Thanks for the link TOM_RUS, and oh hey btw i'd still like to know a little more about how you guys have implemented your FSM

Similar Threads

  1. [Help] Some glitch and pvp problem
    By Anarchy in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 02-18-2008, 12:06 AM
  2. About several navicat and mysql problems
    By Ryuk in forum World of Warcraft Emulator Servers
    Replies: 0
    Last Post: 10-12-2007, 04:31 PM
  3. Head and anim problems
    By Shin92 in forum WoW ME Questions and Requests
    Replies: 0
    Last Post: 06-16-2007, 08:31 AM
  4. im new here and i have just a few questions :D
    By murash_rulez in forum Community Chat
    Replies: 0
    Last Post: 03-01-2007, 04:15 AM
  5. Windows Movie Maker and Fraps Problems
    By xlAnonym0uslx in forum World of Warcraft General
    Replies: 5
    Last Post: 02-15-2007, 06:09 AM
All times are GMT -5. The time now is 05: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