example of forwarded exports in PE

git-svn-id: svn://kolibrios.org@6768 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
CleverMouse 2016-11-29 17:54:32 +00:00
parent a5d8ff9f45
commit 3d2f646747
4 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,5 @@
if tup.getconfig("NO_FASM") ~= "" then return end
ROOT="../../../.."
tup.rule("main.asm", "fasm %f %o " .. tup.getconfig("PESTRIP_CMD") .. tup.getconfig("KPACK_CMD"), "%B.exe")
tup.rule("forwarder.asm", "fasm %f %o " .. tup.getconfig("PESTRIP_CMD") .. tup.getconfig("KPACK_CMD"), "%B.dll")
tup.rule("forwarded.asm", "fasm %f %o " .. tup.getconfig("PESTRIP_CMD") .. tup.getconfig("KPACK_CMD"), "%B.dll")

View File

@ -0,0 +1,28 @@
format PE console 0.8 DLL at 420000h
include '../../../proc32.inc'
include '../../../import.inc'
include '../../../export.inc'
forward_by_name:
invoke con_write_asciiz, forward_by_name_msg
ret
forward_by_ordinal:
invoke con_write_asciiz, forward_by_ordinal_msg
ret
forward_by_name_msg db 'Hello from forward_by_name!',13,10,0
forward_by_ordinal_msg db 'Hello from forward_by_ordinal!',13,10,0
align 4
data import
library console, 'console.dll'
import console, con_write_asciiz, 'con_write_asciiz'
end data
align 4
data export
export 'forwarded.dll', \
forward_by_name, 'forward_by_name', \
forward_by_ordinal, 'forward_by_ordinal'
end data

View File

@ -0,0 +1,11 @@
format PE console 0.8 DLL at 410000h
include '../../../export.inc'
align 4
data export
export 'forwarder.dll', \
func1, 'func1', \
func2, 'func2'
func1 db 'forwarded.forward_by_name',0
func2 db 'forwarded.#2',0
end data

View File

@ -0,0 +1,15 @@
format PE console 0.8
include '../../../proc32.inc'
include '../../../import.inc'
invoke func1
invoke func2
invoke con_exit, 0
xor eax, eax
ret
align 4
data import
library forwarder, 'forwarder.dll', console, 'console.dll'
import forwarder, func1, 'func1', func2, 'func2'
import console, con_exit, 'con_exit'
end data