flat assembler
Message board for the users of flat assembler.

Index > High Level Languages > I compiled dll in VisualStudio 2019 and get 10 kb.

Author
Thread Post new topic Reply to topic
Roman



Joined: 21 Apr 2012
Posts: 1766
Roman 12 Dec 2020, 10:50
How i can get small size dll about 2 kb ?
And can i grab only one function from DLL ?


Last edited by Roman on 13 Dec 2020, 12:43; edited 1 time in total
Post 12 Dec 2020, 10:50
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4016
Location: vpcmpistri
bitRAKE 13 Dec 2020, 09:15
Code:
extern "C" // don't decorate name
__declspec(dllexport)
int
MyAdd(int A, int B) { return A + B; }

bool
__declspec(noinline)
__stdcall
_DllMainCRTStartup(int&, int, int&) { return true; }    
disable security checks "/GS-", /NODEFLIB, etc ...

What do you mean by "grab function from DLL"? The DLL is either loaded or not.

_________________
¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup
Post 13 Dec 2020, 09:15
View user's profile Send private message Visit poster's website Reply with quote
bitshifter



Joined: 04 Dec 2007
Posts: 796
Location: Massachusetts, USA
bitshifter 13 Dec 2020, 09:32
you can dynamically load individual library functions at runtime
is that what you meant?

_________________
Coding a 3D game engine with fasm is like trying to eat an elephant,
you just have to keep focused and take it one 'byte' at a time.
Post 13 Dec 2020, 09:32
View user's profile Send private message Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 798
Location: Russian Federation, Sochi
ProMiNick 13 Dec 2020, 11:32
10 kb for HLL is very nice result if it is not interpretative DotNet program(for DotNet it is catastroficaly large result).
first of all HLL initialization, creating couples(up to 10) of critical sections, RTTI information, there present checking of windows version even if don`t needed, and many many other checks, may be inited internal memory manager even if it not needed...
so 10 kb for HLL is nice. (if it is not .NET exe).
Post 13 Dec 2020, 11:32
View user's profile Send private message Send e-mail Reply with quote
Roman



Joined: 21 Apr 2012
Posts: 1766
Roman 13 Dec 2020, 12:41
bitRAKE wrote:


What do you mean by "grab function from DLL"? The DLL is either loaded or not.

Like as in IDA pro copy code of concrete function.
But do this in special program.

Cut because i need 3 kb code one function, but not all 13 kb dll !
Post 13 Dec 2020, 12:41
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20298
Location: In your JS exploiting you and your system
revolution 13 Dec 2020, 12:44
Oh, so you want to use VS2019 to make some binary code, and then disassemble it and use the code as your own in asm files?

You don't even need to create the DLL. You can ask VS to output just the intermediate assembly text.
Post 13 Dec 2020, 12:44
View user's profile Send private message Visit poster's website 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.