Function at 0x4022d0
Capabilities:
Create raw socket
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x8a0
push ebx
push ebp
mov ebx, ecx
mov eax, dword [ebx + 0xc]
push esi
shl eax, 8
push edi
push eax
mov dword [esp + 0x34], ebx
call fcn.0043bc93
mov edi, eax
add esp, 4
mov dword [esp + 0x14], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ebp, dword [sym.imp.WS2_32.dll_WSACreateEvent]
lea edx, [esp + 0x68]
xor esi, esi
lea ecx, [esp + 0x3c0]
sub edi, edx
mov word [ebx + 0x14], ax
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], edi
call ebp
mov dword [esp + esi*4 + 0x68], eax
call ebp
test eax, eax
lea ecx, [edi + esi*4]
mov dword [esp + ecx + 0x68], eax
je 0x4023cc
mov ecx, dword [esp + esi*4 + 0x68]
test ecx, ecx
je 0x4023cc
mov ecx, dword [esp + 0x24]
mov dword [ecx], eax
inc esi
add ecx, 0x14
cmp esi, 0x40
mov dword [esp + 0x24], ecx
jb 0x402322
push 1
xor esi, esi
push esi
push esi
push 1
push 3
xor eax, eax
mov ecx, 0x80
lea edi, [esp + 0x1c4]
push 2
rep stosd dword es:[edi], eax
call dword [sym.imp.WS2_32.dll_WSASocketA]
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x24], ebp
jne 0x402404
mov esi, dword [esp + 0x14]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ebx, [esp + 0x68]
sub ebx, esi
mov ebp, 0x40
lea ebx, [ebx]
mov eax, dword [ebx + esi]
push eax
call edi
mov ecx, dword [esi]
push ecx
call edi
add esi, 4
dec ebp
jne 0x4023a0
mov edx, dword [esp + 0x14]
push edx
call fcn.0043caa8
add esp, 4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
dec esi
js 0x4023e9
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edx, [edi + esi*4]
mov eax, dword [esp + edx + 0x68]
push eax
call ebx
mov ecx, dword [esp + esi*4 + 0x68]
push ecx
call ebx
dec esi
jns 0x4023d5
mov edx, dword [esp + 0x14]
push edx
call fcn.0043caa8
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebx + 8]
push 4
xor eax, eax
mov dword [esp + 0x40], eax
lea edx, [esp + 0x3c]
push edx
push 0x1002
mov dword [esp + 0x4c], eax
push 0xffff
mov dword [esp + 0x54], eax
push ebp
mov dword [esp + 0x60], esi
mov dword [esp + 0x40], esi
mov dword [esp + 0x30], 1
mov dword [esp + 0x5c], eax
mov dword [esp + 0x54], ecx
mov word [esp + 0x50], 2
mov word [esp + 0x52], 0x50
mov dword [esp + 0x4c], 0x14000
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
jne 0x4024a1
mov esi, dword [esp + 0x14]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ebx, [esp + 0x68]
sub ebx, esi
mov ebp, 0x40
mov eax, dword [esi + ebx]
push eax
call edi
mov ecx, dword [esi]
push ecx
call edi
add esi, 4
dec ebp
jne 0x402475
mov edx, dword [esp + 0x14]
push edx
call fcn.0043caa8
add esp, 4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebx + 0xc], esi
mov dword [esp + 0x20], esi
jle 0x40267b
mov edi, edi
mov dword [esp + 0x1c], 1
push 4
lea eax, [esp + 0x20]
push eax
push 4
push 0
push ebp
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, 0xffffffff
je 0x40274a
mov esi, dword [esp + 0x1c]
shl esi, 3
push 0x400
lea edi, [esp + esi + 0x1b0]
call fcn.0043bf47
mov dword [edi], eax
mov dword [esp + esi + 0x1ac], 8
mov ecx, dword [edi]
mov byte [ecx], 8
mov edx, dword [esp + 0x20]
mov eax, dword [esp + edx*8 + 0x1b0]
mov byte [eax + 1], 0
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + ecx*8 + 0x1b0]
mov ax, word [ebx + 0x14]
mov word [edx + 4], ax
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + eax*8 + 0x1b0]
mov word [ecx + 6], ax
mov edx, dword [esp + 0x20]
mov eax, dword [esp + edx*8 + 0x1b0]
mov word [eax + 2], 0
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + ecx*8 + 0x1b0]
push 8
push edx
call fcn.0040b460
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + ecx*8 + 0x1b8]
add esp, 0xc
mov word [edx + 2], ax
mov eax, dword [esp + 0x1c]
push 0
lea ecx, [eax + eax*4]
lea edx, [esp + ecx*4 + 0x3a0]
push edx
push 0x10
lea ecx, [esp + 0x48]
push ecx
push 0
lea edx, [esp + 0x60]
push edx
push 1
lea eax, [esp + eax*8 + 0x1c4]
push eax
push ebp
call dword [sym.imp.WS2_32.dll_WSASendTo]
cmp eax, 0xffffffff
jne 0x4025fb
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x3e5
je 0x40260e
mov esi, dword [esp + 0x14]
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edi, [esp + 0x68]
xor ebx, ebx
sub edi, esi
mov edx, dword [esi + edi]
push edx
call ebp
mov eax, dword [esi]
push eax
call ebp
mov eax, dword [esp + ebx*8 + 0x1b4]
test eax, eax
je 0x4025d7
push eax
call fcn.0043bf59
add esp, 4
inc ebx
add esi, 4
cmp ebx, 0x40
jb 0x4025b8
mov ecx, dword [esp + 0x14]
push ecx
call fcn.0043caa8
add esp, 4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x14]
mov eax, dword [edx + ecx*4 - 4]
push eax
call dword [sym.imp.WS2_32.dll_WSASetEvent]
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [esp + 0x1c]
inc eax
cmp eax, 0x40
mov dword [esp + 0x1c], eax
jbe 0x4024b8
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
mov ecx, dword [ebx + 0x10]
mov edx, dword [esp + 0x14]
push 0
push ecx
push 1
push edx
push 0x40
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
mov edi, eax
test edi, edi
jne 0x40278d
mov edi, dword [sym.imp.WS2_32.dll_WSAResetEvent]
xor esi, esi
mov eax, dword [esp + 0x14]
mov ecx, dword [eax + esi*4]
push ecx
call edi
inc esi
cmp esi, 0x40
jb 0x402657
mov eax, dword [esp + 0x20]
mov ecx, dword [ebx + 0xc]
inc eax
cmp eax, ecx
mov dword [esp + 0x20], eax
jl 0x4024b0
xor ebx, ebx
mov byte [esp + 0x1b], 0
mov dword [esp + 0x34], ebx
lea ebp, [esp + 0x1b0]
lea esi, [esp + 0x3b0]
mov edx, dword [esp + ebx*4 + 0x68]
mov edi, dword [ebp + 4]
xor eax, eax
mov ecx, esi
mov dword [ecx], eax
mov dword [ecx + 4], eax
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], eax
push eax
push esi
mov dword [ecx + 0x10], eax
push eax
push eax
mov dword [esi + 0x10], edx
mov edx, dword [esp + 0x34]
mov ecx, 0x100
rep stosd dword es:[edi], eax
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x3c]
push eax
lea ecx, [esp + 0x48]
push ecx
push 1
push ebp
push edx
mov dword [ebp], 0x400
call dword [sym.imp.WS2_32.dll_WSARecvFrom]
cmp eax, 0xffffffff
jne 0x4027e6
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
cmp edi, 0x3e5
je 0x4027f5
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebp, dword [esp + 0x28]
xor esi, esi
lea ecx, [ebp + esi*4]
mov edx, dword [esp + ecx + 0x68]
push edx
call ebx
mov eax, dword [esp + esi*4 + 0x68]
push eax
call ebx
mov eax, dword [esp + esi*8 + 0x1b4]
test eax, eax
je 0x40272d
push eax
call fcn.0043bf59
add esp, 4
inc esi
cmp esi, 0x40
jb 0x402707
mov ecx, dword [esp + 0x14]
push ecx
call fcn.0043caa8
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [esp + 0x14]
mov ebx, dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ebp, [esp + 0x68]
xor edi, edi
sub ebp, esi
lea esp, [esp]
mov edx, dword [esi + ebp]
push edx
call ebx
mov eax, dword [esi]
push eax
call ebx
mov eax, dword [esp + edi*8 + 0x1b4]
test eax, eax
je 0x40277f
push eax
call fcn.0043bf59
add esp, 4
inc edi
add esi, 4
cmp edi, 0x40
jb 0x402760
jmp 0x4025e0
mov esi, dword [esp + 0x14]
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [esp + 0x68]
xor ebx, ebx
sub eax, esi
mov dword [esp + 0x20], eax
mov edx, dword [esp + 0x20]
mov eax, dword [esi + edx]
push eax
call ebp
mov ecx, dword [esi]
push ecx
call ebp
mov eax, dword [esp + ebx*8 + 0x1b4]
test eax, eax
je 0x4027c6
push eax
call fcn.0043bf59
add esp, 4
inc ebx
add esi, 4
cmp ebx, 0x40
jb 0x4027a3
mov edx, dword [esp + 0x14]
push edx
call fcn.0043caa8
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
test eax, eax
jne 0x4027f5
mov eax, dword [esp + ebx*4 + 0x68]
push eax
call dword [sym.imp.WS2_32.dll_WSASetEvent]
inc ebx
add esi, 0x14
add ebp, 8
cmp ebx, 0x3f
jb 0x402694
mov ebp, dword [esp + 0x30]
mov edx, dword [ebp + 0x10]
xor eax, eax
push eax
push edx
push eax
mov ecx, 0x10
lea edi, [esp + 0x17c]
rep stosd dword es:[edi], eax
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x74]
push eax
push 0x40
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
mov esi, eax
cmp esi, 0xffffffff
je 0x402ad4
jmp 0x402840
cmp esi, 0x102
je 0x402ad4
mov ecx, dword [esp + esi*4 + 0x68]
lea ebx, [esp + esi*4 + 0x68]
push ecx
call dword [sym.imp.WS2_32.dll_WSAResetEvent]
mov edi, dword [esp + esi*8 + 0x1b4]
mov al, byte [edi + 0x14]
test al, al
jne 0x402873
mov dx, word [edi + 0x18]
cmp dx, word [ebp + 0x14]
jmp 0x40287b
mov cx, word [edi + 0x34]
cmp cx, word [ebp + 0x14]
sete cl
test cl, cl
jne 0x4028e4
push 0
lea edx, [esi + esi*4]
lea eax, [esp + edx*4 + 0x3b4]
push eax
push 0
push 0
lea ecx, [esp + 0x3c]
push ecx
mov ecx, dword [esp + 0x38]
lea edx, [esp + 0x48]
push edx
push 1
lea eax, [esp + esi*8 + 0x1cc]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_WSARecvFrom]
cmp eax, 0xffffffff
jne 0x4028d4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, eax
cmp ebp, 0x3e5
jne 0x402b23
mov ebp, dword [esp + 0x30]
jmp 0x402a63
test eax, eax
jne 0x402a63
mov edx, dword [ebx]
push edx
jmp 0x402a5d
cmp al, 0xb
je 0x4028f0
test al, al
jne 0x402a81
mov cl, byte [esp + 0x1b]
test cl, cl
je 0x402947
test al, al
je 0x402a6a
movzx edx, word [edi + 0x36]
mov al, byte [esp + edx + 0x16f]
test al, al
jne 0x4029f9
mov ax, word [edi + 0x36]
movzx ecx, ax
mov byte [esp + ecx + 0x16f], 1
mov ecx, dword [edi + 0xc]
movzx edx, ax
mov dword [esp + 0x54], ecx
lea eax, [esp + 0x50]
push eax
lea ecx, [esp + 0x64]
push ecx
lea ecx, [ebp + 0x18]
mov dword [esp + 0x58], edx
call fcn.00402150
jmp 0x402a63
test al, al
jne 0x402900
mov ecx, dword [edi + 0xc]
cmp ecx, dword [ebp + 8]
jne 0x402900
movzx eax, word [edi + 0x1a]
mov dl, byte [esp + eax + 0x16f]
test dl, dl
jne 0x402993
mov ax, word [edi + 0x1a]
movzx edx, ax
mov dword [esp + 0x5c], ecx
lea ecx, [esp + 0x58]
mov byte [esp + edx + 0x16f], 1
movzx eax, ax
push ecx
lea edx, [esp + 0x64]
push edx
lea ecx, [ebp + 0x18]
mov dword [esp + 0x60], eax
call fcn.00402150
jmp 0x402a63
mov eax, dword [ebx]
push eax
call dword [sym.imp.WS2_32.dll_WSAResetEvent]
push 0
lea ecx, [esi + esi*4]
lea edx, [esp + ecx*4 + 0x3b4]
push edx
push 0
push 0
lea eax, [esp + 0x3c]
push eax
mov eax, dword [esp + 0x38]
lea ecx, [esp + 0x48]
push ecx
push 1
lea edx, [esp + esi*8 + 0x1cc]
push edx
push eax
call dword [sym.imp.WS2_32.dll_WSARecvFrom]
cmp eax, 0xffffffff
jne 0x4029eb
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, eax
cmp ebp, 0x3e5
jne 0x402b65
mov ebp, dword [esp + 0x30]
jmp 0x402a63
test eax, eax
jne 0x402a63
mov ecx, dword [esp + 0x168]
push ecx
jmp 0x402a5d
mov edx, dword [ebx]
push edx
call dword [sym.imp.WS2_32.dll_WSAResetEvent]
push 0
lea eax, [esi + esi*4]
lea ecx, [esp + eax*4 + 0x3b4]
push ecx
push 0
push 0
lea edx, [esp + 0x3c]
push edx
mov edx, dword [esp + 0x38]
lea eax, [esp + 0x48]
push eax
push 1
lea ecx, [esp + esi*8 + 0x1cc]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_WSARecvFrom]
cmp eax, 0xffffffff
jne 0x402a51
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, eax
cmp ebp, 0x3e5
jne 0x402ba6
mov ebp, dword [esp + 0x30]
jmp 0x402a63
test eax, eax
jne 0x402a63
mov eax, dword [esp + 0x168]
push eax
call dword [sym.imp.WS2_32.dll_WSASetEvent]
mov al, byte [edi + 0x14]
test al, al
jne 0x402a81
mov ecx, dword [edi + 0xc]
cmp ecx, dword [ebp + 8]
jne 0x402a81
movzx edx, word [edi + 0x1a]
mov byte [esp + 0x1b], 1
mov dword [esp + 0x20], edx
jmp 0x402a8d
mov al, byte [esp + 0x1b]
test al, al
je 0x402ab4
mov edx, dword [esp + 0x20]
xor eax, eax
test edx, edx
mov cl, 1
jle 0x402be7
lea esp, [esp]
and cl, byte [esp + eax + 0x170]
inc eax
cmp eax, edx
jl 0x402aa0
test cl, cl
jne 0x402be7
mov edx, dword [ebp + 0x10]
push 0
push edx
push 0
lea eax, [esp + 0x74]
push eax
push 0x40
call dword [sym.imp.WS2_32.dll_WSAWaitForMultipleEvents]
mov esi, eax
cmp esi, 0xffffffff
jne 0x402840
mov edi, dword [sym.imp.WS2_32.dll_WSACloseEvent]
mov ebx, dword [esp + 0x28]
xor esi, esi
lea ecx, [ebx + esi*4]
mov edx, dword [esp + ecx + 0x68]
push edx
call edi
mov eax, dword [esp + esi*4 + 0x68]
push eax
call edi
mov eax, dword [esp + esi*8 + 0x1b4]
test eax, eax
je 0x402b05
push eax
call fcn.0043bf59
add esp, 4
inc esi
cmp esi, 0x40
jb 0x402ae0
mov ecx, dword [esp + 0x14]
push ecx
call fcn.0043caa8
add esp, 4
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [esp + 0x28]
xor esi, esi
nop
lea ecx, [ebx + esi*4]
mov edx, dword [esp + ecx + 0x68]
push edx
call edi
mov eax, dword [esp + esi*4 + 0x68]
push eax
call edi
mov eax, dword [esp + esi*8 + 0x1b4]
test eax, eax
je 0x402b55
push eax
call fcn.0043bf59
add esp, 4
inc esi
cmp esi, 0x40
jb 0x402b30
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [esp + 0x28]
xor esi, esi
lea ecx, [ebx + esi*4]
mov edx, dword [esp + ecx + 0x68]
push edx
call edi
mov eax, dword [esp + esi*4 + 0x68]
push eax
call edi
mov eax, dword [esp + esi*8 + 0x1b4]
test eax, eax
je 0x402b96
push eax
call fcn.0043bf59
add esp, 4
inc esi
cmp esi, 0x40
jb 0x402b71
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [esp + 0x28]
xor esi, esi
lea ecx, [ebx + esi*4]
mov edx, dword [esp + ecx + 0x68]
push edx
call edi
mov eax, dword [esp + esi*4 + 0x68]
push eax
call edi
mov eax, dword [esp + esi*8 + 0x1b4]
test eax, eax
je 0x402bd7
push eax
call fcn.0043bf59
add esp, 4
inc esi
cmp esi, 0x40
jb 0x402bb2
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [esp + 0x28]
xor esi, esi
lea ecx, [ebx + esi*4]
mov edx, dword [esp + ecx + 0x68]
push edx
call edi
mov eax, dword [esp + esi*4 + 0x68]
push eax
call edi
mov eax, dword [esp + esi*8 + 0x1b4]
test eax, eax
je 0x402c18
push eax
call fcn.0043bf59
add esp, 4
inc esi
cmp esi, 0x40
jb 0x402bf3
pop edi
xor eax, eax
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret