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);
}
}