Function at 0x458530
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
mov esi, dword [ebp + 8]
mov dword [ebp - 0x18], 0
cmp dword [ecx + 0x14], 8
push edi
mov dword [ebp - 8], edx
mov dword [ebp - 0x14], esi
jb 0x458551
mov ecx, dword [ecx]
push 0
push 0
push 2
push 0
push 0
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edi, eax
xor ecx, ecx
mov dword [ebp - 4], ecx
test edi, edi
je 0x45868c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 4]
mov dword [ebp - 0x10], eax
test ecx, ecx
je 0x458634
cmp ecx, 0xffffffff
je 0x458634
call fcn.0046cb00
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp + 4]
mov ecx, dword [0x768f28]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 4]
mov dword [ebp - 0xc], eax
test ecx, ecx
jne 0x4585dc
call fcn.0046fd50
mov esi, eax
push esi
call ebx
cmp dword [0x768f28], 0
jne 0x4585cf
call fcn.0046f8e0
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [0x768f28]
push dword [ebp - 0x1c]
mov eax, dword [ecx]
lea edx, [ebp - 4]
push dword [ebp - 0x20]
push edx
push dword [ebp - 0xc]
call dword [eax + 8]
mov ecx, dword [0x768f28]
mov eax, dword [ebp - 4]
mov dword [ebp - 0xc], eax
test ecx, ecx
jne 0x458623
call fcn.0046fd50
mov esi, eax
push esi
call ebx
cmp dword [0x768f28], 0
jne 0x458616
call fcn.0046f8e0
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [0x768f28]
mov eax, dword [ecx]
push dword [ebp - 0xc]
call dword [eax]
mov esi, dword [ebp - 0x14]
mov dword [ebp - 4], 0
cmp edi, 0xffffffff
je 0x458653
mov dword [ebp - 4], edi
call fcn.0046cb00
push eax
mov eax, dword [ebp + 4]
lea edx, [ebp - 4]
push eax
mov ecx, edi
call fcn.0046fc90
add esp, 8
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov ecx, dword [ebp - 4]
test ecx, ecx
je 0x45868c
cmp ecx, 0xffffffff
je 0x45868c
push 0
lea eax, [ebp - 0x18]
push eax
push esi
push dword [ebp - 8]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x458689
mov edi, dword [ebp - 0x18]
cmp edi, esi
jne 0x458689
mov ecx, dword [ebp - 4]
jmp 0x45868f
mov ecx, dword [ebp - 4]
or edi, 0xffffffff
test ecx, ecx
je 0x458732
cmp ecx, 0xffffffff
je 0x458732
call fcn.0046cb00
mov dword [ebp - 8], eax
mov eax, dword [ebp + 4]
mov ecx, dword [0x768f28]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 4]
mov dword [ebp - 0x14], eax
test ecx, ecx
jne 0x4586e3
call fcn.0046fd50
mov esi, eax
push esi
call ebx
cmp dword [0x768f28], 0
jne 0x4586d6
call fcn.0046f8e0
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [0x768f28]
push dword [ebp - 8]
mov eax, dword [ecx]
lea edx, [ebp - 4]
push dword [ebp - 0x10]
push edx
push dword [ebp - 0x14]
call dword [eax + 8]
mov ecx, dword [0x768f28]
mov eax, dword [ebp - 4]
mov dword [ebp - 8], eax
test ecx, ecx
jne 0x45872d
call fcn.0046fd50
mov esi, eax
push esi
call ebx
cmp dword [0x768f28], 0
jne 0x45871d
call fcn.0046f8e0
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [0x768f28]
mov eax, dword [ebp - 8]
mov edx, dword [ecx]
push eax
call dword [edx]
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret