Injecting ASM problems menu

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 34
  1. #16
    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)
    Originally Posted by Cypher View Post
    Go

    kill

    yourself.
    Seriously. I almost gouged my ****ing eyes out writing fasmdll_managed like 18 separate times. Here, I'll let you do the same!:
    Code:
    namespace Fasm
    {
    	public ref class ManagedFasm
    	{
    	public:
    		ManagedFasm();
    		ManagedFasm(IntPtr hProcess);
    
    		~ManagedFasm();
    
    		void AddLine(String ^ szLine);
    		void AddLine(String ^ szFormatString, ... array<Object ^> ^ args);
    		void Add(String ^ szLine);
    		void Add(String ^ szFormatString, ... array<Object ^> ^ args);
    		void InsertLine(String ^ szLine, int nIndex);
    		void Insert(String ^ szLine, int nIndex);
    		void Clear();
    
    		array<Byte> ^ Assemble();
    
    		bool Inject(IntPtr hProcess, DWORD dwAddress);
    		bool Inject(DWORD dwAddress);
    
    		DWORD InjectAndExecute(IntPtr hProcess, DWORD dwAddress, DWORD dwParameter);
    		DWORD InjectAndExecute(IntPtr hProcess, DWORD dwAddress);
    		DWORD InjectAndExecute(DWORD dwAddress);
    
    		IntPtr InjectAndExecuteEx(IntPtr hProcess, DWORD dwAddress, DWORD dwParameter);
    		IntPtr InjectAndExecuteEx(IntPtr hProcess, DWORD dwAddress);
    		IntPtr InjectAndExecuteEx(DWORD dwAddress);
    
    		IntPtr GetProcessHandle() { return m_hProcess; }
    		void SetProcessHandle(IntPtr Value) { m_hProcess = Value; }
    
    		int GetMemorySize() { return m_MemorySize; }
    		void SetMemorySize(int Value) { m_MemorySize = Value; }
    
    		int GetPassLimit() { return m_PassLimit; }
    		void SetPassLimit(int Value) { m_PassLimit = Value; }
    
    		static array<Byte> ^ Assemble(String ^ szSource);
    		static array<Byte> ^ Assemble(String ^ szSource, int nMemorySize);
    		static array<Byte> ^ Assemble(String ^ szSource, int nMemorySize, int nPassLimit);
    
    	private:
    		StringBuilder ^ m_AssemblyString;
    		List<IntPtr> ^ m_ThreadHandles;
    
    		IntPtr m_hProcess;
    		int m_MemorySize;
    		int m_PassLimit;
    	};
    }
    AGHGHHHHHHHHHHHHHHLSDLMFFOFOFOLSHITSHITSHIT.

    Injecting ASM problems
  2. #17
    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)
    I lol'd.

  3. #18
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Okay, I switched to casting and other things using DoString() now, but I can't cast most of the time. I'm using C# so detouring EndScene() is not exactly an option. I've been looking at IDA for an hour or two, trying to find the protection patch. I thought it was at 0x12EB440, but I was sadly wrong. At the moment, I'm just completely mashing DoString about 100x and it usually casts... But this is very ugly. Any hints to finding the patch? I know I could get it in a second with Bobbysing's lib, but I want to know where it's at so I can patch my stuff easier next time.

  4. #19
    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)
    You don't need to patch anything if you're using DoString.


  5. #20
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm pretty sure that the reason it's not working for me because I'm pausing the main thread before I do it. I was having crash issues before I did this.

  6. #21
    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)
    Originally Posted by lanman92 View Post
    I'm pretty sure that the reason it's not working for me because I'm pausing the main thread before I do it. I was having crash issues before I did this.
    Yep. You need to pause the main thread when doing anything that uses thread-local data, otherwise it could invalidate the linked list half way through.

  7. #22
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's my suspend code, I somewhat ripped it from some guys Lua lib... Updated addys real quick, still throwing me that stupid error when I hit my Test lua button to cast Fel armor. After this code I inject and execute then resume.

    Code:
    while (magic.ReadInt(0x12EB444) != 0)
    {
    Thread.Sleep(1);
    }
    magic.SuspendThread();
    


  8. #23
    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)
    Originally Posted by lanman92 View Post
    Here's my suspend code, I somewhat ripped it from some guys Lua lib... Updated addys real quick, still throwing me that stupid error when I hit my Test lua button to cast Fel armor. After this code I inject and execute then resume.

    Code:
    while (magic.ReadInt(0x12EB444) != 0)
    {
    Thread.Sleep(1);
    }
    magic.SuspendThread();
    


  9. #24
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Uhm. Wtf was that?

  10. #25
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe this helps, you obvious want to resume it too after all the injeciton is done

    Code:
                const uint Addon_Lock = 0x12EB444;
    
                ProcessThread wowMainThread = SThread.GetMainThread(_process.Id);
                IntPtr hThread = SThread.OpenThread(wowMainThread.Id);
    
                SThread.SuspendThread(hThread);
    
                if (wow.ReadUInt(Addon_Lock) != 0)
                {
                    SThread.ResumeThread(hThread);
                    System.Threading.Thread.Sleep(500);
                    SThread.SuspendThread(hThread);
                }
    
                Stopwatch _watch = new Stopwatch();
                while (wow.ReadUInt(Addon_Lock) != 0)
                {
                    _watch.Start();
                    System.Threading.Thread.Sleep(5);
    
                    if (Addon_Lock == 0 || _watch.ElapsedMilliseconds < 2000)
                    {
                        _watch.Stop();
                        _watch.Reset();
                        break;
                    }
                }

  11. #26
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wait, am I making a correct assumption that the BlackMagic Lib automatically Opens the main thread when I use OpenThreadAndProcess()? If it doesn't, there's my problem..... /sigh. It seems like my code does the exact same thing as yours, btw. Yours just looks prettier.

  12. #27
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    It seems like my code does the exact same thing as yours, btw. Yours just looks prettier.
    :hug:

    </Fillah of love>

  13. #28
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still not working though. Any other tips?

  14. #29
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by lanman92 View Post
    Still not working though. Any other tips?
    No nothing that i can think of, just make sure u use the new BlackMagic and dont suspend before u do any reads or you get a nasty exception.
    And if you want a failsafe lua_dostring you shoud not resume wows mainthread until the injected code has finished executing.
    Send a message when it's done and then catch it in a messageloop and then resume wows main thread

  15. #30
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was looking into doing that, but what message do you send? I was a little confused on that part =/ kind of noobish question, but whatever.

    EDIT: OMFG, anyone feel like explaining the 3rd parameter to DoString()? I thought it was the luaState or w/e, so I was copying that... Ugh. Now it works like a charm
    Last edited by lanman92; 03-15-2009 at 10:36 PM.

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Injected DoString problems
    By weber7655 in forum WoW Memory Editing
    Replies: 2
    Last Post: 06-07-2011, 10:01 PM
  2. C# Lua Wrapper (No ASM, Requires injected CLR)
    By Apoc in forum WoW Memory Editing
    Replies: 29
    Last Post: 02-04-2011, 02:52 PM
  3. Help getting 3.3.0 Invincible? And problems with cataclysm model injection.
    By random101 in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 07-25-2010, 08:49 AM
  4. M2-OBJ injecting problem
    By s3ph1roth in forum WoW ME Questions and Requests
    Replies: 1
    Last Post: 09-21-2009, 12:09 PM
  5. DLL Injection Problems
    By lanman92 in forum Programming
    Replies: 4
    Last Post: 06-18-2009, 11:24 PM
All times are GMT -5. The time now is 06:20 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