mirror of
https://github.com/KolibriOS/kolibrios.git
synced 2024-12-24 23:56:49 +03:00
example of forwarded exports in PE
git-svn-id: svn://kolibrios.org@6768 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
a5d8ff9f45
commit
3d2f646747
@ -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")
|
28
programs/develop/examples/pe_forwarded_export/forwarded.asm
Normal file
28
programs/develop/examples/pe_forwarded_export/forwarded.asm
Normal 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
|
11
programs/develop/examples/pe_forwarded_export/forwarder.asm
Normal file
11
programs/develop/examples/pe_forwarded_export/forwarder.asm
Normal 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
|
15
programs/develop/examples/pe_forwarded_export/main.asm
Normal file
15
programs/develop/examples/pe_forwarded_export/main.asm
Normal 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
|
Loading…
Reference in New Issue
Block a user