Function at 0x61605130
Capabilities:
Get file size
Read file via mapping
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x7c
mov eax, dword [ebp + 0x14]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x3c], 0
and eax, 4
or eax, dword [ebp + 0x20]
je 0x61605420
mov dword [ebp + 0x10], 0xffffffff
cmp ebx, 0xffffffff
je 0x61605400
lea eax, [ebp - 0x30]
mov dword [esp], ebx
mov esi, dword [sym.imp.kernel32.dll_GetFileSizeEx]
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
mov dword [esp + 4], eax
call esi
sub esp, 8
test eax, eax
je 0x6160540d
cmp dword [ebp + 0xc], 0xffffffff
je 0x61605468
lea eax, [ebp - 0x28]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call esi
sub esp, 8
test eax, eax
je 0x6160540d
mov dword [esp], ebx
mov esi, dword [sym.imp.kernel32.dll_CreateFileMappingW]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], 0
call esi
sub esp, 0x18
mov ebx, eax
test eax, eax
je 0x6160540d
mov eax, dword [ebp + 0xc]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov dword [esp], eax
call esi
sub esp, 0x18
mov esi, eax
test eax, eax
je 0x616054f0
mov eax, dword [ebp - 0x30]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov edi, dword [sym.imp.kernel32.dll_MapViewOfFile]
mov dword [esp + 0x10], eax
mov dword [esp + 4], 4
mov dword [esp], ebx
call edi
mov dword [ebp - 0x4c], eax
sub esp, 0x14
test eax, eax
je 0x616054d8
mov eax, dword [ebp - 0x28]
mov ecx, eax
or ecx, dword [ebp - 0x24]
je 0x616054b0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], esi
call edi
mov dword [ebp - 0x54], eax
sub esp, 0x14
test eax, eax
je 0x61605510
mov eax, dword [ebp - 0x28]
mov edx, dword [ebp + 0x20]
mov ecx, dword [ebp + 0x14]
mov dword [esp + 0xc], eax
xor edi, edi
mov eax, dword [ebp - 0x54]
mov dword [esp + 0x14], 0
mov dword [esp + 0x2c], edx
mov edx, dword [ebp + 0x1c]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x30]
mov dword [esp + 0x28], edx
mov edx, dword [ebp + 0x18]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x4c]
mov dword [esp + 0x24], edx
lea edx, [ebp - 0x20]
mov dword [esp + 0x1c], edx
lea edx, [ebp - 0x38]
mov dword [esp + 0x18], edx
lea edx, [ebp - 0x3c]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x10], edx
mov dword [esp], eax
call sym._apply_patch_to_file_by_buffers
mov dword [ebp - 0x50], eax
test eax, eax
jne 0x61605380
cmp dword [ebp + 0x10], 0xffffffff
mov edi, 1
je 0x61605380
lea eax, [ebp - 0x34]
mov dword [ebp - 0x34], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x38]
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x3c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WriteFile]
sub esp, 0x14
mov edi, eax
test eax, eax
je 0x616054c0
mov eax, dword [ebp - 0x20]
or eax, dword [ebp - 0x1c]
je 0x61605380
lea eax, [ebp - 0x20]
mov dword [esp + 8], 0
mov dword [esp + 0xc], eax
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetFileTime]
sub esp, 0x10
lea esi, [esi]
nop
mov eax, dword [ebp - 0x3c]
test eax, eax
je 0x616053a3
mov dword [esp + 8], 0x8000
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_VirtualFree]
sub esp, 0xc
mov eax, dword [ebp - 0x54]
mov ecx, dword [sym.imp.kernel32.dll_UnmapViewOfFile]
test eax, eax
je 0x616053be
mov dword [ebp - 0x54], ecx
mov dword [esp], eax
call ecx
mov ecx, dword [ebp - 0x54]
sub esp, 4
mov eax, dword [ebp - 0x4c]
mov dword [esp], eax
call ecx
sub esp, 4
mov ecx, dword [sym.imp.kernel32.dll_CloseHandle]
test esi, esi
je 0x616053e1
mov dword [ebp - 0x4c], ecx
mov dword [esp], esi
call ecx
mov ecx, dword [ebp - 0x4c]
sub esp, 4
mov dword [esp], ebx
call ecx
mov edx, dword [ebp - 0x50]
mov eax, dword fs:[0x18]
sub esp, 4
mov dword [eax + 0x34], edx
lea esp, [ebp - 0xc]
mov eax, edi
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword fs:[0x18]
mov dword [eax + 0x34], 6
lea esp, [ebp - 0xc]
xor edi, edi
pop ebx
mov eax, edi
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp + 0x10]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetFilePointer]
sub esp, 0x10
cmp eax, 0xffffffff
je 0x6160540d
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_SetEndOfFile]
sub esp, 4
test eax, eax
jne 0x61605159
jmp 0x6160540d
mov dword [esp], ebx
xor esi, esi
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 2
mov dword [esp + 4], 0
call dword [sym.imp.kernel32.dll_CreateFileMappingW]
sub esp, 0x18
mov ebx, eax
test eax, eax
jne 0x6160522e
jmp 0x6160540d
mov dword [ebp - 0x54], 0
jmp 0x616052a6
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x50], eax
jmp 0x61605380
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
xor edi, edi
mov dword [ebp - 0x50], eax
jmp 0x616053c9
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov ecx, dword [sym.imp.kernel32.dll_CloseHandle]
xor edi, edi
mov dword [ebp - 0x50], eax
jmp 0x616053e1
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov ecx, dword [sym.imp.kernel32.dll_UnmapViewOfFile]
xor edi, edi
mov dword [ebp - 0x50], eax
jmp 0x616053be