flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Static import of Windows programs

Author
Thread Post new topic Reply to topic
macomics



Joined: 26 Jan 2021
Posts: 949
Location: Russia
macomics 07 Aug 2021, 19:25
A self-compiled Windows Batch file for creating include files for static function import to FASM.


Description: Unpack to the directory to fasm.exe.
usage: export C:\Windows\System32\winmm.dll

Download
Filename: export.zip
Filesize: 3.22 KB
Downloaded: 210 Time(s)



Last edited by macomics on 01 Apr 2023, 09:10; edited 4 times in total
Post 07 Aug 2021, 19:25
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 25 Aug 2021, 16:22
Why don't you just include it to your projects?
Code:
include 'MyMacros or code or whatever functions you need.INC'    
Post 25 Aug 2021, 16:22
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 949
Location: Russia
macomics 25 Aug 2021, 17:09
This macro is needed to create plug-in fasm files for static function import from Windows libraries. If the project does not have compiled libraries that are statically connected to the main file, there is no need for it. But if necessary, you can also update the plug-in files of static import of standard Windows libraries and add the missing ones. For myself, I rewrote the standard macros included in the fasm kit for static function import. I need the functions to be listed in a different order, but I was too lazy to rewrite them manually. In order to understand how it works, just try writing in the command line "export.cmd %WinDir%\system32\kernel32.dll", or "export.cmd %WinDir%\system32\winmm.dll".
Post 25 Aug 2021, 17:09
View user's profile Send private message Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 25 Aug 2021, 17:24
Why don't you use import section to add missing/required functions from any library you want?


Description:
Filesize: 21.15 KB
Viewed: 6103 Time(s)

Capture.PNG


Description:
Filesize: 13.79 KB
Viewed: 6103 Time(s)

Capture.PNG


Post 25 Aug 2021, 17:24
View user's profile Send private message Visit poster's website Reply with quote
Overclick



Joined: 11 Jul 2020
Posts: 669
Location: Ukraine
Overclick 25 Aug 2021, 17:28
You can include your "plug-in" to
section '.idata' import data readable writeable
or use my multisection macro precent somewhere in this thread
Post 25 Aug 2021, 17:28
View user's profile Send private message Visit poster's website Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 949
Location: Russia
macomics 25 Aug 2021, 17:46
There is a slightly different principle here. The import section is also used, but you have someone's library and some functions in it. The macro lists them from an already compiled library and forms it as a plug-in file added to the import section.
Post 25 Aug 2021, 17:46
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 949
Location: Russia
macomics 01 Apr 2023, 09:09
Updated the source text of the importer. Now it works fine with PE64 libraries.
Post 01 Apr 2023, 09:09
View user's profile Send private message Reply with quote
FlierMate2



Joined: 21 Mar 2023
Posts: 39
FlierMate2 01 Apr 2023, 15:02
macomics wrote:
Updated the source text of the importer. Now it works fine with PE64 libraries.


Nice, you are practically already doing a PEDump tool.

The output of my cpuname.dll generated by your export.cmd.

Code:
; fasm1 autogenerated include
; builder script: "export.cmd"
; library cpuname.DLL, "C:\FASMW\cpuname.DLL"

import cpuname.DLL,\
                GetCpuName, "GetCpuName",\
                IsAvxSupported, "IsAvxSupported"    
Smile
Post 01 Apr 2023, 15:02
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.