-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBinaryVersion_tool.py
111 lines (100 loc) · 3.54 KB
/
BinaryVersion_tool.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import os
# Variables
# 2.1 OS Android
Branch = "V2.1Live"
Revision = 6689754
MajorVersion = 2
MinorVersion = 1
PatchVersion = 0
AssetBundleMajorVersion = 0
AssetBundleMinorVersion = 0
AssetBundlePatchVersion = 6689754
DesignDataBundleMajorVersion = 0
DesignDataBundleMinorVersion = 0
DesignDataBundlePatchVersion = 6689754
LuaBundleMajorVersion = 0
LuaBundleMinorVersion = 0
LuaBundlePatchVersion = 6689750
AudioBundleMajorVersion = 0
AudioBundleMinorVersion = 0
AudioBundlePatchVersion = 6689754
VideoBundleMajorVersion = 0
VideoBundleMinorVersion = 0
VideoBundlePatchVersion = 6689754
Time = "20240320-1126"
PakType = "PROD" # PROD BETA GM CECREAEATION
PakTypeDetail = ""
SubPakInlcudeAssetType = "StartAsset"
SubPakInlcudeDesignDataType = "StartDesignData"
DispatchSeed = "bba67d093e"
BuildId = "20240320-1126-V2.1Live-6689754-OSPRODAndroid2.1.0-OSLive-aab-icon"
AppIdentity = "0ccc11c5e66a11ee8ef7da26e0554e04"
GameCoreVersion = 6688752
IsEnableExcludeAsset = True
Sdk_PS_Client_Id = ""
def variable_to_hex(variable):
if isinstance(variable, str):
length_byte = len(variable).to_bytes(1, byteorder='big').hex()
return "00" + length_byte + ''.join(format(ord(char), '02x') for char in variable)
elif isinstance(variable, bool):
return "01" if variable else "00" # Encode boolean as 01 for True, 00 for False
elif isinstance(variable, int):
return variable.to_bytes(4, byteorder='big').hex()
else:
raise ValueError("Unsupported variable type")
# Convert variables to hexadecimal
variables = [
Branch, Revision, MajorVersion, MinorVersion, PatchVersion,
AssetBundleMajorVersion, AssetBundleMinorVersion, AssetBundlePatchVersion,
DesignDataBundleMajorVersion, DesignDataBundleMinorVersion, DesignDataBundlePatchVersion,
LuaBundleMajorVersion, LuaBundleMinorVersion, LuaBundlePatchVersion,
AudioBundleMajorVersion, AudioBundleMinorVersion, AudioBundlePatchVersion,
VideoBundleMajorVersion, VideoBundleMinorVersion, VideoBundlePatchVersion,
Time, PakType, PakTypeDetail, SubPakInlcudeAssetType, SubPakInlcudeDesignDataType,
DispatchSeed, BuildId, AppIdentity, GameCoreVersion, IsEnableExcludeAsset, Sdk_PS_Client_Id
]
# Convert variables to hexadecimal
variables_hex = [variable_to_hex(var) for var in variables]
# Write to fil 写入文件
output_dir = "output" # 输出目录
output_path = os.path.join(output_dir, "BinaryVersion.bytes")
os.makedirs(output_dir, exist_ok=True) # 确保输出目录存在
# Write to file
with open(output_path, 'wb') as f:
for var_hex in variables_hex:
f.write(bytes.fromhex(var_hex))
print("\nBinaryVersion.bytes_success")
'''
# 2.1 OS Android
Branch = "V2.1Live"
Revision = 6689754
MajorVersion = 2
MinorVersion = 1
PatchVersion = 0
AssetBundleMajorVersion = 0
AssetBundleMinorVersion = 0
AssetBundlePatchVersion = 6689754
DesignDataBundleMajorVersion = 0
DesignDataBundleMinorVersion = 0
DesignDataBundlePatchVersion = 6689754
LuaBundleMajorVersion = 0
LuaBundleMinorVersion = 0
LuaBundlePatchVersion = 6689750
AudioBundleMajorVersion = 0
AudioBundleMinorVersion = 0
AudioBundlePatchVersion = 6689754
VideoBundleMajorVersion = 0
VideoBundleMinorVersion = 0
VideoBundlePatchVersion = 6689754
Time = "20240320-1126"
PakType = "PROD"
PakTypeDetail = ""
SubPakInlcudeAssetType = "StartAsset"
SubPakInlcudeDesignDataType = "StartDesignData"
DispatchSeed = "bba67d093e"
BuildId = "20240320-1126-V2.1Live-6689754-OSPRODAndroid2.1.0-OSLive-aab-icon"
AppIdentity = "0ccc11c5e66a11ee8ef7da26e0554e04"
GameCoreVersion = 6688752
IsEnableExcludeAsset = True
Sdk_PS_Client_Id = ""
'''