diff --git a/anticheat (reversed)/lua-scripts (these get loaded when the game start)/chunk.lua b/anticheat (reversed)/lua-scripts (these get loaded when the game start)/chunk.lua new file mode 100644 index 000000000..4a01cefa0 --- /dev/null +++ b/anticheat (reversed)/lua-scripts (these get loaded when the game start)/chunk.lua @@ -0,0 +1,1360 @@ + + return function(obj) + local isKeyValuePair + local function lua_iter(cs_iter, k) + if cs_iter:MoveNext() then + local current = cs_iter.Current + if isKeyValuePair == nil then + if type(current) == 'userdata' then + local t = current:GetType() + isKeyValuePair = t.Name == 'KeyValuePair`2' and t.Namespace == 'System.Collections.Generic' + else + isKeyValuePair = false + end + --print(current, isKeyValuePair) + end + if isKeyValuePair then + return current.Key, current.Value + else + return k + 1, current + end + end + end + return lua_iter, obj:GetEnumerator(), -1 + end + -- date: 2020/7/23 17:50:00 +-- target version: WWL5.0 + +-- HotFixNum 238 +require 'xlua.util'.hotfix_ex(CS.GameLogin.UIVersionCodeView, 'GetHotFixVersionStr', function(self) + return " 238" +end) + +-- WWL5.0\#01 +------------------------------------------------------------------------------------------------ +-- HotFix#1 WWL5.0 ps4手柄 激活职业技能的手柄按键名称显示错了 +-- Hengxiachen : Fixed Incorrect Composite Gamepad Button Icon +------------------------------------------------------------------------------------------------ +require 'xlua.util'.hotfix_ex(CS.BattleRoyale.BRSkillView, 'Start', function(self) + + self:Start() + + xlua.private_accessible(CS.GamepadButton) + local getChild = CS.GameEngine.PlayableController + local gamePadBtnObj = getChild.findChild(self.transform, "UIGamepadButton", true).gameObject; + + if gamePadBtnObj == nil then + return + end + + local gamePadBtn = gamePadBtnObj:GetComponent(typeof(CS.GamepadButton)); + if gamePadBtn ~= nil then + local container = getChild.findChild(self.transform, "Container", true).gameObject; + local ButtonSpriteOne = nil + local ButtonSpriteTwo = nil + local BtnSpriteOne = getChild.findChild(self.transform, "ButtonSprite1", true).gameObject + local BtnSpriteTwo = getChild.findChild(self.transform, "ButtonSprite2", true).gameObject + if BtnSpriteOne ~= nil then + ButtonSpriteOne = BtnSpriteOne:GetComponent(typeof(CS.UISprite)) + end + + if BtnSpriteTwo ~= nil then + ButtonSpriteTwo = BtnSpriteTwo:GetComponent(typeof(CS.UISprite)) + end + gamePadBtn.m_IsCompositeButton = true + gamePadBtn.m_CompositeCfg.RootObj = container + gamePadBtn.m_CompositeCfg.ButtonSprite1 = ButtonSpriteOne + gamePadBtn.m_CompositeCfg.ButtonSprite2 = ButtonSpriteTwo + + end +end) + +require 'xlua.util'.hotfix_ex(CS.GameBase.UltSkillHud, 'Start', function(self) + + self:Start() + + xlua.private_accessible(CS.GamepadButton) + local getChildMP = CS.GameEngine.PlayableController + local gamePadBtnObjMP = getChildMP.findChild(self.transform, "UIGamepadButton", true).gameObject; + + if gamePadBtnObjMP == nil then + return + end + + local gamePadBtnMP = gamePadBtnObjMP:GetComponent(typeof(CS.GamepadButton)); + if gamePadBtnMP ~= nil then + local containerMP = getChildMP.findChild(self.transform, "Container", true).gameObject; + local ButtonSpriteOneMP = nil + local ButtonSpriteTwoMP = nil + local BtnSpriteOneMP = getChildMP.findChild(self.transform, "ButtonSprite1", true).gameObject + local BtnSpriteTwoMP = getChildMP.findChild(self.transform, "ButtonSprite2", true).gameObject + if BtnSpriteOneMP ~= nil then + ButtonSpriteOneMP = BtnSpriteOneMP:GetComponent(typeof(CS.UISprite)) + end + + if BtnSpriteTwoMP ~= nil then + ButtonSpriteTwoMP = BtnSpriteTwoMP:GetComponent(typeof(CS.UISprite)) + end + gamePadBtnMP.m_IsCompositeButton = true + gamePadBtnMP.m_CompositeCfg.RootObj = containerMP + gamePadBtnMP.m_CompositeCfg.ButtonSprite1 = ButtonSpriteOneMP + gamePadBtnMP.m_CompositeCfg.ButtonSprite2 = ButtonSpriteTwoMP + + end +end) + +-- WWL5.0\#02 +-------------------------------------------------------------------------------- +-- smartzhu: fix PlaylistSelectorController OnVideoIntroductionBtnClick #2 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.GameUI.Room.PlaylistSelectorController,'OnVideoIntroductionBtnClick',function(self) + + --CS.GameEngine.Log.GeneralError("{0}",self.m_PlaylistId) + local temp = self.m_PlaylistId + local languageCode = CS.LanguageManager.CurrentELanguageCode + local suffix = 0 + if CS.GameDefine.IsIMSDKKing then + if languageCode == CS.msg.ELanguageCode.ar_SA then + suffix=10 + elseif languageCode == CS.msg.ELanguageCode.pt_BR then + suffix=11 + elseif languageCode == CS.msg.ELanguageCode.de_DE then + suffix=12 + elseif languageCode == CS.msg.ELanguageCode.en_US then + suffix=13 + elseif languageCode == CS.msg.ELanguageCode.fr_FR then + suffix=14 + elseif languageCode == CS.msg.ELanguageCode.it_IT then + suffix=15 + elseif languageCode == CS.msg.ELanguageCode.ja_JP then + suffix=16 + elseif languageCode == CS.msg.ELanguageCode.es_ES then + suffix=17 + elseif languageCode == CS.msg.ELanguageCode.ru_RU then + suffix=18 + elseif languageCode == CS.msg.ELanguageCode.tr_TR then + suffix=19 + else + suffix=13 + end + elseif CS.GameDefine.IsIMSDKGarenaSA then + if languageCode == CS.msg.ELanguageCode.zh_TW then + suffix=0 + elseif languageCode == CS.msg.ELanguageCode.en_SG then + suffix=1 + elseif languageCode == CS.msg.ELanguageCode.in_ID then + suffix=2 + elseif languageCode == CS.msg.ELanguageCode.th_TH then + suffix=3 + else + suffix=1 + end + elseif CS.GameDefine.IsIMSDKKorea then + suffix=30 + elseif CS.GameDefine.IsIMSDKVNG then + suffix=20 + end + + --CS.GameEngine.Log.GeneralError("{0}",suffix) + self.m_PlaylistId=self.m_PlaylistId-self.m_PlaylistId%100+suffix + --CS.GameEngine.Log.GeneralError("{0}",self.m_PlaylistId) + self:OnVideoIntroductionBtnClick() + self.m_PlaylistId=temp + --CS.GameEngine.Log.GeneralError("{0}",self.m_PlaylistId) + +end) + +require 'xlua.util'.hotfix_ex(CS.GameUI.Room.PlaylistSelectorController,'SetDetailInfo',function(self, playlistType, playlistId, detailType, enableTutorialVideo) + + if CS.GameDefine.IsMobileIOS and CS.GameDefine.IsIMSDKVNG then + enableTutorialVideo = false + end + self:SetDetailInfo(playlistType, playlistId, detailType, enableTutorialVideo) +end) + +-- WWL5.0\#03 +-------------------------------------------------------------------------------- +-- krisstian: Fix settlement "MORE" localization. V5.0#3 +-------------------------------------------------------------------------------- +--local GeneralError = CS.GameEngine.Log.GeneralError +require 'xlua.util'.hotfix_ex(CS.Settlement.BRSettlementDetailWindowController, 'UpdateView', function(self) + --GeneralError("HotFix BRSettlementDetailWindowController UpdateView") + self:UpdateView() + + if self.m_View ~= nil and self.m_View.BtnMoreMedal ~= nil + then + local label = self.m_View.BtnMoreMedal.transform:GetComponentInChildren(typeof(CS.UILabel)) + if label ~= nil + then + CS.GameUI.UICommonTools.SafeSetLabel(label,CS.LanguageUtility.Translate('LOC_RANK_MORE')) + end + end +end) + +-- WWL5.0\#04 +-------------------------------------------------------------------------------- +-- steekwu: Fix Final Repaly +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.PVP.DeadReplayManager, 'WaitingForFinalKillReplayTimeOut', function(self, time) + time = 5 + self:WaitingForFinalKillReplayTimeOut(time) +end) + +-- WWL5.0\#05 +-------------------------------------------------------------------------------- +-- hehehe: fix PVPOpenSceneHUD +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.GameUI.PVPOpenSceneHUD, 'Awake', function(self) + self:Awake() + self.Skip.width = 60 + local label = self.Skip.gameObject:GetComponent(typeof(CS.UILabel)) + if label ~= nil then + label.text = CS.LanguageUtility.Translate('LOC_BATTLEPASS_SEASONVIDEOVIEW_SKIPBTN') + end +end) + +-- WWL5.0\#06 +-------------------------------------------------------------------------------- +-- smartzhu: fix BRTutorialView localization #6 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.Tutorial.BRTutorialController,'Init',function(self) + self:Init() + local tp = self.m_View.NewsToggle.transform:Find('TAG(BG)') + if tp ~= nil then + local t = tp:Find('Label') + if t ~= nil then + local label = t:GetComponent(typeof(CS.UILabel)) + if label ~= nil then + label.modifier = CS.UILabel.Modifier.Localization + label.locID = 'LOC_FTUE_TAG_NEW' + end + end + end + +end) + +-- WWL5.0\#07 +-------------------------------------------------------------------------------- +-- smartzhu: fix BRTutorialView localization #6 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.PVP.Team.INFGame.InfectGameTipHUD,'RegisterDelegates',function(self) + self:RegisterDelegates() + local labelT = self.countDownTipsRoot.transform:Find('Label') + if labelT ~= nil then + local label = labelT:GetComponent(typeof(CS.UILabel)) + if label ~= nil then + label.modifier = CS.UILabel.Modifier.Localization + label.locID = 'LOC_PREFAB_INFECTED_OR' + end + end + +end) + +-- WWL5.0\#08 +-------------------------------------------------------------------------------- +-- v_wenlliang: fix VNG 18+ tips +-------------------------------------------------------------------------------- + require 'xlua.util'.hotfix_ex(CS.FrontEnd.LobbyMapTopBarView, 'ConfigureStyle', function(self,style,param) + self:ConfigureStyle(style,param) + if style == CS.FrontEnd.ELobbyMapTopBarStyle.OnlyBack then + if CS.GameEngine.DataStoreManager.Instance.GlobalDataStore.Enable18ProhibitedLogo and CS.GameDefine.IsIMSDKVNG then + local uiScene=CS.GameUI.GUIManager.Instance.UISceneObject + if(uiScene ~=nil) then + if uiScene:GetType():ToString() == 'FrontEnd.FrontEndUIScene' then + local currentCtrl = uiScene.CurrentNaviUIController + if nil ~= currentCtrl then + if currentCtrl:GetType():ToString() == 'PersonalInfoHistorySettlementNavController' then + CS.GameUI.UICommonTools.SafeSetActive(self.VNG_18, false) + end + end + end + end + end + end + end) + +-- WWL5.0\#09 +-------------------------------------------------------------------------------- +-- allenmo fix BuffEffect_DroneInterfere crash +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.GameBase.BuffEffect_DroneInterfere, 'TriggerEffectImpl', function(self) + + local PlayEffectCallBack = function (effect) + --CS.UnityEngine.Debug.LogError(self) + --CS.UnityEngine.Debug.LogError(effect) + if self.m_Buff == nil then + return + end + + if CS.GameCommon.LuaUtility.IsNullInCSharp(self.m_Buff.Target) == true then + return + end + + if self.m_Buff.Target:IsDestroyed() == true then + return + end + + if self.m_Buff.Target.ThirdPersonModelSocket == nil then + return + end + + self.m_Effect = effect + --CS.UnityEngine.Debug.LogError(self.m_Effect) + if CS.GameCommon.LuaUtility.IsNullInCSharp(self.m_Effect) == false then + local socketTransform = self.m_Buff.Target.ThirdPersonModelSocket:FindWithName("Bip01", true) + if socketTransform ~= nil then + --CS.UnityEngine.Debug.LogError("PlayEffect") + self.m_Effect.transform.parent = socketTransform + self.m_Effect.transform.localPosition = CS.UnityEngine.Vector3.zero + self.m_Effect.transform.localRotation = CS.UnityEngine.Quaternion.identity + self.m_Effect.transform.localScale = CS.UnityEngine.Vector3.one + + self.m_Effect:PlayEffect() + end + end + end + + --CS.UnityEngine.Debug.LogError("TriggerEffectImpl") + if self.m_Buff ~= nil and CS.GameCommon.LuaUtility.IsNullInCSharp(self.m_Buff.Target) == false then + if CS.GameCommon.LuaUtility.IsNullInCSharp(self.m_Effect) == true then + --CS.UnityEngine.Debug.LogError("step 1") + + if self.m_Buff.Target.ViewType == CS.GameEngine.EActorViewType.ThirdPerson and self.m_Buff.Target.ThirdPersonModelSocket ~= nil then + --CS.UnityEngine.Debug.LogError("step 2") + + local socketTransform = self.m_Buff.Target.ThirdPersonModelSocket:FindWithName("Bip01", true) + if socketTransform ~= nil then + --CS.UnityEngine.Debug.LogError("step 3") + local spawnEffectGeneric = xlua.get_generic_method(CS.GameEngine.EffectManager, "SpawnEffect") + local spawnEffect = spawnEffectGeneric(CS.GameEngine.ParticleEffect) + spawnEffect(310000156, socketTransform.position, socketTransform.rotation, 0, PlayEffectCallBack) + end + end + end + + if self.m_Buff.Target.IsInterferedByDrone == false then + self.m_Buff.Target.IsInterferedByDrone = true + self.m_Buff.Target:CheckBlind() + end + + if self.m_Buff.Target == CS.GameEngine.GamePlay.LocalOrViewTargetPawn and CS.GameEngine.GamePlay.SafeSpectInfo.IsMatchObserver == false then + self.m_IsLocalPlayerInInterferedState = true + self.m_BeginInInterferedStateTime = CS.UnityEngine.Time.realtimeSinceStartup + + CS.GameBase.GameHudStateManager.Instance:AddState(CS.GameBase.GameHudState.GHS_InterferedByDrone) + + if self.m_Buff.Target.IsSpectated == false then + self.m_Buff.Target:CloseAimAndResetData() + end + + CS.GameEngine.GamePlay.SetLockPawnState(CS.GameEngine.EPawnStateLock.LockADS, true) + + CS.GameEngine.AudioSystem.PlaySound("Play_wpn_br_uav_noise", CS.Audio.Defs.AudioGameObjects.SFX) + + CS.GameEngine.EventManager.Instance:SendUIEvent(1020441, false) + + CS.GameEngine.EventManager.Instance:SendUIEvent(1020187, false) + CS.GameEngine.EventManager.Instance:SendUIEvent(1020463, true) + + CS.GameEngine.EventManager.Instance:SendUIEvent(1020182, false) + CS.GameEngine.EventManager.Instance:SendUIEvent(1020181, true) + + CS.GameEngine.EventManager.Instance:SendUIEvent(1020199, false) + end + end +end) + + + +-- WWL5.0\#10 +-------------------------------------------------------------------------------- +-- seanoopdeng fix cloth crash +-------------------------------------------------------------------------------- +local function LuaOverride_IsLowQualitySetting(self) + return true +end + +require 'xlua.util'.hotfix_ex(CS.FrontEnd.AvatarItemBase, 'IsLowQualitySetting', LuaOverride_IsLowQualitySetting) + +-------------------------------------------------------------------------------- +-- hehehe: fix CTFFlag cloth crash +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.PVP.Team.CTFGame.CTFFlag, 'SetCamp', function(self,camp) + self:SetCamp(camp) + local flag = self.ModelInst.transform:FindWithName("PVP_Ctf_Flag_3P_BR_lod0", true) + if flag ~= nil then + local cloth = flag:GetComponent(typeof(CS.UnityEngine.Cloth)) + if cloth ~= nil then + CS.UnityEngine.Debug.LogError("find cloth") + cloth.enabled = false + end + end +end) + +require 'xlua.util'.hotfix_ex(CS.PVP.Team.CTFGame.SwitchRoleComponent_CTFGamePlayerPawn, 'OnLoadFlagCompletes', function(self,assetID,CallBackData) + self:OnLoadFlagCompletes(assetID,CallBackData) + local flag = self.FlagObj.transform:FindWithName("PVP_Ctf_Flag_3P_BR_lod0", true) + if flag ~= nil then + local cloth = flag:GetComponent(typeof(CS.UnityEngine.Cloth)) + if cloth ~= nil then + CS.UnityEngine.Debug.LogError("find cloth") + cloth.enabled = false + end + end + + if CS.GameBase.PoolSystemService.Instance == nil then + return + end + + if CS.GameBase.PoolSystemService.Instance.GeneralPool == nil then + return + end + + local prefabGo = CS.GameBase.PoolSystemService.Instance.GeneralPool:FindInstanceTemplate(assetID) + if CS.GameCommon.LuaUtility.IsNullInCSharp( prefabGo ) == false then + local flagTrans = prefabGo.transform:FindWithName("PVP_Ctf_Flag_3P_BR_lod0", true) + if CS.GameCommon.LuaUtility.IsNullInCSharp( flagTrans ) == false then + local cloth = flagTrans:GetComponent(typeof(CS.UnityEngine.Cloth)) + if cloth ~= nil then + CS.UnityEngine.Debug.LogError("find cloth in prefab") + cloth.enabled = false + end + end + end +end) + +-- WWL5.0\#11 + + +-- date: 20200429 +-- reason: 【ID77997877】【WWL5.0v】 +-- target version: WWL 5.0 +--修复索引溢出 monsterfang + +require 'xlua.util'.hotfix_ex(CS.GameEngine.AvatarLoadOP, 'InstanceUIRoleEquip', function( inAvatar,inEquipAssetIDs) + if CS.GameCommon.LuaUtility.IsNullInCSharp(inAvatar) == true then + CS.GameEngine.Log.GeneralError('[InstanceUIRoleEquip] is Fialed . inAvatar is null ') + return + end + if inEquipAssetIDs == nil then + CS.GameEngine.Log.GeneralError('[InstanceUIRoleEquip] is Fialed . inEquipAssetIDs is null ') + return + end + CS.GameEngine.AvatarLoadOP.InstanceUIRoleEquip(inAvatar,inEquipAssetIDs) +end) + +--[[require 'xlua.util'.hotfix_ex(CS.GameEngine.AvatarComposer, 'UpdateBones', function(self, renderers,targetBones,offset,add,inResetBone) + + if renderers == nil then + if CS.GameCommon.LuaUtility.IsNullInCSharp(self.m_Pawn) == true then + CS.GameEngine.Log.GeneralError('[UpdateBones] is Fialed . m_Pawn is null ') + return false + end + if self.m_Pawn.PlayerInfo == nil then + CS.GameEngine.Log.GeneralError('[UpdateBones] is Fialed . PlayerInfo is null ') + return false + end + end + self:UpdateBones(renderers,targetBones,offset,add,inResetBone) +end)]] + +-- WWL5.0\#12 +-------------------------------------------------------------------------------- +-- v_xinywen:新版本客户端屏蔽至新赛季开放3天以后 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.RankGame.RankView, 'AddSeasonOffTips', function(self) +end) + +require 'xlua.util'.hotfix_ex(CS.GameUI.Home.HomeMainController, 'RefreshRankMatchTopRight_Logo', function(self,isLock) + self:RefreshRankActvAdd() + CS.GameEngine.Log.GeneralError("RefreshRankMatchTopRight_Logo") + self:RefreshRankMatchTopRight_Logo(isLock) +end) + +-- WWL5.0\#13 + +-------------------------------------------------------------------------------- +-- maodai: close mesh combine cache +-------------------------------------------------------------------------------- + require 'xlua.util'.hotfix_ex(CS.GameBase.BaseGame, 'CreateGameComponents', function(self) + self:CreateGameComponents() + + local temp = self.ModelOptimizer + if temp ~= nil then + temp.UICacheOptimizedMesh = false + end + end) + +-- WWL5.0\#14 +-------------------------------------------------------------------------------- +-- corgizhou: 载具车轮破碎崩溃 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.GameBase.NZWheeledVehicleMovementComponent, 'ClearInput', function(self) + if self.gameObject.activeSelf then + self:ClearInput() + end +end) + +require 'xlua.util'.hotfix_ex(CS.GameBase.NZWheeledTankMovementComponent, 'ClearInput', function(self) + if self.gameObject.activeSelf then + self:ClearInput() + end +end) + +-- WWL5.0\#15 +-------------------------------------------------------------------------------- +-- marcusli: BR角色Culling距离 +-------------------------------------------------------------------------------- + require 'xlua.util'.hotfix_ex(CS.FrontEnd.FrontEndUIScene, 'InitGVoice', function(self) + self:InitGVoice() + + CS.GameEngine.SwitchRoleComponent.LOD3Params[2] = 0.008 + CS.GameEngine.SwitchRoleComponent.LOD2Params[1] = 0.008 + end) + +-- WWL5.0\#16 + +-------------------------------------------------------------------------------- +-- kekezhao: dom map domimation point id error. +-------------------------------------------------------------------------------- + require 'xlua.util'.hotfix_ex(CS.PVP.Team.DominationGame.DOMObjectiveVolume, 'Awake', function(self) + self:Awake() + + local gameInfoDS = CS.GameEngine.DataStoreManager.Instance.GameInfoDataStore + local MapID = gameInfoDS.ActualMapId; + if (MapID == 0x10030005) then + CS.GameEngine.Log.GeneralError("map find"); + if self.ObjectiveID == 0 then + self.ObjectiveID = 1 + elseif self.ObjectiveID == 1 then + self.ObjectiveID = 2 + elseif self.ObjectiveID == 2 then + self.ObjectiveID = 0 + end + end + end) + + require 'xlua.util'.hotfix_ex(CS.GameBase.GameEventChannel, 'OnSyncDomArea', function(self, Msg) + + local gameInfoDS = CS.GameEngine.DataStoreManager.Instance.GameInfoDataStore + local MapID = gameInfoDS.ActualMapId; + if (MapID == 0x10030005) then + cast(Msg, typeof(CS.Network.SyncDomareaMsg)) + local ct = Msg.Content; + if ct ~= nil and self.m_Game.DomAreaManager ~= nil then + if ct.AreaId == 0 then + ct.AreaId = 1 + elseif ct.AreaId == 1 then + ct.AreaId = 2 + elseif ct.AreaId == 2 then + ct.AreaId = 0 + end + end + end + self:OnSyncDomArea(Msg) + end) + +-- WWL5.0\#17 +-------------------------------------------------------------------------------- +-- v_wenlliang: 排位加成和排位不掉分活动局内显示 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.LobbyRankPointBuffDataStore, 'GetIsNotDropValid', function(self,serverTime,bAdd) + if bAdd then + if self.mRankedMatchAddInfoList~=nil then + if self.mRankedMatchAddInfoList.Count >0 then + local GameInfoDS=CS.GameEngine.DataStoreManager.Instance.GameInfoDataStore + if(GameInfoDS~=nil) then + local ServiceModule=GameInfoDS.MatchServiceModule + if ServiceModule==4 or ServiceModule==2 then + for i=0, self.mRankedMatchAddInfoList.Count-1, 1 do + local e = self.mRankedMatchAddInfoList[i] + if(e~=nil) then + if(e.Data~=nil) then + if (e.Data.ranked_match_type==5 and ServiceModule==2) or (e.Data.ranked_match_type==6 and ServiceModule==4) then + if e:IsRankBuffValid(serverTime) and e:IsRankRestriction() then + return true + end + end + end + end + end + end + end + end + end + return false + else + return self:GetIsNotDropValid(serverTime,bAdd) + end +end) + +-- WWL5.0\#18 +-------------------------------------------------------------------------------- +-- shifengzhou: RenderMultMaterialManager RefreshRound idiv0 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.RenderMultMaterialManager, 'RefreshRound', function(self) + if self.SubMeshNum == 0 then + + else + return self:RefreshRound() + end +end) + +-- WWL5.0\#19 +-------------------------------------------------------------------------------- +-- corgizhou: 坦克视角切换和子弹数展示问题 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.GameEngine.TankHUD, 'Awake', function(self) + self:Awake() + self.m_AmmoCount = 100 +end) + +require 'xlua.util'.hotfix_ex(CS.BattleRoyale.BRVehicleComponent, 'GetOnVehicle', function(self, vehicle, seat) + local preSeatIdx = self.CurrentSeatIndex + local viewType = self.mLastViewType + self:GetOnVehicle(vehicle, seat) + if preSeatIdx == CS.GameEngine.EVehicleSeatIndex.SEAT_DRIVER then + self.mLastViewType = viewType + end +end) + +-- WWL5.0\#20 +--[[ + coreygao:飞机票段位展示全部为1的问题 +]]-- +xlua.private_accessible(CS.Chat.ChatQTFilterCell) +require 'xlua.util'.hotfix_ex(CS.Chat.ChatQTFilterCell, "ConfigureFilterCell", function(self, mode, cutPanel) + self:ConfigureFilterCell(mode, cutPanel) + if self.PlayerFrame then + local ladderLv, ladderType = 0, CS.GameUI.Room.ELadderType.ENone + if CS.GameEngine.MapStoreHelper.IsBRGameMode(CS.GameEngine.EGameMode.__CastFrom(mode.ModeID)) then + ladderLv, ladderType = mode.BRLadderLevel, CS.GameUI.Room.ELadderType.EBr + else + ladderLv, ladderType = mode.LadderLevel, CS.GameUI.Room.ELadderType.ESpvp + end + self.PlayerFrame:SetData(mode.PictureInfo, mode.Name, mode.PeakLevel, mode.Level, ladderLv, ladderType) + end +end) + +-- WWL5.0\#21 +-------------------------------------------------------------------------------- +-- paulqu: 回流任务累积奖励获取时,不会播放获取动画 +-- http://tapd.oa.com/codm/bugtrace/bugs/view/1110125091078725232 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.GameUI.SoldierReturn.SoldierReturnReturnTrainingController, 'OnNotifyCommonReceiveItemClose', function(self, message) + self:OnNotifyCommonReceiveItemClose(message) + if self._taskController ~= nil then + self._taskController:OnUIEvent(message) + end +end) + +-- WWL5.0\#22 +--[[ + coreygao:飞机票筛选,语言条件写反的问题 +]]-- +xlua.private_accessible(CS.Chat.ChatQTFilterController) +xlua.hotfix(CS.Chat.ChatQTFilterController, "ValidateLanguage", function(self, info) + if not self.m_FilterData.IsSameLanguage then + return true + else + return CS.msg.ELanguageCode.__CastFrom(info.LanguageCode) == CS.LanguageManager.CurrentELanguageCode + end +end) + +-- WWL5.0\#23 +-- date: 2020年6月17日10:38:27 +-- 修复BR偶现的可破坏物消失 +-- huiyicui + +require 'xlua.util'.hotfix_ex(CS.BattleRoyale.BRDestructibleObj, 'Init', function(self, actorId, levelObj) + self.m_IsBroken = false; + self:Init(actorId, levelObj); +end) + +-- WWL5.0\#24 +-------------------------------------------------------------------------------- +-- wenlliang: 低配机广告 +-------------------------------------------------------------------------------- +local function CheckADAvailable() + --CS.UnityEngine.Debug.LogError(CS.GameEngine.SystemSetting.Instance.EnableBackupLowMemStrategy) + --CS.UnityEngine.Debug.LogError(CS.GameEngine.SystemSetting.Instance:IsAndroidDangerousOS()) + if CS.GameEngine.SystemSetting.Instance.EnableBackupLowMemStrategy or + CS.GameEngine.SystemSetting.Instance:IsAndroidDangerousOS() then + return false + end + + return true + end + + require 'xlua.util'.hotfix_ex(CS.AdvertisingDataStore, 'CheckLobbyADShow', function(self) + self:CheckLobbyADShow() + if self.m_IsADShowLobby then + self.m_IsADShowLobby=CheckADAvailable() + end + end) + + + +-- WWL5.0\#25 +-- WWL5.0\#25 +-------------------------------------------------------------------------------- +-- petejiang: fix MP playlist filter switch and tip overlap +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.GameUI.Room.RoomSpvpPlaylistSelectorWindowController, 'OnBtnMapClick', function(self) + self:OnBtnMapClick() + if self.m_View ~= nil and self.m_View.LabelCantNotSelectMapTip ~= nil then + self.m_View.LabelCantNotSelectMapTip.gameObject:SetActive(false) + end +end) + + + +-- WWL5.0\#26 +-- WWL5.0\#26 +-------------------------------------------------------------------------------- +-- rayqiu: 删除接收好友组队弹窗协议后,商城弹窗的特殊处理 +-- 玩家接收到好友组队弹窗,关闭后会卡死在宝箱展示界面 +-- http://tapd.oa.com/codm/bugtrace/bugs/view?bug_id=1110125091078791532 +require 'xlua.util'.hotfix_ex(CS.GameUI.UILuckyBoxAwardsController, 'CloseWindow', function(self) + --CS.GameEngine.Log.GeneralError("Hotfix [UILuckyBoxAwardsController] CloseWindow"); +end) + + +require 'xlua.util'.hotfix_ex(CS.GameShop.ShopPaymentConfirmPopupWindowController, 'CloseWindow', function(self) + --CS.GameEngine.Log.GeneralError("Hotfix [ShopPaymentConfirmPopupWindowController] CloseWindow"); +end) + +-- WWL5.0\#27 +-------------------------------------------------------------------------------- +-- vivinliu: Filter out the Prop Type(EInventoryItemType.Temporary) .#27 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.LiveOps.LiveOpsActivitySystemAssist, 'LiveOpsItemIdGoDetails', function(self,ItemId) + local curtype = CS.GameBase.ItemConfigHelper.GetInventoryType(ItemId); + if curtype == CS.GameBase.EInventoryItemType.Temporary then + return; + end; + self:LiveOpsItemIdGoDetails(ItemId); + +end) + +-- WWL5.0\#28 +-------------------------------------------------------------------------------- +-- rayqiu: 由于人物背包、帽子、衣服都增加了换皮功能,改为用道具id判断是否需要重新加载 + +-- http://tapd.oa.com/codm/bugtrace/bugs/view/1110125091078818510 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.FrontEnd.CommonAvatarView, 'CheckToBeChanged', function(self, param) + -- CS.GameEngine.Log.GeneralError("Hotfix [CheckToBeChanged] CheckToBeChanged") + --先走一遍原函数 + local changed = self:CheckToBeChanged(param) + + -- if changed then + -- CS.GameEngine.Log.GeneralError("Hotfix [CheckToBeChanged]origin changed: true" ) + -- else + -- CS.GameEngine.Log.GeneralError("Hotfix [CheckToBeChanged]origin changed: false" ) + -- end + + -- 对于role Type重新求一遍 + if param.commonAvatarId == self.mAvatarParameter.commonAvatarId and + param.commonAvatarType == self.mAvatarParameter.commonAvatarType then + + if param.commonAvatarType == CS.FrontEnd.CommonAvatarType.Role then + + if param.roleHatId == self.mAvatarParameter.roleHatId and + param.roleBagId == self.mAvatarParameter.roleBagId and + param.roleClothId == self.mAvatarParameter.roleClothId and + param.roleAction == self.mAvatarParameter.roleAction and + (not self:HasEntranceAni(param)) and + (param.roleAction == nil or param.roleAction == "") then + + changed = false + + else + changed = true + end + + end + end + + -- if changed then + -- CS.GameEngine.Log.GeneralError("Hotfix [CheckToBeChanged]return changed: true" ) + -- else + -- CS.GameEngine.Log.GeneralError("Hotfix [CheckToBeChanged]return changed: false" ) + -- end + + return changed + +end) + + +-- WWL5.0\#29,30 +-------------------------------------------------------------------------------- +-- steekwu: 局外喷漆更新显示 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.FrontEnd.AvatarTextureChangeDynamic, 'ChangeMainTexture', function(self, textureName, itemType, itemId) + + local useNew = false + local newAssetID = 0 + + --CS.UnityEngine.Debug.LogError(textureName) + --itemType = CS.GameBase.EInventoryItemType.HeadFramePic + --textureName = "Icon_Frame_122_Latched_Models" + + if itemType == CS.GameBase.EInventoryItemType.HeadAvatarPic then + local strID = string.sub(textureName, 13, 15) + --CS.UnityEngine.Debug.LogError(itemType) + --CS.UnityEngine.Debug.LogError(strID) + local numID = tonumber(strID) + + useNew = numID >= 121 and numID <= 138 + newAssetID = 411000050 + end + + if itemType == CS.GameBase.EInventoryItemType.HeadFramePic then + local strID = string.sub(textureName, 12, 14) + --CS.UnityEngine.Debug.LogError(itemType) + --CS.UnityEngine.Debug.LogError(strID) + local numID = tonumber(strID) + + useNew = numID >= 111 and numID <= 126 + newAssetID = 411000051 + end + + if itemType == CS.GameBase.EInventoryItemType.IndividuationLacquer then + useNew = itemId >= 250200116 and itemId <= 250200135 + newAssetID = 408001015 + end + + if not useNew then + self:ChangeMainTexture(textureName, itemType, itemId) + return + end + + self:Init() + self.m_TextureName = textureName; + + --CS.UnityEngine.Debug.LogError("UseNew"); + + local assetGO = CS.GameEngine.AssetManager.Instance:InstantiateAsset(newAssetID); + if assetGO ~= nil then + --CS.UnityEngine.Debug.LogError("1"); + local set = assetGO:GetComponent(typeof(CS.FrontEnd.PerkTextureSet)); + if set ~= nil then + --CS.UnityEngine.Debug.LogError("2"); + local tex = set:GetTexture(self.m_TextureName, itemId); + if tex ~= nil and self.m_Material ~= nil then + --CS.UnityEngine.Debug.LogError("3"); + self.m_Material.mainTexture = tex; + end + if tex ~= nil and self.m_Material_Low ~= nil then + --CS.UnityEngine.Debug.LogError("4"); + self.m_Material_Low.mainTexture = tex; + end + end + + CS.UnityEngine.GameObject.Destroy(assetGO); + end +end) + + +-- WWL5.0\#31 + + +local SimulatedJumpingSpeedFactor = 0.6 +local SimulatedJumpingMinSpeed = 1.5 +local SimulatedJumpingMaxSpeed = 10 + +local function LuaOverride_SimulatedDoJump(self, jumpMoveData) + self:SimulatedDoJump(jumpMoveData) + + if self.CurClimbType ~= CS.GameBase.Pawn.ClimbType.None then + return + end + + local pendingMoveDataCount = self.m_MoveHelper.SimulateMoveDataList.Count + self.MoveSyncModule.SimulateMoveDataList.Count; + if pendingMoveDataCount == 0 then + return + end + + self.m_SimulatedJumpingSpeedScale = pendingMoveDataCount * SimulatedJumpingSpeedFactor + + if self.m_SimulatedJumpingSpeedScale < SimulatedJumpingMinSpeed then + self.m_SimulatedJumpingSpeedScale = SimulatedJumpingMinSpeed + end + + if self.m_SimulatedJumpingSpeedScale > SimulatedJumpingMaxSpeed then + self.m_SimulatedJumpingSpeedScale = SimulatedJumpingMaxSpeed + end + + --CS.GameEngine.Log.GeneralError("SimulatedDoJump is jump pendingMoveDataCount:{0} m_SimulatedJumpingSpeedScale:{1}", pendingMoveDataCount, self.m_SimulatedJumpingSpeedScale) +end + +require 'xlua.util'.hotfix_ex(CS.GameBase.PlayerPawn, 'SimulatedDoJump', LuaOverride_SimulatedDoJump) + + +local function LuaOverride_IsWaitJumpLand(self) + return false +end +require 'xlua.util'.hotfix_ex(CS.GameBase.PlayerPawn, 'IsWaitJumpLand', LuaOverride_IsWaitJumpLand) + + +local function LuaOverride_CalcSimulatedFallingHorizontalVelocity(self, deltaTime) +end +require 'xlua.util'.hotfix_ex(CS.GameBase.PlayerPawn, 'CalcSimulatedFallingHorizontalVelocity', LuaOverride_CalcSimulatedFallingHorizontalVelocity) + + + +-- WWL5.0\#32 +require 'xlua.util'.hotfix_ex(CS.GameUI.Room.SpvpPlaylistDetailWindowController, 'UpdateView', function(self, detailType) + self:UpdateView(detailType) + if CS.GameCommon.LuaUtility.IsNullInCSharp(self.m_View) == false then + local trans = self.m_View.transform + if trans ~= nil then + local trans2 = trans:FindWithName('Widget(shootout)', true) + if trans2 ~= nil then + local shootoutGo = trans2.gameObject + if shootoutGo ~= nil then + if detailType == 10 then + shootoutGo:SetActive(true) + else + shootoutGo:SetActive(false) + end + end + end + end + end +end) + + + +-- WWL5.0\#33 + + +-- date: 20200429 +-- reason: 【ID77997877】【WWL5.0v】 +-- target version: WWL 5.0 +--表格中的背包资源:局内显示错误:低画质 背包资源全部显示280200132背包资源,高画质背包资源全部显示:280200131 monsterfang + +require 'xlua.util'.hotfix_ex(CS.GameEngine.AvatarComposer, 'ChangeDetailTexture', function(self, inType,inTex) + + local index = CS.System.Convert.ToInt32(inType) + + if self.mAvatarMesh[index] ~= nil and self.mAvatarMesh[index].MeshObjs ~= nil then + + if self.mAvatarMesh[index].isGUPSink == false then + + for i = 1, self.mAvatarMesh[index].MeshObjs.Length do + local obj = self.mAvatarMesh[index].MeshObjs[i -1] + if CS.GameCommon.LuaUtility.IsNullInCSharp(obj) == false then + local _r = obj:GetComponent(typeof(CS.UnityEngine.Renderer)) + + if CS.GameCommon.LuaUtility.IsNullInCSharp(_r) == false then + CS.GameEngine.MaterialCamoHelper.EnableDetailLerp(_r.material, inTex) + end + end + end + + + end + end +end) + +-- WWL5.0\#34 + + +-- date: 20200429 +-- reason: 【ID77997877】【WWL5.0v】 +-- target version: WWL 5.0 +--710000468 背部未显示 monsterfang + + +require 'xlua.util'.hotfix_ex(CS.GameEngine.AvatarLoadOP, 'InstanceUIRole', function( inEquipAssetIDs) + + if inEquipAssetIDs == nil then + CS.GameEngine.Log.GeneralError('[InstanceUIRole] is Fialed . inEquipAssetIDs is null ') + return nil + end + + local rv = CS.GameEngine.AvatarLoadOP.InstanceUIRole(inEquipAssetIDs) + if inEquipAssetIDs[0] == 710000468 then + if CS.GameCommon.LuaUtility.IsNullInCSharp(rv) == false then + local _renderers = rv:GetComponentsInChildren(typeof(CS.UnityEngine.SkinnedMeshRenderer),true) + for i = 1, _renderers.Length do + + if CS.GameCommon.LuaUtility.IsNullInCSharp(_renderers[i -1]) == false then + if _renderers[i -1].gameObject.activeSelf == false then + + _renderers[i -1].gameObject:SetActive(true) + end + end + end + end + end + + return rv +end) + +-- WWL5.0\#35 + + +-- date: 20200706 +-- reason: 【ID78882894】【WWL5.0v2】 +-- target version: WWL 5.0v2 +--78882894 【BR-载具】坦克皮肤(Wrecked)未覆盖炮台corgizhou + + +require 'xlua.util'.hotfix_ex(CS.GameEngine.PhysicsVehicle, 'ChangeMaterial', function( self, mats) + if mats ~= nil and mats.Length > 0 then + local _array = {} + for i = 0, self.weaponInfos.Length - 1 do + local w = self.weaponInfos[i] + if w.weaponMeshOriginal ~= nil then + for j =0, w.weaponMeshOriginal.Length - 1 do + local v = w.weaponMeshOriginal[j] + self:ChangeMaterial(v, mats, _array) + end + end + end + end + self:ChangeMaterial(mats) +end) + + + + +-- date: 20200706 +-- reason: 【ID78884834】【WWL5.0v2】 +-- target version: WWL 5.0v2 +--78884834 【BR-载具】突击车皮肤(Stream)未覆盖机枪板(总单)corgizhou + + +require 'xlua.util'.hotfix_ex(CS.GameEngine.PhysicsVehicle, 'LoadTexture', function( self, inTexID) + self:LoadTexture(inTexID) + local loadAssetSync_generic = xlua.get_generic_method(CS.GameEngine.AssetManager, 'LoadAssetSync') + local loadAssetSync = loadAssetSync_generic(CS.UnityEngine.Texture2D) + local _tex = loadAssetSync(CS.GameEngine.AssetManager.Instance, inTexID) + if _tex ~= nil then + for i = 0, self.weaponInfos.Length - 1 do + local w = self.weaponInfos[i] + if w.weaponMeshOriginal ~= nil then + for j =0, w.weaponMeshOriginal.Length - 1 do + local r = w.weaponMeshOriginal[j] + if r ~= nil then + local mats = r.materials + for v = 0, mats.Length - 1 do + local m = mats[v] + if m ~= nil then + CS.GameEngine.MaterialCamoHelper.EnableDetailLerp(m, _tex) + end + end + end + end + end + end + end +end) + +-- WWL5.0\#36 +-------------------------------------------------------------------------------- +-- 【【WWL5.0v2】【GA预发布】【andriod】【必现】【武器皮肤】【局外】【PVP/BR】【ID 10106060】AK117 - SnakeBite枪身蛇头缺少动态效果】 +-- http://tapd.oa.com/codm/bugtrace/bugs/view?bug_id=1010125091080692985 +-------------------------------------------------------------------------------- + + +require 'xlua.util'.hotfix_ex(CS.ModelOptimizer, 'OptimizeUIWeapon', function(self, model, type1, assetIDs, excludeObjList) + if model ~= nil then + local excludeObj = model.transform:FindWithName("SnakeBite_UI_lod0", true) + if excludeObj ~= nil then + excludeObjList:Add(excludeObj.gameObject) + end + end + return self:OptimizeUIWeapon(model, type1, assetIDs, excludeObjList) +end) + +-- WWL5.0\#37 +-------------------------------------------------------------------------------- +-- author: moonlin +-- 音频配置表格热更优化 +-------------------------------------------------------------------------------- + +require 'xlua.util'.hotfix_ex(CS.GameEngine.WeaponSoundConfigManager, 'SearchConfig', function(Key) + -- local log = 'HotFix' .. 'SearchConfig' + -- GeneralError(log) + if(Key ~= 0) then + if (Key == 200000627) then + return CS.GameEngine.WeaponSoundConfigManager.SearchConfig(200000481) + elseif (Key == 200000628) then + return CS.GameEngine.WeaponSoundConfigManager.SearchConfig(200000482) + elseif (Key == 200000629 or Key == 200000631) then + local weaponSoundConfigItem = CS.GameEngine.WeaponSoundConfigManager.SearchConfig(200000126) + -- MainWeapon_080_AK117_1p + weaponSoundConfigItem.RaiseSound = 'Play_weapon_core_ar_scar_raise_1p' + weaponSoundConfigItem.ClipOutAsset = 'Play_weapon_core_ar_scar_clipout_1p' + weaponSoundConfigItem.ClipInAsset = 'Play_weapon_core_ar_scar_clipin_1p' + weaponSoundConfigItem.WeaponBank1 = '205.bnk' + weaponSoundConfigItem.PlantOKSound = 'Play_weapon_core_ar_scar_down_1p' + weaponSoundConfigItem.FireSound_Compressor = 'Play_weapon_core_ar_scar_silence_fire_1p' + weaponSoundConfigItem.FirstBulletSound = 'Play_weapon_core_ar_scar_fire_1p' + weaponSoundConfigItem.FirstBulletSoundSilencer = 'Play_weapon_core_ar_scar_silence_fire_1p' + weaponSoundConfigItem.FireStopSound = 'Play_weapon_core_ar_scar_firestop_1p' + return weaponSoundConfigItem + elseif (Key == 200000630 or Key == 200000632) then + local weaponSoundConfigItem = CS.GameEngine.WeaponSoundConfigManager.SearchConfig(200000520) + -- MainWeapon_080_AK117_3p + if(CS.GameEngine.GamePlay.GameInfo ~= nil and CS.GameEngine.GamePlay.GameInfo:IsBRGame()) then + weaponSoundConfigItem.RaiseSound = 'Play_weapon_core_ar_scar_raise_3p_br' + weaponSoundConfigItem.ClipOutAsset = 'Play_weapon_core_ar_scar_clipout_3p_br' + weaponSoundConfigItem.ClipInAsset = 'Play_weapon_core_ar_scar_clipin_3p_br' + weaponSoundConfigItem.WeaponBank1 = '205.bnk' + weaponSoundConfigItem.PlantOKSound = 'Play_weapon_core_ar_scar_down_3p_br' + weaponSoundConfigItem.FireSound_Compressor = 'Play_weapon_core_ar_scar_silence_fire_3p_br' + weaponSoundConfigItem.FirstBulletSound = 'Play_weapon_core_ar_scar_fire_3p_br' + weaponSoundConfigItem.FirstBulletSoundSilencer = 'Play_weapon_core_ar_scar_silence_fire_3p_br' + weaponSoundConfigItem.FireStopSound = 'Play_weapon_core_ar_scar_firestop_3p_br' + else + weaponSoundConfigItem.RaiseSound = 'Play_weapon_core_ar_scar_raise_3p' + weaponSoundConfigItem.ClipOutAsset = 'Play_weapon_core_ar_scar_clipout_3p' + weaponSoundConfigItem.ClipInAsset = 'Play_weapon_core_ar_scar_clipin_3p' + weaponSoundConfigItem.WeaponBank1 = '205.bnk' + weaponSoundConfigItem.PlantOKSound = 'Play_weapon_core_ar_scar_down_3p' + weaponSoundConfigItem.FireSound_Compressor = 'Play_weapon_core_ar_scar_silence_fire_3p' + weaponSoundConfigItem.FirstBulletSound = 'Play_weapon_core_ar_scar_fire_3p' + weaponSoundConfigItem.FirstBulletSoundSilencer = 'Play_weapon_core_ar_scar_silence_fire_3p' + weaponSoundConfigItem.FireStopSound = 'Play_weapon_core_ar_scar_firestop_3p' + end + return weaponSoundConfigItem + else + return CS.GameEngine.WeaponSoundConfigManager.SearchConfig(Key) + end + end + + return nil +end) + +-- WWL5.0\#39 + + +-- date: 20200429 +-- reason: 【ID77997877】【WWL5.0v】 +-- target version: WWL 5.0 +--710000468 背部未显示 monsterfang + +require 'xlua.util'.hotfix_ex(CS.GameEngine.AvatarLoadOP, 'Despawn', function( inAvatar,inObj) + + CS.UnityEngine.GameObject.Destroy(inObj) + +end) + +require 'xlua.util'.hotfix_ex(CS.GameEngine.AvatarComposer, 'ChangeEquip', function( self,toMeshGO,show,inMaterialIDs) + + if CS.GameCommon.LuaUtility.IsNullInCSharp(self.m_Pawn) == false then + CS.GameEngine.Log.GeneralError('[AvatarComposer] ChangeEquip. PlayerID:{0} name {1} ',self.m_Pawn.PlayerID,toMeshGO.name) + end + return self:ChangeEquip(toMeshGO,show,inMaterialIDs) + +end) + +require 'xlua.util'.hotfix_ex(CS.GameEngine.AvatarComposer, '_Unequip', function( self,refOPMesh,inType) + + if self:GetShow(1) == false then + if self.mAvatarDefMesh[6].enable then + self.mAvatarDefMesh[6]:SetShow(true, self.m_Pawn) + end + end + + if CS.GameCommon.LuaUtility.IsNullInCSharp(self.m_Pawn) == false then + CS.GameEngine.Log.GeneralError('[AvatarComposer] _Unequip. PlayerID:{0} type {1} ',self.m_Pawn.PlayerID,inType) + end + + return self:_Unequip(refOPMesh,inType) + +end) + +-- WWL5.0\#40 +-------------------------------------------------------------------------------- +-- smartzhu: fix AvatarView_Character GetWeaponCommerialAnimator +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.FrontEnd.AvatarView_Character,'GetWeaponCommerialAnimator',function(self,type) + local weaponAnimator = self:GetWeaponCommerialAnimator(type) + if self.WEASPON_ID == 10305042 then + local parent = self.OrangeLMGWeaponRoleAnimator.gameObject + if parent ~= nil then + local RPDAnimatorTrans = parent.transform:Find('RPDAnimator') + if RPDAnimatorTrans ~= nil then + weaponAnimator = RPDAnimatorTrans:GetComponent(typeof(CS.UnityEngine.Animator)) + else + local obj = CS.GameEngine.AssetManager.Instance:InstantiateAsset(200029001) + if obj ~= nil then + obj.name = 'RPDAnimator' + obj.transform.parent = self.OrangeLMGWeaponRoleAnimator.transform + weaponAnimator = obj.transform:GetComponent(typeof(CS.UnityEngine.Animator)) + end + end + end + end + + return weaponAnimator +end) + +-- WWL5.0\#41 +--------------------------------------------------------------------------------- +-- seanoopdeng +-- fix: 调用CrossFade 需要带参数 time 避免初始化失败 +--------------------------------------------------------------------------------- +local function LuaOverride_SetAnimatorToInit( self ) + if not CS.GameCommon.LuaUtility.IsNullInCSharp(self.m_Animator) then + self:ResetAllTrigger() + self.m_Animator:CrossFade("Alive", 0, self.BaseLayer,0) + self.m_Animator:CrossFade("Idle", 0, self.UpperBodyOverrideLayer,0) + self.m_Animator:CrossFade("Idle", 0, self.UpperBodyLayer,0) + end +end +require 'xlua.util'.hotfix_ex(CS.GameEngine.PawnAnimationComponent, 'SetAnimatorToInit', LuaOverride_SetAnimatorToInit) + +-- WWL5.0\#42 +-- date: 2020/04/13 +-- reason: +-- target version: 5.0 + +-------------------------------------------------------------------------------- +--- Fix: luckydraw奖池增加"owned”标签逻辑 + +require 'xlua.util'.hotfix_ex(CS.LuckyDrawRewardsMgr, 'SetRewards', function(self, prop_list) + self:SetRewards(prop_list) + + local squadDS = CS.GameEngine.DataStoreManager.Instance.SquadInventoryDataStore; + local minCount = CS.System.Math.Min(self.views.Count,prop_list.Count) + + for i = 0, minCount-1, 1 do + local item = prop_list[i] + local view = self.views[i] + + if item.allow_lottery_flag == 0 then + view.Get.gameObject:SetActive(true) + view.GetLabel.text = CS.LanguageUtility.Translate("LOC_SHOP_LUCKYDRAW_RECEIVED") + else + view.Get.gameObject:SetActive(false) + local itemList = squadDS:GetAllSameIdItem(item.prop_id) + for k,v in pairs(itemList) do + if v.TimeType == CS.msg.ITEMDURATIONTYPE.ENM_IDT_TIME_FOREVER then + if view.GetLabel ~= nil then + view.Get.gameObject:SetActive(true) + view.GetLabel.text = CS.LanguageUtility.Translate("LOC_LUCKYBOARD_EXCHANGESHOP_ALREADYOWNED") + end + end + end + end + end +end) + +-- WWL5.0\#43 +-------------------------------------------------------------------------------- +-- vivinliu: modify the time to UTC .#43 +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.LiveOps.MatchJumpClient, 'IsValid', function(self,serverTime) + local globalDS=CS.GameEngine.DataStoreManager.Instance.GlobalDataStore + if globalDS == nil then + return false; + end + + local serverTime = globalDS:GetServerTime(); + local curtime1 = CS.GameEngine.DateTimeUtil.ConvertTimeStampToUTCDateTime(serverTime); + if curtime1 ~= nil then + local curtimeint = curtime1.Year * 10000 + curtime1.Month * 100 + curtime1.Day; + if curtimeint >= self.m_BeginDate and curtimeint <= self.m_EndDate then + if self.m_seqId == 1 then + CS.GameEngine.Log.GeneralWarning('[MatchJumpClient] IsValid. curtime: {0}-{1}-{2} {3}:{4}:{5}, m_seqId={6}, m_BeginDate = {7}, m_EndDate = {8}',curtime1.Year,curtime1.Month,curtime1.Day,curtime1.Hour,curtime1.Minute,curtime1.Second,self.m_seqId,self.m_BeginDate,self.m_EndDate); + end + return true; + end + end + return false; +end) + +require 'xlua.util'.hotfix_ex(CS.LiveOps.LiveOpsMatchJumpItemView_CA, '_RefreshRemainTime', function(self,endTime) + + local globalDS=CS.GameEngine.DataStoreManager.Instance.GlobalDataStore + if globalDS == nil then + return; + end + + local dateTimestr = CS.System.String.Format('{0}-{1}-{2} 23:59:59',math.floor(endTime / 10000), math.floor((endTime % 10000) / 100), endTime % 100); + local tempTime = CS.System.Convert.ToDateTime(dateTimestr); + local timeUtc = CS.System.DateTime.SpecifyKind(tempTime, CS.System.DateTimeKind.Utc); + local endTime_stamp = CS.GameEngine.DateTimeUtil.ConvertDateTimeToTimeStamp(timeUtc); + local remainTime = endTime_stamp - globalDS:GetServerTime(); + CS.GameEngine.Log.GeneralWarning('[LiveOpsMatchJumpItemView_CA] _RefreshRemainTime. endtime = {0}, remainTime = {1}, endtime = {2}-{3}-{4} {5}:{6}:{7}',dateTimestr, remainTime,tempTime.Year,tempTime.Month,tempTime.Day,tempTime.Hour,tempTime.Minute,tempTime.Second); + + if remainTime < 0 then + CS.GameUI.UICommonTools.SafeSetActive(self.LabelRemainTimeBlack, false); + CS.GameUI.UICommonTools.SafeSetActive(self.LabelRemainTimeRed, false); + elseif remainTime <= 3600 then + CS.GameUI.UICommonTools.SafeSetActive(self.LabelRemainTimeRed, true); + CS.GameUI.UICommonTools.SafeSetActive(self.LabelRemainTimeBlack, false); + CS.GameUI.UICommonTools.SafeSetLabel(self.LabelRemainTimeRed, CS.GameBase.ItemConfigHelper.GetTimeString(math.floor(remainTime), CS.GameBase.ETimeUnit.ESecond)); + else + CS.GameUI.UICommonTools.SafeSetActive(self.LabelRemainTimeRed, false); + CS.GameUI.UICommonTools.SafeSetActive(self.LabelRemainTimeBlack, true); + CS.GameUI.UICommonTools.SafeSetLabel(self.LabelRemainTimeBlack, CS.GameBase.ItemConfigHelper.GetTimeString(math.floor(remainTime), CS.GameBase.ETimeUnit.ESecond)); + end +end) + +-- WWL5.0\#44 +-------------------------------------------------------------------------------- +-- petejiang: turn on filter by default #44 +-- select all playlists when player open selector for the first time after hotfix +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.GameUI.Room.RoomSpvpPlaylistSelectorWindowController, 'InitView', function(self, matchType) + self:InitView(matchType) + local roomDS = CS.GameEngine.DataStoreManager.Instance.RoomDataStore + local spvpDS = CS.GameEngine.DataStoreManager.Instance.SpvpDataStore + if roomDS == nil or spvpDS == nil then + return + end + + local playlistInfo = spvpDS:GetPlaylistInfoByPlaylistId(roomDS.PlaylistId) + if playlistInfo ~= nil and playlistInfo.bIncludedInFilter == false then + CS.GameEngine.Log.GeneralWarning("current playlist is not in filter. do nothing!") + return + end + + local playerPrefs = CS.PlayerPrefsManager.Instance + if playerPrefs == nil then + return + end + + if spvpDS.IsMPMultipleChooseAllowed and matchType == CS.msg.EMatchServiceModule.kMatchMaking then + local filterKey = "filter_switch_open" + if not playerPrefs:HasCurrentPlayerKey(filterKey) then + self:SetAllPlaylistSelect(true) + playerPrefs:SetCurrentPlayerInt(filterKey, 0) + end + spvpDS.MPModeSelectType = 1 + local selectNum = 0 + local isSelectAll = false + isSelectAll, selectNum = self:IsSelectAll(selectNum) + self:OnBtnPlaylistClick() + self:RefreshSelectAllBtnState() + self:RefreshTimer() + end +end) + +-- WWL5.0\#45 +-------------------------------------------------------------------------------- +-- moonlin: fix AK Default Pool OOM #45 +-- Expand AK DefaultPoolSize before first Instantiate AKInitializer +-------------------------------------------------------------------------------- +require 'xlua.util'.hotfix_ex(CS.Audio.Utils.AudioResourcesLoaderProxy, 'Load', function(strPath) + if strPath == nil then + return nil + elseif string.find(strPath,'Audio/Configs/WwiseInitializer/WWiseInitializer_') ~= nil then + local wwiseInitializerGO = CS.GameEngine.AssetManager.LoadAudioGameObject(strPath) + if wwiseInitializerGO ~= nil then + local akInitializer = wwiseInitializerGO:GetComponent("AkInitializer"); + akInitializer.defaultPoolSize = 1024 * 15 + akInitializer.lowMem_defaultPoolSize = 1024 * 10 + end + end + return CS.GameEngine.AssetManager.LoadAudioGameObject(strPath) +end) + diff --git a/anticheat (reversed)/lua-scripts (these get loaded when the game start)/init.lua b/anticheat (reversed)/lua-scripts (these get loaded when the game start)/init.lua new file mode 100644 index 000000000..2f09990c4 --- /dev/null +++ b/anticheat (reversed)/lua-scripts (these get loaded when the game start)/init.lua @@ -0,0 +1,133 @@ + + local metatable = {} + local rawget = rawget + local setmetatable = setmetatable + local import_type = xlua.import_type + local import_generic_type = xlua.import_generic_type + local load_assembly = xlua.load_assembly + + function metatable:__index(key) + local fqn = rawget(self,'.fqn') + fqn = ((fqn and fqn .. '.') or '') .. key + + local obj = import_type(fqn) + + if obj == nil then + -- It might be an assembly, so we load it too. + obj = { ['.fqn'] = fqn } + setmetatable(obj, metatable) + elseif obj == true then + return rawget(self, key) + end + + -- Cache this lookup + rawset(self, key, obj) + return obj + end + + function metatable:__newindex() + error('No such type: ' .. rawget(self,'.fqn'), 2) + end + + -- A non-type has been called; e.g. foo = System.Foo() + function metatable:__call(...) + local n = select('#', ...) + local fqn = rawget(self,'.fqn') + if n > 0 then + local gt = import_generic_type(fqn, ...) + if gt then + return rawget(CS, gt) + end + end + error('No such type: ' .. fqn, 2) + end + + CS = CS or {} + setmetatable(CS, metatable) + + typeof = function(t) return t.UnderlyingSystemType end + cast = xlua.cast + if not setfenv or not getfenv then + local function getfunction(level) + local info = debug.getinfo(level + 1, 'f') + return info and info.func + end + + function setfenv(fn, env) + if type(fn) == 'number' then fn = getfunction(fn + 1) end + local i = 1 + while true do + local name = debug.getupvalue(fn, i) + if name == '_ENV' then + debug.upvaluejoin(fn, i, (function() + return env + end), 1) + break + elseif not name then + break + end + + i = i + 1 + end + + return fn + end + + function getfenv(fn) + if type(fn) == 'number' then fn = getfunction(fn + 1) end + local i = 1 + while true do + local name, val = debug.getupvalue(fn, i) + if name == '_ENV' then + return val + elseif not name then + break + end + i = i + 1 + end + end + end + + xlua.hotfix = function(cs, field, func) + if func == nil then func = false end + local tbl = (type(field) == 'table') and field or {[field] = func} + for k, v in pairs(tbl) do + local cflag = '' + if k == '.ctor' then + cflag = '_c' + k = 'ctor' + end + local f = type(v) == 'function' and v or nil + xlua.access(cs, cflag .. '__Hotfix0_'..k, f) -- at least one + pcall(function() + for i = 1, 99 do + xlua.access(cs, cflag .. '__Hotfix'..i..'_'..k, f) + end + end) + end + xlua.private_accessible(cs) + end + xlua.getmetatable = function(cs) + return xlua.metatable_operation(cs) + end + xlua.setmetatable = function(cs, mt) + return xlua.metatable_operation(cs, mt) + end + xlua.setclass = function(parent, name, impl) + impl.UnderlyingSystemType = parent[name].UnderlyingSystemType + rawset(parent, name, impl) + end + + local base_mt = { + __index = function(t, k) + local csobj = t['__csobj'] + local func = csobj['<>xLuaBaseProxy_'..k] + return function(_, ...) + return func(csobj, ...) + end + end + } + base = function(csobj) + return setmetatable({__csobj = csobj}, base_mt) + end + \ No newline at end of file diff --git a/anticheat (reversed)/lua-scripts (these get loaded when the game start)/xlua.util.lua b/anticheat (reversed)/lua-scripts (these get loaded when the game start)/xlua.util.lua new file mode 100644 index 000000000..cc6bc1537 --- /dev/null +++ b/anticheat (reversed)/lua-scripts (these get loaded when the game start)/xlua.util.lua @@ -0,0 +1,178 @@ +-- Tencent is pleased to support the open source community by making xLua available. +-- Copyright (C) 2016 THL A29 Limited, a Tencent company. All rights reserved. +-- Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at +-- http://opensource.org/licenses/MIT +-- Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +local unpack = unpack or table.unpack + +local function async_to_sync(async_func, callback_pos) + return function(...) + local _co = coroutine.running() or error ('this function must be run in coroutine') + local rets + local waiting = false + local function cb_func(...) + if waiting then + assert(coroutine.resume(_co, ...)) + else + rets = {...} + end + end + local params = {...} + table.insert(params, callback_pos or (#params + 1), cb_func) + async_func(unpack(params)) + if rets == nil then + waiting = true + rets = {coroutine.yield()} + end + + return unpack(rets) + end +end + +local function coroutine_call(func) + return function(...) + local co = coroutine.create(func) + assert(coroutine.resume(co, ...)) + end +end + +local move_end = {} + +local generator_mt = { + __index = { + MoveNext = function(self) + self.Current = self.co() + if self.Current == move_end then + self.Current = nil + return false + else + return true + end + end; + Reset = function(self) + self.co = coroutine.wrap(self.w_func) + end + } +} + +local function cs_generator(func, ...) + local params = {...} + local generator = setmetatable({ + w_func = function() + func(unpack(params)) + return move_end + end + }, generator_mt) + generator:Reset() + return generator +end + +local function loadpackage(...) + for _, loader in ipairs(package.searchers) do + local func = loader(...) + if type(func) == 'function' then + return func + end + end +end + +local function auto_id_map() + local hotfix_id_map = require 'hotfix_id_map' + local org_hotfix = xlua.hotfix + xlua.hotfix = function(cs, field, func) + local map_info_of_type = hotfix_id_map[typeof(cs):ToString()] + if map_info_of_type then + if func == nil then func = false end + local tbl = (type(field) == 'table') and field or {[field] = func} + for k, v in pairs(tbl) do + local map_info_of_methods = map_info_of_type[k] + local f = type(v) == 'function' and v or nil + for _, id in ipairs(map_info_of_methods or {}) do + CS.XLua.HotfixDelegateBridge.Set(id, f) + end + --CS.XLua.HotfixDelegateBridge.Set( + end + xlua.private_accessible(cs) + else + return org_hotfix(cs, field, func) + end + end +end + +--和xlua.hotfix的区别是:这个可以调用原来的函数 +local function hotfix_ex(cs, field, func) + assert(type(field) == 'string' and type(func) == 'function', 'invalid argument: #2 string needed, #3 function needed!') + local function func_after(...) + xlua.hotfix(cs, field, nil) + local ret = {func(...)} + xlua.hotfix(cs, field, func_after) + return unpack(ret) + end + xlua.hotfix(cs, field, func_after) +end + +local function bind(func, obj) + return function(...) + return func(obj, ...) + end +end + +--为了兼容luajit,lua53版本直接用|操作符即可 +local enum_or_op = debug.getmetatable(CS.System.Reflection.BindingFlags.Public).__bor +local enum_or_op_ex = function(first, ...) + for _, e in ipairs({...}) do + first = enum_or_op(first, e) + end + return first +end + +-- description: 直接用C#函数创建delegate +local function createdelegate(delegate_cls, obj, impl_cls, method_name, parameter_type_list) + local flag = enum_or_op_ex(CS.System.Reflection.BindingFlags.Public, CS.System.Reflection.BindingFlags.NonPublic, + CS.System.Reflection.BindingFlags.Instance, CS.System.Reflection.BindingFlags.Static) + local m = parameter_type_list and typeof(impl_cls):GetMethod(method_name, flag, nil, parameter_type_list, nil) + or typeof(impl_cls):GetMethod(method_name, flag) + return CS.System.Delegate.CreateDelegate(typeof(delegate_cls), obj, m) +end + +local function state(csobj, state) + local csobj_mt = getmetatable(csobj) + for k, v in pairs(csobj_mt) do rawset(state, k, v) end + local csobj_index, csobj_newindex = state.__index, state.__newindex + state.__index = function(obj, k) + return rawget(state, k) or csobj_index(obj, k) + end + state.__newindex = function(obj, k, v) + if rawget(state, k) ~= nil then + rawset(state, k, v) + else + csobj_newindex(obj, k, v) + end + end + debug.setmetatable(csobj, state) + return state +end + +local function print_func_ref_by_csharp() + local registry = debug.getregistry() + for k, v in pairs(registry) do + if type(k) == 'number' and type(v) == 'function' and registry[v] == k then + local info = debug.getinfo(v) + print(string.format('%s:%d', info.short_src, info.linedefined)) + end + end +end + +return { + async_to_sync = async_to_sync, + coroutine_call = coroutine_call, + cs_generator = cs_generator, + loadpackage = loadpackage, + auto_id_map = auto_id_map, + hotfix_ex = hotfix_ex, + bind = bind, + createdelegate = createdelegate, + state = state, + print_func_ref_by_csharp = print_func_ref_by_csharp, +} diff --git a/ligma (cheat)/sdk/Assembly_CSharp/Assembly_CSharp.cpp b/codm-sdk/Assembly_CSharp/Assembly_CSharp.cpp similarity index 100% rename from ligma (cheat)/sdk/Assembly_CSharp/Assembly_CSharp.cpp rename to codm-sdk/Assembly_CSharp/Assembly_CSharp.cpp diff --git a/ligma (cheat)/sdk/Assembly_CSharp/Assembly_CSharp.hpp b/codm-sdk/Assembly_CSharp/Assembly_CSharp.hpp similarity index 100% rename from ligma (cheat)/sdk/Assembly_CSharp/Assembly_CSharp.hpp rename to codm-sdk/Assembly_CSharp/Assembly_CSharp.hpp diff --git a/ligma (cheat)/sdk/Assembly_CSharp/Assembly_CSharp_forward.hpp b/codm-sdk/Assembly_CSharp/Assembly_CSharp_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/Assembly_CSharp/Assembly_CSharp_forward.hpp rename to codm-sdk/Assembly_CSharp/Assembly_CSharp_forward.hpp diff --git a/ligma (cheat)/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.cpp b/codm-sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.cpp similarity index 100% rename from ligma (cheat)/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.cpp rename to codm-sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.cpp diff --git a/ligma (cheat)/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.hpp b/codm-sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.hpp similarity index 100% rename from ligma (cheat)/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.hpp rename to codm-sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass.hpp diff --git a/ligma (cheat)/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass_forward.hpp b/codm-sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass_forward.hpp rename to codm-sdk/Assembly_CSharp_firstpass/Assembly_CSharp_firstpass_forward.hpp diff --git a/ligma (cheat)/sdk/CSProto/CSProto.cpp b/codm-sdk/CSProto/CSProto.cpp similarity index 100% rename from ligma (cheat)/sdk/CSProto/CSProto.cpp rename to codm-sdk/CSProto/CSProto.cpp diff --git a/ligma (cheat)/sdk/CSProto/CSProto.hpp b/codm-sdk/CSProto/CSProto.hpp similarity index 100% rename from ligma (cheat)/sdk/CSProto/CSProto.hpp rename to codm-sdk/CSProto/CSProto.hpp diff --git a/ligma (cheat)/sdk/CSProto/CSProto_forward.hpp b/codm-sdk/CSProto/CSProto_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/CSProto/CSProto_forward.hpp rename to codm-sdk/CSProto/CSProto_forward.hpp diff --git a/ligma (cheat)/sdk/CSProtoSerializer/CSProtoSerializer.cpp b/codm-sdk/CSProtoSerializer/CSProtoSerializer.cpp similarity index 100% rename from ligma (cheat)/sdk/CSProtoSerializer/CSProtoSerializer.cpp rename to codm-sdk/CSProtoSerializer/CSProtoSerializer.cpp diff --git a/ligma (cheat)/sdk/CSProtoSerializer/CSProtoSerializer.hpp b/codm-sdk/CSProtoSerializer/CSProtoSerializer.hpp similarity index 100% rename from ligma (cheat)/sdk/CSProtoSerializer/CSProtoSerializer.hpp rename to codm-sdk/CSProtoSerializer/CSProtoSerializer.hpp diff --git a/ligma (cheat)/sdk/CSProtoSerializer/CSProtoSerializer_forward.hpp b/codm-sdk/CSProtoSerializer/CSProtoSerializer_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/CSProtoSerializer/CSProtoSerializer_forward.hpp rename to codm-sdk/CSProtoSerializer/CSProtoSerializer_forward.hpp diff --git a/ligma (cheat)/sdk/DOTween/DOTween.cpp b/codm-sdk/DOTween/DOTween.cpp similarity index 100% rename from ligma (cheat)/sdk/DOTween/DOTween.cpp rename to codm-sdk/DOTween/DOTween.cpp diff --git a/ligma (cheat)/sdk/DOTween/DOTween.hpp b/codm-sdk/DOTween/DOTween.hpp similarity index 100% rename from ligma (cheat)/sdk/DOTween/DOTween.hpp rename to codm-sdk/DOTween/DOTween.hpp diff --git a/ligma (cheat)/sdk/DOTween/DOTween_forward.hpp b/codm-sdk/DOTween/DOTween_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/DOTween/DOTween_forward.hpp rename to codm-sdk/DOTween/DOTween_forward.hpp diff --git a/ligma (cheat)/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.cpp b/codm-sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.cpp similarity index 100% rename from ligma (cheat)/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.cpp rename to codm-sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.cpp diff --git a/ligma (cheat)/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.hpp b/codm-sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.hpp similarity index 100% rename from ligma (cheat)/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.hpp rename to codm-sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib.hpp diff --git a/ligma (cheat)/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib_forward.hpp b/codm-sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib_forward.hpp rename to codm-sdk/ICSharpCode_SharpZipLib/ICSharpCode_SharpZipLib_forward.hpp diff --git a/ligma (cheat)/sdk/INIFileParser/INIFileParser.cpp b/codm-sdk/INIFileParser/INIFileParser.cpp similarity index 100% rename from ligma (cheat)/sdk/INIFileParser/INIFileParser.cpp rename to codm-sdk/INIFileParser/INIFileParser.cpp diff --git a/ligma (cheat)/sdk/INIFileParser/INIFileParser.hpp b/codm-sdk/INIFileParser/INIFileParser.hpp similarity index 100% rename from ligma (cheat)/sdk/INIFileParser/INIFileParser.hpp rename to codm-sdk/INIFileParser/INIFileParser.hpp diff --git a/ligma (cheat)/sdk/INIFileParser/INIFileParser_forward.hpp b/codm-sdk/INIFileParser/INIFileParser_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/INIFileParser/INIFileParser_forward.hpp rename to codm-sdk/INIFileParser/INIFileParser_forward.hpp diff --git a/ligma (cheat)/sdk/Il2CppDummyDll/Il2CppDummyDll.cpp b/codm-sdk/Il2CppDummyDll/Il2CppDummyDll.cpp similarity index 100% rename from ligma (cheat)/sdk/Il2CppDummyDll/Il2CppDummyDll.cpp rename to codm-sdk/Il2CppDummyDll/Il2CppDummyDll.cpp diff --git a/ligma (cheat)/sdk/Il2CppDummyDll/Il2CppDummyDll.hpp b/codm-sdk/Il2CppDummyDll/Il2CppDummyDll.hpp similarity index 100% rename from ligma (cheat)/sdk/Il2CppDummyDll/Il2CppDummyDll.hpp rename to codm-sdk/Il2CppDummyDll/Il2CppDummyDll.hpp diff --git a/ligma (cheat)/sdk/Il2CppDummyDll/Il2CppDummyDll_forward.hpp b/codm-sdk/Il2CppDummyDll/Il2CppDummyDll_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/Il2CppDummyDll/Il2CppDummyDll_forward.hpp rename to codm-sdk/Il2CppDummyDll/Il2CppDummyDll_forward.hpp diff --git a/ligma (cheat)/sdk/Mono_Security/Mono_Security.cpp b/codm-sdk/Mono_Security/Mono_Security.cpp similarity index 100% rename from ligma (cheat)/sdk/Mono_Security/Mono_Security.cpp rename to codm-sdk/Mono_Security/Mono_Security.cpp diff --git a/ligma (cheat)/sdk/Mono_Security/Mono_Security.hpp b/codm-sdk/Mono_Security/Mono_Security.hpp similarity index 100% rename from ligma (cheat)/sdk/Mono_Security/Mono_Security.hpp rename to codm-sdk/Mono_Security/Mono_Security.hpp diff --git a/ligma (cheat)/sdk/Mono_Security/Mono_Security_forward.hpp b/codm-sdk/Mono_Security/Mono_Security_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/Mono_Security/Mono_Security_forward.hpp rename to codm-sdk/Mono_Security/Mono_Security_forward.hpp diff --git a/ligma (cheat)/sdk/Newtonsoft_Json/Newtonsoft_Json.cpp b/codm-sdk/Newtonsoft_Json/Newtonsoft_Json.cpp similarity index 100% rename from ligma (cheat)/sdk/Newtonsoft_Json/Newtonsoft_Json.cpp rename to codm-sdk/Newtonsoft_Json/Newtonsoft_Json.cpp diff --git a/ligma (cheat)/sdk/Newtonsoft_Json/Newtonsoft_Json.hpp b/codm-sdk/Newtonsoft_Json/Newtonsoft_Json.hpp similarity index 100% rename from ligma (cheat)/sdk/Newtonsoft_Json/Newtonsoft_Json.hpp rename to codm-sdk/Newtonsoft_Json/Newtonsoft_Json.hpp diff --git a/ligma (cheat)/sdk/Newtonsoft_Json/Newtonsoft_Json_forward.hpp b/codm-sdk/Newtonsoft_Json/Newtonsoft_Json_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/Newtonsoft_Json/Newtonsoft_Json_forward.hpp rename to codm-sdk/Newtonsoft_Json/Newtonsoft_Json_forward.hpp diff --git a/ligma (cheat)/sdk/PlayMaker/PlayMaker.cpp b/codm-sdk/PlayMaker/PlayMaker.cpp similarity index 100% rename from ligma (cheat)/sdk/PlayMaker/PlayMaker.cpp rename to codm-sdk/PlayMaker/PlayMaker.cpp diff --git a/ligma (cheat)/sdk/PlayMaker/PlayMaker.hpp b/codm-sdk/PlayMaker/PlayMaker.hpp similarity index 100% rename from ligma (cheat)/sdk/PlayMaker/PlayMaker.hpp rename to codm-sdk/PlayMaker/PlayMaker.hpp diff --git a/ligma (cheat)/sdk/PlayMaker/PlayMaker_forward.hpp b/codm-sdk/PlayMaker/PlayMaker_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/PlayMaker/PlayMaker_forward.hpp rename to codm-sdk/PlayMaker/PlayMaker_forward.hpp diff --git a/ligma (cheat)/sdk/System/System.cpp b/codm-sdk/System/System.cpp similarity index 100% rename from ligma (cheat)/sdk/System/System.cpp rename to codm-sdk/System/System.cpp diff --git a/ligma (cheat)/sdk/System/System.hpp b/codm-sdk/System/System.hpp similarity index 100% rename from ligma (cheat)/sdk/System/System.hpp rename to codm-sdk/System/System.hpp diff --git a/ligma (cheat)/sdk/System/System_forward.hpp b/codm-sdk/System/System_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/System/System_forward.hpp rename to codm-sdk/System/System_forward.hpp diff --git a/ligma (cheat)/sdk/System_Core/System_Core.cpp b/codm-sdk/System_Core/System_Core.cpp similarity index 100% rename from ligma (cheat)/sdk/System_Core/System_Core.cpp rename to codm-sdk/System_Core/System_Core.cpp diff --git a/ligma (cheat)/sdk/System_Core/System_Core.hpp b/codm-sdk/System_Core/System_Core.hpp similarity index 100% rename from ligma (cheat)/sdk/System_Core/System_Core.hpp rename to codm-sdk/System_Core/System_Core.hpp diff --git a/ligma (cheat)/sdk/System_Core/System_Core_forward.hpp b/codm-sdk/System_Core/System_Core_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/System_Core/System_Core_forward.hpp rename to codm-sdk/System_Core/System_Core_forward.hpp diff --git a/ligma (cheat)/sdk/System_Runtime_Serialization/System_Runtime_Serialization.cpp b/codm-sdk/System_Runtime_Serialization/System_Runtime_Serialization.cpp similarity index 100% rename from ligma (cheat)/sdk/System_Runtime_Serialization/System_Runtime_Serialization.cpp rename to codm-sdk/System_Runtime_Serialization/System_Runtime_Serialization.cpp diff --git a/ligma (cheat)/sdk/System_Runtime_Serialization/System_Runtime_Serialization.hpp b/codm-sdk/System_Runtime_Serialization/System_Runtime_Serialization.hpp similarity index 100% rename from ligma (cheat)/sdk/System_Runtime_Serialization/System_Runtime_Serialization.hpp rename to codm-sdk/System_Runtime_Serialization/System_Runtime_Serialization.hpp diff --git a/ligma (cheat)/sdk/System_Runtime_Serialization/System_Runtime_Serialization_forward.hpp b/codm-sdk/System_Runtime_Serialization/System_Runtime_Serialization_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/System_Runtime_Serialization/System_Runtime_Serialization_forward.hpp rename to codm-sdk/System_Runtime_Serialization/System_Runtime_Serialization_forward.hpp diff --git a/ligma (cheat)/sdk/System_Xml/System_Xml.cpp b/codm-sdk/System_Xml/System_Xml.cpp similarity index 100% rename from ligma (cheat)/sdk/System_Xml/System_Xml.cpp rename to codm-sdk/System_Xml/System_Xml.cpp diff --git a/ligma (cheat)/sdk/System_Xml/System_Xml.hpp b/codm-sdk/System_Xml/System_Xml.hpp similarity index 100% rename from ligma (cheat)/sdk/System_Xml/System_Xml.hpp rename to codm-sdk/System_Xml/System_Xml.hpp diff --git a/ligma (cheat)/sdk/System_Xml/System_Xml_forward.hpp b/codm-sdk/System_Xml/System_Xml_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/System_Xml/System_Xml_forward.hpp rename to codm-sdk/System_Xml/System_Xml_forward.hpp diff --git a/ligma (cheat)/sdk/System_Xml_Linq/System_Xml_Linq.cpp b/codm-sdk/System_Xml_Linq/System_Xml_Linq.cpp similarity index 100% rename from ligma (cheat)/sdk/System_Xml_Linq/System_Xml_Linq.cpp rename to codm-sdk/System_Xml_Linq/System_Xml_Linq.cpp diff --git a/ligma (cheat)/sdk/System_Xml_Linq/System_Xml_Linq.hpp b/codm-sdk/System_Xml_Linq/System_Xml_Linq.hpp similarity index 100% rename from ligma (cheat)/sdk/System_Xml_Linq/System_Xml_Linq.hpp rename to codm-sdk/System_Xml_Linq/System_Xml_Linq.hpp diff --git a/ligma (cheat)/sdk/System_Xml_Linq/System_Xml_Linq_forward.hpp b/codm-sdk/System_Xml_Linq/System_Xml_Linq_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/System_Xml_Linq/System_Xml_Linq_forward.hpp rename to codm-sdk/System_Xml_Linq/System_Xml_Linq_forward.hpp diff --git a/ligma (cheat)/sdk/UnityEngine/UnityEngine.cpp b/codm-sdk/UnityEngine/UnityEngine.cpp similarity index 100% rename from ligma (cheat)/sdk/UnityEngine/UnityEngine.cpp rename to codm-sdk/UnityEngine/UnityEngine.cpp diff --git a/ligma (cheat)/sdk/UnityEngine/UnityEngine.hpp b/codm-sdk/UnityEngine/UnityEngine.hpp similarity index 100% rename from ligma (cheat)/sdk/UnityEngine/UnityEngine.hpp rename to codm-sdk/UnityEngine/UnityEngine.hpp diff --git a/ligma (cheat)/sdk/UnityEngine/UnityEngine_forward.hpp b/codm-sdk/UnityEngine/UnityEngine_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/UnityEngine/UnityEngine_forward.hpp rename to codm-sdk/UnityEngine/UnityEngine_forward.hpp diff --git a/ligma (cheat)/sdk/UnityEngine_UI/UnityEngine_UI.cpp b/codm-sdk/UnityEngine_UI/UnityEngine_UI.cpp similarity index 100% rename from ligma (cheat)/sdk/UnityEngine_UI/UnityEngine_UI.cpp rename to codm-sdk/UnityEngine_UI/UnityEngine_UI.cpp diff --git a/ligma (cheat)/sdk/UnityEngine_UI/UnityEngine_UI.hpp b/codm-sdk/UnityEngine_UI/UnityEngine_UI.hpp similarity index 100% rename from ligma (cheat)/sdk/UnityEngine_UI/UnityEngine_UI.hpp rename to codm-sdk/UnityEngine_UI/UnityEngine_UI.hpp diff --git a/ligma (cheat)/sdk/UnityEngine_UI/UnityEngine_UI_forward.hpp b/codm-sdk/UnityEngine_UI/UnityEngine_UI_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/UnityEngine_UI/UnityEngine_UI_forward.hpp rename to codm-sdk/UnityEngine_UI/UnityEngine_UI_forward.hpp diff --git a/ligma (cheat)/sdk/dll2sdk_forward.g.hpp b/codm-sdk/dll2sdk_forward.g.hpp similarity index 100% rename from ligma (cheat)/sdk/dll2sdk_forward.g.hpp rename to codm-sdk/dll2sdk_forward.g.hpp diff --git a/ligma (cheat)/sdk/il2cpp.hpp b/codm-sdk/il2cpp.hpp similarity index 100% rename from ligma (cheat)/sdk/il2cpp.hpp rename to codm-sdk/il2cpp.hpp diff --git a/ligma (cheat)/sdk/mscorlib/mscorlib.cpp b/codm-sdk/mscorlib/mscorlib.cpp similarity index 100% rename from ligma (cheat)/sdk/mscorlib/mscorlib.cpp rename to codm-sdk/mscorlib/mscorlib.cpp diff --git a/ligma (cheat)/sdk/mscorlib/mscorlib.hpp b/codm-sdk/mscorlib/mscorlib.hpp similarity index 100% rename from ligma (cheat)/sdk/mscorlib/mscorlib.hpp rename to codm-sdk/mscorlib/mscorlib.hpp diff --git a/ligma (cheat)/sdk/mscorlib/mscorlib_forward.hpp b/codm-sdk/mscorlib/mscorlib_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/mscorlib/mscorlib_forward.hpp rename to codm-sdk/mscorlib/mscorlib_forward.hpp diff --git a/ligma (cheat)/sdk/protobuf_net/protobuf_net.cpp b/codm-sdk/protobuf_net/protobuf_net.cpp similarity index 100% rename from ligma (cheat)/sdk/protobuf_net/protobuf_net.cpp rename to codm-sdk/protobuf_net/protobuf_net.cpp diff --git a/ligma (cheat)/sdk/protobuf_net/protobuf_net.hpp b/codm-sdk/protobuf_net/protobuf_net.hpp similarity index 100% rename from ligma (cheat)/sdk/protobuf_net/protobuf_net.hpp rename to codm-sdk/protobuf_net/protobuf_net.hpp diff --git a/ligma (cheat)/sdk/protobuf_net/protobuf_net_forward.hpp b/codm-sdk/protobuf_net/protobuf_net_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/protobuf_net/protobuf_net_forward.hpp rename to codm-sdk/protobuf_net/protobuf_net_forward.hpp diff --git a/ligma (cheat)/sdk/sharedRuntime/sharedRuntime.cpp b/codm-sdk/sharedRuntime/sharedRuntime.cpp similarity index 100% rename from ligma (cheat)/sdk/sharedRuntime/sharedRuntime.cpp rename to codm-sdk/sharedRuntime/sharedRuntime.cpp diff --git a/ligma (cheat)/sdk/sharedRuntime/sharedRuntime.hpp b/codm-sdk/sharedRuntime/sharedRuntime.hpp similarity index 100% rename from ligma (cheat)/sdk/sharedRuntime/sharedRuntime.hpp rename to codm-sdk/sharedRuntime/sharedRuntime.hpp diff --git a/ligma (cheat)/sdk/sharedRuntime/sharedRuntime_forward.hpp b/codm-sdk/sharedRuntime/sharedRuntime_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/sharedRuntime/sharedRuntime_forward.hpp rename to codm-sdk/sharedRuntime/sharedRuntime_forward.hpp diff --git a/ligma (cheat)/sdk/usequencerRuntime/usequencerRuntime.cpp b/codm-sdk/usequencerRuntime/usequencerRuntime.cpp similarity index 100% rename from ligma (cheat)/sdk/usequencerRuntime/usequencerRuntime.cpp rename to codm-sdk/usequencerRuntime/usequencerRuntime.cpp diff --git a/ligma (cheat)/sdk/usequencerRuntime/usequencerRuntime.hpp b/codm-sdk/usequencerRuntime/usequencerRuntime.hpp similarity index 100% rename from ligma (cheat)/sdk/usequencerRuntime/usequencerRuntime.hpp rename to codm-sdk/usequencerRuntime/usequencerRuntime.hpp diff --git a/ligma (cheat)/sdk/usequencerRuntime/usequencerRuntime_forward.hpp b/codm-sdk/usequencerRuntime/usequencerRuntime_forward.hpp similarity index 100% rename from ligma (cheat)/sdk/usequencerRuntime/usequencerRuntime_forward.hpp rename to codm-sdk/usequencerRuntime/usequencerRuntime_forward.hpp diff --git a/ligma (cheat)/ligma.sln b/ligma (bypass)/ligma.sln similarity index 100% rename from ligma (cheat)/ligma.sln rename to ligma (bypass)/ligma.sln diff --git a/ligma (bypass)/ligma/bypass/bypass.cpp b/ligma (bypass)/ligma/bypass/bypass.cpp new file mode 100644 index 000000000..cdbb68070 --- /dev/null +++ b/ligma (bypass)/ligma/bypass/bypass.cpp @@ -0,0 +1,73 @@ +#include "bypass.h" + +namespace ligma +{ + namespace bypass + { + // + // you might need to change your paths for dlopen! + // + void init() + { + fopen_ptr = dlsym(dlopen("libc.so", RTLD_NOLOAD), "fopen"); + system_prop_get = dlsym(dlopen("libc.so", RTLD_NOLOAD), "__system_property_get"); + loadbufferx = dlsym(dlopen("libxlua.so", RTLD_NOW), "luaL_loadbufferx"); + ligma::hook::make_hook(loadbufferx, reinterpret_cast(&loadbufferx_hook)); + ligma::hook::make_hook(fopen_ptr, reinterpret_cast(&fopen_hook)); + ligma::hook::make_hook(system_prop_get, reinterpret_cast(&system_property_hook)); + } + + // + // dont let a single lua script load! + // + int loadbufferx_hook(void* L, const char* buff, size_t sz, const char* name, const char* mode) + { return NULL; } + + // + // the first module loaded by default is libtprt.so, it opens base.apk and checks its MD5. + // we make it open the original apk :) + // + __attribute__((noinline)) + FILE* fopen_hook(const char* path, const char* mode) + { + if (strstr(path, "base.apk")) + { + path = "/data/app/base_orig.apk"; + LOGI("spoofed base.apk to original apk!"); + } + + fopen_mutex.lock(); + ligma::hook::disable(fopen_ptr); + const auto result = fopen(path, mode); + ligma::hook::enable(fopen_ptr); + fopen_mutex.unlock(); + return result; + } + + // + // spoof all hwids to "what do you call nuts on your chin? a dick down your throat you fucking retard!" + // + __attribute__((noinline)) + int system_property_hook(const char* name, char* value) + { + system_prop_mutex.lock(); + ligma::hook::disable(system_prop_get); + __system_property_get(name, value); + ligma::hook::enable(system_prop_get); + system_prop_mutex.unlock(); + + // + // dont spoof persist.sys.timezone or these other ones. + // + if (strcmp(name, "persist.sys.timezone") != 0 && + strcmp(name, "ro.build.fingerprint") != 0 && + strcmp(name, "ro.revision") != 0 && + strcmp(name, "ro.build.version.sdk") != 0) + { + LOGI("spoofed hwid = %s, to = %s", value, HWID_VALUE); + value = HWID_VALUE; + } + return strlen(value); + } + } +} \ No newline at end of file diff --git a/ligma (cheat)/ligma/bypass/bypass.h b/ligma (bypass)/ligma/bypass/bypass.h similarity index 73% rename from ligma (cheat)/ligma/bypass/bypass.h rename to ligma (bypass)/ligma/bypass/bypass.h index 738a2de06..579abd131 100644 --- a/ligma (cheat)/ligma/bypass/bypass.h +++ b/ligma (bypass)/ligma/bypass/bypass.h @@ -3,13 +3,13 @@ #include #include #include -#include "../shithook.h" +#include "../ligma.h" #define HWID_VALUE "what do you call nuts on your chin? a dick down your throat you fucking retard!" -#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "ligma", __VA_ARGS__)) #define offset_emulator_check 0x000D7B4 #define offset_ischeat_packet 0x00128E0 #define offset_mshook_function 0x0010358 +#define offset_fopen_got 0x23ECC namespace ligma { @@ -17,14 +17,14 @@ namespace ligma { inline void* fopen_ptr = nullptr; inline void* system_prop_get = nullptr; + inline void* loadbufferx = nullptr; inline std::mutex fopen_mutex; // every shithook you make you will need a mutex. inline std::mutex system_prop_mutex; + inline std::mutex loadbufferx_mutex; void init(); - signed int emulator_check(const char* a1, const char* a2); FILE* fopen_hook(const char* path, const char* mode); - int tss_sdk_ischeatpacket(int a1); int system_property_hook(const char* name, char* value); - void ms_hook_function(int* a1, int a2, int* a3); + int loadbufferx_hook(void* L, const char* buff, size_t sz, const char* name, const char* mode); } } \ No newline at end of file diff --git a/ligma (bypass)/ligma/hooks/got_hook.h b/ligma (bypass)/ligma/hooks/got_hook.h new file mode 100644 index 000000000..215d709e7 --- /dev/null +++ b/ligma (bypass)/ligma/hooks/got_hook.h @@ -0,0 +1,46 @@ +#include +#include +#include +#include +#include + +#define LOGI(...) ((void)__android_log_print(4, "ligma", __VA_ARGS__)) +#define LOGW(...) ((void)__android_log_print(5, "ligma", __VA_ARGS__)) + +namespace ligma +{ + namespace hook + { + // + // TODO this doesnt work yet, needs to be debugged! + // + inline void* got_hook(elf32_hdr* module_base, const std::pair& module_info, void* new_ptr) + { + if (!module_base || !module_info.first || !module_info.second || !new_ptr) + return {}; + + const auto orig_module_base = dlopen(module_info.first, RTLD_NOW); + const auto orig_ptr = dlsym(orig_module_base, module_info.second); + + const auto shstrtab_header_offset = module_base->e_shoff + module_base->e_shstrndx * sizeof(elf32_shdr); + const auto shstr_header = reinterpret_cast(reinterpret_cast(module_base) + shstrtab_header_offset); + + const auto shstr_section = reinterpret_cast(module_base) + shstr_header->sh_offset; + auto section_header = reinterpret_cast(reinterpret_cast(module_base) + module_base->e_shoff); + + for (auto idx = 0u; idx < module_base->e_shnum; ++idx) + { + if (strcmp(shstr_section + section_header->sh_name, ".got")) + { + for (auto section_value = reinterpret_cast(module_base) + section_header->sh_offset; + section_value < reinterpret_cast(module_base) + section_header->sh_size; section_value += 0x8) + if (*reinterpret_cast(section_value) == orig_ptr) + *reinterpret_cast(section_value) = new_ptr; + break; + } + section_header++; + } + return orig_ptr; + } + } +} \ No newline at end of file diff --git a/ligma (bypass)/ligma/hooks/shithook.h b/ligma (bypass)/ligma/hooks/shithook.h new file mode 100644 index 000000000..bdeaaa5cb --- /dev/null +++ b/ligma (bypass)/ligma/hooks/shithook.h @@ -0,0 +1,137 @@ +/* + MIT License + + Copyright (c) 2020 xerox + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. +*/ + +#pragma once +#include +#include +#include +#include +#include + +#define PAGE_START(ptr) reinterpret_cast(reinterpret_cast(ptr) >> 12 << 12) +#define ARM_JMP_CODE 0xE51FF004 + +namespace ligma +{ + namespace hook + { + class detour + { + public: + detour(void* addr_to_hook, void* jmp_to, bool enable = true) + : + hook_addr(addr_to_hook), + detour_addr(jmp_to), + hook_installed(false) + { + reinterpret_cast(jmp_code)[0] = ARM_JMP_CODE; // LDR PC, [PC, #-4] + reinterpret_cast(jmp_code)[1] = jmp_to; + memcpy(org_bytes, hook_addr, sizeof(org_bytes)); + if (enable) install(); + } + + void install() + { + if (hook_installed.load()) + return; + + if (!mprotect(PAGE_START(hook_addr), getpagesize(), PROT_READ | PROT_WRITE | PROT_EXEC)) + { + memcpy((void*)((long)hook_addr), jmp_code, sizeof(jmp_code)); + mprotect(PAGE_START(hook_addr), getpagesize(), PROT_READ | PROT_EXEC); + cacheflush(reinterpret_cast(hook_addr), reinterpret_cast(hook_addr) + getpagesize(), NULL); + hook_installed.exchange(true); + } + } + + void uninstall() + { + if (!hook_installed.load()) + return; + + if (!mprotect(PAGE_START(hook_addr), getpagesize(), PROT_READ | PROT_WRITE | PROT_EXEC)) + { + memcpy(hook_addr, org_bytes, sizeof(jmp_code)); + mprotect(PAGE_START(hook_addr), getpagesize(), PROT_READ | PROT_EXEC); + cacheflush(reinterpret_cast(hook_addr), reinterpret_cast(hook_addr) + getpagesize(), NULL); + hook_installed.exchange(false); + } + } + + ~detour() { uninstall(); } + bool installed() { return hook_installed; } + void* hook_address() { return hook_addr; } + void* detour_address() { return detour_addr; } + private: + std::atomic hook_installed; + void* hook_addr, * detour_addr; + + unsigned char jmp_code[8]{}; + std::uint8_t org_bytes[sizeof(jmp_code)]; + }; + + // this is jank, but needed because the OS isnt initalizing statics/inlined globals... :| + inline std::map>* get_hooks() + { + static std::map> hooks{}; + return &hooks; + } + + inline void make_hook(void* addr_to_hook, void* jmp_to_addr, bool enable = true) + { + if (!addr_to_hook) + return; + + get_hooks()->insert({ + addr_to_hook, + std::make_unique( + addr_to_hook, + jmp_to_addr, + enable + ) } + ); + } + + inline void enable(void* addr) + { + if (!addr) + return; + get_hooks()->at(addr)->install(); + } + + inline void disable(void* addr) + { + if (!addr) + return; + get_hooks()->at(addr)->uninstall(); + } + + inline void remove(void* addr) + { + if (!addr) + return; + get_hooks()->erase(addr); + } + } +} diff --git a/ligma (bypass)/ligma/ligma.h b/ligma (bypass)/ligma/ligma.h new file mode 100644 index 000000000..1407d69e2 --- /dev/null +++ b/ligma (bypass)/ligma/ligma.h @@ -0,0 +1,8 @@ +#pragma once +#include +#include "utils/utils.h" +#include "hooks/shithook.h" +#include "hooks/got_hook.h" + +#define LOGI(...) ((void)__android_log_print(4, "ligma", __VA_ARGS__)) +#define LOGW(...) ((void)__android_log_print(5, "ligma", __VA_ARGS__)) \ No newline at end of file diff --git a/ligma (cheat)/ligma/ligma.vcxproj b/ligma (bypass)/ligma/ligma.vcxproj similarity index 85% rename from ligma (cheat)/ligma/ligma.vcxproj rename to ligma (bypass)/ligma/ligma.vcxproj index f69401c65..f31cd9aee 100644 --- a/ligma (cheat)/ligma/ligma.vcxproj +++ b/ligma (bypass)/ligma/ligma.vcxproj @@ -128,8 +128,8 @@ adb logcat -c -adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so -start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +adb push C:\Users\%USERNAME%\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "adb logcat | findstr ligma" adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity @@ -141,8 +141,8 @@ adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.Per adb logcat -c -adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so -start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +adb push C:\Users\%USERNAME%\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "adb logcat | findstr ligma" adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity @@ -154,8 +154,8 @@ adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.Per adb logcat -c -adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so -start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +adb push C:\Users\%USERNAME%\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "adb logcat | findstr ligma" adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity @@ -167,8 +167,8 @@ adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.Per adb logcat -c -adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so -start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +adb push C:\Users\%USERNAME%\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "adb logcat | findstr ligma" adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity @@ -180,8 +180,8 @@ adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.Per adb logcat -c -adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so -start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +adb push C:\Users\%USERNAME%\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "adb logcat | findstr ligma" adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity @@ -193,8 +193,8 @@ adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.Per adb logcat -c -adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so -start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +adb push C:\Users\%USERNAME%\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "adb logcat | findstr ligma" adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity @@ -206,8 +206,8 @@ adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.Per adb logcat -c -adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so -start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +adb push C:\Users\%USERNAME%\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "adb logcat | findstr ligma" adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity @@ -219,18 +219,21 @@ adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.Per adb logcat -c -adb push C:\Users\xerox\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so -start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" +adb push C:\Users\%USERNAME%\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so +start cmd /k "adb logcat | findstr ligma" adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity - + - + + + + diff --git a/ligma (cheat)/ligma/ligma.vcxproj.filters b/ligma (bypass)/ligma/ligma.vcxproj.filters similarity index 61% rename from ligma (cheat)/ligma/ligma.vcxproj.filters rename to ligma (bypass)/ligma/ligma.vcxproj.filters index e4a218fdf..4d0e699f9 100644 --- a/ligma (cheat)/ligma/ligma.vcxproj.filters +++ b/ligma (bypass)/ligma/ligma.vcxproj.filters @@ -13,21 +13,36 @@ {3a6ff0eb-0b42-4eae-a5c7-3dad52e2c026} + + {e62eb3d6-ce1d-418e-8ea3-264cb68767c5} + + + {388138af-158e-4b7c-9eae-98b54b9d4146} + - - source - source\bypass + + source + - - headers - headers\bypass + + headers\hooks + + + headers\hooks + + + headers\utils + + + headers + \ No newline at end of file diff --git a/ligma (cheat)/ligma/ligma.vcxproj.user b/ligma (bypass)/ligma/ligma.vcxproj.user similarity index 100% rename from ligma (cheat)/ligma/ligma.vcxproj.user rename to ligma (bypass)/ligma/ligma.vcxproj.user diff --git a/ligma (cheat)/ligma/ligma.cpp b/ligma (bypass)/ligma/main.cpp similarity index 100% rename from ligma (cheat)/ligma/ligma.cpp rename to ligma (bypass)/ligma/main.cpp diff --git a/ligma (bypass)/ligma/utils/utils.h b/ligma (bypass)/ligma/utils/utils.h new file mode 100644 index 000000000..21b4add6e --- /dev/null +++ b/ligma (bypass)/ligma/utils/utils.h @@ -0,0 +1,23 @@ +#pragma once +#include +#include +#include + +namespace ligma +{ + namespace utils + { + inline void iterate_memory(const std::function&, const std::string& protection)>& callback) + { + std::fstream maps("/proc/self/maps"); + std::pair memory_range; + std::string page_perms; + while (maps >> memory_range.first >> memory_range.second >> page_perms) + { + maps.ignore(std::numeric_limits::max(), '\n'); // skip to next line :) + callback(memory_range, page_perms); + } + maps.close(); + } + } +} \ No newline at end of file diff --git a/ligma (cheat)/README.md b/ligma (cheat)/README.md deleted file mode 100644 index 66121979e..000000000 --- a/ligma (cheat)/README.md +++ /dev/null @@ -1,74 +0,0 @@ -# build scripts - -First things first, to get this compiling/working for you, you are going to need to fix these build scripts: - -``` -adb logcat -c -adb push C:\Users\%USERNAME%\source\repos\ligma\ARM\Release\libligma.so /data/app/com.activision.callofduty.shooter-1/lib/arm/libligma.so -start cmd /k "title 'ligma filter' & adb logcat | findstr ligma" -start cmd /k "title 'codm logs' & adb logcat | findstr com.activision.callofduty.shooter" -start cmd /k "title 'all logs' & adb logcat" -adb shell am start -n com.activision.callofduty.shooter/com.tencent.tmgp.cod.PermissionGrantActivity -``` - -just change `C:\Users\%USERNAME%\source\repos\ligma\ARM\Release\libligma.so` to the path of your repo. Also change `adb` to whatever `adb` your emulator is using. - -# setup - -Since we arent done making this cheat, we have no need to repackage the entire apk and reinstall everytime we wanna test our code. Since the application -is not inside of this repo, you will need to first download the apk from here: [cod mobile](https://apkpure.com/call-of-duty-legends-of-war/com.activision.callofduty.shooter). - -### decompile - -First unzip the xapk and take the .apk that is inside of it out. use apktool.jar to decompile the apk. we are going to patch a smali file to load our .so before any other .so. - -``` -apktool.jar d codm.apk -``` - -now go to this smali file: `smali\com\tencent\tpshell\TPShellApplication.smali`. Add this smali code to load our .so: - -[`[WARNING]`]: (do not put libligma.so or ligma.so just ligma!) - -``` -const-string v0, "ligma" -invoke-static {v0}, Ljava/lang/System;->loadLibrary(Ljava/lang/String;)V -``` - - - -### recompile - -simply run this to recompile the apk, this apk is not signed and will need to be signed. - -``` -apktool.jar b codm -o codm_patched.apk -``` - -### signing - -use apksigner.jar to sign the newly compiled apk. - -``` -apksigner.jar -a codm_patched.apk -``` - -now you have a patched & signed apk. Its time to install the apk. - -### install - -now that we have a signed and patched apk, install the apk (not the xapk) just the patched apk into your emulator. After you have installed it you will -need to copy the .obb files which are located INSIDE of the xapk. open the xapk back up in zip, open `Android` folder and you will see an `obb` folder. Copy this folder -to `Android/obb (or copy the content from inside of the obb file to here)` on your emulator. - - - - -Finally you will now need to copy the original `apk` to `/data/app/` please refer to [this](https://githacks.org/android-reverse-engineering/cod-mobile/-/blob/master/ligma%20(cheat)/ligma/bypass/bypass.cpp#L35) line of code to understand why. -Ensure that the `apk` is named `base_orig.apk`. If everything is done correctly you will now be able to build your .so and the game will auto run. - -# Result - -now if you click build inside of visual studios your screen should look like this (make sure you build in release otherwise the build script wont know where to copy your .so from!). Also be aware that you may need to build 2/3 times since `adb` will connect the first time... - - \ No newline at end of file diff --git a/ligma (cheat)/ligma/bypass/bypass.cpp b/ligma (cheat)/ligma/bypass/bypass.cpp deleted file mode 100644 index 20def053b..000000000 --- a/ligma (cheat)/ligma/bypass/bypass.cpp +++ /dev/null @@ -1,106 +0,0 @@ -#include "bypass.h" - -namespace ligma -{ - namespace bypass - { - void init() - { - fopen_ptr = dlsym(dlopen("libc.so", RTLD_NOLOAD), "fopen"); - system_prop_get = dlsym(dlopen("libc.so", RTLD_NOLOAD), "__system_property_get"); - - const auto cubehawk_base = reinterpret_cast(dlopen("libcubehawk.so", RTLD_LAZY)); - const auto libtersafe_base = reinterpret_cast(dlopen("libtersafe.so", RTLD_LAZY)); - - shithook::make_hook(fopen_ptr, reinterpret_cast(&fopen_hook)); - shithook::make_hook(reinterpret_cast(cubehawk_base + offset_emulator_check), reinterpret_cast(&emulator_check)); - - LOGI("disabled emulator checks...."); - LOGI("disabled patch checks...."); - - shithook::make_hook(reinterpret_cast(libtersafe_base + offset_ischeat_packet), reinterpret_cast(&tss_sdk_ischeatpacket)); - shithook::make_hook(system_prop_get, reinterpret_cast(&system_property_hook)); - - LOGI("disabled is cheat packet checks....."); - LOGI("disabled hwid checks....."); - - shithook::make_hook(reinterpret_cast(cubehawk_base + offset_mshook_function), reinterpret_cast(&ms_hook_function)); - LOGI("disabling all MSHookFunction calls! (no more back buffer hook!)"); - } - - // - // the first module loaded by default is libtprt.so, it opens base.apk and checks its MD5. - // - __attribute__((noinline)) - FILE* fopen_hook(const char* path, const char* mode) - { - LOGI("fopen called! path = %s, mode = %s", path, mode); - if (strstr(path, "base.apk")) - { - path = "/data/app/base_orig.apk"; - LOGI("spoofing to original base.apk!"); - } - - fopen_mutex.lock(); - shithook::disable(fopen_ptr); - const auto result = fopen(path, mode); - shithook::enable(fopen_ptr); - fopen_mutex.unlock(); - - LOGI("fopen result = %p", result); - return result; - } - - // - // the original function returns 1 if no emulator is found else a number associated with an emulator. - // - __attribute__((noinline)) - signed int emulator_check(const char* a1, const char* a2) - { - LOGI("emulator check called.... spoofing emulator...."); - return 1; - } - - // - // never send is cheat packet.... - // - __attribute__((noinline)) - int tss_sdk_ischeatpacket(int a1) - { - return false; - } - - // - // spoof all hwids to "what do you call nuts on your chin? a dick down your throat you fucking retard!" - // - __attribute__((noinline)) - int system_property_hook(const char* name, char* value) - { - LOGI("trying to get HWID = %s", name); - system_prop_mutex.lock(); - shithook::disable(system_prop_get); - __system_property_get(name, value); - shithook::enable(system_prop_get); - system_prop_mutex.unlock(); - - // - // dont spoof persist.sys.timezone or these other ones. - // - if (strcmp(name, "persist.sys.timezone") != 0 && - strcmp(name, "ro.build.fingerprint") != 0 && - strcmp(name, "ro.revision") != 0 && - strcmp(name, "ro.build.version.sdk") != 0) - { - LOGI("spoofing hwid = %s, to = %s", value, HWID_VALUE); - value = HWID_VALUE; - } - return strlen(value); - } - - void ms_hook_function(int* a1, int a2, int* a3) - { - LOGI("MSHookFunction called, hooking = %p, to = %p", a1, a2); - return; - } - } -} \ No newline at end of file diff --git a/ligma (cheat)/ligma/shithook.h b/ligma (cheat)/ligma/shithook.h deleted file mode 100644 index 338a3db2a..000000000 --- a/ligma (cheat)/ligma/shithook.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - MIT License - - Copyright (c) 2020 xerox - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in all - copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - SOFTWARE. -*/ - -#pragma once -#include -#include -#include -#include -#include - -#define PAGE_START(ptr) reinterpret_cast(reinterpret_cast(ptr) >> 12 << 12) -#define ARM_JMP_CODE 0xE51FF004 - -namespace shithook -{ - class detour - { - public: - detour(void* addr_to_hook, void* jmp_to, bool enable = true) - : - hook_addr(addr_to_hook), - detour_addr(jmp_to), - hook_installed(false) - { - reinterpret_cast(jmp_code)[0] = ARM_JMP_CODE; // LDR PC, [PC, #-4] - reinterpret_cast(jmp_code)[1] = jmp_to; - memcpy(org_bytes, hook_addr, sizeof(org_bytes)); - if (enable) install(); - } - - void install() - { - if (hook_installed.load()) - return; - - if (!mprotect(PAGE_START(hook_addr), getpagesize(), PROT_READ | PROT_WRITE | PROT_EXEC)) - { - memcpy((void*)((long)hook_addr), jmp_code, sizeof(jmp_code)); - mprotect(PAGE_START(hook_addr), getpagesize(), PROT_READ | PROT_EXEC); - cacheflush(reinterpret_cast(hook_addr), reinterpret_cast(hook_addr) + getpagesize(), NULL); - hook_installed.exchange(true); - } - } - - void uninstall() - { - if (!hook_installed.load()) - return; - - if (!mprotect(PAGE_START(hook_addr), getpagesize(), PROT_READ | PROT_WRITE | PROT_EXEC)) - { - memcpy(hook_addr, org_bytes, sizeof(jmp_code)); - mprotect(PAGE_START(hook_addr), getpagesize(), PROT_READ | PROT_EXEC); - cacheflush(reinterpret_cast(hook_addr), reinterpret_cast(hook_addr) + getpagesize(), NULL); - hook_installed.exchange(false); - } - } - - ~detour() { uninstall(); } - bool installed() { return hook_installed; } - void* hook_address() { return hook_addr; } - void* detour_address() { return detour_addr; } - private: - std::atomic hook_installed; - void* hook_addr, * detour_addr; - - unsigned char jmp_code[8]{}; - std::uint8_t org_bytes[sizeof(jmp_code)]; - }; - - // this is jank, but needed because the OS isnt initalizing statics/inlined globals... :| - inline std::map>* get_hooks() - { - static std::map> hooks{}; - return &hooks; - } - - inline void make_hook(void* addr_to_hook, void* jmp_to_addr, bool enable = true) - { - if (!addr_to_hook) - return; - - get_hooks()->insert({ - addr_to_hook, - std::make_unique( - addr_to_hook, - jmp_to_addr, - enable - ) } - ); - } - - inline void enable(void* addr) - { - if (!addr) - return; - get_hooks()->at(addr)->install(); - } - - inline void disable(void* addr) - { - if (!addr) - return; - get_hooks()->at(addr)->uninstall(); - } - - inline void remove(void* addr) - { - if (!addr) - return; - get_hooks()->erase(addr); - } -}