Function at 0x404790
Capabilities:
Check mutex on windows
Get file size
Read file on windows

Disassembly:
mov eax, 0x1028
call fcn.00459eb0
push ebp
push esi
mov esi, dword [esp + 0x1040]
test esi, esi
je 0x404a0d
mov ebp, dword [esp + 0x1044]
test ebp, ebp
je 0x404a0d
xor eax, eax
mov ecx, ebp
mov dword [ecx], eax
mov dword [ecx + 4], eax
push edi
mov dword [ecx + 8], eax
mov dword [ecx + 0xc], eax
push str.KaseyaWriteFileSizeAndHashValueCache
push eax
lea edx, [esp + 0x28]
push edx
mov dword [ecx + 0x10], eax
mov dword [esp + 0x2c], 0xc
mov dword [esp + 0x30], eax
mov dword [esp + 0x34], 1
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov edi, eax
test edi, edi
mov dword [esp + 0x18], edi
je 0x404810
push 0xffffffffffffffff
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x40481f
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
mov eax, 0xfffffff8
pop ebp
add esp, 0x1028
ret
push ebx
mov ebx, dword [esp + 0x103c]
push 0
push 0x80
push 3
push 0
push 3
push 0x80000000
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x14], edi
je 0x4049de
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [esp + 0x1040]
test ecx, ecx
mov dword [esi], eax
jne 0x404997
mov ebp, dword [esp + 0x1044]
cmp ebp, eax
jle 0x404888
push edi
mov dword [esp + 0x14], 1
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4049ec
mov eax, dword [esp + 0x104c]
push eax
push ebp
call fcn.00404590
add esp, 8
test eax, eax
jne 0x4048ad
push edi
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4049ec
xor edi, edi
mov dword [esp + 0x10], edi
mov dword [esp + 0x18], edi
jmp 0x4048c0
mov esi, ebp
sub esi, edi
cmp esi, 0x1000
jle 0x4048d1
mov esi, 0x1000
mov eax, dword [esp + 0x14]
push 0
lea ecx, [esp + 0x24]
push ecx
push esi
lea edx, [esp + 0x44]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x404982
cmp esi, dword [esp + 0x20]
jne 0x404982
lea ebx, [esi + edi]
cmp ebx, ebp
jl 0x40490a
mov dword [esp + 0x18], 1
mov ecx, dword [esp + 0x18]
xor edx, edx
test edi, edi
sete dl
push ecx
lea eax, [esp + 0x38]
lea ecx, [esp + 0x34]
push edx
mov edx, dword [esp + 0x1054]
push eax
push ecx
push edx
lea eax, [esp + 0x4c]
push esi
push eax
call fcn.004319d0
mov edi, ebx
mov ecx, edi
add esp, 0x1c
and ecx, 0x8001ffff
jns 0x40494b
dec ecx
or ecx, 0xfffe0000
inc ecx
jne 0x404955
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp edi, ebp
jl 0x4048c0
mov edx, dword [esp + 0x104c]
mov edi, dword [esp + 0x103c]
push edx
push ebp
call fcn.004046a0
mov edi, dword [esp + 0x1c]
add esp, 8
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4049ec
mov edi, dword [esp + 0x14]
push edi
mov dword [esp + 0x14], 0xfffffffb
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4049ec
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esi]
push ebp
push eax
call fcn.00404590
add esp, 8
test eax, eax
je 0x4049d4
push ebp
push ebx
call fcn.00431b40
add esp, 8
test eax, eax
je 0x4049c6
mov dword [esp + 0x10], 0xfffffffe
jmp 0x4049ec
mov ecx, dword [esi]
push ebp
push ecx
mov edi, ebx
call fcn.004046a0
add esp, 8
mov dword [esp + 0x10], 0
jmp 0x4049ec
mov dword [esi], 0
mov dword [esp + 0x10], 0xffffffff
mov esi, dword [esp + 0x1c]
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
pop ebx
pop edi
pop esi
pop ebp
add esp, 0x1028
ret
pop esi
mov eax, 0xfffffff9
pop ebp
add esp, 0x1028
ret