Function at 0x406640
Capabilities:
Get file size
Read file via mapping

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x478
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x40], 0xffffffff
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x50], 0
mov dword [ebp - 0x1c], 0
mov dword [ebp - 4], 0
mov dword [ebp - 0x18], 0xffffffff
mov dword [ebp - 0x5c], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x60], 0
mov dword [ebp - 0x4c], 1
mov eax, dword [0x417124]
neg eax
sbb eax, eax
and eax, 0x18
add eax, 8
mov dword [ebp - 8], eax
push 0
push 0x80
push 3
push 0
push 0
push 0x80000000
mov ecx, dword [ebp + 8]
push ecx
call dword [0x417140]
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0xffffffff
jne 0x4066ec
jmp 0x406e24
push 0
mov edx, dword [ebp - 0x40]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
sub eax, dword [ebp - 8]
mov dword [ebp - 4], eax
push 0
push 0
push 0
push 2
push 0
mov eax, dword [ebp - 0x40]
push eax
call dword [0x417148]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x406725
jmp 0x406e24
push 0
push 0
push 0
push 4
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x40675e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 8
jne 0x406754
mov dword [ebp - 0x60], 1
jmp 0x40675e
jmp 0x406e24
cmp dword [ebp - 0x60], 0
je 0x406782
mov edx, dword [ebp - 8]
push edx
push 0
push 0
push 4
mov eax, dword [ebp - 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x4c], 0
mov ecx, dword [ebp - 0x24]
mov edx, dword [ecx]
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 0x24]
mov ecx, dword [eax + 4]
mov dword [0x417138], ecx
cmp dword [0x417124], 0
je 0x4067cc
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + 8]
mov dword [ebp - 0x48], eax
mov ecx, dword [edx + 0xc]
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + 0x10]
mov dword [ebp - 0x30], eax
mov ecx, dword [edx + 0x14]
mov dword [ebp - 0x2c], ecx
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + 0x18]
mov dword [ebp - 0x38], eax
mov ecx, dword [edx + 0x1c]
mov dword [ebp - 0x34], ecx
cmp dword [ebp - 0x60], 0
jne 0x406808
mov edx, dword [ebp - 0xc]
add edx, 0x20
push edx
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
jne 0x406808
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 8
jne 0x4067fe
mov dword [ebp - 0x60], 1
jmp 0x406808
jmp 0x406e24
cmp dword [0x417130], 0
je 0x406835
lea eax, [ebp - 0x1c]
push eax
mov ecx, dword [ebp - 0xc]
push ecx
mov edx, dword [ebp - 0x20]
push edx
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp - 0x24]
add ecx, 8
push ecx
call fcn.0040310a
add esp, 0x14
jmp 0x4069ea
mov edx, dword [0x417138]
and edx, 1
je 0x406868
cmp dword [ebp - 0x60], 0
jne 0x406868
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp - 0x24]
add ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0x20]
push edx
call fcn.00407940
add esp, 0xc
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x1c], eax
jmp 0x4069ea
mov ecx, dword [0x417138]
and ecx, 1
je 0x40688e
cmp dword [ebp - 0x60], 0
je 0x40688e
mov edx, dword [ebp - 0xc]
add edx, dword [ebp - 8]
mov dword [ebp - 0x1c], edx
mov dword [ebp - 0x3c], 1
jmp 0x4069ea
cmp dword [ebp - 0x60], 0
jne 0x4068f9
lea eax, [ebp - 0x1c]
push eax
mov ecx, dword [ebp - 0xc]
push ecx
mov edx, dword [ebp - 0x20]
push edx
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp - 0x24]
add ecx, dword [ebp - 8]
push ecx
call fcn.004021ea
add esp, 0x14
mov edx, dword [ebp - 0x1c]
cmp edx, dword [ebp - 0xc]
jb 0x4068c3
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 4]
jne 0x4068f4
mov ecx, dword [ebp - 4]
cmp ecx, dword [ebp - 0xc]
jne 0x4068ea
mov edx, dword [ebp - 4]
push edx
mov eax, dword [ebp - 0x24]
add eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 0x20]
push ecx
call fcn.00407940
add esp, 0xc
mov edx, dword [ebp - 4]
mov dword [ebp - 0x1c], edx
jmp 0x4068f4
jmp 0x406e24
jmp 0x4069ea
push 0
call fcn.00404b30
add esp, 4
push eax
push 0x413b68
lea eax, [ebp - 0x460]
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0
push 0x4000000
push 2
push 0
push 3
push 0xc0000000
lea ecx, [ebp - 0x460]
push ecx
call dword [0x417140]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
jne 0x40694b
jmp 0x406e24
push 0
mov edx, dword [ebp - 0xc]
push edx
push 0
push 4
push 0
mov eax, dword [ebp - 0x18]
push eax
call dword [0x417148]
mov dword [ebp - 0x5c], eax
cmp dword [ebp - 0x5c], 0
jne 0x406974
jmp 0x406e24
cmp dword [ebp - 0x24], 0
je 0x4069a3
cmp dword [ebp - 0x4c], 0
je 0x4069a3
push 0
lea ecx, [ebp - 0x1c]
push ecx
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp - 0x5c]
push eax
mov ecx, dword [ebp - 4]
push ecx
mov edx, dword [ebp - 0x24]
add edx, dword [ebp - 8]
push edx
call fcn.0040280b
add esp, 0x18
jmp 0x4069c1
mov eax, dword [ebp - 0x10]
push eax
lea ecx, [ebp - 0x1c]
push ecx
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp - 0x5c]
push eax
mov ecx, dword [ebp - 4]
push ecx
push 0
call fcn.0040280b
add esp, 0x18
mov edx, dword [ebp - 0x1c]
cmp edx, dword [ebp - 0xc]
jae 0x4069ea
mov eax, dword [ebp - 4]
cmp eax, dword [ebp - 0xc]
jne 0x4069e0
mov ecx, dword [ebp - 0xc]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x3c], 1
jmp 0x4069ea
jmp 0x406e24
cmp dword [ebp - 0x24], 0
je 0x406a01
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [ebp - 0x24], 0
cmp dword [ebp - 0x10], 0
je 0x406a18
mov eax, dword [ebp - 0x10]
push eax
call dword [0x417144]
mov dword [ebp - 0x10], 0
cmp dword [ebp - 0x40], 0xffffffff
je 0x406a2f
mov ecx, dword [ebp - 0x40]
push ecx
call dword [0x417144]
mov dword [ebp - 0x40], 0xffffffff
xor edx, edx
cmp dword [ebp - 0x3c], 0
setne dl
add edx, 2
mov dword [ebp - 0x28], edx
push 0
push 0x80
mov eax, dword [ebp - 0x28]
push eax
push 0
push 0
push 0xc0000000
mov ecx, dword [ebp + 8]
push ecx
call dword [0x417140]
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0xffffffff
jne 0x406a6f
jmp 0x406e24
push 0
mov edx, dword [ebp - 0x1c]
push edx
push 0
push 4
push 0
mov eax, dword [ebp - 0x40]
push eax
call dword [0x417148]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x406a98
jmp 0x406e24
cmp dword [ebp - 0x60], 0
jne 0x406af1
push 0
push 0
push 0
push 2
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x406ad7
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 8
jne 0x406acd
mov dword [ebp - 0x60], 1
jmp 0x406ad7
jmp 0x406e24
cmp dword [ebp - 0x60], 0
jne 0x406af1
mov edx, dword [ebp - 0x1c]
push edx
mov eax, dword [ebp - 0x20]
push eax
mov ecx, dword [ebp - 0x24]
push ecx
call fcn.00407940
add esp, 0xc
cmp dword [ebp - 0x60], 0
je 0x406e1d
mov dword [ebp - 0x468], 0
cmp dword [ebp - 0x20], 0
je 0x406bcc
mov edx, dword [ebp - 0x1c]
sub edx, dword [ebp - 0x468]
je 0x406bc7
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x468]
cmp eax, 0x2000000
ja 0x406b3f
mov ecx, dword [ebp - 0x1c]
sub ecx, dword [ebp - 0x468]
mov dword [ebp - 0x464], ecx
jmp 0x406b49
mov dword [ebp - 0x464], 0x2000000
cmp dword [ebp - 0x24], 0
je 0x406b59
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov eax, dword [ebp - 0x464]
push eax
mov ecx, dword [ebp - 0x468]
push ecx
push 0
push 2
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x406b88
jmp 0x406e24
mov eax, dword [ebp - 0x20]
add eax, dword [ebp - 0x468]
je 0x406bb0
mov ecx, dword [ebp - 0x464]
push ecx
mov edx, dword [ebp - 0x20]
add edx, dword [ebp - 0x468]
push edx
mov eax, dword [ebp - 0x24]
push eax
call fcn.00407940
add esp, 0xc
mov ecx, dword [ebp - 0x468]
add ecx, dword [ebp - 0x464]
mov dword [ebp - 0x468], ecx
jmp 0x406b0f
jmp 0x406e1d
cmp dword [ebp - 0x3c], 0
jne 0x406cc1
mov edx, dword [ebp - 0x1c]
sub edx, dword [ebp - 0x468]
je 0x406cbc
mov eax, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x468]
cmp eax, 0x2000000
ja 0x406c06
mov ecx, dword [ebp - 0x1c]
sub ecx, dword [ebp - 0x468]
mov dword [ebp - 0x464], ecx
jmp 0x406c10
mov dword [ebp - 0x464], 0x2000000
cmp dword [ebp - 0x24], 0
je 0x406c20
mov edx, dword [ebp - 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov eax, dword [ebp - 0x464]
push eax
mov ecx, dword [ebp - 0x468]
push ecx
push 0
push 2
mov edx, dword [ebp - 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x406c4f
jmp 0x406e24
cmp dword [ebp - 0x14], 0
je 0x406c5f
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov ecx, dword [ebp - 0x464]
push ecx
mov edx, dword [ebp - 0x468]
push edx
push 0
push 2
mov eax, dword [ebp - 0x5c]
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x406c8e
jmp 0x406e24
mov ecx, dword [ebp - 0x464]
push ecx
mov edx, dword [ebp - 0x14]
push edx
mov eax, dword [ebp - 0x24]
push eax
call fcn.00407940
add esp, 0xc
mov ecx, dword [ebp - 0x468]
add ecx, dword [ebp - 0x464]
mov dword [ebp - 0x468], ecx
jmp 0x406bd6
jmp 0x406e1d
mov dword [ebp - 0x470], 0
mov dword [ebp - 0x474], 0
mov dword [ebp - 0x46c], 0
jmp 0x406cf3
mov edx, dword [ebp - 0x46c]
add edx, dword [ebp - 0x470]
mov dword [ebp - 0x46c], edx
mov eax, dword [ebp - 0x46c]
cmp eax, dword [ebp - 0xc]
jae 0x406dd3
mov ecx, dword [ebp - 0x474]
add ecx, 0x2000000
cmp ecx, dword [ebp - 0xc]
jae 0x406d1f
mov dword [ebp - 0x478], 0x2000000
jmp 0x406d2e
mov edx, dword [ebp - 0xc]
sub edx, dword [ebp - 0x474]
mov dword [ebp - 0x478], edx
mov eax, dword [ebp - 0x478]
mov dword [ebp - 0x470], eax
cmp dword [ebp - 0x24], 0
je 0x406d51
mov ecx, dword [ebp - 0x24]
push ecx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [ebp - 0x24], 0
mov edx, dword [ebp - 0x470]
add edx, 8
push edx
mov eax, dword [ebp - 0x46c]
push eax
push 0
push 2
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x406d83
jmp 0x406e24
mov edx, dword [ebp - 0x470]
push edx
mov eax, dword [ebp - 0x46c]
xor edx, edx
mov ecx, 0x2000000
div ecx
mov eax, dword [ebp - 0x24]
lea ecx, [eax + edx + 8]
push ecx
mov eax, dword [ebp - 0x46c]
xor edx, edx
mov ecx, 0x2000000
div ecx
add edx, dword [ebp - 0x24]
push edx
call fcn.00407f60
add esp, 0xc
mov edx, dword [ebp - 0x474]
add edx, dword [ebp - 0x470]
mov dword [ebp - 0x474], edx
jmp 0x406ce1
cmp dword [ebp - 0x24], 0
je 0x406dea
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
mov dword [ebp - 0x24], 0
cmp dword [ebp - 0x10], 0
je 0x406e01
mov ecx, dword [ebp - 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebp - 0x10], 0
push 0
push 0
mov edx, dword [ebp - 0xc]
push edx
mov eax, dword [ebp - 0x40]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp - 0x40]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov dword [ebp - 0x54], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x58], eax
cmp dword [ebp - 0x20], 0
je 0x406e3d
mov edx, dword [ebp - 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp - 0x24], 0
je 0x406e4d
mov eax, dword [ebp - 0x24]
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp dword [ebp - 0x10], 0
je 0x406e5d
mov ecx, dword [ebp - 0x10]
push ecx
call dword [0x417144]
cmp dword [ebp - 0x40], 0xffffffff
je 0x406e92
cmp dword [ebp - 0x54], 0
je 0x406e88
cmp dword [0x417124], 0
je 0x406e88
lea edx, [ebp - 0x38]
push edx
lea eax, [ebp - 0x30]
push eax
lea ecx, [ebp - 0x48]
push ecx
mov edx, dword [ebp - 0x40]
push edx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
mov eax, dword [ebp - 0x40]
push eax
call dword [0x417144]
cmp dword [ebp - 0x14], 0
je 0x406ea2
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp dword [ebp - 0x5c], 0
je 0x406eb2
mov edx, dword [ebp - 0x5c]
push edx
call dword [0x417144]
cmp dword [ebp - 0x18], 0xffffffff
je 0x406ec2
mov eax, dword [ebp - 0x18]
push eax
call dword [0x417144]
mov eax, dword [ebp - 0x54]
mov esp, ebp
pop ebp
ret