Function at 0x40bd50
Capabilities:
Terminate thread

Disassembly:
mov al, byte [esp + 4]
sub esp, 0x49c
push ebx
xor ebx, ebx
cmp al, bl
push esi
jne 0x40c08d
mov eax, dword [0x42842c]
mov esi, 3
cmp eax, 2
mov eax, dword [0x41e16c]
jne 0x40bdc5
cmp eax, esi
jne 0x40bdb1
mov eax, dword [0x429528]
mov dword [0x429440], ebx
cmp eax, ebx
mov dword [0x41e16c], 4
mov dword [0x42943c], esi
je 0x40bdac
push 1
push eax
call dword [sym.imp.KERNEL32.DLL_TerminateThread]
mov dword [0x429528], ebx
call fcn.0040b220
call fcn.0040bd10
mov dword [0x428cc0], esi
pop esi
pop ebx
add esp, 0x49c
ret
cmp eax, 0x64
jl 0x40be7e
mov eax, dword [0x42868c]
test ah, 8
jne 0x40bde8
push esi
push 1
push str.WZCSVC
call fcn.00404dd0
add esp, 0xc
mov eax, dword [0x42868c]
test ah, 2
je 0x40bdfe
mov eax, dword [0x429448]
and al, 0xfd
mov dword [0x429448], eax
push ebx
push ebx
push esi
mov dword [0x429520], ebx
mov dword [0x41e16c], ebx
mov dword [0x429570], ebx
call fcn.0040ca50
mov al, byte [0x429448]
add esp, 0xc
test al, 1
jne 0x40be79
mov eax, dword [0x41e340]
mov cx, word [0x41e344]
push 0x888e
mov dword [0x422a20], eax
mov word [0x422a24], cx
call dword [sym.imp.WS2_32.dll_htons]
mov word [0x422a2c], ax
call fcn.0040bd10
cmp dword [0x422f44], ebx
je 0x40be5f
call fcn.0040b220
mov eax, dword [0x42943c]
mov dword [0x428cc0], esi
inc eax
pop esi
mov dword [0x42943c], eax
pop ebx
add esp, 0x49c
ret
mov eax, dword [0x41e16c]
cmp eax, ebx
jne 0x40bfc7
push edi
mov ecx, 0x104
xor eax, eax
lea edi, [esp + 0x14]
rep stosd dword es:[edi], eax
mov edx, dword [0x422a26]
mov esi, dword [sym.imp.WS2_32.dll_htons]
stosw word es:[edi], ax
stosb byte es:[edi], al
mov ax, word [0x422a2a]
push 0x888e
mov dword [esp + 0x1e], edx
mov word [esp + 0x22], ax
call esi
push 0x888e
mov word [0x422a2c], ax
call esi
mov ecx, dword [0x41e340]
mov word [esp + 0x20], ax
mov al, byte [0x429448]
pop edi
test al, 1
mov ax, word [0x41e344]
jne 0x40beec
mov dword [esp + 0x10], ecx
mov word [esp + 0x14], ax
jmp 0x40bef8
or edx, 0xffffffff
mov dword [esp + 0x10], edx
mov word [esp + 0x14], dx
cmp dword [0x429570], ebx
jne 0x40bf15
mov dword [esp + 0x10], ecx
mov word [esp + 0x14], ax
mov dword [0x429570], 1
jmp 0x40bf27
or eax, 0xffffffff
mov dword [0x429570], ebx
mov dword [esp + 0x10], eax
mov word [esp + 0x14], ax
mov byte [esp + 8], bl
mov byte [esp + 9], bl
mov byte [esp + 0xa], 0x2f
mov byte [esp + 0xb], 0xfc
mov ecx, dword [esp + 8]
push ebx
mov dword [esp + 0x26], ecx
mov ecx, dword [0x42952c]
lea eax, [esp + 0x14]
mov byte [esp + 0x10], 2
mov byte [esp + 0x11], 6
mov dx, word [esp + 0x10]
push 0x12
push eax
push ecx
mov byte [esp + 0x2e], 1
mov byte [esp + 0x2f], 1
mov word [esp + 0x30], bx
mov word [esp + 0x36], dx
mov dword [0x429574], ebx
call fcn.0040bc70
mov eax, dword [0x42952c]
push ebx
lea edx, [esp + 0x24]
push 0x12
push edx
push eax
mov dword [0x429574], 1
call fcn.0040bc70
add esp, 0x20
mov dword [0x428cc0], 0xc
push 1
push ebx
push 6
call fcn.004047d0
add esp, 4
push eax
call fcn.00409af0
add esp, 0xc
pop esi
pop ebx
add esp, 0x49c
ret
cmp eax, 1
je 0x40bfdb
cmp eax, 2
je 0x40c011
cmp eax, esi
jne 0x40c08d
jmp 0x40c011
cmp dword [0x42943c], 1
jne 0x40c011
test byte [0x429448], 2
jne 0x40c011
mov ecx, dword [0x41e340]
mov dx, word [0x41e344]
mov dword [0x422a20], ecx
mov word [0x422a24], dx
mov dword [0x429544], 1
mov ax, word [0x422a30]
push ebx
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, dword [0x42952c]
and eax, 0xffff
add eax, 0x12
push eax
push 0x422a20
push ecx
call fcn.0040bc70
mov eax, dword [0x41e16c]
add esp, 0x10
cmp eax, esi
jge 0x40c08d
push eax
push 7
call fcn.004047d0
add esp, 4
lea edx, [esp + 0x428]
push eax
push str._s__lu_......
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
mov eax, dword [0x429520]
add esp, 0x10
cmp eax, ebx
jne 0x40c083
push 1
lea eax, [esp + 0x428]
push ebx
push eax
call fcn.00409af0
add esp, 0xc
mov dword [0x428cc0], 0x10
pop esi
pop ebx
add esp, 0x49c
ret