예제 #1
0
        public IntPtr InjectAndExecuteEx(uint dwAddress)
        {
            ManagedFasm managedFasm = this;
            IntPtr      hProcess    = managedFasm.m_hProcess;
            int         num1        = (int)dwAddress;
            int         num2        = 0;

            return(managedFasm.InjectAndExecuteEx(hProcess, (uint)num1, (uint)num2));
        }
예제 #2
0
 private void DoStuff()
 {
     Address = (uint)Aobscan.AobScan(GTA, new Byte[] { 0xE8, 0x2D, 0x37, 0xFE, 0xFF, 0x8B, 0x08, 0x8B, 0x54, 0x24, 0x14 });
     if (Address == 0)
     {
         MessageBox.Show("Couldn't find adress to jump from.");
         Environment.Exit(0);
     }
     Address      += 0xB;
     dwBaseAddress = VirtualAllocEx(GTA, 0, 0x300, 0x1000, 0x0040);
     Assembler     = new ManagedFasm(GTA);
     Assembler.SetMemorySize(0x1000);
     Assembler.AddLine("push ebp");
     Assembler.AddLine("push ebx");
     Assembler.AddLine("push esi");
     Assembler.AddLine("cmp ecx,0FFFFC000h");
     Assembler.AddLine("je {0}", dwBaseAddress + Assembler.Assemble().Length + 0x50);
     Assembler.AddLine("mov dword ebp,{0}", dwBaseAddress + 0x200);
     Assembler.AddLine("mov dword ebx,[ebp]");
     Assembler.AddLine("cmp ebx,0");
     Assembler.AddLine("je {0}", dwBaseAddress + Assembler.Assemble().Length + 0x3);
     Assembler.AddLine("mov dword ecx,[ebp]");
     Assembler.AddLine("jmp {0}", dwBaseAddress + Assembler.Assemble().Length + 0x30);
     Assembler.AddLine("mov dword [ebp - 44h],ecx");
     //float x = 1f;
     //Assembler.AddLine("mov dword [ebp - 40h],[{0}]", dwBaseAddress+0x4E);
     Assembler.AddLine("fld dword [ebp-40h]");
     Assembler.AddLine("fild dword [ebp-44h] ");
     Assembler.AddLine("fstp dword [ebp - 0C8h]");
     Assembler.AddLine("fld dword [ebp - 0C8h]");
     Assembler.AddLine("fmulp");
     Assembler.AddLine("fstp qword [ebp - 0D0h]");
     Assembler.AddLine("movsd xmm0,[ebp - 0D0h]");
     Assembler.AddLine("cvttsd2si ecx, xmm0");
     Assembler.AddLine("cmp ecx,50000h");
     Assembler.AddLine("jng {0}", dwBaseAddress + Assembler.Assemble().Length - 0x4);
     Assembler.AddLine("mov dword ecx,50000h");
     Assembler.AddLine("mov dword [ebp - 0E0h], ecx");
     Assembler.AddLine("mov dword [esi+18h], ecx");
     Assembler.AddLine("mov dword [esi+1Ch],edx");
     Assembler.AddLine("pop esi");
     Assembler.AddLine("pop ecx");
     Assembler.AddLine("pop ebp");
     Assembler.AddLine("pop ebx");
     Assembler.AddLine("ret 0010h");
     Assembler.Inject(dwBaseAddress);
     //int test = 0;
     //WriteProcessMemory((int)GTA, (int)dwBaseAddress +0x200 - 0x40, BitConverter.GetBytes(x), BitConverter.GetBytes(x).Length, ref test);
     Assembler.Clear();
     Assembler.AddLine("jmp {0}", dwBaseAddress);
     Assembler.Inject(Address);
     Reader.Enabled = true;
     checkBox1_CheckedChanged(this, new EventArgs());
     textBox1_TextChanged(this, new EventArgs());
     numericUpDown1_ValueChanged(this, new EventArgs());
     //MessageBox.Show("Allocated memory to 0x" + dwBaseAddress.ToString("X8") + Environment.NewLine + "jumped to from 0x" + Address.ToString("X8"));
 }
예제 #3
0
        public bool Inject(uint dwAddress)
        {
            ManagedFasm managedFasm = this;

            IntPtr hProcess = managedFasm.m_hProcess;
            int    num      = (int)dwAddress;

            return(managedFasm.Inject(hProcess, (uint)num));
        }
예제 #4
0
 public byte[] Assemble(string szCode)
 {
     lock (this)
     {
         ManagedFasm fasm = new ManagedFasm();
         fasm.Add(szCode);
         return(fasm.Assemble());
     }
 }
예제 #5
0
 public byte[] Assemble()
 {
     return(ManagedFasm.Assemble(this.m_AssemblyString.ToString(), this.m_MemorySize, this.m_PassLimit));
 }
예제 #6
0
 public static byte[] Assemble(string szSource)
 {
     return(ManagedFasm.Assemble(szSource, 12288, 300));
 }
예제 #7
0
 public static byte[] Assemble(string szSource, int nMemorySize)
 {
     return(ManagedFasm.Assemble(szSource, nMemorySize, 300));
 }