SuspendThread menu

Shout-Out

User Tag List

Results 1 to 1 of 1
  1. #1
    Lecht123's Avatar Member
    Reputation
    2
    Join Date
    Aug 2008
    Posts
    8
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    SuspendThread

    When is it necessary to suspend wow's main thread before injecting and executing a codecave function? Or is it mandatory? Can some functions cause problems? On some occasions, this locks up the wow client.

    Code:
                ProcessThread wowMainThread = SThread.GetMainThread(clientProcess.Id);
                IntPtr hThread = SThread.OpenThread(wowMainThread.Id);
    
                uint movement = client.AllocateMemory(0x1024);
    
                client.Asm.Clear();
                client.Asm.AddLine("mov ebx, [{0}]", ObjectManager.staticClientConnection);
                client.Asm.AddLine("add ebx, {0}", ObjectManager.objectManagerOffset);
                client.Asm.AddLine("mov ebx, [ebx]");
    
                client.Asm.AddLine("fs mov eax, [0x2C]");
                client.Asm.AddLine("mov eax, [eax]");
                client.Asm.AddLine("add eax, 0x8");
                client.Asm.AddLine("mov dword [eax], ebx");
    
                client.Asm.AddLine("mov eax, {0}", System.Environment.TickCount);
                client.Asm.AddLine("mov ecx, {0}", client.ReadUInt((uint)WowOffsets.CInputControl));
                client.Asm.AddLine("push {0}", 0);
                client.Asm.AddLine("push eax");
                client.Asm.AddLine("push {0}", 1);
                client.Asm.AddLine("push {0}", (uint)Flag);
                client.Asm.AddLine("call {0}", (uint)WowOffsets.CGInputControl__SetControlBit_0);
                client.Asm.AddLine("retn");
    
                SThread.SuspendThread(hThread);
                client.Asm.InjectAndExecute(movement);
                SThread.ResumeThread(hThread);
    
                client.FreeMemory(movement);

    SuspendThread
All times are GMT -5. The time now is 06:17 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