Function at 0x401670
Capabilities:
Clear file content
Get file attributes
Get file size
Read file on windows
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xcc
push ebx
push esi
push edi
mov esi, ecx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
test al, 1
je 0x401694
and eax, 0xfffffffe
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFileAttributesW]
push 0
push 0x10000080
push 3
push 0
push 2
push 0x40000005
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x40196a
lea eax, [ebp - 0x28]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
push 0
push 0x400
mov ecx, 1
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x34], 0
call fcn.004015e0
add esp, 8
push edx
push eax
push edx
push eax
call fcn.00412160
mov edi, dword [ebp - 0x28]
mov ebx, eax
mov eax, edx
mov dword [ebp - 4], edi
mov edx, dword [ebp - 0x24]
mov ecx, edi
or ecx, edx
mov dword [ebp - 0xc], eax
je 0x40196a
cmp edx, eax
jg 0x401729
jl 0x401719
cmp edi, ebx
ja 0x401729
mov dword [ebp - 0x10], 1
mov dword [ebp - 0xc], 0
jmp 0x401774
mov ecx, dword [ebp - 0xc]
mov edx, eax
mov eax, ebx
mov dword [ebp - 8], ebx
shld ecx, eax, 2
shl eax, 2
add dword [ebp - 8], eax
mov eax, dword [ebp - 8]
adc edx, ecx
shld edx, eax, 1
add eax, eax
cmp dword [ebp - 0x24], edx
jg 0x401766
jl 0x401753
cmp edi, eax
jae 0x401766
mov dword [ebp - 4], ebx
mov dword [ebp - 0x10], 1
mov dword [ebp - 0xc], 0
jmp 0x401774
mov dword [ebp - 4], ebx
shld dword [ebp - 0xc], ebx, 2
shl ebx, 2
mov dword [ebp - 0x10], ebx
push 0x95
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 8], eax
test eax, eax
je 0x40195a
mov ebx, 1
or edi, 0xffffffff
nop dword [eax + eax]
push 2
push 0
mov eax, edi
cdq
push edx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [ebp - 8]
push 1
add eax, ebx
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
dec edi
inc ebx
cmp edi, 0xffffff6b
jg 0x4017a0
mov edi, dword [ebp - 4]
mov ecx, 0x95
mov ebx, dword [ebp - 0x10]
mov edx, 0x41c650
nop
mov eax, dword [ebp - 8]
movzx eax, byte [ecx + eax - 1]
cmp ax, word [edx]
jne 0x401957
sub ecx, 2
add edx, 2
cmp ecx, 1
jg 0x4017e0
push 4
push 0x3000
push edi
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 4], eax
test eax, eax
je 0x401924
push 0
push 0
xorps xmm0, xmm0
movlpd qword [ebp - 0x18], xmm0
push dword [ebp - 0x14]
push dword [ebp - 0x18]
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
sub esp, 0xc
lea ecx, [ebp - 0xc8]
call fcn.00401000
xor eax, eax
mov dword [ebp - 0x48], 0x40
mov dword [ebp - 0x98], 0
mov dword [ebp - 0x94], 0
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0xc], eax
jl 0x401924
jg 0x401871
test ebx, ebx
je 0x401924
test eax, eax
jne 0x401885
xorps xmm0, xmm0
movlpd qword [ebp - 0x18], xmm0
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x18]
jmp 0x40188f
mov ecx, edi
xor eax, eax
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], eax
push 1
lea edx, [ebp - 0x40]
push edx
push eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push 0
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x30]
push eax
push edi
push dword [ebp - 4]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401907
push 0
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x3c]
push dword [ebp - 0x40]
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push edi
push dword [ebp - 4]
lea ecx, [ebp - 0xc8]
call fcn.004012a0
push 0
push edi
push 0
push dword [ebp - 0x10]
push esi
call dword [sym.imp.KERNEL32.dll_LockFile]
push 0
lea eax, [ebp - 0x34]
push eax
push edi
push dword [ebp - 4]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
push edi
push 0
push dword [ebp - 0x10]
push esi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
mov eax, dword [ebp - 0x1c]
xor ecx, ecx
add eax, edi
mov dword [ebp - 0x1c], eax
cmp ecx, dword [ebp - 0xc]
jl 0x401871
jg 0x401924
cmp eax, ebx
jb 0x401871
mov ecx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x24]
sub ecx, 0x394
push 0
push 0
sbb eax, 0
push eax
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0x8000
push 0
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, dword [ebp - 8]
push eax
push 1
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret