Function at 0x494c03
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x154
push ebx
push esi
push edi
lea eax, [ebp - 0x20]
push dword [ebp + 0x18]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00494b86
push dword [ebp - 0x20]
mov dword [ebp + 8], eax
push eax
call fcn.004919d5
mov esi, eax
xor edi, edi
add esp, 0x18
and esi, 0xff
cmp dword [0x54e69c], edi
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x30], esi
je 0x494d53
cmp dword [ebp + 0x14], edi
je 0x494c61
cmp dword [ebp + 0x14], 1
je 0x494c61
cmp dword [ebp + 0x14], 2
jne 0x494d53
push dword [0x54e640]
mov dword [ebp - 8], edi
call sym.stub.exe_tsrm_mutex_lock
mov eax, dword [0x54e69c]
push 1
push dword [eax]
call fcn.004908af
mov eax, dword [0x54e69c]
lea ebx, [esi*4 + 0x428]
add esp, 0xc
mov dword [ebp - 4], edi
mov esi, dword [ebx + eax]
cmp esi, edi
je 0x494cfe
mov eax, dword [ebp - 0x24]
cmp dword [esi + 4], eax
jne 0x494cb0
push dword [ebp + 8]
lea eax, [esi + 0x20]
push eax
call sub.MSVCRT.dll_strcmp
pop ecx
test eax, eax
pop ecx
je 0x494cb7
mov dword [ebp - 4], esi
mov esi, dword [esi]
jmp 0x494c92
cmp dword [esi + 8], edi
mov dword [ebp - 8], esi
je 0x494cfe
push edi
call dword [sym.imp.MSVCRT.dll_time]
cmp dword [esi + 8], eax
pop ecx
jge 0x494cfe
mov eax, dword [ebp - 4]
cmp eax, edi
jne 0x494ce0
mov ecx, dword [0x54e69c]
mov eax, dword [esi]
mov dword [ebx + ecx], eax
jmp 0x494ce4
mov ecx, dword [esi]
mov dword [eax], ecx
mov eax, dword [0x54e69c]
push esi
dec dword [eax + 0x10]
mov eax, dword [0x54e69c]
push dword [eax]
call fcn.004909e0
pop ecx
mov dword [ebp - 8], edi
pop ecx
mov eax, dword [0x54e69c]
push dword [eax]
call fcn.004908e2
push dword [0x54e640]
call sym.stub.exe_tsrm_mutex_unlock
mov eax, dword [ebp - 8]
pop ecx
cmp eax, edi
pop ecx
je 0x494d53
add eax, 0x10
push 0x10
push eax
push dword [ebp + 0x10]
call sub.MSVCRT.dll_memcpy
push dword [ebp + 0x18]
push dword [ebp + 0x10]
call fcn.00493bce
mov eax, dword [ebp + 0xc]
add esp, 0x14
cmp dword [ebp - 0x20], eax
je 0x494d4b
push dword [ebp + 8]
call sym.stub.exe__efree
pop ecx
push 1
pop eax
jmp 0x49515d
cmp dword [ebp + 0x14], edi
je 0x494d68
cmp dword [ebp + 0x14], 1
je 0x494d68
cmp dword [ebp + 0x14], 3
jne 0x49514a
push dword [ebp + 0x18]
lea eax, [ebp - 0x154]
push dword [ebp + 8]
push str._mmcache_user_
push eax
call fcn.00491c6e
add esp, 0x10
test eax, eax
je 0x49514a
push edi
call dword [sym.imp.MSVCRT.dll_time]
push 1
mov dword [ebp - 0x2c], eax
pop ebx
lea eax, [ebp - 0x154]
mov dword [ebp - 8], ebx
mov dword [ebp - 0x28], edi
mov dword [esp], 0x8000
push eax
call dword [sym.imp.MSVCRT.dll__open]
mov esi, eax
pop ecx
cmp esi, edi
pop ecx
mov dword [ebp - 4], esi
jle 0x49514a
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], edi
push eax
push edi
push ebx
mov ebx, dword [sym.imp.MSVCRT.dll__get_osfhandle]
push edi
push edi
push esi
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 0xc], edi
call ebx
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_LockFileEx]
lea eax, [ebp - 0x50]
push 0x20
push eax
push esi
call dword [sym.imp.MSVCRT.dll__read]
add esp, 0xc
cmp eax, 0x20
jne 0x495112
push 8
lea eax, [ebp - 0x50]
push str.MMCACHE
push eax
call dword [sym.imp.MSVCRT.dll_strncmp]
add esp, 0xc
test eax, eax
jne 0x495112
mov eax, dword [ebp - 0x48]
cmp eax, dword [0x54e638]
jne 0x495112
mov eax, dword [ebp - 0x44]
cmp eax, dword [0x54e608]
jne 0x495112
mov eax, dword [ebp - 0x40]
cmp eax, dword [0x54e644]
jne 0x495112
mov eax, dword [ebp - 0x38]
cmp eax, edi
je 0x494e7e
cmp eax, dword [ebp - 0x2c]
jg 0x494e7e
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], edi
push eax
push edi
push 1
push edi
push esi
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 0xc], edi
call ebx
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_UnlockFileEx]
push esi
jmp 0x4950e7
mov eax, dword [0x54e69c]
cmp eax, edi
je 0x494ec6
cmp dword [ebp + 0x14], edi
je 0x494e92
cmp dword [ebp + 0x14], 1
jne 0x494ec6
mov ecx, dword [0x54e67c]
cmp ecx, edi
je 0x494ea1
cmp dword [ebp - 0x3c], ecx
jg 0x494ec6
push dword [ebp - 0x3c]
push dword [eax]
call fcn.00490a8d
mov esi, eax
pop ecx
cmp esi, edi
pop ecx
jne 0x494edc
push dword [ebp + 0x18]
push dword [ebp - 0x3c]
call fcn.004919fc
mov esi, eax
pop ecx
cmp esi, edi
pop ecx
jne 0x494edc
push dword [ebp - 0x3c]
call sym.stub.exe__emalloc
mov esi, eax
pop ecx
cmp esi, edi
mov dword [ebp - 8], edi
je 0x4950fc
push dword [ebp - 0x3c]
push esi
push dword [ebp - 4]
call dword [sym.imp.MSVCRT.dll__read]
add esp, 0xc
cmp eax, dword [ebp - 0x3c]
jne 0x4950a5
mov eax, dword [esi + 0xc]
cmp dword [ebp - 0x3c], eax
jne 0x4950a5
push eax
push esi
call fcn.00490e88
cmp dword [ebp - 0x34], eax
pop ecx
pop ecx
jne 0x4950a5
mov ecx, dword [ebp + 0x18]
mov edx, dword [0x5593c4]
mov eax, esi
mov ecx, dword [ecx]
sub eax, dword [esi]
mov ecx, dword [ecx + edx*4 - 4]
mov dword [ecx + 0x14], eax
mov ecx, dword [ebp + 0x18]
mov edx, dword [0x5593c4]
push ecx
mov eax, dword [ecx]
mov eax, dword [eax + edx*4 - 4]
mov byte [eax + 9], 1
lea eax, [esi + 0x10]
push eax
call fcn.004937ab
lea eax, [esi + 0x20]
push eax
push dword [ebp + 8]
call sub.MSVCRT.dll_strcmp
add esp, 0x10
test eax, eax
je 0x494fa0
cmp dword [ebp - 8], edi
push esi
je 0x494f6e
mov eax, dword [0x54e69c]
push dword [eax]
call fcn.00490ab8
pop ecx
jmp 0x494f73
call sym.stub.exe__efree
pop ecx
lea eax, [ebp - 0x1c]
push eax
push edi
push 1
push edi
push dword [ebp - 4]
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 0xc], edi
call ebx
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_UnlockFileEx]
push dword [ebp - 4]
jmp 0x495135
lea eax, [esi + 0x10]
push 0x10
push eax
push dword [ebp + 0x10]
call sub.MSVCRT.dll_memcpy
push dword [ebp + 0x18]
push dword [ebp + 0x10]
call fcn.00493bce
add esp, 0x14
cmp dword [ebp - 8], edi
mov dword [ebp - 0x28], 1
je 0x49506f
mov eax, dword [ebp - 0x24]
mov dword [esi + 4], eax
push dword [0x54e640]
call sym.stub.exe_tsrm_mutex_lock
mov eax, dword [0x54e69c]
push 1
push dword [eax]
call fcn.004908af
mov eax, dword [ebp - 0x30]
mov ecx, dword [0x54e69c]
add esp, 0xc
lea eax, [eax*4 + 0x428]
mov ecx, dword [eax + ecx]
mov dword [esi], ecx
mov ecx, dword [0x54e69c]
mov dword [eax + ecx], esi
mov eax, dword [0x54e69c]
inc dword [eax + 0x10]
mov dword [ebp + 0x14], esi
mov esi, dword [esi]
cmp esi, edi
je 0x495055
mov eax, dword [ebp - 0x24]
cmp dword [esi + 4], eax
jne 0x495014
push dword [ebp + 8]
lea eax, [esi + 0x20]
push eax
call sub.MSVCRT.dll_strcmp
pop ecx
test eax, eax
pop ecx
jne 0x495014
mov ecx, dword [ebp + 0x14]
mov eax, dword [esi]
push esi
mov dword [ecx], eax
mov eax, dword [0x54e69c]
dec dword [eax + 0x10]
mov eax, dword [0x54e69c]
push dword [eax]
call fcn.004909e0
pop ecx
pop ecx
mov eax, dword [0x54e69c]
push dword [eax]
call fcn.004908e2
push dword [0x54e640]
call sym.stub.exe_tsrm_mutex_unlock
pop ecx
jmp 0x495075
push esi
call sym.stub.exe__efree
pop ecx
lea eax, [ebp - 0x1c]
push eax
push edi
push 1
push edi
push dword [ebp - 4]
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 0xc], edi
call ebx
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_UnlockFileEx]
push dword [ebp - 4]
call dword [sym.imp.MSVCRT.dll__close]
jmp 0x4950fb
cmp dword [ebp - 8], edi
push esi
je 0x4950ba
mov eax, dword [0x54e69c]
push dword [eax]
call fcn.00490ab8
pop ecx
jmp 0x4950bf
call sym.stub.exe__efree
pop ecx
lea eax, [ebp - 0x1c]
push eax
push edi
push 1
push edi
push dword [ebp - 4]
mov dword [ebp - 0x1c], edi
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 0xc], edi
call ebx
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_UnlockFileEx]
push dword [ebp - 4]
call dword [sym.imp.MSVCRT.dll__close]
lea eax, [ebp - 0x154]
push eax
call dword [sym.imp.MSVCRT.dll__unlink]
pop ecx
pop ecx
mov eax, dword [ebp + 0xc]
cmp dword [ebp - 0x20], eax
je 0x49510d
push dword [ebp + 8]
call sym.stub.exe__efree
pop ecx
mov eax, dword [ebp - 0x28]
jmp 0x49515d
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], edi
push eax
push edi
push 1
push edi
push esi
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], edi
mov dword [ebp - 0x10], edi
mov dword [ebp - 0xc], edi
call ebx
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_UnlockFileEx]
push esi
call dword [sym.imp.MSVCRT.dll__close]
lea eax, [ebp - 0x154]
push eax
call dword [sym.imp.MSVCRT.dll__unlink]
pop ecx
pop ecx
mov eax, dword [ebp + 0xc]
cmp dword [ebp - 0x20], eax
je 0x49515b
push dword [ebp + 8]
call sym.stub.exe__efree
pop ecx
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret