Function at 0x408d40
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [0x4a9bf0]
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 0x47ff2c
push ebx
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x1c], 0
call fcn.00466b72
add esp, 0xc
test eax, eax
jne 0x408e55
add esi, 0x10000
cmp edi, 3
je 0x408db0
cmp edi, 4
jne 0x408dd0
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 0x408df3
cmp dword [ebp - 0x18], 3
je 0x408e39
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 0x408e39
mov eax, 0x2000
jmp 0x408df8
mov eax, 0x1000
or eax, dword [ebp - 0x14]
mov dword [ebp - 0x18], eax
call fcn.0041fd60
cmp esi, dword [eax + 0x1de0]
jge 0x408e0f
mov eax, esi
jmp 0x408e1a
call fcn.0041fd60
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 0x408e4d
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.0046300c
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
jmp 0x408e72
push 0
push dword [ebp - 0x14]
push edi
push dword [ebp - 0x10]
push dword [ebp - 8]
push dword [ebp - 0x20]
push ebx
call fcn.00409250
mov edi, eax
add esp, 0x1c
mov dword [ebp - 0x10], edi
cmp edi, 0xffffffff
je 0x408e39
test esi, esi
jns 0x408e86
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.0046dc45
mov edi, eax
add esp, 4
test edi, edi
je 0x408eae
push 0x58
push 0
push edi
call fcn.00464960
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 0x408ec0
sub ecx, edx
lea eax, [ecx + 1]
push eax
call fcn.0046dc45
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 0x408ed7
test dword [ebp - 0x14], 0x3000
mov dword [edi + 0x30], 1
je 0x408f33
call fcn.0041fd60
cmp esi, dword [eax + 0x1de0]
jge 0x408f06
mov eax, esi
jmp 0x408f11
call fcn.0041fd60
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.004083a0
jmp 0x408fb3
mov eax, dword [ebp - 0x10]
test eax, eax
je 0x408f47
lea ecx, [ebp - 8]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
jmp 0x408f52
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 0x408f9b
test ecx, ecx
jl 0x408f7c
jg 0x408f6e
cmp eax, 0xbebc200
jbe 0x408f7c
mov edx, 0xbebc200
mov dword [ebp - 8], 0
jmp 0x408f81
mov edx, eax
mov dword [ebp - 8], ecx
cmp esi, edx
jg 0x408f9b
test ecx, ecx
jl 0x408f99
jg 0x408f92
cmp eax, 0xbebc200
jbe 0x408f99
mov esi, 0xbebc200
jmp 0x408f9b
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.0046dc45
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.0046300c
mov esp, ebp
pop ebp
ret