Function at 0x502040
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x55aa43
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xf8
push ebx
push esi
mov ebx, ecx
push edi
lea ecx, [ebp - 0x104]
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x20], ebx
mov dword [ebp - 4], 0
call fcn.005014f0
mov dword [ebp - 0x24], 0x55f220
mov eax, dword [ebx + 0x1c]
mov byte [ebp - 4], 2
test eax, eax
jg 0x50209d
jl 0x5021e5
cmp dword [ebx + 0x18], 0x14
jb 0x5021e5
mov edx, dword [ebx + 0xc]
lea eax, [ebp - 0x14]
push 0
push eax
lea ecx, [ebp - 0x88]
push 0x14
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x5023b4
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x5023b4
sub esp, 0x14
mov ecx, 5
lea esi, [ebp - 0x88]
mov edi, esp
rep movsd dword es:[edi], dword [esi]
lea ecx, [ebp - 0x104]
call fcn.00501810
mov esi, eax
test esi, esi
jbe 0x5023c7
mov edx, dword [ebx + 0x1c]
xor eax, eax
lea ecx, [esi + 0x14]
cmp eax, edx
mov dword [ebp - 0x18], ecx
jl 0x50210e
jg 0x5021e5
cmp ecx, dword [ebx + 0x18]
ja 0x5021e5
push esi
call fcn.005380a1
mov edi, eax
add esp, 4
test edi, edi
jne 0x50212e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.new_operator_failed_in_CFormatParsing::PreCheckAvi____lastError__ld_r_n
jmp 0x5023c0
mov ecx, dword [ebx + 0xc]
lea eax, [ebp - 0x14]
push 0
push eax
push esi
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x502396
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x502396
lea edx, [ebp - 0xc8]
lea eax, [ebp - 0x100]
push edx
push eax
push esi
push edi
lea ecx, [ebp - 0x104]
call fcn.005016d0
push edi
call fcn.005380ca
mov edi, dword [ebp - 0x18]
mov ecx, dword [ebx + 0x1c]
xor eax, eax
add esp, 4
add edi, 8
cmp eax, ecx
jl 0x50218d
jg 0x5021e5
cmp edi, dword [ebx + 0x18]
ja 0x5021e5
mov eax, dword [ebx + 0xc]
lea ecx, [ebp - 0x14]
push 0
push ecx
lea edx, [ebp - 0x74]
push 8
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x5023b4
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x5023b4
mov ecx, dword [ebp - 0x70]
mov edx, dword [ebp - 0x74]
push ecx
push edx
lea ecx, [ebp - 0x104]
call fcn.00501870
mov esi, eax
test esi, esi
jbe 0x502273
mov ecx, dword [ebx + 0x1c]
xor eax, eax
add edi, esi
cmp eax, ecx
jl 0x502214
jg 0x5021e5
cmp edi, dword [ebx + 0x18]
jbe 0x502214
mov ebx, dword [ebx + 0x10]
lea ecx, [ebp - 0x104]
neg ebx
sbb ebx, ebx
mov byte [ebp - 4], 0
and ebx, 0xfffffffe
add ebx, 3
call fcn.00501530
mov eax, ebx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push esi
call fcn.005380a1
mov edi, eax
add esp, 4
test edi, edi
jne 0x502234
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.new_operator_failed_in_CFormatParsing::PreCheckAvi____lastError__ld_r_n
jmp 0x5023c0
mov ecx, dword [ebx + 0xc]
lea eax, [ebp - 0x14]
push 0
push eax
push esi
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x502396
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x502396
push 0
push 0
push esi
push edi
lea ecx, [ebp - 0x104]
call fcn.005016d0
push edi
call fcn.005380ca
add esp, 4
mov al, byte [ebp - 0x46]
test al, al
je 0x5023c7
mov al, byte [ebp - 0x47]
test al, al
je 0x5023c7
fld dword [ebp - 0x68]
call fcn.0051ca44
mov edi, edx
mov esi, eax
test edi, edi
jg 0x5022af
jl 0x50229f
test esi, esi
jae 0x5022af
mov edx, dword [0x5bb0f8]
lea eax, [ebp - 0x44]
push edx
push eax
jmp 0x50234a
push 0
push 0x3c
push edi
push esi
call fcn.0051e2c0
mov dword [ebp - 0x18], eax
mov ecx, esi
cdq
sub ecx, eax
mov eax, edi
sbb eax, edx
push 0
push 0x3c
push eax
push ecx
call fcn.0051e210
push 0
push 0x3c
push edx
push eax
call fcn.0051e2c0
push 0
push 0xe10
push edi
push esi
mov dword [ebp - 0x1c], eax
call fcn.0051e210
test edx, edx
jg 0x502341
jl 0x5022fa
cmp eax, 0x2710
ja 0x502341
test eax, eax
je 0x50230b
mov ecx, dword [ebp - 0x1c]
mov edx, dword [0x5bb150]
push ecx
push eax
jmp 0x50231d
mov eax, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x18]
test eax, eax
push ecx
je 0x50232c
mov edx, dword [0x5bb14c]
push eax
lea eax, [ebp - 0x44]
push edx
push eax
call fcn.0051d0e8
add esp, 0x10
jmp 0x502352
mov edx, dword [0x5bb148]
lea eax, [ebp - 0x44]
push edx
push eax
call fcn.0051d0e8
add esp, 0xc
jmp 0x502352
lea ecx, [ebp - 0x44]
push 0x597d04
push ecx
call fcn.0051d0e8
add esp, 8
mov eax, dword [ebp - 0x6c]
mov ecx, dword [ebp - 0x60]
lea edx, [ebp - 0x44]
add ebx, 8
push edx
mov edx, dword [ebp - 0x64]
push eax
mov eax, dword [0x5bb1bc]
push ecx
push edx
push eax
push ebx
call fcn.0053091a
add esp, 0x18
lea ecx, [ebp - 0x104]
mov byte [ebp - 4], 0
call fcn.00501530
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ReadFile___error__ld_in_CFormatParsing::PreCheckAvi___r_n
mov ecx, ebx
call fcn.00503310
push edi
call fcn.005380ca
add esp, 4
jmp 0x5023c7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ReadFile___error__ld_in_CFormatParsing::PreCheckAvi___r_n
mov ecx, ebx
call fcn.00503310
lea ecx, [ebp - 0x104]
mov byte [ebp - 4], 0
call fcn.00501530
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov eax, 1
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret