Exemplo n.º 1
0
        public static void HarpToTP_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "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)
            {
                var player = Context.MyPlayer;
                InlineHook.Inject(Context.HContext,
                                  AssemblySnippet.FromCode(
                                      new AssemblyCode[] {
                    (Instruction)$"pushad",
                    AssemblySnippet.FromClrCall(
                        Context.HContext.MainAddressHelper.GetFunctionAddress("Terraria.Main", "get_LocalPlayer"),
                        null, false),
                    (Instruction)$"mov ebx,eax",
                    (Instruction)$"push 16",
                    (Instruction)$"fild dword ptr [{Context.TileTargetX_Address}]",
                    (Instruction)$"fild dword ptr [esp]",
                    (Instruction)$"fmul",
                    (Instruction)$"fstp dword ptr [ebx+{Entity.OFFSET_Position}]",

                    (Instruction)$"fild dword ptr [{Context.TileTargetY_Address}]",
                    (Instruction)$"fild dword ptr [esp]",
                    (Instruction)$"fmul",
                    (Instruction)$"fstp dword ptr [ebx+{Entity.OFFSET_Position + 0x4}]",
                    (Instruction)$"add esp,4",
                    (Instruction)$"popad",
                }),
                                  a, false);
            }
        }
Exemplo n.º 2
0
        public static void HighLight_E(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext.Handle,
                @"mov [ebp-0x48],edx
fld dword ptr [esi+0x8]
fld dword ptr [ebp-0x3c]
fcomip st(1)
fstp st(0)") + 3;

            if (a <= 0)
            {
                return;
            }
            InlineHook.Inject(Context.HContext,
                              AssemblySnippet.FromASMCode(
                                  @"mov dword ptr [esi+0x8],0x3f800000
mov dword ptr [esi+0x10],0x3f800000
mov dword ptr [esi+0x18],0x3f800000
fld dword ptr [esi+0x8]
fld dword ptr [ebp-0x3c]"
                                  ),
                              a, false
                              );
        }
Exemplo n.º 3
0
        public static void LowGravity_E(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext.Handle,
                "mov [esi+0x414],edx\ncmp dword ptr [esi+0x370],0");

            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode("mov dword ptr [esi+0x410],0x41200000"), a, false);
        }
Exemplo n.º 4
0
        public static void ShadowDodge_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "00 00 88 96 33 05 00 00 88 96 A9 05 00 00") - 4;

            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov byte ptr [esi+0x532],0x1"),
                              a, false, false);
        }
Exemplo n.º 5
0
        public static void ShowCircuit_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "88 96 1D 06 00 00 88 96 1E 06 00 00") - 6;

            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov byte ptr [esi+0x62a],0x1"),
                              a, false, false);
        }
Exemplo n.º 6
0
        public static void MachinicalRulerEffect_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "d9 9e c0 03 00 00 88 96 f0 05 00 00") + 12;

            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov byte ptr [esi+0x5f6],0x1"),
                              a, false, false);
        }
Exemplo n.º 7
0
        public static void FastTileSpeed_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "d9 98 c8 03 00 00 8b 85 30 f0 ff ff d9");

            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov dword ptr [eax+0x3c8],0x3e800000"),
                              a, false, false);
        }
Exemplo n.º 8
0
        public static void FastSpeed_E(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext.Handle,
                "fstp dword ptr [esi+0x3bc]\nmov [esi+0x54b],dl");

            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov dword ptr [esi+0x3bc],0x464b2000\nmov dword ptr [esi+0x3e4],0x464b2000"),
                              a, false, false);
        }
Exemplo n.º 9
0
        public static void FastWallSpeed_E(GameContext Context)
        {
            int a   = (int)Context.HContext.MainAddressHelper.GetFunctionInstruction("Terraria.Player", "Update", 0x2D07).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);
        }
Exemplo n.º 10
0
        public static void SlimeGunBurn_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "8b 85 b8 f3 ff ff 89 45 cc 8b 45 cc 40") - 0x1a;

            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov dword ptr [esp+8],216000\nmov edx,0x99"),
                              a, false, false);
        }
Exemplo n.º 11
0
        public static void RulerEffect_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "88 96 F8 05 00 00 88 96 F9 05 00 00") - 6;

            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov byte ptr [esi+0x5f7],0x1"),
                              a, false, false);
        }
Exemplo n.º 12
0
        public static void DisableInvisibility_E(GameContext Context)
        {
            int a = (int)Context.HContext.MainAddressHelper["Terraria.Player", "UpdateBuffs", 0x21B].StartAddress;
            int s = 0;

            NativeFunctions.ReadProcessMemory(Context.HContext.Handle, a + 4, ref s, 4, 0);
            var code = AssemblySnippet.FromCode(new AssemblyCode[] {
                (Instruction)"mov byte ptr [esi+0x651],0",
            });

            InlineHook.Inject(Context.HContext, code, a, false, false);
        }
Exemplo n.º 13
0
        public static void BonusTwoSlots_E(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext.Handle,
                "mov byte ptr [esi+0x5c0],0\nmov byte ptr [esi+0x514],0\nmov byte ptr [esi+0x5aa],0") - 6;

            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov dword ptr [esi+0x140],2"),
                              a, false, false);
            byte[] bs = { 0x90, 0x90 };

            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, a - 0x10, bs, bs.Length, 0);
        }
Exemplo n.º 14
0
        public static void LowGravity_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "88 96 C2070000 88 96 C3070000");

            if (a <= 0)
            {
                return;
            }
            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov dword ptr [esi+0x7C2],1"),
                              a, false, false);
        }
Exemplo n.º 15
0
        public static void BonusTwoSlots_E(GameContext Context)
        {
            int  a = Context.HContext.MainAddressHelper["Terraria.Player", "IsAValidEquipmentSlotForIteration"];
            byte d = 0;

            NativeFunctions.ReadProcessMemory(Context.HContext.Handle, a, ref d, 1, 0);
            if (d == 0xE9)
            {
                return;
            }
            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov eax,1\nret"),
                              a, false, false);
        }
Exemplo n.º 16
0
        public static void GrabItemFarAway_E(GameContext Context)
        {
            int  a = Context.HContext.MainAddressHelper["Terraria.Player", "GetItemGrabRange"];
            byte d = 0;

            NativeFunctions.ReadProcessMemory(Context.HContext.Handle, a, ref d, 1, 0);
            if (d == 0xE9)
            {
                return;
            }
            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov eax,1000\nret"),
                              a, false, false);
        }
Exemplo n.º 17
0
        public static void FastSpeed_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "D9 E8 D9 9E 28040000 88 96 5E060000");

            if (a <= 0)
            {
                return;
            }
            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov dword ptr [esi+0x428],0x41A00000"),
                              a, false, false);
        }
Exemplo n.º 18
0
        public static void InfiniteFly_E(GameContext Context)
        {
            int addr = AobscanHelper.Aobscan(Context.HContext.Handle, "89 86 90020000 80 BF");

            if (addr <= 0)
            {
                return;
            }
            InlineHook.Inject(Context.HContext, AssemblySnippet.FromCode(
                                  new AssemblyCode[]
            {
                (Instruction)"mov dword ptr [esi+0x290],100000"
            }), addr, false, false);
        }
Exemplo n.º 19
0
        public static void ShadowDodge_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "88 96 3B060000");

            if (a <= 0)
            {
                return;
            }
            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov byte ptr [esi+0x63B],1"),
                              a, false, false);
        }
Exemplo n.º 20
0
        public static void ShowCircuit_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "88 96 8D070000 88 96 7E070000");

            if (a <= 0)
            {
                return;
            }
            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov byte ptr [esi+0x78D],0x1"),
                              a, false, false);
        }
Exemplo n.º 21
0
        public static void MachinicalRulerEffect_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "88 96 52070000 C6 86 53070000 01");

            if (a <= 0)
            {
                return;
            }
            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov byte ptr [esi+0x752],0x1"),
                              a, false, false);
        }
Exemplo n.º 22
0
        public static void SwingIgnoringTiles_E(GameContext Context)
        {
            byte s = 0;

            NativeFunctions.ReadProcessMemory(Context.HContext.Handle,
                                              Context.HContext.MainAddressHelper.GetFunctionAddress("Terraria.Collision", "CanHit"), ref s, 1, 0);
            if (s != 0x55)            //已经被修改,不能再hook
            {
                return;
            }
            var code = AssemblySnippet.FromCode(new AssemblyCode[] {
                (Instruction)"mov eax,1",
            });

            InlineHook.Inject(Context.HContext, code, Context.HContext.MainAddressHelper.GetFunctionAddress("Terraria.Collision", "CanHit"), false, false);
        }
Exemplo n.º 23
0
        public static void RightClickToTP(GameContext Context)
        {
            byte s = 0;

            NativeFunctions.ReadProcessMemory(Context.HContext.Handle,
                                              Context.HContext.MainAddressHelper.GetFunctionAddress("Terraria.Main", "DoUpdate") + 5, ref s, 1, 0);
            if (s == 0xE9)            //已经被修改,不能再hook
            {
                return;
            }

            AssemblySnippet asm = AssemblySnippet.FromClrCall(
                Context.HContext.GetAddressHelper("TRInjections.dll").GetFunctionAddress("TRInjections.Utils", "RightClickTPCheck"), null, true);

            InlineHook.Inject(Context.HContext, asm,
                              Context.HContext.MainAddressHelper.GetFunctionAddress("Terraria.Main", "DoUpdate") + 5, false);
        }
Exemplo n.º 24
0
        public static void FastTileAndWallSpeed_E(GameContext Context)
        {
            int a = AobscanHelper.Aobscan(
                Context.HContext.Handle,
                "D9 E8 D9 9E 30040000 D9 E8 D9 9E 34040000 88 96");

            if (a <= 0)
            {
                return;
            }
            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov dword ptr [esi+0x430],0x41200000"),
                              a, false, false);
            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov dword ptr [esi+0x434],0x41200000"),
                              a + 8, false, false);
        }
Exemplo n.º 25
0
        public static void GoldHoleDropsBag_E(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext.Handle,
                @"push 0
push 0
push 0x49
push 1
push 0
push 0
push 0
push 0") + 2 * 5;

            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov dword ptr [esp+8],3332"),
                              a, false);
        }
Exemplo n.º 26
0
        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);
        }
Exemplo n.º 27
0
        public static void SwingingAttacksAll_E(GameContext Context)
        {
            int  a = (int)Context.HContext.MainAddressHelper["Terraria.Player", "ItemCheck_MeleeHitNPCs", 0x115].StartAddress - 6;
            int  b = (int)Context.HContext.MainAddressHelper["Terraria.Player", "ItemCheck_MeleeHitNPCs", 0x12B].StartAddress;
            byte s = 0;

            NativeFunctions.ReadProcessMemory(Context.HContext.Handle, a, ref s, 1, 0);
            if (s == 0xE9)            //已经被修改,不能再hook
            {
                return;
            }

            var code = AssemblySnippet.FromCode(new AssemblyCode[] {
                (Instruction)"mov eax,1",
            });

            InlineHook.Inject(Context.HContext, code, a, false, false);
            InlineHook.Inject(Context.HContext, code, b, false, false);
        }
Exemplo n.º 28
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
                              );
        }
Exemplo n.º 29
0
        public static void BonusTwoSlots_D(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext,
                "mov byte ptr [esi+0x5c0],0\nmov byte ptr [esi+0x514],0\nmov byte ptr [esi+0x5aa],0") - 6;

            InlineHook.Inject(Context.HContext, AssemblySnippet.FromASMCode(
                                  "mov dword ptr [esi+0x140],2"),
                              a, false, false);

            int y = 0;

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

            byte[] b = Assembler.Assemble("mov [esi+0x140],edx", 0);
            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, a, b, b.Length, 0);
            InlineHook.FreeHook(Context.HContext, y);

            byte[] bs = { 0x74, 0x0c };

            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, a - 0x10, bs, bs.Length, 0);
        }
Exemplo n.º 30
0
        public static void ImmuneDebuffs_E(GameContext Context)
        {
            int a = Context.HContext.MainAddressHelper.GetFunctionAddress("Terraria.Player", "AddBuff");

            byte[] j = new byte[1];
            NativeFunctions.ReadProcessMemory(Context.HContext.Handle, a, j, 1, 0);
            if (j[0] != 0xE9)
            {
                var player = Context.MyPlayer;
                InlineHook.Inject(Context.HContext,
                                  AssemblySnippet.FromCode(
                                      new AssemblyCode[] {
                    (Instruction)$"pushad",
                    (Instruction)$"mov ebx,{Context.Debuff_Address}",
                    (Instruction)$"cmp byte ptr [ebx+edx+8],0",
                    (Instruction)$"je end",
                    (Instruction)$"popad",
                    (Instruction)$"ret 8",
                    (Instruction)$"end:",
                    (Instruction)$"popad",
                }),
                                  a, false);
            }
        }