[閒聊] Show IP Orz

看板ASM作者 (zha0)時間17年前 (2007/06/06 11:59), 編輯推噓2(203)
留言5則, 3人參與, 最新討論串1/1
連到 whatsmyip.org 因為在 title tag 裡有 public ip 找到那東東後把他 show 出來 XDXD XD 最近好像還滿喜歡用 ASM 寫小程式的 XDXD .586 .model flat,stdcall option casemap:none include windows.inc include user32.inc include kernel32.inc include wininet.inc includelib user32.lib includelib kernel32.lib includelib wininet.lib .data szAgent db 'Orz/1.0', 0 szServerName db "whatsmyip.org", 0 szVerb db "GET", 0 ;szObjectName db "", 0 szSearchText db "Your IP is ", 0 .data? hINet dd ?? hConnect dd ?? hData dd ?? dwRead dd ?? szBuffer db 256 dup (?) .code ; --------------------------------------------------------------------------- start: invoke InternetOpen, addr szAgent, INTERNET_OPEN_TYPE_PRECONFIG, NULL, NULL, 0 or eax, eax jz error1 mov hINet, eax invoke InternetConnect, hINet, addr szServerName, 80, NULL, NULL, INTERNET_SERVICE_HTTP, 0, 0 or eax, eax jz error2 mov hConnect, eax ;invoke HttpOpenRequest, hConnect, addr szVerb, addr szObjectName, NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0 invoke HttpOpenRequest, hConnect, addr szVerb, NULL, NULL, NULL, NULL, INTERNET_FLAG_KEEP_CONNECTION, 0 or eax, eax jz error3 mov hData, eax invoke HttpSendRequest, hData, NULL, 0, NULL, 0 Continue: invoke InternetReadFile, hData, addr szBuffer, sizeof szBuffer - 1, addr dwRead mov esi, offset szSearchText invoke lstrlen, esi mov ecx, sizeof szBuffer - 1 sub ecx, eax mov ebx, offset szBuffer Increase: push ecx mov ecx, eax mov esi, offset szSearchText mov edi, ebx _C: mov dl, byte ptr [esi+ecx-1] cmp dl, byte ptr [edi+ecx-1] jnz _F loop _C jmp short Found _F: pop ecx inc ebx loop Increase jmp short NoFound Found: add edi, eax push edi mov ecx, 12+3 ;000. mov al, '<' repnz scasb mov byte ptr [edi-1], 0 pop edi invoke MessageBox, NULL, edi, edi, 0 jmp short Finish NoFound: mov eax, dwRead or eax, eax jz Finish jmp Continue Finish: invoke InternetCloseHandle, hData error3: invoke InternetCloseHandle, hConnect error2: invoke InternetCloseHandle, hINet error1: invoke ExitProcess, NULL end start -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.64.110.97

06/06 13:24, , 1F
.....(昏倒) 還有這樣取本機IP 的
06/06 13:24, 1F

06/06 13:24, , 2F
人家網站都說不要這樣搞啦...
06/06 13:24, 2F

06/06 13:47, , 3F
請問一下你在 NAT 下,要怎麼取你外部 IP ?___?
06/06 13:47, 3F

06/06 13:48, , 4F
我只知道連去外面的方式,我知他網站有寫啊,只是寫好玩的 !!
06/06 13:48, 4F

06/07 00:18, , 5F
你越來越像是在幹壞事了 :p
06/07 00:18, 5F
文章代碼(AID): #16PZ4lvu (ASM)