Function at 0x4066f0
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [0x478bf4]
xor eax, ebp
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x20]
test eax, eax
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov edi, dword [ebp + 0x18]
mov esi, 0x10000
mov dword [ebp - 0x20], ecx
cmovne esi, eax
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 8], ecx
mov ecx, dword [ebp + 0x14]
push 3
mov dword [ebp - 0x10], ecx
mov ecx, dword [ebp + 0x1c]
push 0x454dd0
push ebx
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x1c], 0
call fcn.0043d288
add esp, 0xc
test eax, eax
jne 0x406805
add esi, 0x10000
cmp edi, 3
je 0x406760
cmp edi, 4
jne 0x406780
lea eax, [ebx + 3]
push eax
push 0
push 0xf001f
call dword [sym.imp.KERNEL32.dll_OpenFileMappingA]
mov edi, eax
mov dword [ebp - 0x10], edi
test edi, edi
jne 0x4067a3
cmp dword [ebp - 0x18], 3
je 0x4067e9
lea eax, [ebx + 3]
push eax
push esi
push 0
push 4
push 0
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov edi, eax
mov dword [ebp - 0x10], eax
test edi, edi
je 0x4067e9
mov eax, 0x2000
jmp 0x4067a8
mov eax, 0x1000
or eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
call fcn.00414b10
cmp esi, dword [eax + 0x1de0]
jge 0x4067bf
mov eax, esi
jmp 0x4067ca
call fcn.00414b10
mov eax, dword [eax + 0x1de0]
push eax
push 0
push 0
push 0xf001f
push edi
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [ebp - 0x1c], eax
test eax, eax
jne 0x4067fd
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004379e8
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
jmp 0x406822
push 0
push dword [ebp - 0x14]
push edi
push dword [ebp - 0x10]
push dword [ebp - 8]
push dword [ebp - 0x20]
push ebx
call fcn.00406c00
mov edi, eax
add esp, 0x1c
mov dword [ebp - 0x10], edi
cmp edi, 0xffffffff
je 0x4067e9
test esi, esi
jns 0x406836
push 0
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
mov eax, 0x10000
push 0x58
cmove esi, eax
call fcn.0043d27d
mov edi, eax
add esp, 4
test edi, edi
je 0x40685e
push 0x58
push 0
push edi
call fcn.00439330
add esp, 0xc
mov eax, dword [ebp - 0x14]
mov ecx, ebx
mov dword [edi + 0x1c], eax
mov eax, dword [ebp - 0x10]
mov dword [edi + 8], eax
lea edx, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x406870
sub ecx, edx
lea eax, [ecx + 1]
push eax
call fcn.0043d27d
add esp, 4
mov dword [edi], eax
mov cl, byte [ebx]
lea ebx, [ebx + 1]
mov byte [eax], cl
lea eax, [eax + 1]
test cl, cl
jne 0x406887
test dword [ebp - 0x14], 0x3000
mov dword [edi + 0x30], 1
je 0x4068e3
call fcn.00414b10
cmp esi, dword [eax + 0x1de0]
jge 0x4068b6
mov eax, esi
jmp 0x4068c1
call fcn.00414b10
mov eax, dword [eax + 0x1de0]
mov dword [edi + 0x10], eax
mov eax, esi
cdq
mov dword [edi + 0x20], eax
mov eax, dword [ebp - 0x1c]
mov dword [edi + 0x24], edx
mov dword [edi + 0x18], 4
mov dword [edi + 0x40], fcn.00405d90
jmp 0x406963
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x4068f7
lea ecx, [ebp - 8]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
jmp 0x406902
xorps xmm0, xmm0
movlpd qword [ebp - 0xc], xmm0
mov eax, dword [ebp - 0xc]
cmp dword [ebp - 0x20], 0
mov ecx, dword [ebp - 8]
mov dword [edi + 0x20], eax
mov dword [edi + 0x24], ecx
jge 0x40694b
test ecx, ecx
jl 0x40692c
jg 0x40691e
cmp eax, 0xbebc200
jbe 0x40692c
mov edx, 0xbebc200
mov dword [ebp - 8], 0
jmp 0x406931
mov edx, eax
mov dword [ebp - 8], ecx
cmp esi, edx
jg 0x40694b
test ecx, ecx
jl 0x406949
jg 0x406942
cmp eax, 0xbebc200
jbe 0x406949
mov esi, 0xbebc200
jmp 0x40694b
mov esi, eax
xor ecx, ecx
mov dword [edi + 0x10], esi
add esi, 1
setb cl
neg ecx
or ecx, esi
push ecx
call fcn.0043d27d
add esp, 4
mov ecx, dword [ebp - 4]
mov dword [edi + 0x14], eax
xor ecx, ebp
mov eax, edi
pop edi
pop esi
pop ebx
call fcn.004379e8
mov esp, ebp
pop ebp
ret