How can i process the two strings with IP?
I need to calculate all the addresses like a network scanner from
192.168.11.1 to 192.168.11.255:

192.168.11.1
192.168.11.2
192.168.11.3
192.168.11.4
.....................

192.168.11.253
192.168.11.254
192.168.11.255

How can i do this?
Posted on 2001-12-08 03:19:15 by Anorak
In winsock, IP addresses are DWORDS in network byte order. That means that if you have this IP:
192.168.11.12
It would be strored in memory as:
db 192,168,11,12.
Note that this is the opposite of how normal values are stored. So the solution is easy. Just put this in memory:
db 192,168,11,1
Then use this value as IP, and increment the 4th byte every time until you've reached 255.

Thomas
Posted on 2001-12-08 03:36:12 by Thomas
By some strange freak accident 255 (0xFF in hex) fits in a byte (8 bits). ;)
A wise man might store the address as a set of four bytes, and use the inc instruction, then convert the numbers to strings. Don't take my word for it - what did you have in mind?
Posted on 2001-12-08 03:39:22 by bitRAKE
i got one problem
i'l taking IP string from text box
and then i use this cycle :
invoke GetWindowText,hWndEditStartIP,addr HostIP,15
.WHILE dword ptr !=255
add dword ptr ,1
invoke MessageBox,0,addr HostIP,addr HostIP,MB_OK
.ENDW
then i got this:
192.168.11.1
192.168.21.1
.....................
192.168.91.1
192.168.:1.1
192.168.;1.1
192.168.<1.1
.....................
That the problem?
Posted on 2001-12-08 04:13:54 by Anorak
    [*]String -> number[*]add one[*]Number -> String
Posted on 2001-12-08 04:20:10 by bitRAKE