Function at 0x4053e0
Capabilities:
Get file size
Read file on windows
Set file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4018
call fcn.00411380
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
test edi, edi
je 0x405434
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
inc eax
cmp eax, 0x3fffffff
jg 0x405434
lea ebx, [eax + eax]
mov eax, ebx
call fcn.00411340
mov esi, esp
test esi, esi
je 0x405434
push 0
push 0
push ebx
push esi
push 0xffffffffffffffff
push edi
push 0
push 3
mov byte [esi], 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
neg eax
sbb eax, eax
and eax, esi
jmp 0x405436
xor eax, eax
mov ebx, eax
lea edi, [ebp - 4]
call fcn.00401300
mov esi, dword [ebp + 8]
mov eax, dword [esi - 0x39]
mov edx, dword [eax + 0x10]
add esi, 0xffffffc7
mov ecx, edi
push ecx
mov ecx, esi
call edx
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x40549a
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
inc eax
cmp eax, 0x3fffffff
jg 0x40549a
lea ebx, [eax + eax]
mov eax, ebx
call fcn.00411340
mov edi, esp
test edi, edi
je 0x40549a
mov eax, dword [ebp + 0x10]
push 0
push 0
push ebx
push edi
push 0xffffffffffffffff
push eax
push 0
push 3
mov byte [edi], 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
neg eax
sbb eax, eax
and eax, edi
jmp 0x40549c
xor eax, eax
mov ebx, eax
lea edi, [ebp + 0xc]
call fcn.00401300
mov edx, dword [esi]
mov edx, dword [edx + 0x10]
mov eax, edi
push eax
mov ecx, esi
call edx
mov eax, dword [ebp + 0xc]
push esi
call fcn.004029e0
mov eax, dword [ebp + 0xc]
push 0x80
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
mov ecx, dword [ebp - 4]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp + 0x10], eax
cmp eax, 0xffffffff
jne 0x405574
mov edi, dword [esi]
mov ebx, dword [ebp - 4]
add edi, 0x1c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [edi]
push eax
push ebx
mov ecx, esi
call edx
test al, al
jne 0x4054ca
mov eax, dword [ebp + 0xc]
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
lea ecx, [eax - 0xc]
cmp ecx, 0x424d78
je 0x405539
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x405539
mov edx, dword [ebp + 0xc]
add edx, 0xfffffff4
push edx
call fcn.0040b07a
add esp, 4
mov eax, dword [ebp - 4]
lea ecx, [eax - 0xc]
cmp ecx, 0x424d78
je 0x405560
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x405560
mov edx, dword [ebp - 4]
add edx, 0xfffffff4
push edx
call fcn.0040b07a
add esp, 4
mov eax, 0x80004005
lea esp, [ebp - 0x4024]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
push 0
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 0xc]
push 0
push 0x80
push 2
push 0
push 1
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
mov dword [ebp - 0xc], ebx
cmp ebx, 0xffffffff
jne 0x4055d7
mov edi, dword [esi]
mov ebx, dword [ebp + 0xc]
add edi, 0x1c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [edi]
push eax
push ebx
mov ecx, esi
call edx
test al, al
jne 0x405580
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x40550c
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40550c
mov dword [ebp - 0x10], 0
mov edi, edi
mov edx, dword [ebp + 0x10]
push 0
lea eax, [ebp - 8]
push eax
push 0x4000
lea ecx, [ebp - 0x4018]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x405749
mov ecx, dword [ebp - 8]
push 0
lea eax, [ebp - 0x18]
push eax
push ecx
lea edx, [ebp - 0x4018]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x405643
mov edi, dword [esi]
mov ebx, dword [ebp + 0xc]
add edi, 0x1c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
mov eax, dword [edi]
push ebx
mov ecx, esi
call eax
test al, al
je 0x40570b
mov ebx, dword [ebp - 0xc]
jmp 0x405604
mov edi, dword [ebp - 0x10]
add edi, dword [ebp - 8]
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x10], edi
test ecx, ecx
je 0x405682
cmp ecx, 0x186a0
jbe 0x40566b
mov eax, 0x51eb851f
mul ecx
mov ecx, edx
shr ecx, 5
mov eax, edi
jmp 0x405670
mov eax, edi
imul eax, eax, 0x64
xor edx, edx
div ecx
mov edx, dword [esi]
mov edx, dword [edx + 4]
mov ecx, esi
push eax
mov eax, dword [ebp + 0xc]
push eax
call edx
mov eax, dword [ebp - 8]
mov ecx, dword [ebp + 8]
shr eax, 0xa
add dword [ecx + 8], eax
mov eax, dword [ecx + 8]
mov ecx, dword [ecx + 4]
test ecx, ecx
je 0x4056a8
imul eax, eax, 0x64
cdq
idiv ecx
mov edi, dword [esi]
mov edx, dword [edi + 0x20]
mov ecx, esi
push eax
call edx
cmp dword [ebp - 8], 0x4000
je 0x4055e0
mov ecx, dword [ebp + 0xc]
mov eax, dword [esi]
mov edx, dword [eax + 4]
push 0x64
push ecx
mov ecx, esi
call edx
mov ecx, dword [ebp + 0xc]
mov eax, dword [esi]
mov edx, dword [eax + 8]
push ecx
push 3
mov ecx, esi
call edx
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x4056e0
push ebx
call esi
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x4056ea
push eax
call esi
lea ecx, [ebp + 0xc]
call fcn.00401fb0
lea ecx, [ebp - 4]
call fcn.00401fb0
xor eax, eax
lea esp, [ebp - 0x4024]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp - 0xc]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x40571b
push eax
call esi
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x405725
push eax
call esi
lea ecx, [ebp + 0xc]
call fcn.00401fb0
lea ecx, [ebp - 4]
call fcn.00401fb0
mov eax, 0x80004005
lea esp, [ebp - 0x4024]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp - 4]
mov edi, dword [esi]
mov dword [ebp + 8], eax
add edi, 0x1c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp + 8]
mov edx, dword [edi]
push eax
push ecx
mov ecx, esi
call edx
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test ebx, ebx
je 0x405772
push ebx
call esi
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x40577c
push eax
call esi
lea ecx, [ebp + 0xc]
call fcn.00401fb0
lea ecx, [ebp - 4]
call fcn.00401fb0
mov eax, 0x80070057
lea esp, [ebp - 0x4024]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc