Function at 0x10229ba
Capabilities:
Read file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
mov esi, dword [ebp + 8]
cmp esi, dword [0x1066fa8]
push edi
jae 0x1022b9d
mov eax, esi
sar eax, 5
lea edi, [eax*4 + 0x1066fc0]
mov eax, dword [edi]
and esi, 0x1f
shl esi, 3
add eax, esi
mov dl, byte [eax + 4]
test dl, 1
je 0x1022b9d
and dword [ebp - 0xc], 0
cmp dword [ebp + 0x10], 0
mov ebx, dword [ebp + 0xc]
mov ecx, ebx
je 0x1022a67
test dl, 2
jne 0x1022a67
test dl, 0x48
je 0x1022a31
cmp byte [eax + 5], 0xa
je 0x1022a31
mov eax, dword [edi]
mov al, byte [eax + esi + 5]
dec dword [ebp + 0x10]
mov byte [ebx], al
mov eax, dword [edi]
lea ecx, [ebx + 1]
mov dword [ebp - 0xc], 1
mov byte [eax + esi + 5], 0xa
push 0
lea eax, [ebp - 0x10]
push eax
push dword [ebp + 0x10]
mov eax, dword [edi]
push ecx
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1022a7a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop ecx
cmp eax, ecx
jne 0x1022a62
mov dword [0x1065358], ecx
jmp 0x1022ba4
cmp eax, 0x6d
jne 0x1022a6e
xor eax, eax
jmp 0x1022bb1
push eax
call fcn.01023aba
pop ecx
jmp 0x1022bae
mov eax, dword [ebp - 0x10]
mov ecx, dword [edi]
add dword [ebp - 0xc], eax
test byte [ecx + esi + 4], 0x80
je 0x1022b98
test eax, eax
je 0x1022aa1
cmp byte [ebx], 0xa
jne 0x1022aa1
mov eax, ecx
lea eax, [eax + esi + 4]
or byte [eax], 4
jmp 0x1022aaa
mov eax, dword [edi]
lea eax, [eax + esi + 4]
and byte [eax], 0xfb
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 0xc]
add ecx, eax
cmp eax, ecx
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], ecx
jae 0x1022b92
mov eax, dword [ebp - 8]
mov al, byte [eax]
cmp al, 0x1a
je 0x1022b78
cmp al, 0xd
je 0x1022adc
mov byte [ebx], al
inc ebx
inc dword [ebp - 8]
jmp 0x1022b6a
dec ecx
cmp dword [ebp - 8], ecx
jae 0x1022af6
mov eax, dword [ebp - 8]
inc eax
cmp byte [eax], 0xa
jne 0x1022af1
add dword [ebp - 8], 2
jmp 0x1022b4a
mov dword [ebp - 8], eax
jmp 0x1022b66
inc dword [ebp - 8]
push 0
lea eax, [ebp - 0x10]
push eax
push 1
lea eax, [ebp - 1]
push eax
mov eax, dword [edi]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1022b1e
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x1022b66
cmp dword [ebp - 0x10], 0
je 0x1022b66
mov eax, dword [edi]
test byte [eax + esi + 4], 0x48
je 0x1022b3f
mov al, byte [ebp - 1]
cmp al, 0xa
je 0x1022b4a
mov byte [ebx], 0xd
mov ecx, dword [edi]
mov byte [ecx + esi + 5], al
jmp 0x1022b69
cmp ebx, dword [ebp + 0xc]
jne 0x1022b4f
cmp byte [ebp - 1], 0xa
jne 0x1022b4f
mov byte [ebx], 0xa
jmp 0x1022b69
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.0102406e
add esp, 0x10
cmp byte [ebp - 1], 0xa
je 0x1022b6a
mov byte [ebx], 0xd
inc ebx
mov ecx, dword [ebp - 0xc]
cmp dword [ebp - 8], ecx
jb 0x1022ac0
jmp 0x1022b92
mov eax, dword [edi]
test byte [eax + esi + 4], 0x40
jne 0x1022b8a
lea esi, [eax + esi + 4]
or byte [esi], 2
jmp 0x1022b92
mov eax, dword [ebp - 8]
mov al, byte [eax]
mov byte [ebx], al
inc ebx
sub ebx, dword [ebp + 0xc]
mov dword [ebp - 0xc], ebx
mov eax, dword [ebp - 0xc]
jmp 0x1022bb1
and dword [0x1065358], 0
mov dword [0x1065354], 9
or eax, 0xffffffff
pop edi
pop esi
pop ebx
leave
ret