Function at 0x40e870
Capabilities:
Write file on windows

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x417dcd
mov eax, dword fs:[0]
push eax
push ebx
sub esp, 0x48
mov eax, dword [0x42100c]
xor eax, ebp
mov dword [ebp - 0x14], eax
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x54], edx
mov esi, ecx
xorps xmm0, xmm0
mov dword [ebp - 0x34], 0
movups xmmword [ebp - 0x4c], xmm0
mov dword [ebp - 0x4c], 0
movq qword [ebp - 0x3c], xmm0
push 0xd
push 0x41a5a0
lea ecx, [ebp - 0x48]
mov dword [ebp - 4], 0
call fcn.0040e780
add esp, 8
mov dword [ebp - 4], 1
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x54]
mov dword [ebp - 0x24], esi
cmp dword [eax + 0x14], 0x10
mov edi, dword [eax + 0x10]
jb 0x40e91e
add edi, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x54], eax
jmp 0x40e920
add edi, eax
sub edi, eax
push edi
je 0x40e942
lea ecx, [ebp - 0x20]
call fcn.0040d4d0
mov edx, dword [ebp - 0x54]
mov esi, dword [ebp - 0x20]
push edi
push edx
push esi
call sub.VCRUNTIME140.dll_memmove
add esp, 0xc
add edi, esi
jmp 0x40e94d
push eax
push 0
call sub.VCRUNTIME140.dll_memmove
add esp, 0xc
mov dword [ebp - 0x1c], edi
mov byte [ebp - 0x4d], 0
cmp edi, dword [ebp - 0x18]
je 0x40e965
mov byte [edi], 0
mov edi, dword [ebp - 0x1c]
inc edi
mov dword [ebp - 0x1c], edi
jmp 0x40e975
lea eax, [ebp - 0x4d]
push eax
push edi
lea ecx, [ebp - 0x20]
call fcn.0040ec20
mov edi, dword [ebp - 0x1c]
sub edi, dword [ebp - 0x20]
xor ecx, ecx
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x2c], ecx
mov dword [ebp - 0x28], ecx
add edi, 4
je 0x40e9e9
cmp edi, 0x7fffffff
ja 0x40eba8
cmp edi, 0x1000
jb 0x40e9c5
lea eax, [edi + 0x23]
cmp eax, edi
jbe 0x40ebad
push eax
call fcn.00415527
mov ecx, eax
add esp, 4
test ecx, ecx
je 0x40eb59
lea eax, [ecx + 0x23]
and eax, 0xffffffe0
mov dword [eax - 4], ecx
jmp 0x40e9ce
push edi
call fcn.00415527
add esp, 4
push edi
lea esi, [eax + edi]
mov dword [ebp - 0x30], eax
push 0
push eax
mov dword [ebp - 0x28], esi
call sub.VCRUNTIME140.dll_memset
mov ecx, dword [ebp - 0x30]
add esp, 0xc
mov dword [ebp - 0x2c], esi
mov eax, dword [ebp - 0x24]
mov dword [ecx], eax
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x20]
sub eax, ecx
push eax
mov eax, dword [ebp - 0x30]
push ecx
add eax, 4
push eax
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [ebp - 0x30]
add esp, 0xc
mov edi, dword [ebp - 0x2c]
sub edi, eax
mov dword [ebp - 0x54], eax
push 0
push 0
push edi
push eax
push dword [ebp - 0x4c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x40ea9c
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 6
je 0x40ea3d
cmp eax, 0xe9
jne 0x40eaa5
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x4c], 0
test eax, eax
je 0x40ea53
cmp eax, 0xffffffff
je 0x40ea53
push eax
call esi
cmp dword [ebp - 0x34], 0x10
lea eax, [ebp - 0x48]
push 0
cmovae eax, dword [ebp - 0x48]
push 0
push 4
push 0
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [ebp - 0x4c]
mov dword [ebp - 0x4c], eax
test ecx, ecx
je 0x40ea89
cmp ecx, 0xffffffff
je 0x40ea89
push ecx
call esi
mov eax, dword [ebp - 0x4c]
push 0
push 0
push edi
push dword [ebp - 0x54]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40eaa5
push dword [ebp - 0x4c]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov ecx, dword [ebp - 0x30]
test ecx, ecx
je 0x40eaee
mov edx, dword [ebp - 0x28]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x40eacf
mov ecx, dword [eax - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40eb59
push edx
push ecx
call fcn.004158c2
add esp, 8
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x28], 0
mov ecx, dword [ebp - 0x20]
test ecx, ecx
je 0x40eb33
mov edx, dword [ebp - 0x18]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x40eb14
mov ecx, dword [eax - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x40eb59
push edx
push ecx
call fcn.004158c2
add esp, 8
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x18], 0
mov ecx, dword [ebp - 0x34]
cmp ecx, 0x10
jb 0x40eb69
mov edx, dword [ebp - 0x48]
inc ecx
mov eax, edx
cmp ecx, 0x1000
jb 0x40eb5f
mov edx, dword [eax - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x40eb5f
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push ecx
push edx
call fcn.004158c2
add esp, 8
mov eax, dword [ebp - 0x4c]
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x34], 0xf
mov byte [ebp - 0x48], 0
test eax, eax
je 0x40eb8a
cmp eax, 0xffffffff
je 0x40eb8a
push eax
call esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00415439
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
call fcn.0040b910
call fcn.004011f0
int3