Function at 0x5412b0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x100
push ebx
push ebp
push esi
mov esi, ecx
xor ebx, ebx
push edi
mov eax, dword [esi + 0x2f4]
cmp eax, ebx
jle 0x5412e2
cmp dword [esi + 0x2dc], ebx
je 0x5412e2
cmp dword [esi + 0x2f0], eax
jge 0x5414bc
cmp eax, 1
jl 0x5412f3
cmp dword [esi + 0x2d8], ebx
jne 0x5413a1
mov eax, dword [esi + 0x2d8]
cmp eax, ebx
je 0x54130d
push eax
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
mov dword [esi + 0x2d8], ebx
mov eax, dword [esi + 0x304]
mov ecx, dword [esi + 0xd4]
push ecx
mov edx, dword [eax + 0x2c]
add eax, 0x20
push edx
push eax
push 0x5965b8
push str._s_testerhistory_s_d__d.fxt
lea eax, [esp + 0x24]
push 0xff
push eax
call dword [sym.imp.MSVCRT.dll__snprintf]
lea ecx, [esp + 0x2c]
push 0x581660
push ecx
call dword [sym.imp.MSVCRT.dll_fopen]
add esp, 0x24
cmp eax, ebx
mov dword [esi + 0x2d8], eax
jne 0x54137c
lea edx, [esp + 0x10]
push edx
push str.TestGenerator:_cannot_open_file__s
push 1
push 0x5960a0
call fcn.0046b660
add esp, 0x10
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [eax + 0x10]
push eax
call dword [sym.imp.MSVCRT.dll__filelength]
mov ecx, eax
mov eax, 0x4ec4ec4f
sub ecx, 0x2d8
add esp, 4
mul ecx
shr edx, 4
mov dword [esi + 0x2f4], edx
cmp dword [esi + 0x2dc], ebx
jne 0x54140a
mov edi, dword [esi + 0x2f4]
cmp edi, 0x2710
jle 0x5413bc
mov edi, 0x2710
lea edx, [edi + edi*2 + 3]
lea eax, [edi + edx*4 + 1]
shl eax, 2
push eax
call fcn.004c2e90
add esp, 4
cmp eax, ebx
mov dword [esi + 0x2dc], eax
jne 0x5413fe
mov dword [esi + 0x2ec], ebx
mov dword [esi + 0x2e8], ebx
mov esi, dword [esi + 0x304]
mov ecx, dword [esi + 0x2c]
add esi, 0x20
push ecx
push esi
push str.TestGenerator:_not_enough_memory_for__s_d
jmp 0x5414ad
mov dword [esi + 0x2e8], ebx
mov dword [esi + 0x2ec], edi
mov eax, dword [esi + 0x2ec]
mov ecx, dword [esi + 0x2e8]
cmp ecx, eax
jne 0x541426
cmp dword [esi + 0x2f4], eax
je 0x54154a
mov eax, dword [esi + 0x2f0]
mov ecx, dword [esi + 0x2d8]
add eax, 0xe
push ebx
lea edx, [eax + eax*2]
lea eax, [eax + edx*4]
shl eax, 2
push eax
push ecx
call dword [sym.imp.MSVCRT.dll_fseek]
add esp, 0xc
test eax, eax
je 0x541458
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [esi + 0x2f4]
mov edx, dword [esi + 0x2f0]
mov eax, dword [esi + 0x2ec]
sub edi, edx
cmp edi, eax
jle 0x541472
mov edi, eax
mov edx, dword [esi + 0x2d8]
lea eax, [edi + edi*2]
push edx
mov edx, dword [esi + 0x2dc]
lea ecx, [edi + eax*4]
push 1
shl ecx, 2
push ecx
push edx
call dword [sym.imp.MSVCRT.dll_fread]
add esp, 0x10
cmp eax, 1
je 0x5414c6
mov esi, dword [esi + 0x304]
mov eax, dword [esi + 0x2c]
add esi, 0x20
push eax
push esi
push str.TestGenerator:_error_reading_file_for__s_d
push 1
push 0x5960a0
call fcn.0046b660
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x2dc]
cmp edi, ebx
mov dword [esi + 0x2e8], edi
jle 0x54154a
lea ecx, [eax + 4]
fld qword [ecx]
fcomp qword [ecx + 8]
fnstsw ax
test ah, 1
jne 0x541582
fld qword [ecx]
fcomp qword [ecx + 0x10]
fnstsw ax
test ah, 0x41
je 0x541582
fld qword [ecx]
fcomp qword [0x565ac0]
fnstsw ax
test ah, 0x41
jne 0x541582
fld qword [ecx + 0x18]
fcomp qword [0x565ac0]
fnstsw ax
test ah, 0x41
jne 0x541582
fld qword [ecx + 0x18]
fcomp qword [ecx + 8]
fnstsw ax
test ah, 1
jne 0x541582
fld qword [ecx + 0x18]
fcomp qword [ecx + 0x10]
fnstsw ax
test ah, 0x41
je 0x541582
fld qword [ecx + 0x20]
fcomp qword [0x565ac0]
fnstsw ax
test ah, 0x41
jne 0x541582
dec edi
add ecx, 0x34
cmp edi, ebx
jg 0x5414d9
mov edi, dword [esi + 0x310]
mov eax, dword [esi + 0x2e8]
mov ecx, dword [esi + 0x2dc]
cmp edi, ebx
mov dword [esi + 0x2f8], ecx
lea edx, [eax + eax*2]
jne 0x5415b4
lea eax, [eax + edx*4]
lea ecx, [ecx + eax*4]
mov eax, 1
mov dword [esi + 0x2fc], ecx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x304]
mov ecx, dword [eax + 0x2c]
add eax, 0x20
push ecx
push eax
push str.TestGenerator:_invalid_file_for__s_d
push 1
push 0x5960a0
call fcn.0046b660
add esp, 0x14
mov dword [esi + 0x2e8], ebx
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
lea edx, [eax + edx*4]
mov ebp, dword [ecx + edx*4 - 8]
lea edx, [ecx + edx*4]
cmp ebp, edi
jge 0x5415d5
mov dword [esi + 0x2fc], edx
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
xor edx, edx
cmp eax, ebx
mov dword [esi + 0x2fc], ecx
jle 0x5415fa
mov ecx, dword [esi + 0x2fc]
cmp dword [ecx + 0x2c], edi
jge 0x5415fa
inc edx
add ecx, 0x34
cmp edx, eax
mov dword [esi + 0x2fc], ecx
jl 0x5415e1
pop edi
mov eax, 1
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret