Function at 0x52ea60
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
lea esp, [esp]
mov edi, dword [esi + 4]
mov ecx, dword [esi + 8]
cmp edi, ecx
jb 0x52eac3
push 0
push 0
push 0x2000
lea edi, [esi + 0xc]
push edi
lea eax, [ebp - 0x10]
push eax
push 0
push 0
push 0
push dword [esi]
call dword [sym.imp.ntdll.dll_NtReadFile]
lea esp, [esp]
test eax, eax
js 0x52ed48
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x52ed48
lea ecx, [esi + 0xc]
mov dword [esi + 4], edi
add ecx, eax
mov dword [ebp - 4], edi
mov dword [esi + 8], ecx
jmp 0x52eac9
lea eax, [esi + 0xc]
mov dword [ebp - 4], eax
mov dl, byte [edi]
inc edi
mov eax, dword [ebp + 0xc]
mov dword [esi + 4], edi
movzx ebx, dl
mov eax, dword [eax]
sub eax, 0
mov dword [ebp - 8], eax
mov eax, dword [ebp - 4]
jne 0x52ed83
test bl, bl
jns 0x52ed54
cmp ebx, 0xfe
jne 0x52eb2d
cmp edi, ecx
jb 0x52eb0d
mov ecx, esi
call fcn.0052f020
test eax, eax
js 0x52ed48
mov eax, dword [esi + 4]
mov cl, byte [eax]
inc eax
mov dword [esi + 4], eax
cmp cl, 0xff
jne 0x52ed48
mov eax, dword [ebp + 0xc]
mov dword [eax], 1
jmp 0x52ea70
cmp dl, 0xff
jne 0x52eb68
cmp edi, ecx
jb 0x52eb48
mov ecx, esi
call fcn.0052f020
lea ecx, [ecx]
test eax, eax
js 0x52ed48
mov eax, dword [esi + 4]
mov cl, byte [eax]
inc eax
mov dword [esi + 4], eax
cmp cl, 0xfe
jne 0x52ed48
mov eax, dword [ebp + 0xc]
mov dword [eax], 2
jmp 0x52ea70
mov eax, ebx
and eax, 0xe0
cmp al, 0xc0
je 0x52ecf9
mov eax, ebx
and eax, 0xf0
cmp al, 0xe0
jne 0x52ec17
cmp edi, ecx
jb 0x52eb9b
mov ecx, esi
call fcn.0052f020
test eax, eax
js 0x52ed48
mov eax, dword [esi + 4]
movzx ecx, byte [eax]
lea edx, [eax + 1]
mov eax, ecx
mov dword [esi + 4], edx
and al, 0xc0
cmp al, 0x80
jne 0x52ed48
and ebx, 0xf
and ecx, 0x3f
shl ebx, 6
or ebx, ecx
mov edi, ebx
cmp edx, dword [esi + 8]
jb 0x52ebd4
mov ecx, esi
call fcn.0052f020
test eax, eax
js 0x52ed48
mov eax, dword [esi + 4]
movzx ebx, byte [eax]
inc eax
mov dword [esi + 4], eax
mov eax, ebx
and al, 0xc0
cmp al, 0x80
jne 0x52ed48
and ebx, 0x3f
shl edi, 6
or ebx, edi
cmp ebx, 0x800
jb 0x52ed32
mov edi, edi
cmp ebx, 0xfeff
je 0x52ea70
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov eax, ebx
and eax, 0xf8
cmp al, 0xf0
jne 0x52ed48
cmp edi, ecx
jb 0x52ec3b
mov ecx, esi
call fcn.0052f020
test eax, eax
js 0x52ed48
mov eax, dword [esi + 4]
movzx ecx, byte [eax]
lea edx, [eax + 1]
mov eax, ecx
mov dword [esi + 4], edx
and al, 0xc0
cmp al, 0x80
jne 0x52ed48
and ebx, 7
and ecx, 0x3f
shl ebx, 6
or ebx, ecx
cmp edx, dword [esi + 8]
jb 0x52ec74
mov ecx, esi
call fcn.0052f020
test eax, eax
js 0x52ed48
mov eax, dword [esi + 4]
movzx edi, byte [eax]
lea ecx, [eax + 1]
mov eax, edi
mov dword [esi + 4], ecx
and al, 0xc0
cmp al, 0x80
jne 0x52ed48
and edi, 0x3f
shl ebx, 6
or edi, ebx
cmp ecx, dword [esi + 8]
jb 0x52ecad
mov ecx, esi
call fcn.0052f020
test eax, eax
js 0x52ed48
mov eax, dword ds:[esi + 4]
movzx ebx, byte [eax]
inc eax
mov dword [esi + 4], eax
mov eax, ebx
and al, 0xc0
cmp al, 0x80
jne 0x52ed48
and ebx, 0x3f
shl edi, 6
or ebx, edi
cmp ebx, 0x10000
jae 0x52efb3
push ebx
push str.Invalid_UTF_8_sequence_for_character_0x_04x_
lfence
call fcn.0052e720
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
cmp edi, ecx
jb 0x52ed09
mov ecx, esi
call fcn.0052f020
test eax, eax
js 0x52ed48
mov eax, dword [esi + 4]
movzx ecx, byte [eax]
inc eax
mov dword [esi + 4], eax
mov eax, ecx
and al, 0xc0
cmp al, 0x80
jne 0x52ed48
and ebx, 0x1f
and ecx, 0x3f
shl ebx, 6
or ebx, ecx
cmp ebx, 0x80
jae 0x52efb3
push ebx
push str.Invalid_UTF_8_sequence_for_character_0x_04x_
lfence
call fcn.0052e720
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
cmp dl, 0x20
jae 0x52efb3
lea ecx, [ecx]
cmp dl, 0xa
je 0x52efb3
cmp dl, 0xd
je 0x52efb3
cmp dl, 9
je 0x52efb3
push ebx
push str.Bad_control_character_0x_02x_not_allowed_by_XML_standard_
jmp 0x52ed38
mov edx, dword [ebp - 8]
sub edx, 1
je 0x52ee9e
sub edx, 1
jne 0x52efb3
cmp edi, ecx
jb 0x52edcc
push edx
push edx
push 0x2000
push eax
lea eax, [ebp - 0x10]
push eax
push edx
push edx
push edx
push dword [esi]
call dword [sym.imp.ntdll.dll_NtReadFile]
test eax, eax
js 0x52ed48
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x52ed48
mov edi, dword [ebp - 4]
lea ecx, [esi + 0xc]
add ecx, eax
mov dword [esi + 4], edi
mov dword [esi + 8], ecx
movzx eax, byte [edi]
inc edi
shl eax, 8
or eax, ebx
mov dword [esi + 4], edi
mov ebx, eax
cmp eax, 0x20
jae 0x52ee18
nop
cmp eax, 0xa
je 0x52efb3
cmp eax, 0xd
je 0x52efb3
cmp eax, 9
je 0x52efb3
push ebx
push str.Bad_control_character_0x_02x_not_allowed_by_XML_standard_
lfence
call fcn.0052e720
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
add eax, 0xffff2800
cmp eax, 0x3ff
ja 0x52efb3
cmp edi, ecx
jb 0x52ee3e
mov ecx, esi
call fcn.0052f020
test eax, eax
js 0x52ed48
mov eax, dword [esi + 4]
movzx edi, byte [eax]
inc eax
mov dword [esi + 4], eax
cmp eax, dword [esi + 8]
jb 0x52ee5c
mov ecx, esi
call fcn.0052f020
test eax, eax
js 0x52ed48
mov eax, dword [esi + 4]
movzx ecx, byte [eax]
inc eax
shl ecx, 8
or ecx, edi
mov dword [esi + 4], eax
lea eax, [ecx - 0xdc00]
cmp eax, 0x3fe
ja 0x52ed48
and ebx, 0x3ff
and ecx, 0x3ff
shl ebx, 0xa
or ebx, ecx
add ebx, 0x10000
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
mov edi, edi
cmp edi, ecx
jb 0x52eee7
push 0
push 0
push 0x2000
push eax
lea eax, [ebp - 0x10]
push eax
push 0
push 0
push 0
push dword [esi]
call dword [sym.imp.ntdll.dll_NtReadFile]
test eax, eax
js 0x52ed48
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x52ed48
mov edi, dword [ebp - 4]
lea ecx, [esi + 0xc]
add ecx, eax
mov dword [esi + 4], edi
mov dword [esi + 8], ecx
movzx eax, byte [edi]
inc edi
shl ebx, 8
or ebx, eax
mov dword [esi + 4], edi
cmp ebx, 0x20
jae 0x52ef38
jmp 0x52ef00
cmp ebx, 0xa
je 0x52efb3
cmp ebx, 0xd
je 0x52efb3
cmp ebx, 9
je 0x52efb3
push ebx
push str.Bad_control_character_0x_02x_not_allowed_by_XML_standard_
lfence
call fcn.0052e720
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
lea eax, ds:[ebx - 0xd800]
cmp eax, 0x3ff
ja 0x52efb3
cmp edi, ecx
jb 0x52ef5e
mov ecx, esi
call fcn.0052f020
test eax, eax
js 0x52ed48
mov eax, dword [esi + 4]
movzx edi, byte [eax]
inc eax
mov dword [esi + 4], eax
cmp eax, dword [esi + 8]
jb 0x52ef7c
mov ecx, esi
call fcn.0052f020
test eax, eax
js 0x52ed48
mov eax, dword [esi + 4]
shl edi, 8
movzx ecx, byte [eax]
inc eax
or edi, ecx
mov dword [esi + 4], eax
lea eax, [edi - 0xdc00]
cmp eax, 0x3fe
ja 0x52ed48
and ebx, 0x3ff
and edi, 0x3ff
shl ebx, 0xa
or ebx, edi
add ebx, 0x10000
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 8