Пример #1
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
                              );
        }
Пример #2
0
        public static void LowGravity_D(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext.Handle,
                "fldz\nfstp dword ptr [esi+0x410]") + 8;

            InlineHook.FreeHook(Context.HContext, a);
        }
Пример #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);
        }
Пример #4
0
        public static void ProjectileIgnoreTile_D(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext.Handle,
                "mov [ebp-0x20],eax\ncmp byte ptr [ebx+0xE7],0") + 11;

            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, a, new byte[] { 0x84 }, 1, 0);
        }
Пример #5
0
        public static void FastSpeed_D(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext.Handle,
                "mov [esi+0x54b],dl\nmov [esi+0x54d],dl") - 6;

            InlineHook.FreeHook(Context.HContext, a);
        }
Пример #6
0
        public static void AobReplaceASM(GameContext Context, string asm, string target)
        {
            var addrs = AobscanHelper.AobscanASM(Context.HContext.Handle, asm);

            byte[] code = Assembler.Assemble(target, 0);
            foreach (var addr in addrs)
            {
                Context.HContext.DataAccess.WriteBytes(addr, code);
            }
        }
Пример #7
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);
        }
Пример #8
0
        public static void AobReplaceASM(GameContext Context, string src, string target, int offset = 0)
        {
            int addr = 0;

            while ((addr = AobscanHelper.AobscanASM(Context.HContext.Handle, src)) != -1)
            {
                byte[] code = Assembler.Assemble(target, 0);
                NativeFunctions.WriteProcessMemory(Context.HContext.Handle, addr + offset, code, code.Length, 0);
            }
        }
Пример #9
0
        public static void GoldHoleDropsBag_D(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext.Handle,
                @"push 0
push 0
push 0x49
push 1
push 0") + 2 * 5;

            InlineHook.FreeHook(Context.HContext, a);
        }
Пример #10
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);
        }
Пример #11
0
        public static void GrabItemFarAway_D(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext.Handle,
                "mov [ebp-0x18],eax\ncmp byte ptr [ebx+0x62e],0") + 3;
            int b = a + 0x7;
            int c = a + 0xf;
            int d = a + 0x14;

            byte[] bs = { 0x74, 0x15 };
            byte[] cs = { 0x7C, 0x0D };
            byte[] ds = { 0x7F, 0x08 };
            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, b, bs, bs.Length, 0);
            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, c, cs, cs.Length, 0);
            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, d, ds, ds.Length, 0);
        }
Пример #12
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);
        }
Пример #13
0
        public static void LowGravity_D(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext,
                "fldz\nfstp dword ptr [esi+0x410]") + 8;

            int t = 0;

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

            var ass = Assembler.Assemble("mov [esi+0x414],edx", 0);

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

            InlineHook.FreeHook(Context.HContext, t);
        }
Пример #14
0
        public static void FastSpeed_D(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext,
                "mov [esi+0x54b],dl\nmov [esi+0x54d],dl") - 6;

            int t = 0;

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

            var ass = Assembler.Assemble("fstp dword ptr [esi+0x3bc]", 0);

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

            InlineHook.FreeHook(Context.HContext, t);
        }
Пример #15
0
        public static void GrabItemFarAway_E(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext.Handle,
                "mov [ebp-0x18],eax\ncmp byte ptr [ebx+0x62e],0") + 3;
            int b = a + 0x7;
            int c = a + 0xf;
            int d = a + 0x14;
            int e = a + 0x17;
            int y = 0;
            int t = 1000;

            NativeFunctions.ReadProcessMemory(Context.HContext.Handle, e, ref y, 4, 0);
            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, y, ref t, 4, 0);
            byte[] bs = { 0x90, 0x90 };
            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, b, bs, bs.Length, 0);
            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, c, bs, bs.Length, 0);
            NativeFunctions.WriteProcessMemory(Context.HContext.Handle, d, bs, bs.Length, 0);
        }
Пример #16
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);
        }
Пример #17
0
        public static void GoldHoleDropsBag_D(GameContext Context)
        {
            int a = AobscanHelper.AobscanASM(
                Context.HContext,
                @"push 0
push 0
push 0x49
push 1
push 0") + 2 * 5;

            int y = 0;

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

            byte[] b = Assembler.Assemble(@"push 0
push 0
push 0", 0);

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

            InlineHook.FreeHook(Context.HContext, y);
        }
Пример #18
0
 public static IEnumerable <nuint> AobscanASM(GameContext Context, string asm)
 {
     return(AobscanHelper.AobscanASM(Context.HContext.Handle, asm));
 }