Function at 0x4201e1
Capabilities:
Get local ipv4 addresses
Get socket information
Get socket status
Receive data
Receive data on socket
Resolve dns
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4f0
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
push esi
call fcn.00430c55
xor ecx, ecx
cmp al, 2
sete cl
xor ebx, ebx
push ebx
push 1
lea eax, [ebp - 5]
push eax
mov edi, esi
mov dword [ebp - 0x20], ecx
call fcn.004158d1
test al, al
je 0x42045a
cmp byte [ebp - 5], bl
je 0x42045a
movzx eax, byte [ebp - 5]
push ebx
push eax
lea eax, [ebp - 0x36c]
push eax
call fcn.004158d1
test al, al
je 0x42045a
movzx eax, byte [ebp - 5]
jmp 0x42024b
dec eax
cmp byte [ebp + eax - 0x36c], bl
je 0x420288
cmp eax, ebx
jne 0x420241
xor eax, eax
neg eax
sbb eax, eax
and eax, 0xffff0100
mov edi, 0xff05
add eax, edi
movzx eax, ax
mov dword [ebp - 0x1c], eax
push 2
lea eax, [ebp - 0x1c]
push eax
push esi
call fcn.0041598f
test al, al
je 0x42045a
cmp word [ebp - 0x1c], di
jne 0x420291
mov al, 1
jmp 0x42045c
lea eax, [ebp + eax - 0x36c]
jmp 0x420251
push ebx
push 4
lea eax, [ebp - 0x3c]
push eax
mov edi, esi
mov byte [ebp - 9], bl
call fcn.004158d1
test al, al
je 0x42045a
cmp byte [ebp - 0x3c], 5
jne 0x42045a
test byte [ebp - 0x20], 1
je 0x4202ca
mov dword [ebp - 0x48], 0x17
mov dword [ebp - 0x44], 2
jmp 0x4202d8
mov dword [ebp - 0x48], 2
mov dword [ebp - 0x44], 0x17
movzx eax, byte [ebp - 0x39]
dec eax
mov esi, dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x28], ebx
je 0x4203fe
dec eax
dec eax
je 0x42033e
dec eax
jne 0x42045a
mov edi, dword [ebp + 8]
push ebx
push 0x10
lea eax, [ebp - 0xe4]
push eax
call fcn.004158d1
test al, al
je 0x42045a
push 0x20
push 8
push dword [0x4401c8]
call esi
mov dword [ebp - 0x28], eax
cmp eax, ebx
je 0x420424
push 0x17
pop ecx
mov word [eax], cx
push 0x10
lea ecx, [ebp - 0xe4]
add eax, 8
jmp 0x420438
mov edi, dword [ebp + 8]
push ebx
push 1
lea eax, [ebp - 0xa]
push eax
call fcn.004158d1
test al, al
je 0x42045a
cmp byte [ebp - 0xa], bl
je 0x42045a
movzx eax, byte [ebp - 0xa]
push ebx
push eax
lea eax, [ebp - 0x4ec]
push eax
call fcn.004158d1
test al, al
je 0x42045a
movzx eax, byte [ebp - 0xa]
mov byte [ebp + eax - 0x4ec], bl
lea eax, [ebp - 0x38]
push eax
push ebx
push ebx
lea eax, [ebp - 0x4ec]
push eax
mov dword [ebp - 0x38], ebx
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x4203a6
mov byte [ebp - 9], 4
jmp 0x42043f
xor dl, dl
mov eax, dword [ebp - 0x38]
cmp eax, ebx
je 0x4203c2
movzx ecx, dl
mov ecx, dword [ebp + ecx*4 - 0x48]
cmp dword [eax + 4], ecx
je 0x4203d8
mov eax, dword [eax + 0x1c]
cmp eax, ebx
jne 0x4203b6
inc dl
cmp dl, 2
jb 0x4203a8
mov byte [ebp - 9], 4
push dword [ebp - 0x38]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
jmp 0x42043f
push dword [eax + 0x10]
push dword [eax + 0x18]
call fcn.00421d55
mov dword [ebp - 0x28], eax
cmp eax, ebx
jne 0x4203f0
mov byte [ebp - 9], 1
jmp 0x4203cd
cmp word [eax], 0x17
jne 0x4203cd
mov dword [eax + 0x18], ebx
mov dword [eax + 4], ebx
jmp 0x4203cd
mov edi, dword [ebp + 8]
push ebx
push 4
lea eax, [ebp - 0x4c]
push eax
call fcn.004158d1
test al, al
je 0x42045a
push 0x14
push 8
push dword [0x4401c8]
call esi
mov dword [ebp - 0x28], eax
cmp eax, ebx
jne 0x42042a
mov byte [ebp - 9], 1
jmp 0x42043f
push 2
pop ecx
mov word [eax], cx
push 4
lea ecx, [ebp - 0x4c]
add eax, 4
push ecx
push eax
call fcn.00421d23
mov edi, dword [ebp + 8]
push ebx
push 2
lea eax, [ebp - 0x40]
push eax
call fcn.004158d1
test al, al
jne 0x420463
push dword [ebp - 0x28]
call fcn.00421ce7
xor al, al
pop edi
pop esi
pop ebx
leave
ret 4
mov byte [ebp - 5], 1
cmp byte [ebp - 9], bl
jne 0x420a90
mov ax, word [ebp - 0x40]
mov esi, dword [ebp - 0x28]
mov word [esi + 2], ax
movzx eax, byte [ebp - 0x3b]
dec eax
je 0x420a46
dec eax
je 0x42099f
dec eax
je 0x420499
mov byte [ebp - 9], 7
jmp 0x420a90
mov eax, 0x80
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x54], eax
lea eax, [ebp - 0x50]
push eax
lea eax, [ebp - 0xd4]
push eax
push edi
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x420996
lea eax, [ebp - 0x54]
push eax
lea eax, [ebp - 0x3ec]
push eax
push edi
call dword [sym.imp.WS2_32.dll_getpeername]
test eax, eax
jne 0x420996
cmp word [ebp - 0xd4], 0x17
mov word [ebp - 0xd2], ax
jne 0x4204f5
mov dword [ebp - 0xbc], ebx
mov dword [ebp - 0xd0], ebx
lea esi, [ebp - 0xd4]
call fcn.00415cc5
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
je 0x420996
push 0x10003
push 8
push dword [0x4401c8]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov edi, eax
cmp edi, ebx
jne 0x42052e
mov byte [ebp - 9], 1
jmp 0x42098e
push dword [ebp - 0x20]
mov esi, dword [ebp + 8]
push ebx
push dword [ebp - 0x18]
push esi
call fcn.004200cb
cmp eax, 1
jne 0x42097a
mov eax, dword [ebp - 0x18]
or dword [ebp - 0x14], 0xffffffff
or dword [ebp - 0x1e0], 0xffffffff
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x1ec], 2
mov dword [ebp - 0x1e8], esi
mov dword [ebp - 0x1e4], eax
jmp 0x420957
push dword [ebp + 8]
lea eax, [ebp - 0x1ec]
call fcn.004158ab
test al, al
je 0x4205a3
push ebx
push 0xffff
push edi
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_recv]
test eax, eax
jle 0x420970
push dword [ebp - 0x18]
lea eax, [ebp - 0x1ec]
mov dword [ebp - 0x10], 0x80
call fcn.004158ab
test al, al
je 0x420861
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0xd4]
push eax
push ebx
push 0xffff
push edi
push dword [ebp - 0x18]
call dword [sym.imp.WS2_32.dll_recvfrom]
mov esi, eax
mov dword [ebp - 0x2c], esi
cmp esi, ebx
jle 0x420970
cmp esi, 6
jb 0x420861
mov ax, word [ebp - 0xd4]
cmp word [ebp - 0x3ec], ax
jne 0x420861
cmp ax, 2
jne 0x420619
mov eax, dword [ebp - 0x3e8]
cmp eax, dword [ebp - 0xd0]
jmp 0x420634
cmp ax, 0x17
jne 0x42063a
push 0x10
lea eax, [ebp - 0xcc]
lea ecx, [ebp - 0x3e4]
call fcn.00421dac
test eax, eax
jne 0x420861
cmp byte [edi + 2], 0
jne 0x420861
cmp word [edi], bx
jne 0x420861
cmp dword [ebp - 0x1c], ebx
jne 0x420684
push dword [ebp - 0x10]
lea eax, [ebp - 0xd4]
push eax
lea eax, [ebp - 0x26c]
push eax
call fcn.00421d23
cmp word [ebp - 0x26c], 0x17
jne 0x42067e
mov dword [ebp - 0x254], ebx
mov dword [ebp - 0x268], ebx
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], eax
push 0x80
lea eax, [ebp - 0xd4]
push ebx
push eax
call dword [sym.imp.msvcrt.dll_memset]
movzx eax, byte [edi + 3]
add esp, 0xc
dec eax
je 0x420799
dec eax
dec eax
je 0x4206e3
dec eax
jne 0x420861
cmp esi, 0x16
jle 0x420861
push 0x17
pop eax
mov word [ebp - 0xd4], ax
push 0x10
lea eax, [edi + 4]
push eax
lea eax, [ebp - 0xcc]
push eax
mov dword [ebp - 0x10], 0x1c
call fcn.00421d23
push 0x14
jmp 0x4207c7
mov al, byte [edi + 4]
test al, al
je 0x420861
movzx eax, al
lea ecx, [eax + 7]
cmp esi, ecx
jle 0x420861
push eax
lea ecx, [edi + 5]
push ecx
lea ecx, [ebp - 0x36c]
push ecx
call fcn.00421d23
mov byte [ebp + eax - 0x36c], 0
lea ebx, [eax + 5]
xor eax, eax
lea ecx, [ebp - 0x34]
push ecx
push eax
push eax
mov dword [ebp - 0x34], eax
lea eax, [ebp - 0x36c]
push eax
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
jne 0x420861
xor dl, dl
xor esi, esi
mov eax, dword [ebp - 0x34]
cmp eax, esi
je 0x420756
movzx ecx, dl
mov ecx, dword [ebp + ecx*4 - 0x48]
cmp dword [eax + 4], ecx
je 0x420762
mov eax, dword [eax + 0x1c]
cmp eax, esi
jne 0x42074a
inc dl
cmp dl, 2
jb 0x42073c
jmp 0x420861
mov ecx, dword [eax + 0x10]
push ecx
mov dword [ebp - 0x10], ecx
push dword [eax + 0x18]
lea eax, [ebp - 0xd4]
push eax
call fcn.00421d23
cmp word [ebp - 0xd4], 0x17
jne 0x42078e
mov dword [ebp - 0xbc], esi
mov dword [ebp - 0xd0], esi
push dword [ebp - 0x34]
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
jmp 0x4207c8
cmp esi, 0xa
jle 0x420861
push 2
pop eax
mov word [ebp - 0xd4], ax
push 4
lea eax, [edi + 4]
push eax
lea eax, [ebp - 0xd0]
push eax
mov dword [ebp - 0x10], 0x10
call fcn.00421d23
push 8
pop ebx
mov ax, word [edi + ebx]
add ebx, 2
cmp dword [ebp - 0x14], 0xffffffff
mov word [ebp - 0xd2], ax
jne 0x420831
push 0x80
lea eax, [ebp - 0x2ec]
push 0
push eax
call dword [sym.imp.msvcrt.dll_memset]
mov ax, word [ebp - 0xd4]
mov word [ebp - 0x2ec], ax
movzx eax, ax
add esp, 0xc
lea esi, [ebp - 0x2ec]
mov dword [ebp - 0x24], eax
call fcn.00415cc5
mov dword [ebp - 0x14], eax
cmp eax, 0xffffffff
je 0x420970
xor eax, eax
cmp dword [ebp - 0x24], 0x17
setne al
dec eax
and eax, 0xc
add eax, 0xa
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x2c], ebx
jle 0x420861
movzx eax, word [ebp - 0xd4]
cmp dword [ebp - 0x24], eax
jne 0x420861
push dword [ebp - 0x10]
lea eax, [ebp - 0xd4]
push eax
mov eax, dword [ebp - 0x2c]
push 0
sub eax, ebx
push eax
lea eax, [edi + ebx]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.WS2_32.dll_sendto]
cmp dword [ebp - 0x14], 0xffffffff
je 0x420929
push dword [ebp - 0x14]
lea eax, [ebp - 0x1ec]
call fcn.004158ab
test al, al
je 0x420929
mov esi, dword [ebp - 0x30]
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0xd4]
push eax
xor ebx, ebx
push ebx
mov eax, 0xffff
sub eax, esi
push eax
lea eax, [edi + esi]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.WS2_32.dll_recvfrom]
cmp eax, ebx
jg 0x4208b7
movzx ecx, word [ebp - 0xd4]
cmp dword [ebp - 0x24], ecx
jne 0x42092b
xor ecx, ecx
mov word [edi], cx
mov byte [edi + 2], cl
cmp word [ebp - 0xd4], 0x17
setne cl
dec cl
and cl, 3
inc cl
cmp dword [ebp - 0x24], 0x17
mov byte [edi + 3], cl
jne 0x4208e4
push 0x10
lea ecx, [ebp - 0xcc]
jmp 0x4208f2
cmp dword [ebp - 0x24], 2
jne 0x42092b
push 4
lea ecx, [ebp - 0xd0]
push ecx
lea ecx, [edi + 4]
push ecx
call fcn.00421d23
push 2
lea ecx, [ebp - 0xd2]
push ecx
lea ecx, [edi + esi - 2]
push ecx
call fcn.00421d23
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x26c]
push ecx
push ebx
add eax, esi
push eax
push edi
push dword [ebp - 0x18]
call dword [sym.imp.WS2_32.dll_sendto]
jmp 0x42092b
xor ebx, ebx
mov eax, dword [ebp - 0x14]
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov dword [ebp - 0x1e0], eax
add ecx, 2
mov dword [ebp - 0x1ec], ecx
mov ecx, dword [ebp + 8]
mov dword [ebp - 0x1e8], ecx
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x1e4], ecx
push ebx
push ebx
push ebx
lea eax, [ebp - 0x1ec]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x420579
mov esi, dword [ebp - 0x14]
call fcn.00415caf
jmp 0x420988
cmp eax, 0xffffffff
jne 0x420985
mov byte [ebp - 9], 1
jmp 0x420988
mov byte [ebp - 5], bl
push edi
call fcn.00421ce7
mov esi, dword [ebp - 0x18]
jmp 0x420a8b
mov byte [ebp - 9], 1
jmp 0x420a90
xor eax, eax
cmp word [esi], 0x17
mov word [esi + 2], ax
jne 0x4209b8
push 0x10
lea eax, [esi + 8]
push eax
call fcn.00421ddc
jmp 0x4209bb
mov dword [esi + 4], ebx
mov eax, esi
call fcn.00415aa7
mov esi, eax
mov dword [ebp - 0x30], esi
cmp esi, 0xffffffff
je 0x420a54
push dword [ebp - 0x20]
push ebx
push esi
push edi
call fcn.004200cb
mov edi, eax
cmp edi, 1
jne 0x420a2d
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 0x30]
push eax
call fcn.00415c7f
mov esi, dword [ebp - 0x30]
mov edi, eax
mov dword [ebp - 0x2c], edi
call fcn.00415caf
cmp edi, 0xffffffff
je 0x420996
push edi
call fcn.00431324
mov eax, dword [ebp - 0x20]
or eax, 2
push eax
push ebx
push edi
push dword [ebp + 8]
call fcn.004200cb
mov edi, eax
cmp edi, 1
jne 0x420a2a
push dword [ebp - 0x2c]
mov ebx, dword [ebp + 8]
call fcn.00415b08
mov esi, dword [ebp - 0x2c]
call fcn.00415caf
cmp edi, 0xffffffff
je 0x420996
cmp edi, 1
je 0x420a90
mov byte [ebp - 5], 0
jmp 0x420a90
mov edi, esi
call fcn.004159ad
mov esi, eax
cmp esi, 0xffffffff
jne 0x420a5a
mov byte [ebp - 9], 5
jmp 0x420a90
push esi
call fcn.00431324
push dword [ebp - 0x20]
push ebx
push esi
push dword [ebp + 8]
call fcn.004200cb
cmp eax, 1
jne 0x420a7d
mov ebx, dword [ebp + 8]
push esi
call fcn.00415b08
jmp 0x420a8b
cmp eax, 0xffffffff
jne 0x420a88
mov byte [ebp - 9], 1
jmp 0x420a8b
mov byte [ebp - 5], bl
call fcn.00415caf
push dword [ebp - 0x28]
call fcn.00421ce7
mov al, byte [ebp - 5]
cmp al, 1
jne 0x42045c
cmp byte [ebp - 9], 0
je 0x42045c
push dword [ebp - 0x20]
push dword [ebp - 9]
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.004200cb
test eax, eax
setne al
jmp 0x42045c