Function at 0x522250
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov edx, dword [ebp + 8]
push ebx
push esi
xor ebx, ebx
mov esi, dword [edx + 0x108]
push edi
mov dword [ebp - 0x1c], esi
mov edi, dword [esi + 0x94]
mov dword [ebp - 0xc], ebx
cmp dword [edx + 0x100], ebx
jne 0x521fe3
mov eax, dword [0x801448]
test eax, eax
je 0x5222b8
mov eax, dword [eax + 0x14]
test eax, eax
je 0x5222b8
push str.FDLRead:_Given_file_not_open
call eax
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [edx + 0x110]
test cl, 1
jne 0x522019
mov eax, dword [0x801448]
test eax, eax
je 0x5222b8
mov eax, dword [eax + 0x14]
test eax, eax
je 0x5222b8
push str.FDLRead:_Given_file_not_open_for_reading
call eax
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
test cl, 0x20
je 0x522049
mov eax, dword [0x801448]
test eax, eax
je 0x5222b8
mov eax, dword [eax + 0x14]
test eax, eax
je 0x5222b8
push str.FDLRead:_Current_record_was_returned_by_FDLReturnProem
call eax
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x98]
mov esi, dword [esi + 0x88]
and eax, 2
mov dword [ebp - 8], eax
test cl, 0x10
je 0x5223f6
mov dword [ebp - 0x14], ebx
test esi, esi
jle 0x52235c
lea ebx, [edi + 0x4c]
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
test eax, eax
jne 0x5222c1
mov eax, dword [ebx + 0x20]
test al, 2
jne 0x5222c1
cmp byte [ebx - 0xc], 0x43
jne 0x522135
push dword [edx + 0x100]
lea eax, [ebp - 0xc]
push 1
push 2
push eax
call edi
add esp, 0x10
test eax, eax
je 0x522288
lea edx, [ebp - 0xc]
lea esi, [ebp - 0xb]
mov al, byte [esi]
mov cl, byte [edx]
mov byte [edx], al
inc edx
mov byte [esi], cl
dec esi
cmp edx, esi
jb 0x5220b6
mov eax, dword [ebp - 0xc]
test ax, ax
je case.0x5221f4.69
mov edi, dword [ebp + 8]
movsx esi, ax
mov eax, dword [ebx - 8]
movzx edx, ax
mov ecx, edx
mov dword [ebp - 0x18], ecx
mov ecx, dword [edi + 0x100]
push ecx
push 1
cmp esi, eax
jle 0x522117
sub esi, eax
mov eax, edx
mov dword [ebp - 0xc], eax
cwde
push eax
mov eax, dword [ebx]
add eax, dword [ebp + 0xc]
push eax
mov eax, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
call eax
add esp, 0x10
test eax, eax
je 0x52228b
push 1
push esi
jmp 0x5222fc
mov eax, dword [ebx]
add eax, dword [ebp + 0xc]
push esi
push eax
mov eax, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
call eax
add esp, 0x10
test eax, eax
je 0x52228b
jmp case.0x5221f4.69
test al, 4
je 0x522269
mov eax, dword [ebx - 8]
mov ecx, dword [0x801448]
lea esi, [eax + 0x100]
cmp dword [ecx + 8], esi
jge 0x52217d
push 0x7dd
push str.C:Development_flameskernelutil_fdb_fdl.c
push esi
push 1
push dword [ecx + 4]
push dword [ecx]
call sym.FLAMESLauncher.exe_MXV01Resize
mov ecx, dword [0x801448]
add esp, 0x18
mov edx, dword [ebp + 8]
mov dword [ecx + 4], eax
mov dword [ecx + 8], esi
mov eax, dword [ebx - 8]
push dword [edx + 0x100]
push 1
push eax
push dword [ecx + 4]
call edi
add esp, 0x10
test eax, eax
je 0x522288
cmp byte [ebx - 0xc], 0x42
je 0x5221dd
xor edi, edi
cmp dword [ebx - 4], edi
jbe 0x5221dd
mov ecx, dword [0x801448]
nop dword [eax]
mov edx, dword [ebx - 8]
imul edx, edi
add edx, dword [ecx + 4]
lea esi, [edx - 1]
add esi, dword [ebx - 8]
cmp edx, esi
jae 0x5221d7
mov al, byte [esi]
mov cl, byte [edx]
mov byte [edx], al
inc edx
mov byte [esi], cl
dec esi
cmp edx, esi
jb 0x5221c3
mov ecx, dword [0x801448]
inc edi
cmp edi, dword [ebx - 4]
jb 0x5221b0
movsx eax, byte [ebx + 4]
add eax, 0xffffffbc
cmp eax, 0xf
ja case.0x5221f4.69
movzx eax, byte [eax + 0x52285c]
jmp dword [eax*4 + 0x522848]
mov eax, dword [0x801448]
mov ecx, dword [ebp + 0xc]
mov eax, dword [eax + 4]
movss xmm0, dword [eax]
mov eax, dword [ebx]
cvtps2pd xmm0, xmm0
movsd qword [ecx + eax], xmm0
jmp case.0x5221f4.69
mov eax, dword [0x801448]
mov ecx, dword [ebp + 0xc]
mov eax, dword [eax + 4]
movsd xmm0, qword [eax]
mov eax, dword [ebx]
cvtpd2ps xmm0, xmm0
movss dword [ecx + eax], xmm0
jmp case.0x5221f4.69
mov eax, dword [0x801448]
mov edx, dword [ebp + 0xc]
mov eax, dword [eax + 4]
movsx ecx, word [eax]
mov eax, dword [ebx]
mov dword [edx + eax], ecx
jmp case.0x5221f4.69
mov eax, dword [0x801448]
mov ecx, dword [ebx]
mov edx, dword [ebp + 0xc]
mov eax, dword [eax + 4]
mov ax, word [eax]
mov word [edx + ecx], ax
jmp case.0x5221f4.69
push dword [edx + 0x100]
mov eax, dword [ebx]
push dword [ebx - 4]
add eax, dword [ebp + 0xc]
push dword [ebx - 8]
push eax
call edi
add esp, 0x10
test eax, eax
jne case.0x5221f4.69
mov edi, dword [ebp + 8]
push edi
push str.FDLRead:_Error_reading_file__s
push 0x801450
call fcn.004f9620
mov eax, dword [0x801448]
add esp, 0xc
test eax, eax
je 0x5222b8
mov eax, dword [eax + 0x14]
test eax, eax
je 0x5222b8
push 0x801450
call eax
add esp, 4
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
cmp byte [ebx - 0xc], 0x43
jne 0x522316
push dword [edx + 0x100]
lea eax, [ebp - 0xc]
push 1
push 2
push eax
call edi
add esp, 0x10
test eax, eax
je 0x522288
lea edx, [ebp - 0xc]
lea esi, [ebp - 0xb]
mov al, byte [esi]
mov cl, byte [edx]
mov byte [edx], al
inc edx
mov byte [esi], cl
dec esi
cmp edx, esi
jb 0x5222e4
movsx eax, word [ebp - 0xc]
mov edi, dword [ebp + 8]
push 1
push eax
push dword [edi + 0x100]
mov eax, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
call eax
add esp, 0xc
test eax, eax
jne 0x52228b
jmp case.0x5221f4.69
mov eax, dword [ebx - 8]
imul eax, dword [ebx - 4]
push 1
push eax
push dword [edx + 0x100]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fseek]
add esp, 0xc
test eax, eax
jne 0x522288
mov eax, dword [ebp - 0x1c]
add ebx, 0x70
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
inc ecx
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
cmp ecx, dword [eax + 0x88]
mov eax, dword [ebp - 8]
mov dword [ebp - 0x14], ecx
jl 0x522078
test eax, eax
jne 0x5223ea
mov eax, dword [edx + 0x108]
mov ebx, dword [eax + 0x90]
mov ecx, dword [eax + 0x84]
mov dword [ebp + 8], ecx
test ebx, ebx
jne 0x52238c
mov ecx, dword [eax + 0x88]
mov ebx, dword [eax + 0x94]
mov dword [ebp + 8], ecx
test ecx, ecx
jle 0x5223ea
add ebx, 0x40
test byte [ebx + 0x2c], 6
jne 0x5223df
mov al, byte [ebx]
cmp al, 0x42
je 0x5223df
cmp al, 0x43
je 0x5223df
xor edi, edi
cmp dword [ebx + 8], edi
jbe 0x5223df
mov ecx, dword [ebp + 0xc]
nop dword [eax]
mov edx, dword [ebx + 4]
imul edx, edi
add edx, dword [ebx + 0xc]
add edx, ecx
lea esi, [edx - 1]
add esi, dword [ebx + 4]
cmp edx, esi
jae 0x5223d6
mov al, byte [esi]
mov cl, byte [edx]
mov byte [edx], al
inc edx
mov byte [esi], cl
dec esi
cmp edx, esi
jb 0x5223c5
mov ecx, dword [ebp + 0xc]
inc edi
cmp edi, dword [ebx + 8]
jb 0x5223b0
mov ecx, dword [ebp + 8]
add ebx, 0x70
sub ecx, 1
mov dword [ebp + 8], ecx
jne 0x522393
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0x18], ebx
test esi, esi
jle 0x5223ea
lea esi, [edi + 0x6c]
movsx eax, byte [esi - 0x2c]
mov edi, dword [esi - 0x24]
add eax, 0xffffffbe
cmp eax, 0x16
ja case.0x522416.69
movzx eax, byte [eax + 0x522894]
jmp dword [eax*4 + 0x52286c]
mov dword [ebp - 0x14], 0
test edi, edi
jle case.0x522416.69
nop dword [eax + eax]
lea eax, [ebp - 0x30]
push eax
push str.__lf
push dword [edx + 0x100]
call fcn.004feff0
add esp, 0xc
mov ebx, eax
cmp dword [ebp - 8], 0
jne 0x52246a
test byte [esi], 2
jne 0x52246a
mov ecx, dword [esi - 0x20]
mov eax, dword [ebp - 0x14]
movsd xmm0, qword [ebp - 0x30]
lea ecx, [ecx + eax*8]
mov eax, dword [ebp + 0xc]
movsd qword [ecx + eax], xmm0
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
inc ecx
mov dword [ebp - 0x14], ecx
cmp ecx, edi
jl 0x522430
test ebx, ebx
je 0x522288
mov edi, dword [ebp + 8]
cmp ebx, 0xffffffff
je 0x52228b
mov ecx, dword [ebp - 0x18]
add esi, 0x70
mov eax, dword [ebp - 0x1c]
inc ecx
mov edx, dword [ebp + 8]
mov dword [ebp - 0x18], ecx
cmp ecx, dword [eax + 0x88]
jl 0x522400
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0x14], 0
test edi, edi
jle case.0x522416.69
nop
lea eax, [ebp - 0x20]
push eax
push 0x5a010c
push dword [edx + 0x100]
call fcn.004feff0
add esp, 0xc
mov ebx, eax
cmp dword [ebp - 8], 0
jne 0x5224fa
test byte [esi], 2
jne 0x5224fa
mov eax, dword [esi - 0x20]
mov ecx, dword [ebp - 0x14]
movss xmm0, dword [ebp - 0x20]
lea eax, [eax + ecx*4]
mov ecx, dword [ebp + 0xc]
movss dword [eax + ecx], xmm0
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
inc eax
mov dword [ebp - 0x14], eax
cmp eax, edi
jl 0x5224c0
jmp case.0x522416.69
mov dword [ebp - 0x14], 0
test edi, edi
jle case.0x522416.69
nop dword [eax]
lea eax, [ebp - 0x30]
push eax
push str.__lf
push dword [edx + 0x100]
call fcn.004feff0
add esp, 0xc
mov ebx, eax
cmp dword [ebp - 8], 0
jne 0x52255a
test byte [esi], 2
jne 0x52255a
mov eax, dword [esi - 0x20]
mov ecx, dword [ebp - 0x14]
movsd xmm0, qword [ebp - 0x30]
lea eax, [eax + ecx*8]
mov ecx, dword [ebp + 0xc]
movsd qword [eax + ecx], xmm0
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
inc eax
mov dword [ebp - 0x14], eax
cmp eax, edi
jl 0x522520
jmp case.0x522416.69
mov dword [ebp - 0x14], 0
test edi, edi
jle case.0x522416.69
nop dword [eax]
lea eax, [ebp - 0x24]
push eax
push 0x5a0118
push dword [edx + 0x100]
call fcn.004feff0
add esp, 0xc
mov ebx, eax
cmp dword [ebp - 8], 0
jne 0x5225b6
test byte [esi], 2
jne 0x5225b6
mov eax, dword [esi - 0x20]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp + 0xc]
lea ecx, [eax + ecx*4]
mov eax, dword [ebp - 0x24]
mov dword [ecx + edx], eax
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
inc eax
mov dword [ebp - 0x14], eax
cmp eax, edi
jl 0x522580
jmp case.0x522416.69
mov dword [ebp - 0x14], 0
test edi, edi
jle case.0x522416.69
nop dword [eax + eax]
lea eax, [ebp - 4]
push eax
push str.__hd
push dword [edx + 0x100]
call fcn.004feff0
add esp, 0xc
mov ebx, eax
cmp dword [ebp - 8], 0
jne 0x522618
test byte [esi], 2
jne 0x522618
mov eax, dword [esi - 0x20]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp + 0xc]
lea ecx, [eax + ecx*2]
mov ax, word [ebp - 4]
mov word [ecx + edx], ax
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
inc eax
mov dword [ebp - 0x14], eax
cmp eax, edi
jl 0x5225e0
jmp case.0x522416.69
mov dword [ebp - 0x14], 0
test edi, edi
jle case.0x522416.69
nop word [eax + eax]
lea eax, [ebp - 0x28]
push eax
push str.__lX
push dword [edx + 0x100]
call fcn.004feff0
add esp, 0xc
mov ebx, eax
cmp dword [ebp - 8], 0
jne 0x522676
test byte [esi], 2
jne 0x522676
mov eax, dword [esi - 0x20]
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp + 0xc]
lea ecx, [eax + ecx*4]
mov eax, dword [ebp - 0x28]
mov dword [ecx + edx], eax
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
inc eax
mov dword [ebp - 0x14], eax
cmp eax, edi
jl 0x522640
jmp case.0x522416.69
mov dword [ebp - 0x14], 0
test edi, edi
jle case.0x522416.69
nop dword [eax + eax]
lea eax, [ebp - 4]
push eax
push str.__hd
push dword [edx + 0x100]
call fcn.004feff0
add esp, 0xc
mov ebx, eax
cmp dword [ebp - 8], 0
jne 0x5226d3
test byte [esi], 2
jne 0x5226d3
mov ecx, dword [esi - 0x20]
add ecx, dword [ebp - 0x14]
mov edx, dword [ebp + 0xc]
mov al, byte [ebp - 4]
mov byte [ecx + edx], al
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
inc eax
mov dword [ebp - 0x14], eax
cmp eax, edi
jl 0x5226a0
jmp case.0x522416.69
mov eax, dword [0x801448]
mov eax, dword [eax + 4]
mov byte [eax], 0
lea eax, [ebp - 0x10]
push eax
push 0x5a0100
push dword [edx + 0x100]
call fcn.004feff0
mov edi, dword [ebp + 8]
mov ebx, eax
push 0x5c5ae0
push dword [edi + 0x100]
call fcn.004feff0
mov ecx, dword [ebp - 0x10]
add esp, 0x14
mov edx, dword [0x801448]
lea eax, [ecx + 0x100]
mov dword [ebp - 0x14], eax
cmp dword [edx + 8], eax
jge 0x522760
push 0x7dd
push str.C:Development_flameskernelutil_fdb_fdl.c
push eax
push 1
push dword [edx + 4]
push dword [edx]
call sym.FLAMESLauncher.exe_MXV01Resize
mov edx, dword [0x801448]
add esp, 0x18
mov dword [edx + 4], eax
mov eax, dword [ebp - 0x14]
mov dword [edx + 8], eax
mov ecx, dword [ebp - 0x10]
test ebx, ebx
je 0x522783
push dword [edi + 0x100]
mov eax, dword [0x801448]
push 1
push ecx
push dword [eax + 4]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
mov ecx, dword [ebp - 0x10]
add esp, 0x10
mov ebx, eax
cmp ecx, dword [esi - 0x28]
cmovge ecx, dword [esi - 0x28]
cmp dword [ebp - 8], 0
mov dword [ebp - 0x10], ecx
jne 0x5227c4
test byte [esi], 2
jne 0x5227c4
mov eax, dword [0x801448]
mov edi, dword [ebp + 0xc]
push ecx
push dword [eax + 4]
mov eax, dword [esi - 0x20]
add eax, edi
push eax
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncpy]
mov ecx, dword [ebp - 0x10]
add esp, 0xc
cmp ecx, dword [esi - 0x28]
jge 0x5227c4
mov eax, dword [esi - 0x20]
add eax, ecx
mov byte [eax + edi], 0
test ebx, ebx
jne 0x522480
mov ebx, 1
jmp 0x52248c
mov ecx, dword [0x801448]
mov eax, dword [ecx + 4]
mov byte [eax], 0
push dword [ecx + 4]
push str.___:_
push dword [edx + 0x100]
call fcn.004feff0
mov edi, dword [ebp + 8]
mov ebx, eax
push 0x5c5ae0
push dword [edi + 0x100]
call fcn.004feff0
add esp, 0x14
cmp dword [ebp - 8], 0
jne 0x522834
test byte [esi], 2
jne 0x522834
mov eax, dword [0x801448]
mov ecx, dword [esi - 0x20]
add ecx, dword [ebp + 0xc]
mov edx, dword [eax + 4]
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x522826
test ebx, ebx
jne 0x522483
mov ebx, 1
jmp 0x52248c