Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
581 B
2
Indexable
Never
import os
import json

memory_dump_folder = '/path/to/memory/dump/folder'  # Update this path

for filename in os.listdir(memory_dump_folder):
    filepath = os.path.join(memory_dump_folder, filename)
    
    with open(filepath, 'rb') as f:
        data = f.read()
        
    # Convert binary data to list of integers
    data = list(data)
    
    # Generate output JSON filename
    json_filename = filename + '.json'
    json_filepath = os.path.join(memory_dump_folder, json_filename)
    
    with open(json_filepath, 'w') as f:
        json.dump(data, f)