Can anybody give me a code or advise me how can I convert IP address from decimal to hexadecimal..

Example, the hexadecimal of “ will be, “01020304??? in hexadecimal; decimal “ will be
“CA1C0150???.. as you can see when converted it change the address into hexadecimal notation by ignoring the dot...

Thanks in advanced!
Posted on 2006-08-19 01:58:40 by boonmai
Plug it in and move on  :)
; IN:  pointer to string "x.y.z.w"
; OUT: eax holds IP dword
IPStrToDw proc uses esi, pIPString:PTR BYTE
mov esi,pIPString
xor eax,eax
xor ecx,ecx
jmp @F
.if edx == '.'
or ecx,eax
shl ecx,8
xor eax,eax
lea eax,
lea eax,
movzx edx,byte ptr
inc esi
.until !edx
or eax,ecx
IPStrToDw endp

;;;;;;;;;;;;;;;;;;;; Test
ipString db "",0
invoke IPStrToDw,addr ipString
Posted on 2006-08-19 11:13:58 by drizz
Thank you very much!!!
Posted on 2006-08-19 11:46:27 by boonmai