Function at 0x40b3a0
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x46bf48
mov eax, dword fs:[0]
push eax
sub esp, 8
push ebp
push esi
push edi
mov eax, dword [0x489ec0]
xor eax, esp
push eax
lea eax, [esp + 0x18]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [0x48b668]
mov edx, dword [eax + 0xc]
mov ecx, 0x48b668
call edx
lea edi, [eax + 0x10]
mov dword [esp + 0x10], edi
mov ecx, dword [esi + 0x34]
sub ecx, dword [esi + 0x30]
mov eax, 0x2aaaaaab
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
mov dword [esp + 0x20], 0
jne 0x40b43c
mov edx, dword [esp + 0x2c]
push ecx
mov ecx, esp
mov dword [esp + 0x18], esp
push edx
call fcn.00408550
mov eax, dword [esp + 0x2c]
push ecx
mov ecx, esp
mov dword [esp + 0x34], esp
push eax
mov byte [esp + 0x2c], 1
call fcn.00408550
mov ecx, esi
mov byte [esp + 0x28], 0
call fcn.0040aa90
mov ebp, eax
test ebp, ebp
jl 0x40b55f
mov edi, dword [esp + 0x30]
mov ebp, dword [reloc.WS2_32.dll_connect]
test edi, edi
je 0x40b45f
mov eax, dword [esi + 0xc]
mov ecx, dword [eax - 0xc]
push ecx
push eax
call ebp
test eax, eax
jne 0x40b45d
call fcn.0040d770
mov dword [edi], eax
mov edi, dword [esp + 0x34]
test edi, edi
je 0x40b47c
mov eax, dword [esi + 8]
mov ecx, dword [eax - 0xc]
push ecx
push eax
call ebp
test eax, eax
jne 0x40b47a
call fcn.0040d770
mov dword [edi], eax
lea ecx, [esp + 0x2c]
push ecx
mov ecx, esi
call fcn.00409730
push eax
lea ecx, [esp + 0x14]
mov byte [esp + 0x24], 2
call fcn.004068e0
mov eax, dword [esp + 0x2c]
add eax, 0xfffffff0
mov byte [esp + 0x20], 0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40b4bc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea ecx, [esp + 0x10]
push str.setup
push ecx
call fcn.004057e0
mov edi, dword [esp + 0x18]
add esp, 8
test al, al
je 0x40b529
cmp dword [esp + 0x38], 0
je 0x40b4f3
mov eax, dword [edi - 0xc]
push eax
push edi
call ebp
test eax, eax
jne 0x40b4ed
call fcn.0040d770
mov edx, dword [esp + 0x38]
mov dword [edx], eax
mov ebp, dword [esi + 0x30]
cmp ebp, dword [esi + 0x34]
jbe 0x40b500
call fcn.0044f012
mov eax, dword [esi + 0x24]
test eax, eax
jne 0x40b525
call fcn.0044f012
xor eax, eax
cmp ebp, dword [eax + 0x10]
jb 0x40b518
call fcn.0044f012
add ebp, 0xc
push ebp
mov ecx, esi
call fcn.00408f60
jmp 0x40b55d
mov eax, dword [eax]
jmp 0x40b50e
mov eax, dword [esi + 0x20]
cmp dword [eax - 0xc], 0
jne 0x40b539
mov ebp, 0x80040073
jmp 0x40b55f
cmp dword [esp + 0x38], 0
je 0x40b556
mov eax, dword [edi - 0xc]
push eax
push edi
call ebp
test eax, eax
jne 0x40b550
call fcn.0040d770
mov ecx, dword [esp + 0x38]
mov dword [ecx], eax
mov ecx, esi
call fcn.0040a940
mov ebp, eax
lea edx, [esi + 0x3c]
push edx
call fcn.00416f90
lea eax, [esp + 0x14]
push str.setup
push eax
call fcn.00405840
add esp, 0xc
test al, al
je 0x40b593
lea ecx, [esi + 0x18]
push ecx
call fcn.00417070
add esi, 0x1c
push esi
call fcn.00417070
add esp, 8
lea eax, [edi - 0x10]
mov dword [esp + 0x20], 0xffffffff
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40b5b7
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, ebp
mov ecx, dword [esp + 0x18]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
add esp, 0x14
ret 0x14