Help with managed DLL injection menu

Shout-Out

User Tag List

Results 1 to 4 of 4
  1. #1
    wowsc4p3's Avatar Active Member
    Reputation
    59
    Join Date
    Nov 2007
    Posts
    380
    Thanks G/R
    0/2
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Help with managed DLL injection

    I had GreyMagic working a while ago, but it involved compiling 2 other things (1 dll, 1 executable and the injected classes DLL). I have since lost the code, and forgotten how to inject a managed .net DLL into the application.
    I've been trying all of the options available, and none seem to work. This is the code I have:
    Code:
    using System;using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Diagnostics;
    using System.Runtime.InteropServices;
    using GreyMagic;
    using System.Windows.Forms;
    namespace WoWHack
    {
        public class Class1
        {
            [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
            public delegate int FrameScript_ExecuteBufferDelegate(byte a, IntPtr addr, IntPtr addrStr);
            public FrameScript_ExecuteBufferDelegate FrameScript_ExecuteBuffer;
            public void main()
            {
                Process p = Process.GetCurrentProcess();
                
                InProcessMemoryReader Memory = new InProcessMemoryReader(p);
                FrameScript_ExecuteBuffer = Memory.CreateFunction<FrameScript_ExecuteBufferDelegate>((IntPtr)0x4F9EC, true);
                string str = "print('test');";
                IntPtr buff = Marshal.AllocHGlobal(str.Length + 0x100);
                Memory.WriteString(buff, str, Encoding.UTF8);
                FrameScript_ExecuteBuffer(0, buff, buff);
                Marshal.FreeHGlobal(buff);
            }
            public static int DllMain(string p)
            {
                MessageBox.Show(p, "Managed MessageBox", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                new Class1().main();
                return -1;
            }
        }
    }
    However, No messagebox is shown, and generally there is some kind of error.
    What should I do? Are there any pre-made applications to inject a .net dll into a native process?

    Thanks for reading.

    Help with managed DLL injection
  2. #2
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1515
    Join Date
    May 2008
    Posts
    2,433
    Thanks G/R
    81/336
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    wowsc4p3's Avatar Active Member
    Reputation
    59
    Join Date
    Nov 2007
    Posts
    380
    Thanks G/R
    0/2
    Trade Feedback
    2 (100%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That didn't work when I tried (It gave me error -2 billion). I found a working one elsewhere though and modified the process list to only list wow.
    Thanks anyway.

  4. #4
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1515
    Join Date
    May 2008
    Posts
    2,433
    Thanks G/R
    81/336
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    -2 billion is probably an error code which would be useful to you. Convert it to hex and find which error it is.

Similar Threads

  1. [C#] Managed Dll Injection
    By streppel in forum WoW Memory Editing
    Replies: 26
    Last Post: 06-01-2010, 05:29 AM
  2. Need help with C# Dll and C++
    By hamburger12 in forum WoW Memory Editing
    Replies: 10
    Last Post: 05-18-2010, 08:21 PM
  3. Destructor's Tutorial: Managed .NET DLL Injection
    By ugkbunb in forum Programming
    Replies: 1
    Last Post: 07-30-2009, 05:15 PM
  4. DLL injection with windows SP3
    By Therrm in forum World of Warcraft Bots and Programs
    Replies: 3
    Last Post: 12-06-2008, 03:03 PM
  5. What are the risks with DLL injection?
    By object in forum WoW Memory Editing
    Replies: 14
    Last Post: 08-22-2008, 09:23 PM
All times are GMT -5. The time now is 02:19 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