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

Disassembly:
push 0x684
mov eax, 0x1006caa5
call fcn.100521f6
mov eax, dword [ebp + 0xc]
push eax
lea eax, [ebp - 0x420]
mov edi, ecx
push 0x1007bfb8
push eax
mov dword [ebp - 0x68c], edi
call fcn.1002cf19
xor ebx, ebx
xor esi, esi
add esp, 0xc
cmp dword [ebp + 8], 0x1e
mov dword [ebp - 0x688], eax
mov dword [ebp - 0x678], esi
mov dword [ebp - 0x66c], ebx
mov dword [ebp - 0x674], edi
jbe 0x1002cbda
jmp 0x1002c8aa
mov edi, dword [ebp - 0x674]
push dword [edi]
call fcn.1002c705
pop ecx
test eax, eax
je 0x1002cbda
movzx ecx, word [edi + 0x1a]
movzx eax, word [edi + 0x1c]
add eax, ecx
mov ecx, dword [edi + 0x12]
lea eax, [eax + ecx + 0x1e]
mov ecx, dword [ebp + 8]
sub ecx, esi
cmp eax, ecx
mov dword [ebp - 0x67c], eax
jg 0x1002cbda
mov eax, dword [edi + 0x16]
or dword [ebp - 0x668], 0xffffffff
or dword [ebp - 0x670], 0xffffffff
mov dword [ebp - 0x664], ebx
mov dword [ebp - 0x684], ebx
cmp eax, 0x100000
jbe 0x1002c9aa
xor eax, eax
push 0x206
mov word [ebp - 0x628], ax
lea eax, [ebp - 0x626]
push ebx
push eax
call fcn.10051a60
add esp, 0xc
lea esi, [ebp - 0x628]
call fcn.1002c74f
push ebx
push 0x4000100
push 2
push ebx
push ebx
push 0x10000000
mov eax, esi
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x668], eax
cmp eax, 0xffffffff
je 0x1002cb8a
push ebx
push ebx
push dword [edi + 0x16]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push dword [ebp - 0x668]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push ebx
push ebx
push ebx
push 4
push ebx
push dword [ebp - 0x668]
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [ebp - 0x670], eax
cmp eax, 0xffffffff
je 0x1002cb8a
push ebx
push ebx
push ebx
push 0xf001f
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x684], 1
jmp 0x1002c9b1
push eax
call fcn.1004c552
pop ecx
mov dword [ebp - 0x664], eax
cmp eax, ebx
je 0x1002cb74
mov ecx, dword [edi + 0x12]
mov eax, dword [ebp - 0x67c]
mov edx, dword [edi + 0x16]
sub eax, ecx
add eax, edi
mov dword [ebp - 0x680], ebx
cmp ecx, edx
je 0x1002ca02
mov ebx, dword [ebp - 0x664]
lea esi, [ebp - 0x680]
push esi
push ecx
push eax
mov edi, edx
call fcn.100319fe
mov esi, dword [ebp - 0x680]
mov edi, dword [ebp - 0x674]
add esp, 0xc
xor ebx, ebx
jmp 0x1002ca16
mov esi, dword [edi + 0xe]
push ecx
push eax
push edx
push dword [ebp - 0x664]
call fcn.1004ccab
add esp, 0x10
cmp dword [edi + 0xe], esi
jne 0x1002cb74
movzx eax, word [edi + 0x1a]
push eax
lea eax, [edi + 0x1e]
push eax
lea esi, [ebp - 0x660]
call fcn.1002cef3
mov dword [ebp - 4], ebx
xor eax, eax
mov dword [ebp - 0x62c], 7
mov dword [ebp - 0x630], ebx
mov word [ebp - 0x640], ax
lea eax, [ebp - 0x644]
push eax
push 0xfde9
mov eax, esi
mov byte [ebp - 4], 1
call fcn.100281b7
cmp dword [ebp - 0x62c], 8
mov eax, dword [ebp - 0x640]
pop ecx
pop ecx
jae 0x1002ca7d
lea eax, [ebp - 0x640]
push eax
mov eax, dword [ebp - 0x688]
mov esi, 0x104
mov ecx, esi
sub ecx, eax
push 0x1007698c
push ecx
lea eax, [ebp + eax*2 - 0x420]
push eax
call fcn.1004c98d
lea edx, [ebp - 0x420]
call fcn.1002c723
xor eax, eax
push 0x206
mov word [ebp - 0x218], ax
lea eax, [ebp - 0x216]
push ebx
push eax
call fcn.10051a60
add esp, 0x1c
lea eax, [ebp - 0x420]
push eax
lea eax, [ebp - 0x218]
push esi
push eax
call fcn.1004d03b
add esp, 0xc
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x1002cb0c
lea eax, [ebp - 0x218]
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x1002cb4e
push ebx
lea eax, [ebp - 0x690]
push eax
push dword [edi + 0x16]
push dword [ebp - 0x664]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
inc dword [ebp - 0x66c]
push ebx
push 1
lea esi, [ebp - 0x644]
call fcn.1000457f
or dword [ebp - 4], 0xffffffff
push ebx
push 1
lea ecx, [ebp - 0x660]
call fcn.1000507a
cmp dword [ebp - 0x684], ebx
je 0x1002cb8a
push dword [ebp - 0x664]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
jmp 0x1002cb96
push dword [ebp - 0x664]
call fcn.1004d030
pop ecx
push dword [ebp - 0x670]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 0x668]
call esi
mov esi, dword [ebp - 0x678]
add esi, dword [ebp - 0x67c]
mov eax, dword [ebp - 0x68c]
add eax, esi
mov dword [ebp - 0x674], eax
mov eax, dword [ebp + 8]
sub eax, esi
mov dword [ebp - 0x678], esi
cmp eax, 0x1e
ja 0x1002c8a4
mov eax, dword [ebp - 0x66c]
call fcn.10052279
ret