Upload files to "/"

This commit is contained in:
2024-10-18 17:21:00 +08:00
parent 9bd4f149a5
commit 9327c44117
2 changed files with 17 additions and 12 deletions

View File

@@ -53,7 +53,7 @@ def export_local_types_for_struct():
type_name = get_numbered_type_name(i) # 获取类型名称
if(type_name is None):return type_list
type_data=get_numbered_type(None,i) #获取类型
mylog("export_local_types_for_struct",type_name)
#mylog("export_local_types_for_struct",type_name)
if not type_data or type_data[1] is None :continue #[1]判断是否为普通类型,普通类型[1]为None
tinfo = tinfo_t()
# 调用 deserialize序列化
@@ -71,14 +71,21 @@ def export_local_types_for_struct():
mylog("export_local_types_for_struct",msg)
def export_local_types(save_file):
save_file=save_file+"_Estruct.json"
struct_list=export_local_types_for_struct()#返回字典列表
if(struct_list is None):return
# 将结构体信息转换为 JSON 格式
# # 将结构体信息转换为 JSON 格式
json_output = json.dumps(struct_list, indent=4)
#print(json_output)
save_file=save_file+"_Estruct.json"
with open(save_file,"w") as f:
f.write(json_output)
# 字符串存储
# save_file=save_file+"_Estruct.txt"
# with open(save_file,"w") as f:
# for i in struct_list:
# f.write(f"[{i['name']}:struct_size {i['size']} -> {i['info']}]\n")
#函数黑名单
BLACK_LIST={
"_start","_dl_relocate_static_pie",
@@ -95,8 +102,10 @@ def main():
filepath="tmp.txt"
if (os.path.exists(filepath) and os.path.isfile(filepath) ):
with open(filepath,"r") as f:
extractfile=f.read()
extractfile=f.read()
extractfile=extractfile.split("/")[-1]
extractfile=os.path.join(save_dir,extractfile)
export_func(extractfile)
export_local_types(extractfile)
@@ -107,4 +116,4 @@ if __name__ == "__main__":
main()
except AssertionError as msg:
mylog("__main__",msg)
qexit(0)
qexit(0)