Permalink
Browse files

fix typo in protobin decompiler

  • Loading branch information...
fry committed Nov 15, 2011
1 parent 98367c7 commit 066f49990bd4a129aae486245196b1af61c5fc8c
Showing with 15 additions and 14 deletions.
  1. +15 −14 decompile_protobins.py
View
@@ -54,7 +54,6 @@ def decompile(self, file_name, out_dir = ".", stdout=False):
print "Descriptor dump:"
print descriptor
raise
- print "Decompiled %s" % file_name
def decompile_file_descriptor(self, out, descriptor):
# deserialize package name and dependencies
@@ -167,20 +166,22 @@ def write(self, out, str):
out.write("\t" * self.indent_level)
out.write(str)
-decomp = ProtobinDecompiler()
+if __name__ == '__main__':
+ decomp = ProtobinDecompiler()
-if len(sys.argv) < 3:
- print "Usage: %s in_folder out_folder" % sys.argv[0]
- sys.exit()
+ if len(sys.argv) < 3:
+ print "Usage: %s in_folder out_folder" % sys.argv[0]
+ sys.exit()
-in_dir = sys.argv[1]
-out_dir = sys.argv[2]
+ in_dir = sys.argv[1]
+ out_dir = sys.argv[2]
-in_files = []
-for root, dirs, files in os.walk(in_dir):
- for file in files:
- if file.endswith(".protobin"):
- in_files.append(os.path.join(root, file))
+ in_files = []
+ for root, dirs, files in os.walk(in_dir):
+ for file in files:
+ if file.endswith(".protobin"):
+ in_files.append(os.path.join(root, file))
-for file in in_files:
- decomp.decompile(file, out_dir)
+ for file in in_files:
+ print "Decompiling %s" % file
+ decomp.decompile(file, out_dir)

0 comments on commit 066f499

Please sign in to comment.