예제 #1
0
        static public void CanPowerAttack()
        {
            Trampoline.WriteRelativeCallBranch
            (
                ScrambledBugs.Offsets.Patches.PowerAttackStamina.GetStaminaCostActor,
                PowerAttackStamina.CanPowerAttack(Memory.ReadRelativeCall(ScrambledBugs.Offsets.Patches.PowerAttackStamina.GetStaminaCostActor))
            );

            var assemblyActor = new UnmanagedArray <System.Byte>();

            assemblyActor.Add(new System.Byte[2] {
                0x84, 0xC0
            });                                                                 // test al, al
            assemblyActor.Add(new System.Byte[1] {
                Assembly.Nop
            });                                                                 // nop
            assemblyActor.Add(new System.Byte[2] {
                0x74, 0x6E
            });                                                                 // jz 6E

            Memory.SafeWrite <System.Byte>(ScrambledBugs.Offsets.Patches.PowerAttackStamina.HasStaminaCostActor, assemblyActor);



            Trampoline.WriteRelativeCallBranch
            (
                ScrambledBugs.Offsets.Patches.PowerAttackStamina.GetStaminaCostPlayerCharacter,
                PowerAttackStamina.CanPowerAttack(Memory.ReadRelativeCall(ScrambledBugs.Offsets.Patches.PowerAttackStamina.GetStaminaCostPlayerCharacter))
            );

            var assemblyPlayerCharacter = new UnmanagedArray <System.Byte>();

            assemblyPlayerCharacter.Add(new System.Byte[2] {
                0x84, 0xC0
            });                                                                                 // test al, al
            assemblyPlayerCharacter.Add(new System.Byte[1] {
                Assembly.Nop
            });                                                                                 // nop
            assemblyPlayerCharacter.Add(new System.Byte[2] {
                0x75, 0x34
            });                                                                                 // jnz 34

            Memory.SafeWrite <System.Byte>(ScrambledBugs.Offsets.Patches.PowerAttackStamina.HasStaminaCostPlayerCharacter, assemblyPlayerCharacter);
        }