flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Broken resource-only dlls, build with FASM above 1.69.14

Author
Thread Post new topic Reply to topic
addhaloka



Joined: 23 Oct 2013
Posts: 9
addhaloka 29 Feb 2016, 07:03
For example - drive buttons dll for Total Commander or localization dll for WinRAR. This question has long been interested in the now mostly theoretical, but all the same I would like to find out what wrong.

Example (drive buttons dll):

make.bat:
Code:
@echo off
set MASM32=F:\masm32
set "PATH=%MASM32%\bin;%PATH%"
set "INCLUDE=%MASM32%\include;%INCLUDE%"
rc /l 0x409 rsrc.rc
:: old fasm 1.69.14 and below - working dll
FASM16914.EXE Lubuntu14.asm Lubuntu14.dll
:: new versions above 1.69.14 - not working
:: FASM.EXE Lubuntu14.asm Lubuntu14.dll
del *.obj,*.res
pause    

Lubuntu14.asm:
Code:
format PE GUI 4.0 DLL
section '.rsrc' data readable resource from 'rsrc.res'    

rsrc.rc:
Code:
DISK35 BITMAP DISCARDABLE "Bitmap_1.bmp"
DISK525 BITMAP DISCARDABLE "Bitmap_2.bmp"
DISKCDROM BITMAP DISCARDABLE "Bitmap_3.bmp"
DISKCOMPUTER BITMAP DISCARDABLE "DISKCOMPUTER.bmp"
DISKDOCUMENTS BITMAP DISCARDABLE "DISKDOCUMENTS.bmp"
DISKFTP BITMAP DISCARDABLE "Bitmap_4.bmp"
DISKHDD BITMAP DISCARDABLE "Bitmap_5.bmp"
DISKNET BITMAP DISCARDABLE "Bitmap_6.bmp"
DISKNETHOOD BITMAP DISCARDABLE "Bitmap_7.bmp"
DISKNETX BITMAP DISCARDABLE "Bitmap_8.bmp"
DISKRAM BITMAP DISCARDABLE "Bitmap_9.bmp"
DISKREMOVE BITMAP DISCARDABLE "Bitmap_10.bmp"
    
Post 29 Feb 2016, 07:03
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20304
Location: In your JS exploiting you and your system
revolution 29 Feb 2016, 07:49
What do you mean by not working? Gives an error? Generates a bad file? Crashes? Something else?
Post 29 Feb 2016, 07:49
View user's profile Send private message Visit poster's website Reply with quote
addhaloka



Joined: 23 Oct 2013
Posts: 9
addhaloka 29 Feb 2016, 09:42
Just do not display resources, i.e the program works with the dll, does not see them - WinRAR is not picked up in the localization file "RarLng.dll", similarly in TweakTC (tweaker for TC) does not see buttons dll - screen: http://s1.bild.me/bilder/030315/1605317_0.png
Post 29 Feb 2016, 09:42
View user's profile Send private message Reply with quote
l_inc



Joined: 23 Oct 2009
Posts: 881
l_inc 29 Feb 2016, 13:00
addhaloka
My guess is that the older fasm versions forget to set the flag IMAGE_FILE_RELOCS_STRIPPED . Add the following lines at the end, and it should work fine with the newer versions:
Code:
section '.reloc' data readable discardable
data fixups
end data
rd 1    

_________________
Faith is a superposition of knowledge and fallacy
Post 29 Feb 2016, 13:00
View user's profile Send private message Reply with quote
addhaloka



Joined: 23 Oct 2013
Posts: 9
addhaloka 29 Feb 2016, 15:01
l_inc
Thanks. Everything right, so it turns out working dll. I just did not think that relocations might have importance for resource-only dll. Confused
Post 29 Feb 2016, 15:01
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.