NO

Author Topic: Exported functions and aliases  (Read 1569 times)

Offline Vortex

  • Member
  • *
  • Posts: 843
    • http://www.vortex.masmcode.com
Exported functions and aliases
« on: August 02, 2024, 09:27:03 PM »
Hello,

Here is an example of exported functions with aliases.

ConsFuncs.def :

Code: [Select]
LIBRARY ConsFuncs
EXPORTS

"cls"=_ClearScreen@0
"WriteConsole"=_StdOut@4
StrLen
locate

Example code calling the functions :

Code: [Select]
.386
.model flat, stdcall
option casemap :none

ExitProcess PROTO :DWORD

includelib \PellesC\lib\Win\kernel32.lib
includelib ConsFuncs.lib

cls PROTO
WriteConsole    PROTO :DWORD
StrLen          PROTO :DWORD
locate          PROTO :DWORD,:DWORD

.data

message         db 'Hello world!',13,10
                db 'This is a console application.',13,10,0

.code

start:

    invoke  StrLen,ADDR message ; just for testing
    invoke  cls
    invoke  WriteConsole,ADDR message                                               
    invoke  ExitProcess,0

END start
Code it... That's all...