Skip to content

Instantly share code, notes, and snippets.

@Alex4386
Created July 3, 2023 07:34
Show Gist options
  • Save Alex4386/7336e776226261c915f4be09d1f938e6 to your computer and use it in GitHub Desktop.
Save Alex4386/7336e776226261c915f4be09d1f938e6 to your computer and use it in GitHub Desktop.
The Error Telemetry for specific anime social credit downloader
# Source Generated with Decompyle++
# File: upload_crash.pyc (Python 3.8)
import requests
import sys
import os
import traceback
debugUrl = 'http://hk4e-uspider.mihoyo.com:8888/fileupload'
releaseUrl = 'http://47.103.71.252:8888/fileupload'
userName = 'WindowsCrash'
logFile = open('upload_err.log', 'w')
def get_info(filename):
rs = { }
file = open(filename, 'r')
lines = file.readlines()
for line in lines:
if line != '' and line != '\n':
value = line.split(':')[1].replace('\n', '')
rs[line.split(':')[0]] = value.encode('utf8')
continue
file.close()
return rs
def get_content(filename):
# Decomp Incomplete
pass
def upload_crash():
content_file = sys.argv[1]
info_file = sys.argv[2]
info = get_info(info_file)
if len(sys.argv) >= 4:
info['type'] = sys.argv[3]
content = get_content(content_file)
fileName = os.path.basename(content_file)
headers = {
'content-type': 'application/octet-stream',
'userName': userName,
'fileName': fileName }
for k in info:
headers[k] = info[k]
if 'isRelease' not in info:
return None
if None['isRelease'].decode('utf-8') == '0':
msg = 'upload_crash debug upload: ' + str(len(content))
print(msg)
logFile.writelines(msg + '\n')
data_response = requests.post(debugUrl, content, headers, **('data', 'headers'))
logFile.writelines(str(data_response.status_code) + '\n')
logFile.writelines(data_response.text + '\n')
else:
msg = 'upload_crash release upload:' + str(len(content))
print(msg)
logFile.writelines(msg + '\n')
data_response = requests.post(releaseUrl, content, headers, **('data', 'headers'))
logFile.writelines(str(data_response.status_code) + '\n')
logFile.writelines(data_response.text + '\n')
@Alex4386
Copy link
Author

This probably mean that WindowsCrash is a reserved keyword for username creation 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment