This commit is contained in:
Kovid Goyal 2012-11-07 09:13:41 +05:30
parent b9cefe9989
commit 985c9c857f
2 changed files with 10 additions and 2 deletions

View File

@ -104,8 +104,9 @@ class Dict(Reader):
self.operators = {op:(name, arg) for op, name, arg, default, conv in
table}
def decompile(self, strings, data):
def decompile(self, strings, global_subrs, data):
self.strings = strings
self.global_subrs = global_subrs
self.stack = []
index = 0
while index < len(data):

View File

@ -42,8 +42,12 @@ class CFF(object):
self.strings = Strings(raw, offset)
offset = self.strings.pos
# Read global subroutines
self.global_subrs = GlobalSubrs(raw, offset)
offset = self.global_subrs.pos
# Decompile Top Dict
self.top_dict.decompile(self.strings, self.top_index[0])
self.top_dict.decompile(self.strings, self.global_subrs, self.top_index[0])
import pprint
pprint.pprint(self.top_dict)
@ -81,6 +85,9 @@ class Strings(Index):
def __init__(self, raw, offset):
super(Strings, self).__init__(raw, offset, prepend=cff_standard_strings)
class GlobalSubrs(Index):
pass
class CFFTable(UnknownTable):
def decompile(self):