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")); }
private void checkBox1_CheckedChanged(object sender, EventArgs e) { Assembler.Clear(); if (checkBox1.Checked) { Assembler.AddLine("jmp {0}", dwBaseAddress + 0x53); } else { Assembler.AddLine("jng {0}", dwBaseAddress + 0x53); } Assembler.Inject(dwBaseAddress + 0x4C); }