Update of /cvsroot/wisp/wisp/users/dig
In directory sc8-pr-cvs1:/tmp/cvs-serv32479
Modified Files:
make-pe-exe.py pedump.py
Log Message:
made result of make-pe-hello.py edible to pedump.py
Index: make-pe-exe.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/make-pe-exe.py,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -d -r1.49 -r1.50
--- make-pe-exe.py 13 May 2003 21:17:03 -0000 1.49
+++ make-pe-exe.py 13 May 2003 21:30:55 -0000 1.50
@@ -279,12 +279,12 @@
imports.place_symbol('&.imports/%s/first-thunk' % dll)
for sym in imports_by_dlls[dll].keys():
imports.place_symbol('&.imports/slot/' + sym + '@' + dll)
- imports.emit_tetra_sum(['&.imports/thunk/%s@%s #rva' % (sym, dll)])
+ imports[::4] = '&.imports/thunk/%s@%s #rva' % (sym, dll)
imports.emit_tetra(0)
# emit thunk structures
for dll in imports_by_dlls.keys():
for sym in imports_by_dlls[dll].keys():
- imports.place_symbol('&.imports/thunk/%s@%s #rva' % (sym, dll))
+ imports.place_symbol('&.imports/thunk/%s@%s' % (sym, dll))
imports.align(2)
imports[::2] = 0 # ordinal
imports.emit_string(sym)
@@ -390,6 +390,7 @@
e.place_symbol('#delay-import-descriptor/size', 0)
e.place_symbol('&COM+-runtime-header', base_address)
e.place_symbol('#COM+-runtime-header/size', 0)
+e.align(512)
e.link()
e.dump()
Index: pedump.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/pedump.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- pedump.py 22 Apr 2003 22:29:30 -0000 1.5
+++ pedump.py 13 May 2003 21:30:55 -0000 1.6
@@ -189,14 +189,17 @@
print 'Forwarder chain: 0x%08x' % fwdr_chain
print 'DLL name: 0x%08x %r' % (dll_name, string_by_rva(dll_name))
print 'First thunk: 0x%08x' % first_thunk
- print 'Hint name array:'
h = hint_name
- herva, = struct.unpack('<L', by_rva[h:h + 4]); h += 4
- while herva <> 0:
- exord, = struct.unpack('<H', by_rva[herva:herva + 2])
- print ' [%08x] %04x %r' % (herva, exord,
- string_by_rva(herva + 2))
+ if h <> 0:
+ print 'Hint/name array:'
herva, = struct.unpack('<L', by_rva[h:h + 4]); h += 4
+ while herva <> 0:
+ exord, = struct.unpack('<H', by_rva[herva:herva + 2])
+ print ' [%08x] %04x %r' % (herva, exord,
+ string_by_rva(herva + 2))
+ herva, = struct.unpack('<L', by_rva[h:h + 4]); h += 4
+ else:
+ print 'Hint/name array is empty'
print 'Thunk array:'
t = first_thunk
terva, = struct.unpack('<L', by_rva[t:t + 4]); t += 4
|