Function at 0x40ed50
Capabilities:
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x56d97a
mov eax, dword fs:[0]
push eax
sub esp, 0x50
mov eax, dword [0x5d7050]
xor eax, esp
mov dword [esp + 0x48], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x5d7050]
xor eax, esp
push eax
lea eax, [esp + 0x64]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x74]
lea ebx, [ebp + 0x1028]
push ebx
mov dword [esp + 0x24], ebx
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [esp + 0x6c], 0
cmp byte [ebp + 0x1088], 0
je 0x40eddf
cmp dword [esp + 0x78], 0
mov byte [ebp + 0x1088], 0
je 0x40ee1b
cmp dword [esp + 0x7c], 0
je 0x40ee1b
lea edi, [ebp + 0x1040]
call fcn.0040f160
mov esi, dword [eax]
mov eax, edi
call fcn.0040f1a0
test esi, esi
je 0x40eddf
mov eax, dword [esi]
mov edx, dword [eax]
push 1
mov ecx, esi
call edx
cmp dword [ebp + 0x1050], 0
je 0x40eeec
cmp dword [ebp + 0x108c], 0xffffffff
je 0x40ee21
lea edi, [ebp + 0x1040]
call fcn.0040f160
mov edi, dword [eax]
mov eax, dword [edi + 4]
test eax, eax
mov ecx, dword [edi + 8]
lea esi, [eax + ecx]
mov dword [esp + 0x18], esi
je 0x40ee2f
mov edx, dword [eax]
add eax, ecx
add eax, edx
jmp 0x40ee31
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40eef5
xor eax, eax
lea ecx, [esi + 4]
cmp ecx, eax
mov dword [esp + 0x1c], eax
ja 0x40ee40
mov dword [esp + 0x18], ecx
lea ecx, [esp + 0x24]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
lea eax, [esp + 0x24]
push eax
lea esi, [esp + 0x1c]
mov byte [esp + 0x70], 1
call fcn.0040f810
lea ecx, [esp + 0x40]
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::constructor_void_]
mov ecx, dword [edi + 4]
mov eax, dword [ecx]
add eax, dword [edi + 8]
lea edx, [ebp + 0x1070]
push edx
lea edx, [esp + 0x80]
push edx
push eax
mov eax, dword [ebp + 0x108c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40eec7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
mov byte [esp + 0x6c], 1
lea ecx, [esp + 0x40]
je 0x40eed0
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea ecx, [esp + 0x24]
mov byte [esp + 0x6c], 0
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
jmp 0x40eef5
mov byte [esp + 0x6c], 1
lea ecx, [esp + 0x40]
mov byte [ebp + 0x1088], 1
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
lea ecx, [esp + 0x24]
mov byte [esp + 0x6c], 0
call dword [sym.imp.MSVCP80.dll_public:_void___thiscall_std::basic_string_char__struct_std::char_traits_char___class_std::allocator_char__::destructor_void_]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, 1
mov ecx, dword [esp + 0x64]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.00569ed6
add esp, 0x5c
ret 0xc