Thread: [Wisp-cvs] wisp/users/dig pe.py,1.24,1.25 pe.tran,1.8,1.9
Status: Alpha
Brought to you by:
digg
|
From: <di...@us...> - 2003-05-19 13:34:04
|
Update of /cvsroot/wisp/wisp/users/dig
In directory sc8-pr-cvs1:/tmp/cvs-serv18383
Modified Files:
pe.py pe.tran
Log Message:
converted the body of make_pe_aout_header into |make-pe-aout-header|
Index: pe.py
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/pe.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- pe.py 19 May 2003 13:22:21 -0000 1.24
+++ pe.py 19 May 2003 13:28:27 -0000 1.25
@@ -52,81 +52,7 @@
def make_pe_aout_header ():
h = Linkie('<')
interp = Interpreter(h)
- # #aout/image-base must be multiple of 64ki
- # #aout/file-align must be a power of 2 in range of [512 ... 64Ki]
- # &aout/image-end must be a multiple of #aout/memory-align
- # !aout/header-end must be a multiple of #aout/file-align
- # Known flags for #aout/dll-flags
- # 0x0001 - per-process library initialization
- # 0x0002 - per-process library termination
- # 0x0004 - per-thread library initialization
- # 0x0008 - per-thread library termination
- # All others must be zero.
- interp.do("""
- 4 align
- ' #aout/magic w, 0x10B =: #?aout/magic
- ' #aout/linker-version-major (opt) b,
- ' #aout/linker-version-minor (opt) b,
- ' #aout/text-size t,
- ' #aout/data-size t,
- ' #aout/bss-size t,
- ' &_start ' #rva + t,
- ' &.text ' #rva + t,
- ' &.data ' #rva + t,""" + # not present in PE32+ (?)
- """
- ' #aout/image-base t,
- ' #aout/memory-align t,
- ' #aout/file-align t,
- ' #aout/os-version-major w,
- ' #aout/os-version-minor w,
- ' #aout/image-version-major (opt) w,
- ' #aout/image-version-minor (opt) w,
- ' #aout/subsys-version-major w,
- ' #aout/subsys-version-minor w,
- 0 t,
- ' &aout/image-end ' #rva + t,
- ' !aout/header-end t,
- ' #aout/checksum (opt) t,
- ' #aout/subsys w,
- ' #aout/dll-flags w,
- ' #aout/stack-reserve-size t,
- ' #aout/stack-commit-size t,
- ' #aout/heap-reserve-size t,
- ' #aout/heap-commit-size t,
- 0 t,""" + # loader flags -- obsolete
- """
- ' #aout/dict-entry-count t,
- ' &export-table ' #rva + t,
- ' #export-table/size t,
- ' &.imports ' #rva + t,
- ' #.imports/memsz t,
- ' &resource-table ' #rva + t,
- ' #resource-table/size t,
- ' &exception-table ' #rva + t,
- ' #exception-table/size t,
- ' !cert-table t,
- ' #cert-table/size t,
- ' &base-rel-table ' #rva + t,
- ' #base-rel-table/size t,
- ' &debug-data ' #rva + t,
- ' #debug-data/size t,
- ' &arch-specific ' #rva + t,
- ' #arch-specific/size t,
- ' &global-pointer ' #rva + t,
- 0 t,
- ' &tls ' #rva + t,
- ' #tls/size t,
- ' &load-config-table ' #rva + t,
- ' #load-config-table/size t,
- ' &bound-import-table ' #rva + t,
- ' #bound-import-table/size t,
- ' &import-address-table ' #rva + t,
- ' #import-address-table/size t,
- ' &delay-import-descr ' #rva + t,
- ' #delay-import-descr/size t,
- ' &COM+-runtime-header ' #rva + t,
- ' #COM+-runtime-header/size t,
- 0 t, 0 t,""") # reserved
+ interp.do('needs pe make-pe-aout-header')
return h
def populate_pe_directories (linkie, base, **given):
Index: pe.tran
===================================================================
RCS file: /cvsroot/wisp/wisp/users/dig/pe.tran,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- pe.tran 18 May 2003 17:47:38 -0000 1.8
+++ pe.tran 19 May 2003 13:28:27 -0000 1.9
@@ -42,4 +42,77 @@
mingle #*/flags t,
;
+:[ ] make-pe-aout-header
+ \ &aout/image-end must be a multiple of #aout/memory-align
+ \ !aout/header-end must be a multiple of #aout/file-align
+ 4 align
+ '#aout/magic w, #x10B =: #?aout/magic
+ '#aout/linker-version-major (opt) b,
+ '#aout/linker-version-minor (opt) b,
+ '#aout/text-size t,
+ '#aout/data-size t,
+ '#aout/bss-size t,
+ '&_start '#rva + t,
+ '&.text '#rva + t,
+ '&.data '#rva + t, \ not present in PE32+ (?)
+ '#aout/image-base t, \ must be multiple of 64ki
+ '#aout/memory-align t,
+ '#aout/file-align t, \ must be a power of 2 in range of [512 ... 64Ki]
+ '#aout/os-version-major w,
+ '#aout/os-version-minor w,
+ '#aout/image-version-major (opt) w,
+ '#aout/image-version-minor (opt) w,
+ '#aout/subsys-version-major w,
+ '#aout/subsys-version-minor w,
+ 0 t,
+ '&aout/image-end '#rva + t,
+ '!aout/header-end t,
+ '#aout/checksum (opt) t,
+ '#aout/subsys w,
+ '#aout/dll-flags w,
+ \ Known flags for #aout/dll-flags
+ \ 0x0001 - per-process library initialization
+ \ 0x0002 - per-process library termination
+ \ 0x0004 - per-thread library initialization
+ \ 0x0008 - per-thread library termination
+ \ All others must be zero.
+ '#aout/stack-reserve-size t,
+ '#aout/stack-commit-size t,
+ '#aout/heap-reserve-size t,
+ '#aout/heap-commit-size t,
+ 0 t, \ loader flags -- obsolete
+ '#aout/dict-entry-count t,
+ '&export-table '#rva + t,
+ '#export-table/size t,
+ '&.imports '#rva + t,
+ '#.imports/memsz t,
+ '&resource-table '#rva + t,
+ '#resource-table/size t,
+ '&exception-table '#rva + t,
+ '#exception-table/size t,
+ '!cert-table t,
+ '#cert-table/size t,
+ '&base-rel-table '#rva + t,
+ '#base-rel-table/size t,
+ '&debug-data '#rva + t,
+ '#debug-data/size t,
+ '&arch-specific '#rva + t,
+ '#arch-specific/size t,
+ '&global-pointer '#rva + t,
+ 0 t,
+ '&tls '#rva + t,
+ '#tls/size t,
+ '&load-config-table '#rva + t,
+ '#load-config-table/size t,
+ '&bound-import-table '#rva + t,
+ '#bound-import-table/size t,
+ '&import-address-table '#rva + t,
+ '#import-address-table/size t,
+ '&delay-import-descr '#rva + t,
+ '#delay-import-descr/size t,
+ '&COM+-runtime-header '#rva + t,
+ '#COM+-runtime-header/size t,
+ 0 t, 0 t,
+;
+
\ vim: ft=tran
|