Function at 0x406a10
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [0x479bf0]
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 0x455de0
push ebx
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x1c], 0
call fcn.0043bc62
add esp, 0xc
test eax, eax
jne 0x406b25
add esi, 0x10000
cmp edi, 3
je 0x406a80
cmp edi, 4
jne 0x406aa0
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 0x406ac3
cmp dword [ebp - 0x18], 3
je 0x406b09
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 0x406b09
mov eax, 0x2000
jmp 0x406ac8
mov eax, 0x1000
or eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
call fcn.00415230
cmp esi, dword [eax + 0x1de0]
jge 0x406adf
mov eax, esi
jmp 0x406aea
call fcn.00415230
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 0x406b1d
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.004380f8
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
jmp 0x406b42
push 0
push dword [ebp - 0x14]
push edi
push dword [ebp - 0x10]
push dword [ebp - 8]
push dword [ebp - 0x20]
push ebx
call fcn.00406f20
mov edi, eax
add esp, 0x1c
mov dword [ebp - 0x10], edi
cmp edi, 0xffffffff
je 0x406b09
test esi, esi
jns 0x406b56
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.00442d35
mov edi, eax
add esp, 4
test edi, edi
je 0x406b7e
push 0x58
push 0
push edi
call fcn.00439a50
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 0x406b90
sub ecx, edx
lea eax, [ecx + 1]
push eax
call fcn.00442d35
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 0x406ba7
test dword [ebp - 0x14], 0x3000
mov dword [edi + 0x30], 1
je 0x406c03
call fcn.00415230
cmp esi, dword [eax + 0x1de0]
jge 0x406bd6
mov eax, esi
jmp 0x406be1
call fcn.00415230
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.004060b0
jmp 0x406c83
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x406c17
lea ecx, [ebp - 8]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
jmp 0x406c22
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 0x406c6b
test ecx, ecx
jl 0x406c4c
jg 0x406c3e
cmp eax, 0xbebc200
jbe 0x406c4c
mov edx, 0xbebc200
mov dword [ebp - 8], 0
jmp 0x406c51
mov edx, eax
mov dword [ebp - 8], ecx
cmp esi, edx
jg 0x406c6b
test ecx, ecx
jl 0x406c69
jg 0x406c62
cmp eax, 0xbebc200
jbe 0x406c69
mov esi, 0xbebc200
jmp 0x406c6b
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.00442d35
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.004380f8
mov esp, ebp
pop ebp
ret