GetD3DFunction() public method

public GetD3DFunction ( string funcName ) : uint
funcName string
return uint
        static void Main(string[] args)
        {
            Executor      injector = new Executor();
            string        dllName  = "D3DModelRipper.dll";
            MessageStruct mes      = new MessageStruct();

            if (ProcessParameters(args, ref mes) != 0)
            {
                Console.WriteLine("Error Processing Parameters");
                return;
            }

            try
            {
                injector.Inject(dllName, args[0].Substring(0, args[0].Length - 4));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine("Error Injecting");
                return;
            }

            D3DFuncLookup d3d9Util;

            try
            {
                d3d9Util = new D3DHookingLibrary.D3DFuncLookup(args[0], args[1]);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine("Error Initializing D3DHookingLibrary");
                return;
            }

            IntPtr dipAddress;
            IntPtr setStreamSourceAddress;

            try
            {
                dipAddress                  = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.DrawIndexedPrimitive);
                setStreamSourceAddress      = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.SetStreamSource);
                mes.dip_address             = dipAddress;
                mes.setStreamSource_address = setStreamSourceAddress;
                injector.getSyringe().CallExport(dllName, "InstallHook", mes);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return;
            }
            while (true)
            {
                Thread.Sleep(300);
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Executor injector = new Executor();
            string dllName = "D3DModelRipper.dll";
            MessageStruct mes = new MessageStruct();
            if (ProcessParameters(args, ref mes) != 0)
            {
                Console.WriteLine("Error Processing Parameters");
                return;
            }

            try
            {
                injector.Inject(dllName, args[0].Substring(0, args[0].Length - 4));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine("Error Injecting");
                return;
            }

            D3DFuncLookup d3d9Util;
            try
            {
                d3d9Util = new D3DHookingLibrary.D3DFuncLookup(args[0], args[1]);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine("Error Initializing D3DHookingLibrary");
                return;
            }

            IntPtr dipAddress;
            IntPtr setStreamSourceAddress;

            try
            {
                dipAddress = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.DrawIndexedPrimitive);
                setStreamSourceAddress = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.SetStreamSource);
                mes.dip_address = dipAddress;
                mes.setStreamSource_address = setStreamSourceAddress;
                injector.getSyringe().CallExport(dllName, "InstallHook", mes);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return;
            }
            while (true) Thread.Sleep(300);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Executor injector = new Executor();
            string dllName = "D3DTextureRipper.dll";
            injector.Inject(dllName, args[0].Substring(0, args[0].Length-4));

            D3DFuncLookup d3d9Util = new D3DHookingLibrary.D3DFuncLookup(args[0], args[1]);

            IntPtr resetAddress = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.SetTexture);
            MessageStruct mes = new MessageStruct() { reset_address = resetAddress};
            injector.getSyringe().CallExport(dllName, "InstallHook", mes);
            while (true) Thread.Sleep(300);
        }
        public static void hook(object parameter)
        {
            string exeName   = (string)parameter;
            Int32  TargetPID = 0;

            addresses[0] = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.EndScene);
            addresses[1] = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.SetStreamSource);
            addresses[2] = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.DrawIndexedPrimitive);
            addresses[3] = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.BeginScene);
            addresses[4] = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.Reset);

            if (addresses[0] == null || addresses[1] == null)
            {
                return;
            }

            TargetPID = Convert.ToInt32(d3d9Util.LookUpObject.FindProcessId(exeName));

            RemoteHooking.IpcCreateServer <D3DLoggerInterface>(ref ChannelName, WellKnownObjectMode.SingleCall, _interface);

            Hooking.hook(TargetPID, "Whatever descriptor", "D3DTextureLoggerClient.exe", "D3DTextureLogger.dll",
                         "D3DTextureLogger.dll", ChannelName, addresses);
        }
Beispiel #5
0
        static void Main(string[] args)
        {
            Executor injector = new Executor();
            string dllName = "D3DWindower.dll";
            injector.Inject(dllName, args[0].Substring(0, args[0].Length-4));

            D3DFuncLookup d3d9Util = new D3DHookingLibrary.D3DFuncLookup(args[0], args[1]);

            int input_width = Convert.ToInt32(args[2]);
            int input_height = Convert.ToInt32(args[3]);

            IntPtr resetAddress = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.Reset);
            MessageStruct mes = new MessageStruct() { reset_address = resetAddress, height = input_height, width = input_width };
            injector.getSyringe().CallExport(dllName, "InstallHook", mes);
            while (true) Thread.Sleep(300);
        }
Beispiel #6
0
        static void Main(string[] args)
        {
            Executor injector = new Executor();
            string   dllName  = "D3DTextureRipper.dll";

            injector.Inject(dllName, args[0].Substring(0, args[0].Length - 4));

            D3DFuncLookup d3d9Util = new D3DHookingLibrary.D3DFuncLookup(args[0], args[1]);

            IntPtr        resetAddress = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.SetTexture);
            MessageStruct mes          = new MessageStruct()
            {
                reset_address = resetAddress
            };

            injector.getSyringe().CallExport(dllName, "InstallHook", mes);
            while (true)
            {
                Thread.Sleep(300);
            }
        }
Beispiel #7
0
        static void Main(string[] args)
        {
            Executor injector = new Executor();
            string   dllName  = "D3DWindower.dll";

            injector.Inject(dllName, args[0].Substring(0, args[0].Length - 4));

            D3DFuncLookup d3d9Util = new D3DHookingLibrary.D3DFuncLookup(args[0], args[1]);

            int input_width  = Convert.ToInt32(args[2]);
            int input_height = Convert.ToInt32(args[3]);

            IntPtr        resetAddress = (IntPtr)d3d9Util.GetD3DFunction(D3DFuncLookup.D3D9Functions.Reset);
            MessageStruct mes          = new MessageStruct()
            {
                reset_address = resetAddress, height = input_height, width = input_width
            };

            injector.getSyringe().CallExport(dllName, "InstallHook", mes);
            while (true)
            {
                Thread.Sleep(300);
            }
        }