├── config.json ├── examples ├── Hotfix-Peaking.lua └── CS-ChangeTexture.lua ├── README.md └── dump.py /config.json: -------------------------------------------------------------------------------- 1 | { 2 | "luac": "luac" 3 | } -------------------------------------------------------------------------------- /examples/Hotfix-Peaking.lua: -------------------------------------------------------------------------------- 1 | -- 2.7 Only Thanks @lilmayofuksu 2 | 3 | local function peaking() 4 | xlua.hotfix( 5 | CS.LLJAGKPPOEH, "CBOIHDDDANF", 6 | function (self, ...) 7 | base(self):CBOIHDDDANF(self, 1) 8 | end 9 | ) 10 | end 11 | 12 | local function onError(error) 13 | CS.UnityEngine.GameObject.Find("/BetaWatermarkCanvas(Clone)/Panel/TxtUID"):GetComponent("Text").text = tostring(error) 14 | end 15 | 16 | xpcall(peaking, onError) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # WindSeedDump / 风种子转储工具 2 | 3 | WindSeed Type 1 `sb_1184180438`. 4 | 5 | 支持类型 1 官服的 `sb_1184180438` 解析。 6 | 7 | ```bash 8 | python .\dump.py [json or bin] 9 | ``` 10 | 11 | ## Format of JSON / JSON 格式 12 | 13 | ```jsonc 14 | { 15 | "index": int, 16 | "object": { 17 | "areaNotify": { 18 | "areaId": int, 19 | "areaCode": base64str, 20 | "areaType": 1 21 | } 22 | }, 23 | "packet": base64str, 24 | "packetId": int, 25 | "protoName": "WindSeedClientNotify", 26 | "reltime": float, 27 | "source": int, 28 | "time": int 29 | } 30 | ``` 31 | 32 | ## Disclaimer / 免责声明 33 | 34 | Children do not understand things, just write for fun. You want to do bad things, I can only condemn you morally, I can not stop you. 35 | 36 | 小孩子不懂事,写着玩的。你做坏事,我管不着你。 37 | -------------------------------------------------------------------------------- /examples/CS-ChangeTexture.lua: -------------------------------------------------------------------------------- 1 | local function findActiveAvatar() 2 | local avatarRoot = CS.UnityEngine.GameObject.Find("/EntityRoot/AvatarRoot") 3 | if avatarRoot.transform.childCount == 0 then 4 | return 5 | end 6 | for i = 0, avatarRoot.transform.childCount - 1 do 7 | local avatar = avatarRoot.transform:GetChild(i) 8 | if avatar.gameObject.activeInHierarchy then 9 | return avatar.gameObject 10 | end 11 | end 12 | end 13 | 14 | local function findAvatarBody(avatar) 15 | for i = 0, avatar.transform.childCount - 1 do 16 | local transform = avatar.transform:GetChild(i) 17 | if transform.name == "OffsetDummy" then 18 | for j = 0, transform.childCount - 1 do 19 | local child = transform:GetChild(j) 20 | for k = 0, child.transform.childCount - 1 do 21 | local body = child.transform:GetChild(k) 22 | if body.name == "Body" then 23 | return body.gameObject 24 | end 25 | end 26 | end 27 | end 28 | end 29 | end 30 | 31 | 32 | local function replaceTexture() 33 | local nowAvatar = findActiveAvatar() 34 | local nowBody = findAvatarBody(nowAvatar) 35 | local texture = CS.UnityEngine.Texture2D(2048, 2048) 36 | local image = CS.System.IO.File.ReadAllBytes("F:/hutao.png") 37 | CS.UnityEngine.ImageConversion.LoadImage(texture, image) 38 | local renderer = nowBody:GetComponent(typeof(CS.UnityEngine.SkinnedMeshRenderer)) 39 | renderer.materials[1].mainTexture = texture 40 | 41 | end 42 | 43 | local function onError(error) 44 | CS.UnityEngine.GameObject.Find("/BetaWatermarkCanvas(Clone)/Panel/TxtUID"):GetComponent("Text").text = tostring(error) 45 | end 46 | 47 | xpcall(replaceTexture, onError) 48 | -------------------------------------------------------------------------------- /dump.py: -------------------------------------------------------------------------------- 1 | import sys 2 | import json 3 | import base64 4 | import struct 5 | 6 | def xor(message, key): 7 | return hex(message ^ key) 8 | 9 | def dump(path): 10 | try: 11 | config = json.load(open(path, "r"))["object"] 12 | data = config["areaNotify"]["areaCode"] 13 | if config["areaNotify"]["areaType"] != 1: 14 | print("I cannnot deal with type 2 or 3.") 15 | sys.exit(1) 16 | luac = base64.b64decode(data) 17 | except: 18 | luac = open(path, "rb").read() 19 | 20 | if b"sb_1184180438" in luac: 21 | start = luac.find(0x38) + 14 22 | end = luac.rfind(0xA3) 23 | 24 | luac = luac[start:end + 1] 25 | 26 | with open("temp_dump.luac", "wb") as f: 27 | f.write(luac) 28 | 29 | file = open("temp_dump.luac", "rb") 30 | 31 | data = [] 32 | while True: 33 | temp = file.read(1) 34 | if not temp: 35 | break 36 | else: 37 | if (ord(temp) <= 15): 38 | data.append(("0x0" + hex(ord(temp))[2:])[2:]) 39 | else: 40 | data.append((hex(ord(temp))[2:])) 41 | 42 | data.reverse() 43 | 44 | for key, value in enumerate(data): 45 | if key == 0: 46 | pass 47 | else: 48 | data[key] = xor(int(value, 16), int(data[key - 1], 16)) 49 | 50 | for key, value in enumerate(data): 51 | data[key] = xor(int(value, 16), 0xA3) 52 | 53 | data.reverse() 54 | 55 | with open("result.luac", "wb") as file: 56 | for item in data: 57 | pack = struct.pack("B", int(item, 16)) 58 | file.write(pack) 59 | 60 | else: 61 | open("result.luac", "wb").write(luac) 62 | print("Done! result.luac") 63 | 64 | def help(): 65 | print("dump.py ") 66 | 67 | 68 | if len(sys.argv) != 2: 69 | help() 70 | else: 71 | dump(sys.argv[1]) 72 | --------------------------------------------------------------------------------