Function at 0x409040
Capabilities:
Get file size

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41ea58
mov eax, dword fs:[0]
push eax
sub esp, 0x294
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [ebp + 8]
lea esi, [ebp + 0x10]
mov ecx, 0x96
mov dword [ebp - 0x29c], ebx
lea edi, [ebp - 0x290]
mov byte [ebp - 0x291], 0
rep movsd dword es:[edi], dword [esi]
or edi, 0xffffffff
test ebx, ebx
jne 0x4090aa
push str.Cant_write_to_disk_no_protocol_passed_in._n
call fcn.0040b79b
add esp, 4
lea eax, [ebx + 0x57]
jmp 0x4092af
mov ecx, str.ZERO
lea eax, [ebp - 0x240]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x4090db
test dx, dx
je 0x4090d7
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x4090db
add eax, 4
add ecx, 4
test dx, dx
jne 0x4090b5
xor eax, eax
jmp 0x4090e0
sbb eax, eax
or eax, 1
test eax, eax
jne 0x4090f6
push str.Zeroing_out_area_n
call fcn.0040b79b
add esp, 4
jmp 0x40923b
mov byte [ebp - 0x14], 0
lea eax, [ebp - 0x240]
mov dword [ebp - 4], 0
push eax
lea ecx, [ebp - 0x34]
call fcn.0040ade0
test eax, eax
jne 0x409147
push dword [ebp - 0x284]
mov eax, dword [ebx + 0x22c]
push dword [ebp - 0x288]
cdq
push edx
push eax
mov byte [ebp - 0x291], 1
call fcn.00415a10
push edx
push eax
push ebx
lea ecx, [ebp - 0x34]
call fcn.0040ae70
mov esi, eax
jmp 0x409218
push str._nSparse_image_not_detected____loading_binary_n
call fcn.0040b79b
add esp, 4
lea eax, [ebp - 0x240]
push 0
push 0x80
push 3
push 0
push 7
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x2a0], edi
cmp edi, 0xffffffff
jne 0x40918d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x409218
lea eax, [ebp - 0x298]
mov dword [ebp - 0x298], 0
push eax
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, dword [ebx + 0x22c]
mov ecx, eax
mov esi, dword [ebp - 0x298]
xor ebx, ebx
mov eax, edi
cdq
add ebx, eax
lea eax, [edi - 1]
not eax
adc esi, edx
add ebx, ecx
cdq
adc esi, 0
sub ebx, 1
sbb esi, 0
and ebx, eax
and esi, edx
mov eax, edi
cdq
push edx
push eax
push esi
push ebx
call fcn.0041d710
cmp edx, dword [ebp - 0x274]
jg 0x4091fd
jl 0x4091ef
cmp eax, dword [ebp - 0x278]
ja 0x4091fd
mov dword [ebp - 0x278], eax
mov dword [ebp - 0x274], edx
jmp 0x40920a
push str._nFileSize_is___partition_size__truncating_file_n
call fcn.0040b79b
add esp, 4
mov ebx, dword [ebp - 0x29c]
xor esi, esi
mov edi, dword [ebp - 0x2a0]
mov dword [ebp - 4], 0xffffffff
cmp byte [ebp - 0x14], 0
je 0x40922e
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
jne 0x4092ad
cmp byte [ebp - 0x291], 0
jne 0x4092ad
push dword [ebp - 0x274]
push dword [ebp - 0x278]
push dword [ebp - 0x284]
push dword [ebp - 0x288]
push dword [ebp - 0x27c]
push dword [ebp - 0x280]
push str.In_offset:__I64d_out_offset:__I64d_sectors:__I64d_n
call fcn.0040b79b
add esp, 0x1c
mov eax, dword [ebx]
mov ecx, ebx
push dword [ebp - 0x270]
push dword [ebp - 0x274]
push dword [ebp - 0x278]
push dword [ebp - 0x284]
push dword [ebp - 0x288]
push dword [ebx + 0x218]
push dword [ebp - 0x27c]
push dword [ebp - 0x280]
push edi
call dword [eax + 0xc]
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040b500
mov esp, ebp
pop ebp
ret 0x260