Function at 0x422160
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1024
call fcn.004aa660
mov eax, dword [0x4d0008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x1024], eax
mov eax, dword [ebp + 0xc]
lea ecx, [ebp - 0x1010]
push ecx
push eax
mov dword [ebp - 0x101c], edx
call dword [sym.imp.PAL.dll_PalFileCreate]
mov esi, eax
add esp, 8
cmp esi, 0xffffffff
jne 0x4221b7
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046d15f
mov esp, ebp
pop ebp
ret
push ebx
push 0
push dword [ebp - 0x1008]
call dword [sym.imp.PAL.dll_PalMemoryAlloc]
add esp, 8
mov ebx, eax
lea eax, [ebp - 0x1018]
mov dword [ebp - 0x1014], ebx
push 0
push eax
push dword [ebp - 0x1008]
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x1008]
mov edx, ebx
mov ecx, edi
call fcn.00422010
mov ecx, dword [ebp - 0x1008]
add esp, 4
mov dword [ebp - 0x1020], eax
mov dword [ebp - 0x1018], eax
cmp eax, ecx
je 0x42234f
mov edi, ecx
lea ebx, [eax + ebx]
mov esi, 0
sub edi, eax
je 0x4222dc
nop dword [eax]
mov cl, byte [esi + ebx]
lea edx, [esi + ebx]
movsx eax, cl
add eax, 0xfffffff6
cmp eax, 0x51
ja case.0x422248.11
movzx eax, byte [eax + 0x4223b8]
jmp dword [eax*4 + 0x4223ac]
xor eax, eax
test cl, cl
je 0x4222c6
cmp cl, 0xd
je 0x4222b9
cmp cl, 0xa
je 0x4222c5
mov cl, byte [eax + edx + 1]
inc eax
test cl, cl
jne 0x422255
jmp 0x4222c6
mov eax, edi
lea ecx, [ebp - 0x1004]
sub eax, esi
push eax
push 0x4bd5b4
call fcn.00468510
push dword [ebp - 0x101c]
add esi, eax
lea eax, [ebp - 0x1004]
push eax
call fcn.0046eb10
add esp, 0x10
test eax, eax
jne 0x4222d0
mov cl, byte [esi + ebx]
lea edx, [esi + ebx]
test cl, cl
je 0x4222c6
cmp cl, 0xd
je 0x4222b9
cmp cl, 0xa
je 0x4222c5
mov cl, byte [eax + edx + 1]
inc eax
test cl, cl
jne 0x4222a4
jmp 0x4222c6
cmp byte [edx + eax + 1], 0xa
jne 0x4222c5
add eax, 2
jmp 0x4222c6
inc eax
add esi, eax
cmp esi, edi
jb 0x422230
mov ecx, dword [ebp - 0x1008]
mov eax, dword [ebp - 0x1020]
mov dword [ebp - 0x1018], esi
cmp esi, 0xffffffff
je 0x422349
mov ebx, dword [ebp - 0x1014]
add esi, eax
cmp esi, ecx
jae 0x42238a
lea edi, [esi + ebx]
nop word [eax + eax]
movzx eax, byte [edi]
push eax
call fcn.0047b584
add esp, 4
test eax, eax
je 0x42236c
cmp byte [edi], 0xa
je 0x42238a
inc esi
inc edi
cmp esi, dword [ebp - 0x1008]
jb 0x422300
push ebx
call dword [sym.imp.PAL.dll_PalMemoryFree]
add esp, 4
mov eax, 1
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046d15f
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0x1018], 0xffffffff
mov ebx, dword [ebp - 0x1014]
push ebx
call dword [sym.imp.PAL.dll_PalMemoryFree]
add esp, 4
xor eax, eax
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046d15f
mov esp, ebp
pop ebp
ret
mov ecx, edi
call fcn.00468140
mov esi, eax
push esi
push edi
mov edi, dword [ebp - 0x1024]
push edi
call fcn.00477d10
add esp, 0xc
mov byte [edi + esi], 0
push ebx
call dword [sym.imp.PAL.dll_PalMemoryFree]
mov ecx, dword [ebp - 4]
add esp, 4
xor ecx, ebp
mov eax, 1
pop ebx
pop edi
pop esi
call fcn.0046d15f
mov esp, ebp
pop ebp
ret