예제 #1
0
        public static void SlimeGunBurn_D(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext,
                "8b 85 b8 f3 ff ff 89 45 cc 8b 45 cc 40") - 0x1a;

            int y = 0;

            NativeFunctions.ReadProcessMemory(Context.HContext.Handle, a + 1, ref y, 4, 0);
            y += a + 5;

            byte[] b = Assembler.Assemble("mov edx,[ebp-0xc34]", 0);

            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, a, b, b.Length, 0);

            InlineHook.FreeHook(Context.HContext, y);
        }
예제 #2
0
        public static void InitSign()
        {
            int s = AobscanHelper.Aobscan(GameContext.HContext, SignHeadAob);

            SignHead = s + 20;
            if (s != -1)
            {
                return;
            }
            int t = NativeFunctions.VirtualAllocEx(
                GameContext.HContext.Handle, 0, SignSize,
                NativeFunctions.AllocationType.Commit,
                NativeFunctions.MemoryProtection.ExecuteReadWrite);

            NativeFunctions.WriteProcessMemory(GameContext.HContext.Handle, t, AobscanHelper.GetHexCodeFromString(SignHeadAob), 16, 0);
            SignHead = t + 20;
        }
예제 #3
0
        public static void SuperRange_E(GameContext Context)
        {
            //int a = (int)Context.HContext.MainAddressHelper.GetFunctionInstruction("Terraria.Player", "ResetEffects", 0x08AE).StartAddress;
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "C7 05 ******** 05000000 C7 05 ******** 04000000 A1", true);

            if (a <= 0)
            {
                return;
            }
            int b = a + 6;
            int c = a + 16;
            int v = 0x1000;

            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, b, ref v, 4, 0);
            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, c, ref v, 4, 0);
        }
예제 #4
0
파일: Utils.cs 프로젝트: BlentER/QTRHacker
        public static void FastTileSpeed_E(GameContext Context)
        {
            /*int a = (int)Context.HContext.MainAddressHelper.GetFunctionInstruction("Terraria.Player", "Update", 0x2CDD).EndAddress - 6;
             * int off = 0;
             * NativeFunctions.ReadProcessMemory(Context.HContext.Handle, a + 2, ref off, 4, 0);
             * InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
             *      $"mov dword ptr [eax+{off}],0x3e800000"),
             *      a, false, false);*/
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "d9 98 c8 03 00 00 8b 85 30 f0 ff ff d9");
            int off = 0;

            NativeFunctions.ReadProcessMemory(Context.HContext.Handle, a + 2, ref off, 4, 0);
            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov dword ptr [eax+0x3c8],0x3e800000"),
                              a, false, false);
        }
예제 #5
0
        public static void HarpToTP_D(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext,
                "8B 8D E4 F9 FF FF FF 15") - 5;

            byte[] j = new byte[1];
            NativeFunctions.ReadProcessMemory(Context.HContext.Handle, a, j, 1, 0);
            if (j[0] == 0xE9)
            {
                int y = 0;
                NativeFunctions.ReadProcessMemory(Context.HContext.Handle, a + 1, ref y, 4, 0);
                y += a + 5;
                byte[] b = Assembler.Assemble("movq [esp],xmm0", 0);
                NativeFunctions.WriteProcessMemory(Context.HContext.Handle, a, b, b.Length, 0);
                InlineHook.FreeHook(Context.HContext, y);
            }
        }
예제 #6
0
        public static void HighLight_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                @"C7 ** ** ******** D9 07 D9 45 F0 DF F1 DD D8 7A", true);

            if (a <= 0)
            {
                return;
            }
            InlineHook.Inject(Context.HContext,
                              AssemblySnippet.FromASMCode(
                                  @"mov dword ptr[ebp-0x10],0x3F800000
mov dword ptr[ebp-0x14],0x3F800000
mov dword ptr[ebp-0x18],0x3F800000"
                                  ),
                              a + 7, false
                              );
        }
예제 #7
0
        private void button1_Click(object sender, EventArgs e)
        {
            var pid = int.Parse(textBox1.Text);

            //var pid = 11892;
            hwnd = NativeFunctions.OpenProcess(NativeFunctions.PROCESS_ALL_ACCESS, false, pid);
            int i = 0;

            var tuple = AobscanHelper.Aobscan(hwnd, idcode, addr =>
            {
                var frame = TryGetInfo(hwnd, addr);
                if (frame.Item1 >= 0 && frame.Item1 < 1000 && frame.Item2 > 80 && frame.Item2 < 100)
                {
                    label3.Text = ($"data found, frameCount = {frame.Item1}, limitTime = {frame.Item2}");
                    return(true);
                }
                return(false);
            }, callback: s =>
            {
                label3.Text = s;
                if (++i % 100 == 0)
                {
                    Refresh();
                }
            });

            addr = tuple.Item1;

            label3.Text = ($"addr = {addr:x}");

            if (addr == -1)
            {
                label3.Text = ("aobscan failed.");
                return;
            }

            button1.Visible      = false;
            textBox1.Visible     = false;
            radioButton1.Visible = false;
            radioButton2.Visible = false;
            label3.Visible       = false;
            label1.Visible       = false;
        }
예제 #8
0
        public static void HighLight_D(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(Context.HContext, "df f1 dd d8 7a 0a 73 08 d9 46 08 d9 5d c4 eb 2c d9 45 c4 dd 05") - 6;

            if (a <= 0)
            {
                return;
            }
            var ass = Assembler.Assemble(@"fld dword ptr [esi+0x8]
fld dword ptr [ebp-0x3c]", 0);
            int y   = 0;

            NativeFunctions.ReadProcessMemory(Context.HContext.Handle, a + 1, ref y, 4, 0);
            y += a + 5;

            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, a, ass, ass.Length, 0);

            InlineHook.FreeHook(Context.HContext, y);
        }
예제 #9
0
파일: Utils.cs 프로젝트: Phyzait/QTRHacker
        public static void EnableAllRecipes_E(GameContext Context)
        {
            NativeFunctions.WriteProcessMemory(Context.HContext.Handle,
                                               Context.HContext.MainAddressHelper.GetFunctionAddress("Terraria.Recipe", "FindRecipes"),
                                               new byte[] { 0xC3 }, 1, 0);
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "33 c9 89 4c 90 08 42 3b") + 0x13;
            int max = 2000;
            int v = 0, y = max;

            NativeFunctions.ReadProcessMemory(Context.HContext.Handle, a, ref v, 4, 0);
            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, v, ref y, 4, 0);

            NativeFunctions.ReadProcessMemory(Context.HContext.Handle,
                                              Context.HContext.MainAddressHelper.GetFunctionAddress("Terraria.Recipe", "FindRecipes") + 0x1c,
                                              ref v, 4, 0);
            NativeFunctions.ReadProcessMemory(Context.HContext.Handle, v, ref y, 4, 0);

            for (int i = 0; i < max; i++)
            {
                NativeFunctions.WriteProcessMemory(Context.HContext.Handle, y + 0x8 + i * 4, ref i, 4, 0);
            }
        }
예제 #10
0
 public static IEnumerable <nuint> Aobscan(GameContext Context, string srcHex)
 {
     return(AobscanHelper.Aobscan(Context.HContext.Handle, srcHex));
 }