flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
anon
hi
I got ip string like here Code: ip db '72.14.205.100',0 how to add 1 or 10 or 1000? thanks. |
|||
![]() |
|
ManOfSteel
1. Use the inet_addr API to convert the IP address to an integer. Use bit rotation instructions to convert back and forth between host/network byte orders (ntohl and htonl APIs do that too), and add/inc to modify any of the four parts.
or 2. Manually parse the IP address string, convert the parts to decimal and modify accordingly. |
|||
![]() |
|
Picnic
Here's a solution of doing that, hope it helps.
Code: invoke inet_addr, ip ; dot notation string to network bytes invoke ntohl, eax ; from tcp/ip network order to host byte order inc eax ; add 1 invoke htonl, eax ; from host to tcp/ip network bytes invoke inet_ntoa, eax ; network bytes to dot notation string invoke lstrcpy, ip, eax ; save back to buffer, mind the extra space you might need ;ip = '72.14.205.101',0 |
|||
![]() |
|
anon
hi
I have to read more about APIs functions. Merry Christmas all. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.