flat assembler
Message board for the users of flat assembler.

Index > Compiler Internals > Hilighting problem?

Author
Thread Post new topic Reply to topic
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark
Hi Tomasz,

I got below

Code:
3eax equ ebx

   mov eax, 3eax
    


3eax is hilighted as numberic, Is it legal?

By the way, How can I create resource-only dll, the entry directive won't allowed me using 0 as the entry.
Post 18 Nov 2003, 03:29
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7796
Location: Kraków, Poland
Tomasz Grysztar
Everything that start with a decimal digit is considered a number - and using such symbols as labels is illegal.
Post 18 Nov 2003, 06:26
View user's profile Send private message Visit poster's website Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark
I have compiled it and allowed me to compile.
so what is illegal? Laughing
Post 18 Nov 2003, 07:39
View user's profile Send private message Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark
What about resource-only dll that need entry to be 0?
Post 18 Nov 2003, 08:05
View user's profile Send private message Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7796
Location: Kraków, Poland
Tomasz Grysztar
Of course you can do even:
Code:
 31 equ ebx 

   mov eax, 31    

and get "mov eax,ebx", as it is preprocessor's matter.
But you can't do:
Code:
 31:    

nor:
Code:
 31 = 23    


Last edited by Tomasz Grysztar on 18 Nov 2003, 09:39; edited 1 time in total
Post 18 Nov 2003, 09:38
View user's profile Send private message Visit poster's website Reply with quote
Tomasz Grysztar



Joined: 16 Jun 2003
Posts: 7796
Location: Kraków, Poland
Tomasz Grysztar
BiDark wrote:
What about resource-only dll that need entry to be 0?

What do you mean?
Post 18 Nov 2003, 09:39
View user's profile Send private message Visit poster's website Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark
I can't do.

Code:
format PE DLL
entry 0
    


I want to create the resource-only dll that doesn't has entry point (must be 0).

How do I do?
Post 18 Nov 2003, 10:31
View user's profile Send private message Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica
Don't specify an entry point, but IMO should should create the LibMain stub, IIRC windows calls it to verify that the DLL was propperly loaded.

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 18 Nov 2003, 11:12
View user's profile Send private message Visit poster's website Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark
scientica wrote:
Don't specify an entry point, but IMO should should create the LibMain stub, IIRC windows calls it to verify that the DLL was propperly loaded.


Didn't work, It set to the first section's rva. Confused
I will try.
Post 18 Nov 2003, 12:12
View user's profile Send private message Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark
I did a small resource dll in VC with /noentry switch (set entry point to 0) and use with LoadLibrary,FreeLibrary. It works fine.

But Fasm I have edit the entry point later using PEditor. When loaded, It says "Invalid Window image format...".

Gotta find this out why...
Post 18 Nov 2003, 13:27
View user's profile Send private message Reply with quote
comrade



Joined: 16 Jun 2003
Posts: 1137
Location: Russian Federation
comrade
DLL entry point is always called on LoadLibrary(). There is no way not to call it.

_________________
comrade (comrade64@live.com; http://comrade.ownz.com/)
Post 19 Nov 2003, 04:59
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark
comrade wrote:
DLL entry point is always called on LoadLibrary(). There is no way not to call it.


Ok you guys, see youself, I want to fool noone, use OllyDbg and see (this dll was built using VC 6.0).
I'm on Xp SP1.


Description:
Download
Filename: test.zip
Filesize: 1001 Bytes
Downloaded: 435 Time(s)

Post 19 Nov 2003, 05:50
View user's profile Send private message Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica
From what I can see now (in school - no access to anything but notepad) there are two sections, .rsrc and .reloc, so it's not just a resource section in it. Maybe there is some code too (like a simple ret at rva 0), but I don't know now.

_________________
... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself.
- Bradley Kuhn
Post 19 Nov 2003, 09:00
View user's profile Send private message Visit poster's website Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark
I don't think so, Very Happy

There is no code in the resource section, It's just a resouce headers at offset 200h.

What the difference beetween Fasm's dll and VC's dll I have right now is the 'relocation' section (It should be most neccesary, right?). I don't know what is put but Fasm'dll doesn't has.

May be at rva 0. Question
Post 19 Nov 2003, 09:32
View user's profile Send private message Reply with quote
BiDark



Joined: 22 Jun 2003
Posts: 109
Location: .th
BiDark
I got it, got it. Very Happy

This is the magic bytes from reloc section.

db 0,0,0,0,0,0,0,0,8,0,0,0

It won't load if the reloc section size (virtual size) is 0 or these bytes doesn't exist.

Any idea?
Post 19 Nov 2003, 10:39
View user's profile Send private message Reply with quote
pelaillo
Missing in inaction


Joined: 19 Jun 2003
Posts: 878
Location: Colombia
pelaillo
comrade wrote:
DLL entry point is always called on LoadLibrary(). There is no way not to call it.

If you use LoadLibraryEx, you can specifiy LOAD_LIBRARY_AS_DATAFILE flag and the loader does not call your entry point nor do relocations.
Post 19 Nov 2003, 16:31
View user's profile Send private message Yahoo Messenger 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. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.