Skip to content

Commit e29c3c9

Browse files
committed
backwards compatibility
1 parent 377c44a commit e29c3c9

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

refinery/units/formats/pe/perc.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,15 @@ def __init__(self, reader: StructReader):
5959
self.entries = [GRPICONDIRENTRY(reader) for _ in range(count)]
6060

6161

62+
def _mktbl(ids: list[tuple[int, int, int]]) -> dict[int, dict[int, int]]:
63+
table = {}
64+
for pid, sid, lcid in ids:
65+
if pid not in table:
66+
table[pid] = {0: lcid}
67+
table[pid][sid] = lcid
68+
return table
69+
70+
6271
class perc(PathExtractorUnit):
6372
"""
6473
Extract PE file resources.
@@ -196,15 +205,6 @@ def unpack(self, data):
196205
raise TypeError('resource root entry was unexpectedly not a directory')
197206
yield from self._search(pe, rsrc)
198207

199-
@staticmethod
200-
def _mktbl(ids: list[tuple[int, int, int]]) -> dict[int, dict[int, int]]:
201-
table = {}
202-
for pid, sid, lcid in ids:
203-
if pid not in table:
204-
table[pid] = {0: lcid}
205-
table[pid][sid] = lcid
206-
return table
207-
208208
_LANG_ID_TO_LCID = _mktbl([
209209
(0x00, 0x03, 0x0C00),
210210
(0x00, 0x05, 0x1400),

0 commit comments

Comments
 (0)