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

Disassembly:
push 0x678
mov eax, 0x449228
call fcn.0042f711
mov ebx, edx
mov dword [ebp - 0x680], ebx
mov esi, ecx
mov dword [ebp - 0x67c], esi
mov eax, dword [ebp + 8]
push eax
lea eax, [ebp - 0x218]
push 0x452c08
push eax
call fcn.004073cf
mov dword [ebp - 0x678], eax
xor edx, edx
xor eax, eax
mov dword [ebp - 0x66c], edx
add esp, 0xc
mov dword [ebp - 0x660], eax
cmp ebx, 0x1e
jbe 0x4073c9
cmp dword [esi], 0x15145c61
je 0x406fed
cmp dword [esi], 0x4034b50
jne 0x4073c3
movzx eax, word [esi + 0x1a]
movzx ecx, word [esi + 0x1c]
mov edi, dword [esi + 0x12]
add ecx, eax
add edi, 0x1e
mov eax, ebx
add edi, ecx
sub eax, edx
mov dword [ebp - 0x664], edi
cmp edi, eax
jg 0x4073c3
or dword [ebp - 0x670], 0xffffffff
xor ebx, ebx
or dword [ebp - 0x674], 0xffffffff
and dword [ebp - 0x668], ebx
cmp dword [esi + 0x16], 0x100000
jbe 0x4070e2
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x628], ax
lea eax, [ebp - 0x626]
push eax
call fcn.0042edc0
add esp, 0xc
lea ecx, [ebp - 0x628]
call fcn.00406e7d
xor eax, eax
push eax
push 0x4000100
push 2
push eax
push eax
push 0x10000000
lea eax, [ebp - 0x628]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x670], edi
cmp edi, 0xffffffff
je 0x407379
push ebx
push ebx
push dword [esi + 0x16]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
xor eax, eax
push eax
push eax
push eax
push 4
push eax
push edi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov edi, eax
mov dword [ebp - 0x674], edi
cmp edi, 0xffffffff
je 0x407379
xor eax, eax
push eax
push eax
push eax
push 0xf001f
push edi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edi, dword [ebp - 0x664]
mov dword [ebp - 0x668], 1
jmp 0x4070eb
push dword [esi + 0x16]
call fcn.0042cfcd
pop ecx
mov ebx, eax
test ebx, ebx
je 0x407367
mov ecx, dword [esi + 0x12]
mov eax, edi
and dword [ebp - 0x65c], 0
sub eax, ecx
add eax, esi
cmp ecx, dword [esi + 0x16]
je 0x407129
lea edx, [ebp - 0x65c]
push edx
push dword [esi + 0x16]
mov edx, ecx
mov ecx, eax
push ebx
call fcn.004094d1
mov edi, dword [ebp - 0x65c]
add esp, 0xc
jmp 0x40713a
mov edi, dword [esi + 0xe]
push ecx
push eax
push dword [esi + 0x16]
push ebx
call fcn.0042e77d
add esp, 0x10
cmp dword [esi + 0xe], edi
jne 0x407367
movzx eax, word [esi + 0x1a]
lea ecx, [ebp - 0x658]
and dword [ebp - 0x648], 0
push eax
lea eax, [esi + 0x1e]
mov dword [ebp - 0x644], 0xf
push eax
mov byte [ebp - 0x658], 0
call fcn.00401ef1
and dword [ebp - 4], 0
xor eax, eax
and dword [ebp - 0x630], 0
mov dword [ebp - 0x62c], 7
mov word [ebp - 0x640], ax
mov edi, 0x452928
mov byte [ebp - 4], 1
push edi
call fcn.00401bec
pop ecx
push eax
push edi
lea ecx, [ebp - 0x640]
call fcn.00401b73
cmp dword [ebp - 0x644], 0x10
lea eax, [ebp - 0x658]
mov ecx, dword [ebp - 0x648]
cmovae eax, dword [ebp - 0x658]
xor edx, edx
push edx
push edx
push ecx
push eax
push edx
push 0xfde9
mov dword [ebp - 0x65c], ecx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov edi, eax
test edi, edi
je 0x40722e
push 0
push edi
lea ecx, [ebp - 0x640]
call fcn.004097c9
cmp dword [ebp - 0x62c], 8
lea ecx, [ebp - 0x640]
push edi
cmovae ecx, dword [ebp - 0x640]
lea eax, [ebp - 0x658]
cmp dword [ebp - 0x644], 0x10
push ecx
push dword [ebp - 0x65c]
cmovae eax, dword [ebp - 0x658]
push eax
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
cmp dword [ebp - 0x62c], 8
lea eax, [ebp - 0x640]
mov ecx, dword [ebp - 0x678]
mov edi, 0x104
cmovae eax, dword [ebp - 0x640]
push eax
mov eax, edi
sub eax, ecx
push 0x452c10
push eax
lea eax, [ebp - 0x218]
lea eax, [eax + ecx*2]
push eax
call fcn.0042d0c2
lea eax, [ebp - 0x218]
add esp, 0x10
test eax, eax
je 0x40729d
xor eax, eax
movzx ecx, word [ebp + eax*2 - 0x218]
xor edx, edx
cmp dx, cx
je 0x40729d
push 0x2f
pop edx
cmp dx, cx
jne 0x407298
push 0x5c
pop ecx
mov word [ebp + eax*2 - 0x218], cx
inc eax
cmp eax, edi
jl 0x407276
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x420], ax
lea eax, [ebp - 0x41e]
push eax
call fcn.0042edc0
add esp, 0xc
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x420]
push edi
push eax
call fcn.0042e236
add esp, 0xc
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [ebp - 0x420]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x4072ff
lea eax, [ebp - 0x420]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectory]
xor eax, eax
push eax
push 0x80
push 2
push eax
push eax
push 0x40000000
lea eax, [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x40733f
push 0
lea eax, [ebp - 0x684]
push eax
push dword [esi + 0x16]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
inc dword [ebp - 0x660]
lea ecx, [ebp - 0x640]
push 0
push 1
call fcn.00401aa3
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x658]
push 0
push 1
call fcn.00401ead
cmp dword [ebp - 0x668], 0
je 0x407379
push ebx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
jmp 0x407380
push ebx
call fcn.0042d9d5
pop ecx
push dword [ebp - 0x674]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
push dword [ebp - 0x670]
call edi
mov edx, dword [ebp - 0x66c]
add edx, dword [ebp - 0x664]
mov ebx, dword [ebp - 0x680]
mov ecx, ebx
mov esi, dword [ebp - 0x67c]
sub ecx, edx
add esi, edx
mov dword [ebp - 0x66c], edx
cmp ecx, 0x1e
ja 0x406fd9
mov eax, dword [ebp - 0x660]
call fcn.0042f6cf
ret