Function at 0x494330
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4c9ba3
mov eax, dword fs:[0]
push eax
push ecx
push ebx
push esi
push edi
mov eax, dword [0x504c94]
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.0049d1fb
xor ecx, ecx
cmp eax, edi
setne cl
cmp ecx, edi
jne 0x49437b
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 0x4943e9
cmp dword [edi + 0xc], 0
jl 0x4943da
mov edx, dword [eax]
cmp edx, dword [edi]
jne 0x4943da
push eax
call fcn.00423f84
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 0x4943d0
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 0x4943e6
mov eax, dword [ecx - 0xc]
push eax
push ecx
mov ecx, ebx
call fcn.00423f13
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 0x494437
push 0x4f806c
lea eax, [ebp + 0x10]
push eax
mov dword [ebp + 0x10], str.Cant_open_file
call fcn.004b1aec
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 0x49446e
jb 0x494450
cmp eax, 0x40
jae 0x49446e
mov ecx, dword [esi]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x4f806c
lea edx, [ebp + 0x10]
push edx
mov dword [ebp + 0x10], str.Incorrect_PE_file__too_small_
call fcn.004b1aec
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 0x4944ac
mov edx, dword [esi]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x4f806c
lea eax, [ebp + 0x10]
push eax
mov dword [ebp + 0x10], str.Cant_create_file_mapping
call fcn.004b1aec
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 0x4944ef
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 0x4f806c
lea ecx, [ebp + 0x10]
push ecx
mov dword [ebp + 0x10], str.Cant_create_map_file_view
call fcn.004b1aec
mov dword [esi + 0x34], 1
mov dword [esi + 0x38], edi
call fcn.00494540
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 0x494524
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