-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreator.py
More file actions
executable file
·32 lines (24 loc) · 803 Bytes
/
creator.py
File metadata and controls
executable file
·32 lines (24 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3
# This script creats mapping files of JAR files
import argparse
import zipfile
import re
from io import StringIO
from Krakatau.Krakatau.classfileformat.reader import Reader
from Krakatau.Krakatau.classfileformat.classdata import ClassData
from Krakatau.Krakatau.assembler.disassembly import Disassembler
from common import *
file_jar = JarFile()
parser = argparse.ArgumentParser(
prog = "creator.py",
description = "Create symbol mapping of JAR files"
)
parser.add_argument('jar_file')
parser.add_argument('output_file')
args = parser.parse_args()
print("Read the JAR file")
with zipfile.ZipFile(args.jar_file, 'r') as archive:
addSymbols(archive, file_jar, True)
print("Write the mapping file")
with open(args.output_file, "w") as output:
output.write(str(file_jar))