Function at 0x40c7b0
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
test byte [0x4805a8], 2
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x10]
push ebx
mov ebx, dword [sym.imp.MSVCR100.dll_fprintf]
push esi
mov esi, dword [sym.imp.MSVCR100.dll__errno]
push edi
mov edi, dword [sym.imp.MSVCR100.dll___iob_func]
mov dword [ebp - 0xc], ecx
je 0x40c84c
call esi
mov edx, dword [eax]
push 0x480590
mov dword [ebp - 4], edx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push str.local_socket_destroy
push str.sockets.cpp
push str._s::_s__:
call edi
add eax, 0x40
push eax
call ebx
add esp, 0x10
call esi
mov ecx, dword [ebp - 4]
mov dword [eax], ecx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x20]
mov eax, dword [eax + 8]
push edx
push eax
push str.LS__d_:_destroying_fde.fd_d_n
call edi
add eax, 0x40
push eax
call ebx
call edi
add eax, 0x40
push eax
call dword [sym.imp.MSVCR100.dll_fflush]
add esp, 0x14
push 0x480590
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call esi
mov ecx, dword [ebp - 4]
mov dword [eax], ecx
mov eax, dword [ebp + 8]
lea ecx, [eax + 0x18]
mov edx, 0x200
test word [ecx + 0x10], dx
je 0x40c87a
mov edx, dword [ecx + 4]
mov ecx, dword [ecx]
mov dword [edx], ecx
mov ecx, dword [eax + 0x1c]
mov edx, dword [eax + 0x18]
mov dword [edx + 4], ecx
lea ecx, [eax + 0x18]
mov dword [ecx], 0
mov dword [ecx + 4], 0
movzx edx, word [ecx + 0x10]
mov dword [ebp - 8], edx
test edx, 0x100
je 0x40c8ab
movzx edx, dl
test edx, edx
je 0x40c8a0
push edx
mov edx, dword [ecx + 8]
push edx
call fcn.004112e0
mov eax, dword [ebp + 8]
add esp, 8
lea edx, [eax + 0x18]
call fcn.00411ed0
mov eax, dword [ebp + 8]
xor ecx, ecx
mov dword [eax + 0x28], ecx
mov ecx, dword [eax + 0x38]
mov dword [ebp - 4], ecx
test ecx, ecx
je 0x40c95e
jmp 0x40c8c3
mov ecx, dword [ebp - 4]
test byte [0x4805a8], 2
je 0x40c93e
call esi
mov eax, dword [eax]
push 0x480590
mov dword [ebp - 8], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push str.local_socket_destroy
push str.sockets.cpp
push str._s::_s__:
call edi
add eax, 0x40
push eax
call ebx
add esp, 0x10
call esi
mov ecx, dword [ebp - 8]
mov edx, dword [ebp - 4]
mov dword [eax], ecx
mov eax, dword [edx + 4]
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 8]
push eax
push edx
push str.LS__d_:_discarding__d_bytes_n
call edi
add eax, 0x40
push eax
call ebx
call edi
add eax, 0x40
push eax
call dword [sym.imp.MSVCR100.dll_fflush]
add esp, 0x14
push 0x480590
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call esi
mov ecx, dword [ebp - 8]
mov dword [eax], ecx
mov ecx, dword [ebp - 4]
mov edx, dword [ecx]
push ecx
mov dword [ebp - 8], edx
call dword [sym.imp.MSVCR100.dll_free]
mov eax, dword [ebp - 8]
add esp, 4
mov dword [ebp - 4], eax
test eax, eax
jne 0x40c8c0
mov eax, dword [ebp + 8]
mov edx, dword [eax + 4]
test edx, edx
je 0x40c97f
mov ecx, dword [eax]
test ecx, ecx
je 0x40c97f
mov dword [edx], ecx
mov ecx, dword [eax]
mov edx, dword [eax + 4]
mov dword [ecx + 4], edx
xor ecx, ecx
mov dword [eax], ecx
mov dword [eax + 4], ecx
mov dword [eax + 8], ecx
push eax
call dword [sym.imp.MSVCR100.dll_free]
add esp, 4
cmp dword [ebp - 0xc], 0
je 0x40ca01
test byte [0x4805a8], 2
je 0x40c9f9
call esi
mov eax, dword [eax]
push 0x480590
mov dword [ebp + 8], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push str.local_socket_destroy
push str.sockets.cpp
push str._s::_s__:
call edi
add eax, 0x40
push eax
call ebx
add esp, 0x10
call esi
mov ecx, dword [ebp + 8]
push str.local_socket_destroy:_exiting_n
mov dword [eax], ecx
call edi
add eax, 0x40
push eax
call ebx
call edi
add eax, 0x40
push eax
call dword [sym.imp.MSVCR100.dll_fflush]
add esp, 0xc
push 0x480590
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
call esi
mov edx, dword [ebp + 8]
mov dword [eax], edx
push 1
call dword [sym.imp.MSVCR100.dll_exit]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret