flat assembler
Message board for the users of flat assembler.

Index > Windows > import section dll name cannot contain '-'?

Author
Thread Post new topic Reply to topic
sleepsleep



Joined: 05 Oct 2006
Posts: 8885
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
i tried the following with 1.71.17
Code:
  library kernel32,'KERNEL32.DLL',\
          libgtk-3-0,'libgtk-3-0.dll'

include 'API\KERNEL32.INC'
import libgtk-3-0,\
        gtk_about_dialog_add_credit_section,'gtk_about_dialog_add_credit_section'
    

Quote:

D:\PROJECT>fasm greminder.asm
flat assembler version 1.71.17 (1048576 kilobytes memory)
greminder.asm [22]:
library kernel32,'KERNEL32.DLL',\
D:\fasmw17117\INCLUDE\macro/import32.inc [9] library [4]:
if defined name#.redundant
error: invalid name.


if clear the '-' dash, "import libgtk-3-0" change to "import libgtk"
it assembled fine.

is it no dash allowed for import library naming?
Post 05 Feb 2014, 10:11
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
It is just a standard label name with the same naming restrictions as any other label name. Use an underscore, or something, instead.
Post 05 Feb 2014, 10:14
View user's profile Send private message Visit poster's website Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8885
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
now i change it back, it doesn't assemble anymore, weird, sometime it works, sometime it doesn't.

Code:
format PE GUI 4.0
entry start

include 'win32a.inc'

section '.data' data readable writeable
apple   dd 0

section '.code' code readable executable
start:
        invoke  ExitProcess,0

section '.idata' import data readable
  library kernel32,'KERNEL32.DLL',\
          libgtk,'libgtk-3-0.dll'

include 'API\KERNEL32.INC'
import libgtk,\

        gtk_about_dialog_add_credit_section,'gtk_about_dialog_add_credit_section'    


Quote:

D:\PROJECT>fasm greminder.asm
flat assembler version 1.71.17 (1048576 kilobytes memory)
greminder.asm [26]:
import libgtk,\
D:\fasmw17117\INCLUDE\macro/import32.inc [31] import [5]:
if used label
error: invalid expression.


weird,i copied from notepad, there is no CRLF between libgtk,\ to gtk_about....
but once i paste it here, there got CRLF, maybe issue with notepad i guess.
Post 05 Feb 2014, 10:20
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8885
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
Image

2 CR there? 0D 0D
maybe i did something wrong with the dll2inc, i guess.
Post 05 Feb 2014, 10:41
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8885
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
Image

but i didn't put two 0D 0D
Post 05 Feb 2014, 10:48
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8885
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
Code:
cinvoke fopen,oufwrite,<'wb+',0> 
    


must use b, binary, otherwise, fprintf seems to add another 0x0D into buffer.
Post 05 Feb 2014, 15:43
View user's profile Send private message Reply with quote
baldr



Joined: 19 Mar 2008
Posts: 1651
baldr
sleepsleep,

Yep, C runtime writes '\r\n' instead of each '\n' for files opened in text mode. This is platform-specific issue, because historically end-of-line is represented as CR LF pair in DOS and Windows; thus text streams use that translation internally during input/output.
Post 05 Feb 2014, 16:41
View user's profile Send private message Reply with quote
sleepsleep



Joined: 05 Oct 2006
Posts: 8885
Location: ˛                             ⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣⁣Posts: 334455
sleepsleep
thanks, baldr =)
Post 05 Feb 2014, 17:08
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17270
Location: In your JS exploiting you and your system
revolution
sleepsleep wrote:
Code:
cinvoke fopen,oufwrite,<'wb+',0> 
    


must use b, binary, otherwise, fprintf seems to add another 0x0D into buffer.
Perhaps you would be better off to use the Windows native functions (WriteFile etc.) for such things.
Post 05 Feb 2014, 18:32
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-2020, Tomasz Grysztar.

Powered by rwasa.