flat assembler
Message board for the users of flat assembler.

Index > Windows > lstrlen, lstrlenA and lstrlenW - why ?

Author
Thread Post new topic Reply to topic
IronFelix



Joined: 09 Dec 2004
Posts: 141
Location: Russia, Murmansk region
IronFelix 22 Apr 2009, 16:14
Hi all!
Please explain why there are "lstrlen" exported function along with "lstrlenA" and "lstrlenW" in kernel32.dll? Similar situation is in other dll's too. What is the difference between "lstrlen" and other functions in this case?

Thanks.

_________________
Flat Assembler is the best!
Post 22 Apr 2009, 16:14
View user's profile Send private message Reply with quote
asmcoder



Joined: 02 Jun 2008
Posts: 784
asmcoder 22 Apr 2009, 16:30
[content deleted]


Last edited by asmcoder on 14 Aug 2009, 14:51; edited 1 time in total
Post 22 Apr 2009, 16:30
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 22 Apr 2009, 16:37
A and W versions are for ASCII (A) and UNICODE (W) versions. lstrlen is not a real import, it is aliased (by macros) to either the A or W version.
Post 22 Apr 2009, 16:37
View user's profile Send private message Visit poster's website Reply with quote
asmfan



Joined: 11 Aug 2006
Posts: 392
Location: Russian
asmfan 22 Apr 2009, 18:46
revolution actually it is real, but it has the same address as A version as other postfixless) APIs bound to A analogs.
Post 22 Apr 2009, 18:46
View user's profile Send private message Reply with quote
IronFelix



Joined: 09 Dec 2004
Posts: 141
Location: Russia, Murmansk region
IronFelix 22 Apr 2009, 20:00
Thank you. So, as i supposed, it is better to use A and W versions and ignore such bounded/aliases exports?
Post 22 Apr 2009, 20:00
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 23 Apr 2009, 01:12
asmfan wrote:
revolution actually it is real, but it has the same address as A version as other postfixless) APIs bound to A analogs.
It is only at the same address as the A version if you include win32ax. If you include win32wx then it is the same address as the W version. The macros are used to select which of the two will be imported. Have a look at the generated exe file with a hex editor you will see the appended A or W in the imports list.
Post 23 Apr 2009, 01:12
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 23 Apr 2009, 01:28
revolution, lstrlen exists on KERNEL32.DLL. However, this is not true with every API of course, this is just one of the exceptional cases


Description:
Filesize: 17.94 KB
Viewed: 4030 Time(s)

lstrlen.PNG


Post 23 Apr 2009, 01:28
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 23 Apr 2009, 01:34
Oh, you are all talking about exports, I was talking about imports. Sorry for the confusion.
Post 23 Apr 2009, 01:34
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-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.