First Commit

main
IMXNOOBX 9 months ago
parent 8c5c4cf374
commit acb673c7c7

@ -0,0 +1,88 @@
import os
# Input directory containing the files
input_dir = "old_steam/"
# Output directory for generated header files
output_dir = "steam-rollback/resources/"
# Create the output directory if it doesn't exist
os.makedirs(output_dir, exist_ok=True)
os.remove(output_dir + "*")
# Function to generate C-style array from binary content
def generate_binary_array(binary_content, filename):
binary_array = ", ".join(f"{byte:#04x}" for byte in binary_content)
result = f"const unsigned char {filename}_data[] = {{ {binary_array} }};\n\n"
result += f"const size_t {filename}_size = sizeof({filename}_data);"
return result
# Recursively walk through the input directory and its subdirectories
header_entries = []
for root, _, filenames in os.walk(input_dir):
for filename in filenames:
file_path = os.path.join(root, filename)
raw_relative_path = os.path.relpath(file_path, input_dir)
relative_path_parts = raw_relative_path.split(os.sep)
relative_path_parts[-1] = relative_path_parts[-1].replace(".", "_").replace("-", "_")
relative_path = os.path.join(*relative_path_parts)
output_path = os.path.join(output_dir, raw_relative_path) + ".h"
with open(file_path, "rb") as f:
binary_content = f.read()
header_content = f"#pragma once\n\n"
header_content += generate_binary_array(binary_content, filename.replace(".", "_").replace("-", "_"))
header_subdir = os.path.dirname(output_path)
os.makedirs(header_subdir, exist_ok=True)
with open(output_path, "w") as header_file:
header_file.write(header_content)
print(f"Generated header: {output_path}")
# Append entry to header_entries list
header_entries.append({
"relative_path": raw_relative_path,
"raw_relative_path": raw_relative_path.replace("\\", "\\\\"),
"filename": filename.replace(".", "_").replace("-", "_"),
"raw_filename": filename,
"variable_name": f"data_{relative_path.replace('/', '_').replace('.', '_')}",
})
# Generate the index header file
index_header_content = "#pragma once\n\n"
index_header_content += "#include <cstddef>\n"
index_header_content += "#include <string>\n\n"
for entry in header_entries:
index_header_content += f"#include \"{entry['relative_path']}.h\"\n"
index_header_content += "\nnamespace embedded_files {\n"
index_header_content += """
\tstruct binary_info {
\t const unsigned char* data;
\t size_t size;
\t std::string name;
\t std::string relative_path;
\t};
"""
index_header_content += "\tconst binary_info file_array[] = {\n"
for entry in header_entries:
index_header_content += "\t\t{ " + entry['filename'] + "_data, " + entry['filename'] + "_size, \"" + entry['raw_filename'] + "\", \"" + entry['raw_relative_path'] + "\" },\n"
index_header_content += "\t};\n"
index_header_content += "}\n"
index_header_path = os.path.join(output_dir, "embedded_files.h")
with open(index_header_path, "w") as index_header_file:
index_header_file.write(index_header_content)
print(f"Generated index header: {index_header_path}")
print("All headers and index file generated.")

@ -0,0 +1,46 @@
import os
import zipfile
# Input directory containing the files
input_dir = "old_steam/"
zip_file_name = "old_steam"
# Output directory for generated header files
output_dir = "steam-rollback/resources/"
# Create the output directory if it doesn't exist
os.makedirs(output_dir, exist_ok=True)
# os.remove(output_dir + "*")
# Function to generate C-style array from binary content
def generate_binary_array(binary_content, filename):
binary_array = ", ".join(f"{byte:#04x}" for byte in binary_content)
result = f"const unsigned char {filename}_data[] = {{ {binary_array} }};\n\n"
result += f"const size_t {filename}_size = sizeof({filename}_data);"
return result
with zipfile.ZipFile(zip_file_name + ".zip", 'w') as zipf:
for root, _, filenames in os.walk(input_dir):
for filename in filenames:
file_path = os.path.join(root, filename) # Construct the full path
print(f"Adding file into zip: {file_path}")
zipf.write(file_path, os.path.relpath(file_path, input_dir)) # Add the file to the zip archive
print(f"All files added to the zip, generating header file")
# Generate the index header file
header_content = f"#pragma once\n\n"
with open(zip_file_name + ".zip", "rb") as f:
binary_content = f.read()
header_content += f"const char* file_name = \"{zip_file_name}.zip\";\n"
header_content += generate_binary_array(binary_content, zip_file_name.replace(".", "_").replace("-", "_"))
with open(output_dir + zip_file_name + ".h", "w") as header_file:
header_file.write(header_content)
print(f"Generated index header: {output_dir + zip_file_name}.h")
print("All headers and index file generated.")

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1 @@
171788ace04d1b54d496db77a4e8d005

Binary file not shown.

@ -0,0 +1,17 @@
import os
folder_path = "." # Replace with the actual folder path
def rename_files(folder_path, target_string):
for filename in os.listdir(folder_path):
if target_string in filename:
new_filename = filename.replace(target_string, "")
old_path = os.path.join(folder_path, filename)
new_path = os.path.join(folder_path, new_filename)
os.rename(old_path, new_path)
print(f"Renamed: {filename} -> {new_filename}")
target_string = "RollbackSteam.Resources."
rename_files(folder_path, target_string)
print("Renaming complete.")

@ -0,0 +1,3 @@
BootStrapperInhibitAll=enable
BootStrapperForceSelfUpdate = disable
#ForceOfflineMode=enable

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,2 @@
/* Third-party software licenses can be found at licenses.txt */
"use strict";(self.webpackChunksteamui=self.webpackChunksteamui||[]).push([[1879],{31879:e=>{e.exports=JSON.parse('{"language":"arabic"}')}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,3 @@
/* Third-party software licenses can be found at licenses.txt */
(self.webpackChunksteamui=self.webpackChunksteamui||[]).push([[6109],{90529:n=>{n.exports={IconContainer:"awardicon_IconContainer_6TbQg",ButtonContainer:"awardicon_ButtonContainer_kaquA",InfoContainer:"awardicon_InfoContainer_2ydoR",IconImg:"awardicon_IconImg_2xJ_L",ReactionCount:"awardicon_ReactionCount_22PNg",IconList:"awardicon_IconList_1NEGw"}},77986:(n,e,t)=>{"use strict";t.r(e),t.d(e,{AwardIcon:()=>u,AwardIconList:()=>d});var o=t(67294),a=(t(16329),t(81603)),r=t(22784),c=t(90529),i=t.n(c),s=t(27194),p=t(45520);class u extends o.PureComponent{render(){const n=(0,s.kb)("#RewardsReaction_Tooltip",this.props.reaction.count||0,(0,a.C)(this.props.reaction.reaction_type));return o.createElement(r.HP,{className:(0,p.Z)(i().InfoContainer,i().IconContainer),toolTipContent:n},o.createElement("img",{className:i().IconImg,src:(0,a.w)(this.props.reaction.reaction_type,!1)}),this.props.reaction.count&&o.createElement("div",{className:i().ReactionCount},this.props.reaction.count))}}class d extends o.PureComponent{render(){let n=[];for(const e of this.props.reactions)n.push(o.createElement(u,{key:e.reaction_type,reaction:e}));return o.createElement("div",{className:i().IconList},n)}}}}]);
//# sourceMappingURL=awardicon.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,3 @@
html,body{padding:0;margin:0}.login_Login_VZ6x_{position:relative;height:100%;background:linear-gradient(0deg, #191A1E, #191A1E 58%, #212328 84%)}.login_TitleBar_1C4of{position:fixed;top:0;right:0;left:0;height:40px;z-index:9000;-webkit-app-region:drag}.login_TitleBar_1C4of .login_CloseButton_1mcCj{-webkit-app-region:no-drag;position:absolute;top:10px;right:10px;width:15px;height:15px}
/*# sourceMappingURL=css\4535.css.map*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -0,0 +1,3 @@
.awardicon_IconContainer_6TbQg{display:flex;flex-flow:row nowrap;border-radius:5px;padding:5px;margin:0 2px;background-color:rgba(0,0,0,.2);transition:background-color;transition-duration:.13s}.awardicon_ButtonContainer_kaquA{cursor:pointer}.awardicon_ButtonContainer_kaquA:hover{background-color:rgba(255,255,255,.2)}.awardicon_InfoContainer_2ydoR{cursor:unset}.awardicon_InfoContainer_2ydoR:hover{background-color:rgba(0,0,0,.1)}.awardicon_IconImg_2xJ_L{width:20px;height:20px;vertical-align:middle}.awardicon_ReactionCount_22PNg{color:#66c0f4;font-size:13px;vertical-align:middle;font-weight:bold;padding:3px}.awardicon_IconList_1NEGw{display:flex;flex-flow:row nowrap;padding-top:5px}
/*# sourceMappingURL=css\6109.css.map*/

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 444 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save