Skip to content

Commit

Permalink
Merge pull request #407 from serpilliere/ordinal_export
Browse files Browse the repository at this point in the history
Loader/pe: Add ordinal export
  • Loading branch information
commial authored Aug 10, 2016
2 parents ec147b3 + 96f4930 commit f2a9a35
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions miasm2/jitter/loader/pe.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@ def get_export_name_addr_list(e):
# hex(e.rva2virt(addr.rva))))
out.append(
(o.ordinal + e.DirExport.expdesc.base, e.rva2virt(addr.rva)))

for i, s in enumerate(e.DirExport.f_address):
if not s.rva:
continue
out.append((i + e.DirExport.expdesc.base, e.rva2virt(s.rva)))

return out


Expand Down Expand Up @@ -396,6 +402,7 @@ def add_export_lib(self, e, name):
c_name = canon_libname_libfunc(
name_inv[libad], imp_ord_or_name)
self.fad2cname[ad] = c_name
log.debug("Add func %s %s", hex(ad), c_name)
self.fad2info[ad] = libad, imp_ord_or_name

def gen_new_lib(self, target_pe, filter_import=lambda peobj, ad: True, **kwargs):
Expand Down

0 comments on commit f2a9a35

Please sign in to comment.