public void ExternHooks() { if (EXAMNotHooked) { //Main.LocalPlayer.ActiveHealthController.GetType().GetMethod("HandleFall"); create_exam_hook = new DumbHook(); create_exam_hook.Init(typeof(Item).GetMethod("get_ExaminedByDefault"), typeof(B1ghook).GetMethod("InfHk")); //typeof(Item).Assembly.GetType("\uE1B4") create_exam_hook.Hook(); EXAMNotHooked = false; } if (SLOTNotHooked) { Type InvController = typeof(EFT.UI.TasksScreen).GetField("_inventoryController", BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic).FieldType; if (InvController != null) { create_slot_hook = new DumbHook(); create_slot_hook.Init(InvController.GetMethod("IsAllowedToSeeSlot"), typeof(B1ghook).GetMethod("SlotHk")); create_slot_hook.Hook(); SLOTNotHooked = false; } } if (GAMMANotHooked) { create_gamma_hook = new DumbHook(); create_gamma_hook.Init(typeof(CantPutIntoDuringRaidComponent).GetMethod("CanPutInto"), typeof(B1ghook).GetMethod("InfHk")); create_gamma_hook.Hook(); GAMMANotHooked = false; } if (GAMMANotHooked2) { create_gamma2_hook = new DumbHook(); create_gamma2_hook.Init(typeof(CantRemoveFromSlotsDuringRaidComponent).GetMethod("CanRemoveFromSlotDuringRaid"), typeof(B1ghook).GetMethod("GammaHk")); create_gamma2_hook.Hook(); GAMMANotHooked2 = false; } /* * if (PocketNotHooked) * { * create_pocket_hook = new DumbHook(); * create_pocket_hook.Init(typeof(Item).GetMethod("get_NotShownInSlot"), typeof(B1ghook).GetMethod("KeyHk")); * create_pocket_hook.Hook(); * PocketNotHooked = false; * } */ }
public void Hooks() { if (Settings.SilentAim) { if (SANothooked) { create_sa_hook = new DumbHook(); create_sa_hook.Init(typeof(BallisticsCalculator).GetMethod("CreateShot"), typeof(B1ghook).GetMethod("SilentaimHk")); create_sa_hook.Hook(); SANothooked = false; } } if (Settings.ExperimentalFeatures) { if (PANotHooked) { create_pa_hook = new DumbHook(); create_pa_hook.Init(typeof(BodyPartCollider).GetMethod("IsPenetrated"), typeof(B1ghook).GetMethod("PenHk")); create_pa_hook.Hook(); PANotHooked = false; } if (DFNotHooked) { create_df_hook = new DumbHook(); create_df_hook.Init(typeof(BodyPartCollider).GetMethod("Deflects"), typeof(B1ghook).GetMethod("DefHk")); create_df_hook.Hook(); DFNotHooked = false; } if (SPDNotHooked) { create_spd_hook = new DumbHook(); create_spd_hook.Init(typeof(Player.FirearmController).GetMethod("get_SpeedFactor"), typeof(B1ghook).GetMethod("SpdHk")); create_spd_hook.Hook(); SPDNotHooked = false; } if (SPD2NotHooked) { create_spd2_hook = new DumbHook(); create_spd2_hook.Init(typeof(Weapon).GetMethod("get_SpeedFactor"), typeof(B1ghook).GetMethod("SpdHk2")); create_spd2_hook.Hook(); SPD2NotHooked = false; } /* * if (BINDNotHooked) * { * Type InvController = typeof(EFT.UI.TasksScreen).GetField("_inventoryController", BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic).FieldType; * if (InvController != null) * { * create_bind_hook = new DumbHook(); * //GameUtils.GetType(0x02000FCD) .GetField("_inventoryController") .GetMethod("IsAtBindablePlace") * create_bind_hook.Init(InvController.GetMethod("IsAtBindablePlace"), typeof(B1ghook).GetMethod("BindHk")); * create_bind_hook.Hook(); * BINDNotHooked = false; * } * } */ if (INFNotHooked) { Type InvController = typeof(EFT.UI.TasksScreen).GetField("_inventoryController", BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic).FieldType; if (InvController != null) { create_inf_hook = new DumbHook(); create_inf_hook.Init(InvController.GetMethod("CanStartNewSearchOperation"), typeof(B1ghook).GetMethod("InfHk")); create_inf_hook.Hook(); INFNotHooked = false; } } if (StandNotHooked) { Type MovementContext = typeof(MovementState).GetField("MovementContext", BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic).FieldType; if (MovementContext != null) { create_stand_hook = new DumbHook(); create_stand_hook.Init(MovementContext.GetMethod("CanStandAt"), typeof(B1ghook).GetMethod("StandHk")); create_stand_hook.Hook(); StandNotHooked = false; } } if (WeightNotHooked) { Type Physical = typeof(EFT.Player).GetField("Physical", BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic).FieldType; if (Physical != null) { create_weight_hook = new DumbHook(); create_weight_hook.Init(Physical.GetMethod("UpdateWeightLimits"), typeof(B1ghook).GetMethod("WeightHk")); create_weight_hook.Hook(); WeightNotHooked = false; } } if (MeleeNotHooked) { Type Physical = typeof(EFT.Player).GetField("Physical", BindingFlags.Instance | BindingFlags.Public | BindingFlags.Static | BindingFlags.NonPublic).FieldType; if (Physical != null) { create_melee_hook = new DumbHook(); create_melee_hook.Init(Physical.GetMethod("get_MeleeSpeed"), typeof(B1ghook).GetMethod("MeleeHk")); create_melee_hook.Hook(); MeleeNotHooked = false; } } } if (Settings.InstantDoorBreach) { if (DBNotHooked) { create_db_hook = new DumbHook(); create_db_hook.Init(typeof(Door).GetMethod("BreachSuccessRoll"), typeof(B1ghook).GetMethod("DoorHk")); create_db_hook.Hook(); DBNotHooked = false; } } if (Settings.Testings) { /* * if (STSNotHooked) * { * create_static_hook = new DumbHook(); * create_static2_hook = new DumbHook(); * * create_static_hook.Init(typeof(BetterAudio).Assembly.GetType("\uE6CB").GetMethod("get_Succeed"), typeof(B1ghook).GetMethod("InfHk")); * create_static2_hook.Init(typeof(BetterAudio).Assembly.GetType("\uE6CB").GetMethod("ValidateCertificate"), typeof(B1ghook).GetMethod("CertHk")); * * create_static_hook.Hook(); * create_static2_hook.Hook(); * STSNotHooked = false; * } * * if (NAMENotHooked) * { * //Main.LocalPlayer.ActiveHealthController.GetType().GetMethod("HandleFall");x * if (Main.LocalPlayer != null && Main.LocalPlayer.ActiveHealthController != null) * { * create_name_hook = new DumbHook(); * create_name_hook.Init(typeof(EFT.Player).GetField("ActiveHealthController").FieldType.GetMethod("HandleFall"), typeof(B1ghook).GetMethod("FallHk")); //typeof(Item).Assembly.GetType("\uE1B4") * create_name_hook.Hook(); * NAMENotHooked = false; * } * * } */ } /* * if (Settings.DevMode) * { * if (DEVNotHooked) * { * create_dev_hook = new DumbHook(); * create_dev_hook.Init(typeof(AbstractSession).GetMethod("get_MemberCategory"), typeof(B1ghook).GetMethod("DevHk")); * create_dev_hook.Hook(); * DEVNotHooked = false; * } * } */ /* * * if (Settings.GrenadeAimbot) * { * if (GANotHooked) * { * create_ga_hook = new DumbHook(); * create_ga_hook.Init(typeof(Grenade).GetMethod("Explosion"), typeof(b1ghook).GetMethod("grenadeHk")); * create_ga_hook.Hook(); * GANotHooked = false; * } * } */ }