diff options
author | Thomas Van Iseghem <[email protected]> | 2023-04-23 11:32:48 +0200 |
---|---|---|
committer | Thomas Van Iseghem <[email protected]> | 2023-04-23 11:32:48 +0200 |
commit | c5f7df96219d5d1d892acbcc69f7d3a661462083 (patch) | |
tree | 838e986c3a536c88080758e6ef9058e4e5fd4db2 | |
parent | f086606c68fb8c0a46f58a397d442fc0e5f72f57 (diff) | |
download | OpenCortex-c5f7df96219d5d1d892acbcc69f7d3a661462083.tar.gz OpenCortex-c5f7df96219d5d1d892acbcc69f7d3a661462083.zip |
Better file export for decoded capture
The previous method gave trouble because it wasn't UTF-8 encoded that way
-rw-r--r-- | Capture-decryption/README.md | 2 | ||||
-rw-r--r-- | Capture-decryption/decode_capture.py | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/Capture-decryption/README.md b/Capture-decryption/README.md index 5a3535c..4a9a8e8 100644 --- a/Capture-decryption/README.md +++ b/Capture-decryption/README.md @@ -38,5 +38,5 @@ pip install protobuf==3.20.* ## Usage ``` -python decode_capture.py <your-file>.cns.dec > <output-name>.json +python decode_capture.py <your-file>.cns.dec ```
\ No newline at end of file diff --git a/Capture-decryption/decode_capture.py b/Capture-decryption/decode_capture.py index bb85618..dd3d413 100644 --- a/Capture-decryption/decode_capture.py +++ b/Capture-decryption/decode_capture.py @@ -19,5 +19,6 @@ message.ParseFromString(input_data) # Convert the message object to a JSON string json_string = json_format.MessageToJson(message) -# Print the JSON string to stdout -sys.stdout.write(json_string) +# Save the JSON string to a file +with open("capture.json", "w") as f: + f.write(json_string)
\ No newline at end of file |