Function at 0x40e510
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x413b7d
mov eax, dword fs:[0]
push eax
sub esp, 0x54
mov eax, dword [0x42000c]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov dword [ebp - 0x50], esi
mov eax, dword [esi + 0x1fe8]
mov dword [ebp - 0x60], eax
mov eax, dword [esi + 0x1fec]
push 0xffffffffffffffff
mov dword [ebp - 0x5c], eax
lea eax, [ebp - 0x60]
push 0
push eax
push 2
mov dword [ebp - 0x44], 0
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test eax, eax
jne 0x40e809
lea ecx, [esi + 0x1fb8]
add esi, 0x1fd0
mov dword [ebp - 0x4c], ecx
mov dword [ebp - 0x58], esi
xor ebx, ebx
xor eax, eax
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x2c], eax
push ecx
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [ebp - 0x34]
xor edi, edi
cmp eax, esi
je 0x40e5c4
mov eax, dword [esi + 4]
mov ecx, dword [esi + 8]
mov ebx, dword [esi]
mov dword [esi], edi
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov edi, eax
mov dword [ebp - 0x34], ebx
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x48], ecx
mov dword [ebp - 0x2c], ecx
push dword [ebp - 0x4c]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, ebx
cmp esi, dword [ebp - 0x30]
je 0x40e777
nop dword [eax + eax]
mov edx, dword [esi + 0x10]
mov eax, SysReAllocString
sub eax, edx
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x38], edx
cmp eax, 1
jb 0x40e82c
cmp dword [esi + 0x14], 8
mov dword [ebp - 0x40], esi
jb 0x40e60b
mov eax, dword [esi]
mov dword [ebp - 0x40], eax
lea ecx, [edx + 1]
mov dword [ebp - 0x28], 0
mov edi, 7
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x14], 0
lea ebx, [ebp - 0x28]
mov dword [ebp - 0x3c], ecx
cmp ecx, edi
jbe 0x40e6ba
mov edi, ecx
or edi, 7
cmp edi, 0x7ffffffe
jbe 0x40e64f
mov edi, SysReAllocString
mov eax, 0xfffffffe
jmp 0x40e671
cmp edi, 0xa
mov eax, 0xa
cmovb edi, eax
lea eax, [edi + 1]
cmp eax, 0x7fffffff
ja 0x40e827
add eax, eax
cmp eax, 0x1000
jb 0x40e69e
lea ecx, [eax + 0x23]
cmp ecx, eax
jbe 0x40e827
push ecx
call fcn.00410ea3
add esp, 4
test eax, eax
je 0x40e803
mov ecx, dword [ebp - 0x3c]
lea ebx, [eax + 0x23]
mov edx, dword [ebp - 0x38]
and ebx, 0xffffffe0
mov dword [ebx - 4], eax
jmp 0x40e6b7
test eax, eax
je 0x40e6b5
push eax
call fcn.00410ea3
mov ecx, dword [ebp - 0x3c]
add esp, 4
mov edx, dword [ebp - 0x38]
mov ebx, eax
jmp 0x40e6b7
xor ebx, ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x14], edi
lea edi, [edx + edx]
push edi
push dword [ebp - 0x40]
mov dword [ebp - 0x18], ecx
push ebx
call sub.VCRUNTIME140.dll_memcpy
or dword [ebp - 0x44], 1
add esp, 0xc
mov eax, 0xa
xor ecx, ecx
mov word [edi + ebx], ax
mov eax, dword [ebp - 0x38]
push 2
push ecx
push ecx
mov word [ebx + eax*2 + 2], cx
mov ebx, dword [ebp - 0x50]
push dword [ebx + 0x1ff4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [ebp - 0x14], 8
lea eax, [ebp - 0x54]
push 0
push eax
mov eax, dword [ebp - 0x18]
lea ecx, [ebp - 0x28]
cmovae ecx, dword [ebp - 0x28]
add eax, eax
push eax
push ecx
push dword [ebx + 0x1ff4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebx + 0x1ff4]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov edx, dword [ebp - 0x14]
cmp edx, 8
jb 0x40e764
mov ecx, dword [ebp - 0x28]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x40e75a
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e803
push edx
push ecx
call fcn.00411124
add esp, 8
mov eax, dword [ebp - 0x30]
add esi, 0x18
cmp esi, eax
jne 0x40e5e0
mov ebx, dword [ebp - 0x34]
mov edi, eax
mov dword [ebp - 4], 0xffffffff
test ebx, ebx
je 0x40e7e4
push ecx
mov edx, edi
mov ecx, ebx
call fcn.00410730
mov ecx, dword [ebp - 0x48]
mov eax, 0x2aaaaaab
sub ecx, ebx
add esp, 4
imul ecx
sar edx, 2
mov eax, edx
shr eax, 0x1f
add eax, edx
lea ecx, [eax + eax*2]
mov eax, ebx
shl ecx, 3
cmp ecx, 0x1000
jb 0x40e7c5
mov ebx, dword [ebx - 4]
add ecx, 0x23
sub eax, ebx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40e803
push ecx
push ebx
call fcn.00411124
add esp, 8
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
push 0xffffffffffffffff
push 0
lea eax, [ebp - 0x60]
push eax
push 2
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
test eax, eax
jne 0x40e809
mov esi, dword [ebp - 0x58]
mov ecx, dword [ebp - 0x4c]
jmp 0x40e583
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00410e60
mov esp, ebp
pop ebp
ret
call fcn.004017fa
call fcn.0040185b
int3