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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x4c
push ebx
xor ebx, ebx
test byte [ebp + 0xc], 0x10
push esi
push edi
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x38], ebx
mov dword [ebp - 0x44], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x34], ebx
je 0x10105f0
test byte [ebp + 0xc], 0x40
push 3
pop eax
je 0x10105ea
xor eax, eax
push eax
call fcn.010116f2
xor esi, esi
inc esi
test byte [ebp + 0xc], 1
je 0x1010600
and dword [ebp + 0xc], 0xfffffff7
mov dword [ebp - 0x24], esi
lea eax, [ebp - 0x4c]
push eax
push dword [ebp + 8]
call fcn.0100fdb5
test eax, eax
jne 0x101061d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x1010be9
lea eax, [ebp - 0x2c]
push eax
push esi
push 4
push 0x102234c
call fcn.01012139
test eax, eax
je 0x1010610
lea eax, [ebp - 0x20]
push eax
push dword [ebp - 0x2c]
call fcn.0101243a
test eax, eax
je 0x1010610
push 0x1002df8
lea eax, [ebp - 0x4c]
push eax
mov dword [ebp - 0x28], ebx
call fcn.01011d36
test eax, eax
je 0x101065a
mov dword [ebp - 0x28], esi
push 0x1002dd4
lea eax, [ebp - 0x4c]
push eax
mov dword [ebp + 8], ebx
call fcn.01011d36
test eax, eax
je 0x1010672
mov dword [ebp + 8], esi
push 0x1003a98
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
mov edi, eax
mov dword [ebp - 0x1c], edi
cmp edi, ebx
je 0x1010610
push 0x1003a60
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
mov esi, eax
mov dword [ebp - 0x14], esi
cmp esi, ebx
je 0x1010610
test byte [ebp + 0xc], 0x20
je 0x10106c1
push 0x1003a00
push 3
mov dword [ebp - 0x10], 1
call fcn.01011772
pop ecx
pop ecx
jmp 0x1010738
cmp dword [ebp - 0x28], ebx
je 0x101070e
push 1
push edi
call fcn.0101285c
test eax, eax
jne 0x10106ef
mov eax, 0xc1
push eax
push edi
mov esi, eax
push 0x1003980
push 4
call fcn.01011772
add esp, 0x10
jmp 0x1010be9
push 0x1003958
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
mov esi, eax
mov dword [ebp - 8], esi
cmp esi, ebx
je 0x1010610
push 1
jmp 0x101071a
push ebx
push edi
call fcn.0101285c
test eax, eax
je 0x10106d2
push ebx
push esi
call fcn.0101285c
test eax, eax
jne 0x101072d
mov dword [ebp - 0x10], 1
jmp 0x1010738
push ebx
push esi
push edi
call fcn.0100fd06
mov dword [ebp - 0x10], eax
push 0x1003934
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
mov dword [ebp - 4], eax
cmp eax, ebx
je 0x1010610
push 0x1003910
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
mov edi, eax
mov dword [ebp - 0x18], edi
cmp edi, ebx
je 0x1010610
push edi
push dword [ebp - 4]
push 0x10038c8
push 2
call fcn.01011772
add esp, 0x10
push ebx
push dword [ebp - 0x24]
push dword [ebp + 8]
push dword [ebp + 8]
push dword [ebp - 0x10]
push edi
push dword [ebp - 4]
call fcn.0101004b
test eax, eax
jne 0x10107ba
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push edi
push dword [ebp - 4]
push 0x1003850
push 4
call fcn.01011772
add esp, 0x14
jmp 0x1010be9
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
cmp dword [ebp - 0x28], ebx
jne 0x1010906
push 0x1003820
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
mov dword [ebp - 0xc], eax
push 0x10037d8
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
mov edi, eax
cmp dword [ebp - 0xc], ebx
je 0x1010856
cmp edi, ebx
je 0x1010856
push edi
call fcn.0100fa13
push 2
push edi
mov ebx, eax
call fcn.01011923
push 1
push edi
push dword [ebp - 0x1c]
mov dword [ebp - 0x40], eax
call fcn.0100fd06
test ebx, ebx
je 0x101081f
cmp dword [ebp - 0x40], 1
jne 0x1010864
test eax, eax
je 0x1010864
push dword [ebp - 0xc]
call fcn.01013776
test eax, eax
jne 0x101083f
call esi
push eax
push 0x1003750
push 3
call fcn.01011772
add esp, 0xc
jmp 0x1010864
push edi
push dword [ebp - 0x1c]
call fcn.0100f991
test eax, eax
jne 0x1010864
call esi
push eax
push 0x10036b8
jmp 0x1010833
push 0x1003650
push 3
call fcn.01011772
pop ecx
pop ecx
cmp dword [ebp - 0xc], 0
je 0x101087c
push dword [ebp - 0xc]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
test edi, edi
je 0x1010890
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [ebp - 4]
xor ebx, ebx
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
test eax, eax
je 0x10108aa
mov dword [ebp - 4], ebx
push 0x1003614
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
test byte [ebp + 0xc], 0x80
push 0
pop ecx
setne cl
push ebx
push 6
mov dword [ebp - 0xc], eax
inc ecx
mov edi, ecx
push edi
push ebx
push ebx
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x40], eax
cmp eax, 0xffffffff
jne 0x10109e5
call esi
cmp eax, 0x50
jne 0x10108f6
cmp edi, 2
jne 0x1010aa1
call esi
push eax
push dword [ebp - 0xc]
push 0x10035a0
jmp 0x1010a97
cmp dword [ebp - 0x24], ebx
jne 0x1010890
mov edi, 0x1002f40
cmp dword [ebp + 8], ebx
je 0x101094f
cmp dword [ebp - 8], ebx
jne 0x1010933
push 0x1003958
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
mov dword [ebp - 8], eax
cmp eax, ebx
je 0x1010610
push edi
push ebx
push dword [ebp - 8]
call fcn.0101268b
test eax, eax
jne 0x101094f
call esi
cmp eax, 2
je 0x101094f
call esi
jmp 0x1010616
cmp dword [ebp - 0x10], ebx
je 0x1010963
push dword [ebp - 8]
push dword [ebp - 0x1c]
call fcn.0100f991
test eax, eax
je 0x1010948
push dword [ebp - 8]
call fcn.01012fa0
test eax, eax
jne 0x101098a
call esi
mov esi, eax
push esi
push dword [ebp - 8]
call fcn.01011513
push esi
push dword [ebp - 8]
push 0x1003530
jmp 0x10106e0
push 7
push dword [ebp - 8]
call fcn.0100fb5d
test eax, eax
je 0x1010948
cmp dword [ebp + 8], ebx
je 0x10109ba
push edi
push 1
push dword [ebp - 8]
call fcn.0101268b
test eax, eax
je 0x1010948
push edi
push ebx
push dword [ebp - 0x14]
call fcn.0101268b
test eax, eax
je 0x1010948
push dword [ebp - 0x14]
call fcn.01013089
test eax, eax
jne 0x1010890
call esi
mov esi, eax
push esi
push dword [ebp - 0x14]
call fcn.01011513
push esi
push dword [ebp - 0x14]
push 0x10034c8
jmp 0x10106e0
mov edi, 0x10000
push edi
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
jne 0x1010a14
push dword [ebp - 0xc]
push 0x1003440
push 3
call fcn.01011772
add esp, 0xc
jmp 0x1010a77
push edi
push 0
push ebx
call sub.msvcrt.dll_memset
add esp, 0xc
push 0
lea eax, [ebp - 0x3c]
push eax
push edi
push ebx
push dword [ebp - 0x40]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1010a4c
call esi
push eax
push dword [ebp - 0xc]
push 0x10035a0
push 3
call fcn.01011772
add esp, 0x10
jmp 0x1010a67
cmp dword [ebp - 0x3c], edi
je 0x1010a67
push edi
push dword [ebp - 0x3c]
push dword [ebp - 0xc]
push 0x10033a8
push 3
call fcn.01011772
add esp, 0x14
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push dword [ebp - 0x40]
call dword [sym.imp.ntdll.dll_NtClose]
push dword [ebp - 0xc]
call fcn.01012fa0
test eax, eax
jne 0x1010aa1
call esi
push eax
push dword [ebp - 0xc]
push 0x1003328
push 3
call fcn.01011772
add esp, 0x10
xor edi, edi
mov ebx, 0x1003048
cmp dword [ebp - 0x28], edi
je 0x1010b3a
cmp dword [ebp - 0x24], edi
jne 0x1010b23
push 0x10032fc
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
mov dword [ebp - 0x30], eax
push 0x10032c8
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
push 6
push dword [ebp - 0x30]
mov dword [ebp - 0x34], eax
call fcn.0100fb5d
test eax, eax
jne 0x1010af1
call esi
cmp eax, 2
jne 0x1010948
push 6
push dword [ebp - 0x34]
call fcn.0100fb5d
test eax, eax
jne 0x1010b0a
call esi
cmp eax, 2
jne 0x1010948
push 6
push dword [ebp - 0xc]
call fcn.0100fb5d
test eax, eax
jne 0x1010b23
call esi
cmp eax, 2
jne 0x1010948
cmp dword [ebp + 8], edi
je 0x1010b3a
push ebx
push edi
push dword [ebp - 0x18]
call fcn.0101268b
test eax, eax
je 0x1010948
test byte [ebp + 0xc], 8
je 0x1010bb5
push 0x10032a4
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
mov dword [ebp - 4], eax
cmp eax, edi
je 0x1010948
push 0x1003270
lea eax, [ebp - 0x4c]
push eax
call fcn.01011fa1
mov edi, eax
mov dword [ebp - 0x38], edi
test edi, edi
je 0x1010948
push edi
push dword [ebp - 4]
push 0x1003228
push 2
call fcn.01011772
add esp, 0x10
push 0
push dword [ebp - 0x24]
push dword [ebp + 8]
push dword [ebp + 8]
push dword [ebp - 0x10]
push edi
push dword [ebp - 4]
call fcn.0101004b
test eax, eax
jne 0x1010bb5
call esi
mov esi, eax
push esi
push edi
push dword [ebp - 4]
push 0x10031b8
jmp 0x10107ab
cmp dword [ebp - 0x28], 0
je 0x1010be6
push 6
push dword [ebp - 0x18]
call fcn.0100fb5d
test eax, eax
je 0x1010948
cmp dword [ebp + 8], 0
je 0x1010be6
push ebx
push 1
push dword [ebp - 0x18]
call fcn.0101268b
test eax, eax
je 0x1010948
mov esi, dword [ebp - 0x44]
call fcn.0101174c
xor edi, edi
cmp dword [ebp - 0x20], edi
je 0x1010bfe
push edi
push dword [ebp - 0x20]
call fcn.0101243a
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
cmp dword [ebp - 4], edi
je 0x1010c1b
push dword [ebp - 4]
push 0
call ebx
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
push eax
call edi
jmp 0x1010c21
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
cmp dword [ebp - 0x38], 0
je 0x1010c31
push dword [ebp - 0x38]
push 0
call ebx
push eax
call edi
cmp dword [ebp - 0x18], 0
je 0x1010c41
push dword [ebp - 0x18]
push 0
call ebx
push eax
call edi
cmp dword [ebp - 0x1c], 0
je 0x1010c51
push dword [ebp - 0x1c]
push 0
call ebx
push eax
call edi
cmp dword [ebp - 0x14], 0
je 0x1010c61
push dword [ebp - 0x14]
push 0
call ebx
push eax
call edi
cmp dword [ebp - 8], 0
je 0x1010c71
push dword [ebp - 8]
push 0
call ebx
push eax
call edi
cmp dword [ebp - 0x30], 0
je 0x1010c81
push dword [ebp - 0x30]
push 0
call ebx
push eax
call edi
cmp dword [ebp - 0x34], 0
je 0x1010c91
push dword [ebp - 0x34]
push 0
call ebx
push eax
call edi
cmp dword [ebp - 0xc], 0
je 0x1010ca1
push dword [ebp - 0xc]
push 0
call ebx
push eax
call edi
cmp dword [ebp - 0x20], 0
je 0x1010cb9
push dword [ebp - 0x20]
push 0
call ebx
push eax
call edi
test eax, eax
je 0x1010cb9
and dword [ebp - 0x20], 0
cmp dword [ebp - 0x2c], 0
je 0x1010cd1
push dword [ebp - 0x2c]
push 0
call ebx
push eax
call edi
test eax, eax
je 0x1010cd1
and dword [ebp - 0x2c], 0
test esi, esi
je 0x1010ce0
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
jmp 0x1010ce3
xor eax, eax
inc eax
pop edi
pop esi
pop ebx
leave
ret 8