Function at 0x1005f420
Capabilities:
Check if file exists
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x924
mov eax, dword [0x1018d0d0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_TryEnterCriticalSection]
lea ebx, [eax + 0x61c]
push ebx
mov dword [ebp - 0x914], eax
xor esi, esi
call edi
test eax, eax
jne 0x1005f47c
jmp 0x1005f460
inc esi
cmp esi, 0x3e8
jg 0x1005f69f
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
push ebx
call edi
test eax, eax
je 0x1005f460
mov esi, dword [ebp - 0x914]
cmp dword [esi + 0x618], 0
je 0x1005f698
add esi, 0x410
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
push 0x80
test eax, eax
je 0x1005f4cc
push 3
push 0
push 0
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x1005f698
jmp 0x1005f519
push 2
push 0
push 0
push 0xc0000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x1005f698
push 0
lea eax, [ebp - 0x924]
mov word [ebp - 0x918], 0xfeff
push eax
push 2
lea eax, [ebp - 0x918]
mov dword [ebp - 0x924], 0
push eax
push esi
call edi
test eax, eax
je 0x1005f691
push 2
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
xor eax, eax
push 0x81e
push eax
mov word [ebp - 0x8ec], ax
lea eax, [ebp - 0x8ea]
push eax
call fcn.1011a400
lea eax, [ebp + 0x10]
push eax
push dword [ebp + 0xc]
lea eax, [ebp - 0x8ec]
push 0x207
push eax
call fcn.1011dd42
add esp, 0x1c
test eax, eax
js 0x1005f569
cmp eax, 0x207
ja 0x1005f569
jne 0x1005f572
xor eax, eax
mov word [ebp - 0x4de], ax
xor eax, eax
push 0xc6
push eax
mov word [ebp - 0xcc], ax
lea eax, [ebp - 0xca]
push eax
call fcn.1011a400
push 0
call fcn.1011cfc5
add esp, 0x10
mov dword [ebp - 0x920], eax
mov dword [ebp - 0x91c], edx
test edx, edx
jl 0x1005f5bb
jg 0x1005f5ad
test eax, eax
jb 0x1005f5bb
cmp edx, 7
jl 0x1005f5cf
jg 0x1005f5bb
cmp eax, 0x93406fff
jbe 0x1005f5cf
mov dword [ebp - 0x920], 0
mov dword [ebp - 0x91c], 0
lea eax, [ebp - 0x920]
push eax
lea eax, [ebp - 0x910]
push eax
call fcn.1011eb21
lea eax, [ebp - 0x910]
push eax
push str._Y__m__d__H:_M:_S
lea eax, [ebp - 0xcc]
push 0x64
push eax
call fcn.1011eb04
lea ecx, [ebp - 0xcc]
mov dword [ebp - 0x914], 0
add esp, 0x18
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1005f612
sub ecx, edx
lea eax, [ebp - 0x914]
push 0
sar ecx, 1
push eax
lea eax, [ecx + ecx]
push eax
lea eax, [ebp - 0xcc]
push eax
push esi
call edi
push 0
lea eax, [ebp - 0x914]
push eax
push 2
push 0x10155634
push esi
call edi
lea ecx, [ebp - 0x8ec]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1005f654
sub ecx, edx
lea eax, [ebp - 0x914]
push 0
sar ecx, 1
push eax
lea eax, [ecx + ecx]
push eax
lea eax, [ebp - 0x8ec]
push eax
push esi
call edi
push 0
lea eax, [ebp - 0x914]
push eax
push 4
push 0x10155638
push esi
call edi
test esi, esi
je 0x1005f698
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.1011a3e5
mov esp, ebp
pop ebp
ret