Function at 0x10040040
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x90
mov eax, dword [0x1009e024]
xor eax, esp
mov dword [esp + 0x8c], eax
mov edx, dword [esp + 0x98]
mov ecx, edx
mov eax, dword [esp + 0xa0]
push ebx
mov ebx, dword [esp + 0x98]
push ebp
mov ebp, dword [esp + 0xa4]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0xac]
push esi
mov dword [esp + 0x30], ebx
lea esi, [ecx + 1]
mov dword [esp + 0x14], ebp
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0x28], 0
mov al, byte [ecx]
inc ecx
test al, al
jne 0x100400a7
sub ecx, esi
je 0x100404a9
cmp byte [edx], 0x3d
je 0x100404a9
lea eax, [esp + 0x18]
push eax
lea eax, [esp + 0x14]
push eax
push edx
call fcn.1003b3a0
add esp, 0xc
test eax, eax
jne 0x100402a0
cmp dword [esp + 0x10], eax
je 0x100404a9
lea eax, [esp + 0x64]
push eax
mov eax, dword [0x100c43dc]
push 0
push dword [ebp + 4]
mov eax, dword [eax + 0x2c]
call eax
mov esi, eax
test esi, esi
je 0x10040136
push dword [esp + 0x10]
call dword [0x1009e004]
add esp, 4
mov eax, 0x5e
cmp esi, 0x80090300
mov ecx, 0x1b
cmove eax, ecx
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x8c]
xor ecx, esp
call fcn.1004138c
add esp, 0x90
ret
lea eax, [esp + 0x2c]
push eax
mov eax, dword [0x100c43dc]
push 1
push dword [ebp]
mov eax, dword [eax + 8]
call eax
mov esi, eax
test esi, esi
jne 0x100400fe
push dword [esp + 0x18]
mov dword [esp + 0x50], eax
lea eax, [esp + 0x38]
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x54], 2
mov dword [esp + 0x3c], 0xa
mov dword [esp + 0x40], eax
call fcn.10019620
add esp, 4
mov dword [esp + 0x34], eax
lea eax, [esp + 0x28]
mov dword [esp + 0x44], 1
mov dword [esp + 0x48], esi
mov dword [esp + 0x40], esi
push eax
push esi
lea eax, [esp + 0x54]
push eax
mov eax, dword [0x100c43dc]
push dword [ebp + 4]
mov eax, dword [eax + 0x68]
call eax
test eax, eax
je 0x100401e5
push str.GSSAPI_handshake_failure__empty_security_message__n
push ebx
call fcn.100171e0
push dword [esp + 0x18]
call dword [0x1009e004]
add esp, 0xc
pop esi
pop ebp
mov eax, 0x3d
pop ebx
mov ecx, dword [esp + 0x8c]
xor ecx, esp
call fcn.1004138c
add esp, 0x90
ret
cmp dword [esp + 0x40], 4
je 0x100401f3
push str.GSSAPI_handshake_failure__invalid_security_data__n
jmp 0x100401b5
mov eax, dword [esp + 0x48]
push eax
mov ecx, dword [eax]
mov eax, dword [0x100c43dc]
mov dword [esp + 0x10], ecx
mov eax, dword [eax + 0x40]
call eax
push dword [esp + 0x10]
call dword [0x1009e004]
mov eax, dword [esp + 0x10]
add esp, 4
movzx ecx, al
mov dword [esp + 0xc], ecx
test ecx, reloc.WS2_32.dll_accept
jne 0x10040238
push str.GSSAPI_handshake_failure__invalid_security_layer__n
push ebx
call fcn.100171e0
add esp, 8
jmp 0x100401c8
push edi
and eax, 0xffffff00
push eax
call dword [sym.imp.WS2_32.dll_ntohl]
push dword [esp + 0x74]
mov ebp, eax
xor eax, eax
test ebp, ebp
cmovne ebp, eax
call dword [section..data]
mov edi, eax
add esp, 4
test edi, edi
je 0x1004029a
mov esi, dword [esp + 0x30]
test esi, esi
je 0x10040290
mov ecx, esi
lea edx, [ecx + 1]
mov edi, edi
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10040270
sub ecx, edx
lea eax, [ecx + 5]
push eax
mov dword [esp + 0x24], eax
call dword [section..data]
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x100402b8
push edi
call dword [0x1009e004]
add esp, 4
mov eax, 0x1b
pop edi
mov ecx, dword [esp + 0x98]
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.1004138c
add esp, 0x90
ret
push ebp
call dword [sym.imp.WS2_32.dll_htonl]
or eax, dword [esp + 0x10]
lea ecx, [ebx + 4]
mov dword [ebx], eax
sub ecx, esi
lea ebx, [ebx]
mov al, byte [esi]
lea esi, [esi + 1]
mov byte [ecx + esi - 1], al
test al, al
jne 0x100402d0
push dword [esp + 0x70]
call dword [section..data]
mov ebp, eax
add esp, 4
test ebp, ebp
jne 0x10040303
push ebx
call dword [0x1009e004]
push edi
call dword [0x1009e004]
add esp, 8
jmp 0x1004029a
push dword [esp + 0x20]
lea eax, [esp + 0x7c]
mov dword [esp + 0x60], 0
mov dword [esp + 0x68], eax
mov eax, dword [esp + 0x78]
mov dword [esp + 0x64], 3
mov dword [esp + 0x80], 2
mov dword [esp + 0x84], edi
mov dword [esp + 0x7c], eax
mov dword [esp + 0x8c], 1
mov dword [esp + 0x90], ebx
call fcn.10019620
add esp, 4
mov dword [esp + 0x84], eax
mov eax, dword [esp + 0x70]
mov dword [esp + 0x90], eax
lea eax, [esp + 0x5c]
mov dword [esp + 0x94], 9
push 0
push eax
mov eax, dword [esp + 0x20]
push reloc.WS2_32.dll_accept
mov dword [esp + 0xa4], ebp
push dword [eax + 4]
mov eax, dword [0x100c43dc]
mov eax, dword [eax + 0x64]
call eax
mov esi, eax
test esi, esi
je 0x100403ca
push ebp
call dword [0x1009e004]
push ebx
call dword [0x1009e004]
push edi
call dword [0x1009e004]
add esp, 0xc
mov eax, 0x5e
cmp esi, 0x80090300
mov ecx, 0x1b
cmove eax, ecx
jmp 0x1004029f
mov eax, dword [esp + 0x90]
add eax, dword [esp + 0x84]
add eax, dword [esp + 0x78]
push eax
mov dword [esp + 0x1c], eax
call dword [section..data]
add esp, 4
mov dword [esp + 0x10], eax
test eax, eax
jne 0x1004040f
push ebp
call dword [0x1009e004]
push ebx
call dword [0x1009e004]
push edi
call dword [0x1009e004]
add esp, 0xc
jmp 0x1004029a
push dword [esp + 0x78]
push dword [esp + 0x84]
push eax
call fcn.10045c90
push dword [esp + 0x90]
mov esi, dword [esp + 0x88]
push dword [esp + 0x9c]
mov eax, dword [esp + 0x24]
add eax, esi
push eax
call fcn.10045c90
push dword [esp + 0xa8]
mov eax, dword [esp + 0xa0]
add eax, dword [esp + 0x2c]
push dword [esp + 0xb4]
add eax, esi
push eax
call fcn.10045c90
push dword [esp + 0x48]
push dword [esp + 0x50]
push dword [esp + 0x44]
push dword [esp + 0x40]
push dword [esp + 0x68]
call fcn.1003b4a0
push dword [esp + 0x48]
mov esi, eax
call dword [0x1009e004]
push ebp
call dword [0x1009e004]
add esp, 0x40
push ebx
call dword [0x1009e004]
push edi
call dword [0x1009e004]
add esp, 8
mov eax, esi
jmp 0x1004029f
push str.GSSAPI_handshake_failure__empty_security_message__n
push ebx
call fcn.100171e0
add esp, 8
jmp 0x100401c8