mirror of
https://github.com/dobin/SuperMega
synced 2026-06-02 17:27:10 +00:00
feature: write files with raw bytes
This commit is contained in:
@@ -35,6 +35,8 @@ def project():
|
||||
print("Handle: ", file)
|
||||
|
||||
with open(os.path.join("logs", file), "r") as f:
|
||||
if file.endswith(".bin"):
|
||||
continue
|
||||
data = f.read()
|
||||
|
||||
if 'main_c' in file:
|
||||
|
||||
@@ -22,6 +22,7 @@ class Observer():
|
||||
self.write_to_file(name + ".disas.txt", ret['text'])
|
||||
self.write_to_file(name + ".disas.ascii", ret['color'])
|
||||
self.write_to_file(name + ".hex", ret['hexdump'])
|
||||
self.write_to_file_bin(name + ".bin", data)
|
||||
self.idx += 1
|
||||
|
||||
def add_json(self, name, data):
|
||||
@@ -33,6 +34,11 @@ class Observer():
|
||||
return
|
||||
with open("logs/{}-{}".format(self.idx, filename), "w") as f:
|
||||
f.write(data)
|
||||
def write_to_file_bin(self, filename, data):
|
||||
if not self.active:
|
||||
return
|
||||
with open("logs/{}-{}".format(self.idx, filename), "wb") as f:
|
||||
f.write(data)
|
||||
|
||||
def clean_files(self):
|
||||
delete_all_files_in_directory("logs/")
|
||||
|
||||
Reference in New Issue
Block a user