Function at 0x405201
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
xor ecx, ecx
push esi
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], ecx
push edi
test esi, esi
jne 0x405251
mov ebx, 0x80070057
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
push ebx
push 0x269
push edi
mov esi, ebx
call fcn.0040129e
push str.Invalid_argument_pcbDest
push ebx
push 0x13
push 5
push 0x269
push edi
call fcn.004012a1
add esp, 0x18
jmp 0x40567c
mov edi, dword [ebp + 8]
test edi, edi
jne 0x405281
mov ebx, 0x80070057
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
push ebx
push 0x26a
push edi
mov esi, ebx
call fcn.0040129e
push str.Invalid_argument_ppbDest
push ebx
push 0x13
push 5
push 0x26a
jmp 0x405243
mov ebx, dword [ebp + 0x10]
test ebx, ebx
jne 0x4052b1
mov ebx, 0x80070057
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
push ebx
push 0x26b
push edi
mov esi, ebx
call fcn.0040129e
push str.Invalid_argument_wzSrcPath
push ebx
push 0x13
push 5
push 0x26b
jmp 0x405243
xor eax, eax
cmp ax, word [ebx]
jne 0x4052e4
mov ebx, 0x80070057
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
push ebx
push 0x26c
push edi
mov esi, ebx
call fcn.0040129e
push str.wzSrcPath_is_null
push ebx
push 0x13
push 5
push 0x26c
jmp 0x405243
push ecx
push 0x8000080
push 3
push ecx
push dword [ebp + 0x24]
push SysReAllocString
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x14], eax
cmp eax, 0xffffffff
jne 0x405379
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
cmp esi, 3
je 0x405363
cmp esi, 2
je 0x405363
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40532d
movzx esi, si
or esi, 0x80070000
test esi, esi
js 0x405334
mov esi, 0x80004005
push esi
push 0x276
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
push edi
call fcn.0040129e
push ebx
push str.Failed_to_open_file:__ls
push esi
push 0x13
push 5
push 0x276
push edi
call fcn.004012a1
add esp, 0x1c
jmp 0x40567c
test esi, esi
jle 0x40567c
movzx esi, si
or esi, 0x80070000
jmp 0x40567c
lea ecx, [ebp - 0x20]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x4053d5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40539f
movzx esi, si
or esi, 0x80070000
test esi, esi
js 0x4053a6
mov esi, 0x80004005
push esi
push 0x27b
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
push edi
call fcn.0040129e
push ebx
push str.Failed_to_get_size_of_file:__ls
push esi
push 0x13
push 5
push 0x27b
push edi
call fcn.004012a1
add esp, 0x1c
jmp 0x405673
cmp dword [ebp + 0x14], 0
je 0x405472
mov eax, dword [ebp + 0x18]
xor ecx, ecx
cmp ecx, dword [ebp - 0x1c]
jl 0x405422
jg 0x4053f0
cmp eax, dword [ebp - 0x20]
jbe 0x405422
push dword [ebp - 0x1c]
mov ebx, 0x80070057
push dword [ebp - 0x20]
mov esi, ebx
push dword [ebp + 0x10]
push eax
push str.Start_position__d_bigger_than_file__ls_size__llu
push ebx
push 0x13
push 5
push 0x283
push str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
call fcn.004012a1
add esp, 0x28
jmp 0x405673
push 1
push ecx
push eax
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x405479
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40544b
movzx esi, si
or esi, 0x80070000
test esi, esi
jns 0x405476
push esi
mov ebx, 0x289
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
push ebx
push edi
call fcn.0040129e
push dword [ebp + 0x18]
push str.Failed_to_seek_position__d
push esi
push 0x13
push 5
push ebx
jmp 0x4053c7
xor eax, eax
jmp 0x40547c
mov esi, dword [ebp + 0xc]
mov eax, dword [ebp + 0x18]
cmp dword [ebp + 0x20], 0
je 0x4054a9
mov ecx, dword [ebp + 0x1c]
mov dword [ebp - 0x10], ecx
cmp dword [edi], 0
je 0x405532
test ecx, ecx
jne 0x4054f2
push dword [edi]
call fcn.0040758b
xor eax, eax
mov dword [edi], eax
mov dword [esi], eax
mov esi, eax
jmp 0x405673
mov edx, dword [ebp - 0x20]
mov ecx, edx
sub ecx, eax
sub edx, eax
mov eax, dword [ebp - 0x1c]
sbb eax, 0
mov dword [ebp - 0x10], ecx
cmp dword [ebp - 0x18], eax
jg 0x405488
jl 0x4054c7
cmp dword [ebp + 0x1c], edx
jae 0x405488
mov esi, 0x8007007a
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
push esi
push 0x29b
push edi
call fcn.0040129e
push ebx
push str.Failed_to_load_file:__ls__too_large.
push esi
push 0x13
push 5
push 0x29b
jmp 0x4053c7
push 1
push ecx
push dword [edi]
call fcn.00407684
mov edi, eax
mov dword [ebp - 4], edi
test edi, edi
jne 0x40557b
mov eax, 0x8007000e
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
push eax
push 0x2a9
push edi
mov esi, eax
call fcn.0040129e
push ebx
push str.Failed_to_re_allocate_memory_to_read_in_file:__ls
push esi
push 0x13
push 5
push 0x2a9
jmp 0x4053c7
test ecx, ecx
jne 0x40553d
xor eax, eax
jmp 0x4054a0
push 1
push ecx
call fcn.004073cd
mov edi, eax
mov dword [ebp - 4], eax
test edi, edi
jne 0x40557b
mov eax, 0x8007000e
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
push eax
push 0x2b6
push edi
mov esi, eax
call fcn.0040129e
push ebx
push str.Failed_to_allocate_memory_to_read_in_file:__ls
push esi
push 0x13
push 5
push 0x2b6
jmp 0x4053c7
xor ecx, ecx
mov eax, ecx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], eax
jmp 0x405589
xor ecx, ecx
mov dword [ebp - 0x18], ecx
lea ecx, [ebp - 0x18]
push ecx
push eax
push dword [ebp - 0x10]
call fcn.00404786
mov esi, eax
test esi, esi
js 0x40564a
mov ecx, dword [ebp - 8]
xor eax, eax
push eax
lea eax, [ebp - 0xc]
add ecx, edi
push eax
push dword [ebp - 0x18]
push ecx
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x405608
mov eax, dword [ebp - 8]
add eax, dword [ebp - 0xc]
cmp dword [ebp - 0xc], 0
mov dword [ebp - 8], eax
jne 0x405587
mov ecx, dword [ebp - 0x10]
cmp eax, ecx
je 0x4055fa
push ebx
push str.Failed_to_completely_read_file:__ls
mov esi, 0x8000ffff
push esi
push 0x13
push 5
push 0x2cc
push str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
call fcn.004012a1
add esp, 0x1c
jmp 0x405666
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
mov dword [eax], edi
xor eax, eax
mov dword [edx], ecx
jmp 0x405669
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x40561f
movzx esi, si
or esi, 0x80070000
test esi, esi
js 0x405626
mov esi, 0x80004005
push esi
push 0x2c3
mov edi, str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
push edi
call fcn.0040129e
push ebx
push str.Failed_to_read_from_file:__ls
push esi
push 0x13
push 5
push 0x2c3
push edi
jmp 0x4055f0
push str.Underflow_calculating_remaining_buffer_size.
push esi
push 0x13
push 5
push 0x2bf
push str.d:_awixwix_srclibsdutilwixtoolset.dutil_fileutil.cpp
call fcn.004012a1
add esp, 0x18
mov eax, dword [ebp - 4]
test eax, eax
je 0x405673
push eax
call fcn.0040758b
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret 0x20