flat assembler
Message board for the users of flat assembler.

Index > Windows > in General about API

Author
Thread Post new topic Reply to topic
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle 05 Dec 2003, 07:53
is there in the Microsoft implementation of Win32 API a function which can change the human readable ASCI like: 10.101.217.215 to double word in the network order?


I am lazy and first ask, second I have to programm ,yeah!
Wink

thx the Gr8 3.14159..ple

_________________
Microsoft: brings power of yesterday to computers of today.
Post 05 Dec 2003, 07:53
View user's profile Send private message Reply with quote
jInuQ



Joined: 26 Jun 2003
Posts: 48
Location: USA - NV
jInuQ 05 Dec 2003, 09:03
There is a tutorial by Iczelion http://spiff.tripnet.se/~iczelion/asmsockguide.html that should give you the gist. It is for masm but that should be to hard to grok.

_________________
jInuQ

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
- Antoine de Saint Exupery
Post 05 Dec 2003, 09:03
View user's profile Send private message Visit poster's website AIM Address Reply with quote
HarryTuttle



Joined: 26 Sep 2003
Posts: 211
Location: Poland
HarryTuttle 05 Dec 2003, 13:36
for all ,such lazy like me Wink

Thx to jIunQ the GIST of the converting string to netw_byte_order
result->eax ofcoz.
Code:


.data
IPAddress db "206.34.234.23",0 


.code
invoke inet_addr, addr IPAddress    ; convert the IP address into network byte order 
    

_________________
Microsoft: brings power of yesterday to computers of today.
Post 05 Dec 2003, 13:36
View user's profile Send private message Reply with quote
scientica
Retired moderator


Joined: 16 Jun 2003
Posts: 689
Location: Linköping, Sweden
scientica 05 Dec 2003, 14:51
not what you asked for but anyway:
If you got the address in binary (4 bytes (IPv4)), then it easy to shift between big/small endian:
Code:
mov eax, [ip_address]
bswap eax ; if [ip_address] is big end- it's now little end, if it's little end. it's now big endian
    

_________________
... 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 05 Dec 2003, 14:51
View user's profile Send private message Visit poster's website Reply with quote
jInuQ



Joined: 26 Jun 2003
Posts: 48
Location: USA - NV
jInuQ 06 Dec 2003, 10:03
Well thats nifty 8^). Thanks for the quick tip.

_________________
jInuQ

"Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away."
- Antoine de Saint Exupery
Post 06 Dec 2003, 10:03
View user's profile Send private message Visit poster's website AIM Address 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.