Function at 0x497ab0
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4cdb23
mov eax, dword fs:[0]
push eax
push ecx
push ebx
push esi
push edi
mov eax, dword [0x50cc94]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [ebp + 8]
xor edi, edi
mov dword [ebp - 4], edi
lea ebx, [esi + 0x20]
call fcn.004a1286
xor ecx, ecx
cmp eax, edi
setne cl
cmp ecx, edi
jne 0x497afb
push 0x80004005
call fcn.00421000
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebx], eax
mov byte [ebp - 4], 1
mov ecx, dword [ebp + 0xc]
mov dword [esi + 0x38], edi
mov edi, dword [ebx]
lea eax, [ecx - 0x10]
sub edi, 0x10
cmp eax, edi
je 0x497b69
cmp dword [edi + 0xc], 0
jl 0x497b5a
mov edx, dword [eax]
cmp edx, dword [edi]
jne 0x497b5a
push eax
call fcn.004242ab
mov dword [ebp - 0x10], eax
add esp, 4
lea eax, [edi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x497b50
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
mov ecx, dword [ebp - 0x10]
add ecx, 0x10
mov dword [ebx], ecx
jmp 0x497b66
mov eax, dword [ecx - 0xc]
push eax
push ecx
mov ecx, ebx
call fcn.0042423a
mov ecx, dword [ebp + 0xc]
mov edi, dword [ebp + 0x10]
xor ebx, ebx
push ebx
push 0x80
push 3
mov edx, edi
neg edx
sbb edx, edx
push ebx
and edx, 0x116
push 1
add edx, 0x120089
push edx
push ecx
mov dword [esi], ebx
mov dword [esi + 4], ebx
mov dword [esi + 0x34], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [esi], eax
cmp eax, 0xffffffff
jne 0x497bb7
push 0x4ff4d4
lea eax, [ebp + 0x10]
push eax
mov dword [ebp + 0x10], str.Cant_open_file
call fcn.004b5a3c
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [esi + 0x28], eax
mov dword [esi + 0x2c], ebx
cmp ebx, ebx
ja 0x497bee
jb 0x497bd0
cmp eax, 0x40
jae 0x497bee
mov ecx, dword [esi]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x4ff4d4
lea edx, [ebp + 0x10]
push edx
mov dword [ebp + 0x10], str.Incorrect_PE_file__too_small_
call fcn.004b5a3c
mov ecx, dword [esi]
xor eax, eax
cmp edi, ebx
push ebx
setne al
push ebx
push ebx
lea eax, [eax + eax + 2]
push eax
push ebx
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [esi + 4], eax
cmp eax, ebx
jne 0x497c2c
mov edx, dword [esi]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x4ff4d4
lea eax, [ebp + 0x10]
push eax
mov dword [ebp + 0x10], str.Cant_create_file_mapping
call fcn.004b5a3c
xor ecx, ecx
cmp edi, ebx
setne cl
push ebx
push ebx
push ebx
lea ecx, [ecx + ecx + 4]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [esi + 0x30], eax
cmp eax, ebx
jne 0x497c6f
mov edx, dword [esi + 4]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push edx
call edi
mov eax, dword [esi]
push eax
call edi
push 0x4ff4d4
lea ecx, [ebp + 0x10]
push ecx
mov dword [ebp + 0x10], str.Cant_create_map_file_view
call fcn.004b5a3c
mov dword [esi + 0x34], 1
mov dword [esi + 0x38], edi
call fcn.00497cc0
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x497ca4
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc