Created
July 1, 2023 11:47
-
-
Save infirms/a057b7d695ff2b5b71fe86dc53688dd2 to your computer and use it in GitHub Desktop.
Allows to convert steamguard-cli maFile format to the SDA maFile format with some drawbacks. Usage: python cli_to_mafile.py <cli-mafile> <output-mafile>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import sys | |
def convert_json(input_file, output_file): | |
with open(input_file, 'r') as f: | |
data = json.load(f) | |
new_data = { | |
"shared_secret": "REPLACEME", | |
"serial_number": "REPLACEME", | |
"revocation_code": "REPLACEME", | |
"uri": "REPLACEME", | |
"server_time": "REPLACEME", | |
"account_name": "REPLACEME", | |
"token_gid": "REPLACEME", | |
"identity_secret": "REPLACEME", | |
"secret_1": "REPLACEME", | |
"status": 1, | |
"device_id": "REPLACEME", | |
"fully_enrolled": True, | |
"Session": { | |
"SessionID": "", | |
"SteamLogin": "", | |
"SteamLoginSecure": "", | |
"WebCookie": "", | |
"OAuthToken": "", | |
"SteamID": "REPLACEME" | |
} | |
} | |
for key in new_data.keys(): | |
if key in data: | |
new_data[key] = data[key] | |
elif key == 'Session' and 'steam_id' in data: | |
new_data['Session']['SteamID'] = data['steam_id'] | |
new_data['Session']['WebCookie'] = None | |
elif key == 'server_time': | |
new_data['server_time'] = 0 | |
with open(output_file, 'w') as f: | |
json.dump(new_data, f, indent=4) | |
if __name__ == "__main__": | |
convert_json(sys.argv[1], sys.argv[2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment