Function at 0x406bbe
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov edx, dword [ebp + 0x10]
add esp, 0xffffffe4
push edi
mov edi, dword [ebp + 8]
push 0xfffffffffffffffe
pop eax
mov dword [ebp - 0x14], eax
cmp edi, eax
mov dword [ebp - 0x1c], edx
jne 0x406bf3
call fcn.00404edb
and dword [eax], 0
call fcn.00404ec8
mov dword [eax], 9
or eax, 0xffffffff
jmp 0x40715d
push esi
xor esi, esi
cmp edi, esi
jl 0x406c02
cmp edi, dword [0x41484c]
jb 0x406c29
call fcn.00404edb
mov dword [eax], esi
call fcn.00404ec8
push esi
push esi
push esi
push esi
push esi
mov dword [eax], 9
call fcn.00404e69
add esp, 0x14
or eax, 0xffffffff
jmp 0x40715c
mov eax, edi
push ebx
and edi, 0x1f
imul edi, edi, 0x28
sar eax, 5
lea ebx, [eax*4 + 0x414860]
mov eax, dword [ebx]
add eax, edi
mov cl, byte [eax + 4]
test cl, 1
jne 0x406c5f
call fcn.00404edb
mov dword [eax], esi
call fcn.00404ec8
mov dword [eax], 9
jmp 0x406da6
mov dword [ebp - 0x10], esi
cmp edx, esi
je 0x407159
test cl, 2
jne 0x407159
mov ecx, dword [ebp + 0xc]
cmp ecx, esi
je 0x406d94
mov al, byte [eax + 0x24]
add al, al
sar al, 1
mov byte [ebp - 2], al
movsx eax, al
dec eax
je 0x406d8c
dec eax
jne 0x406ca7
mov eax, edx
not eax
test al, 1
je 0x406d94
and edx, 0xfffffffe
mov dword [ebp + 0x10], edx
mov dword [ebp - 0xc], ecx
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebx]
lea esi, [edi + ecx]
test byte [esi + 4], 0x48
je 0x406d2e
mov cl, byte [esi + 5]
cmp cl, 0xa
je 0x406d2e
xor edx, edx
cmp dword [ebp + 0x10], edx
je 0x406d2e
mov byte [eax], cl
inc eax
mov esi, dword [ebx]
dec dword [ebp + 0x10]
cmp byte [ebp - 2], dl
mov dword [ebp - 0x10], 1
mov byte [edi + esi + 5], 0xa
je 0x406d2e
mov ecx, dword [ebx]
mov cl, byte [edi + ecx + 0x25]
cmp cl, 0xa
je 0x406d2e
cmp dword [ebp + 0x10], edx
je 0x406d2e
mov byte [eax], cl
inc eax
mov esi, dword [ebx]
dec dword [ebp + 0x10]
cmp byte [ebp - 2], 1
mov dword [ebp - 0x10], 2
mov byte [edi + esi + 0x25], 0xa
jne 0x406d2e
mov ecx, dword [ebx]
mov cl, byte [edi + ecx + 0x26]
cmp cl, 0xa
je 0x406d2e
cmp dword [ebp + 0x10], edx
je 0x406d2e
mov byte [eax], cl
mov esi, dword [ebx]
inc eax
dec dword [ebp + 0x10]
mov dword [ebp - 0x10], 3
mov byte [edi + esi + 0x26], 0xa
lea ecx, [ebp - 0x18]
push 0
push ecx
push dword [ebp + 0x10]
push eax
mov eax, dword [ebx]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x407123
mov esi, dword [ebp - 0x18]
or esi, esi
jl 0x407123
cmp esi, dword [ebp + 0x10]
ja 0x407123
mov eax, dword [ebx]
lea eax, [edi + eax + 4]
add dword [ebp - 0x10], esi
test byte [eax], 0x80
je 0x406fc3
cmp byte [ebp - 2], 2
je 0x406fed
or esi, esi
je 0x406df8
mov ecx, dword [ebp - 0xc]
cmp byte [ecx], 0xa
jne 0x406df8
or byte [eax], 4
jmp 0x406dfb
mov eax, edx
not eax
test al, 1
jne 0x406db5
call fcn.00404edb
mov dword [eax], esi
call fcn.00404ec8
mov dword [eax], 0x16
push esi
push esi
push esi
push esi
push esi
call fcn.00404e69
add esp, 0x14
jmp 0x406df0
push 4
pop ecx
mov dword [ebp + 0x10], ecx
mov eax, edx
shr eax, 1
cmp eax, ecx
jb 0x406dc6
mov dword [ebp + 0x10], eax
push dword [ebp + 0x10]
call fcn.00409f6f
pop ecx
mov dword [ebp - 0xc], eax
cmp eax, esi
jne 0x406caa
call fcn.00404ec8
mov dword [eax], 0xc
call fcn.00404edb
mov dword [eax], 8
or eax, 0xffffffff
jmp 0x40715b
and byte [eax], 0xfb
mov eax, dword [ebp - 0x10]
mov esi, dword [ebp - 0xc]
add eax, esi
mov dword [ebp + 0x10], esi
cmp esi, eax
mov dword [ebp - 0x10], eax
jae 0x406ee1
mov ecx, dword [ebp + 0x10]
mov al, byte [ecx]
cmp al, 0x1a
je 0x406ecc
cmp al, 0xd
je 0x406e2e
mov byte [esi], al
inc esi
inc ecx
mov dword [ebp + 0x10], ecx
jmp 0x406ebe
mov eax, dword [ebp - 0x10]
dec eax
cmp ecx, eax
jae 0x406e4d
lea eax, [ecx + 1]
cmp byte [eax], 0xa
jne 0x406e48
inc ecx
inc ecx
mov dword [ebp + 0x10], ecx
mov byte [esi], 0xa
jmp 0x406ebd
mov dword [ebp + 0x10], eax
jmp 0x406eba
lea eax, [ebp - 0x18]
inc dword [ebp + 0x10]
push 0
push eax
lea eax, [ebp - 1]
push 1
push eax
mov eax, dword [ebx]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x406e75
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x406eba
cmp dword [ebp - 0x18], 0
je 0x406eba
mov eax, dword [ebx]
test byte [edi + eax + 4], 0x48
je 0x406e98
cmp byte [ebp - 1], 0xa
je 0x406e43
mov byte [esi], 0xd
mov cl, byte [ebp - 1]
mov eax, dword [ebx]
mov byte [edi + eax + 5], cl
jmp 0x406ebd
cmp esi, dword [ebp - 0xc]
jne 0x406ea3
cmp byte [ebp - 1], 0xa
je 0x406e43
push 1
push 0xffffffffffffffff
push 0xffffffffffffffff
push dword [ebp + 8]
call fcn.0040b25b
add esp, 0x10
cmp byte [ebp - 1], 0xa
je 0x406ebe
mov byte [esi], 0xd
inc esi
mov eax, dword [ebp - 0x10]
cmp dword [ebp + 0x10], eax
jb 0x406e11
jmp 0x406ee1
mov eax, dword [ebx]
lea eax, [edi + eax + 4]
test byte [eax], 0x40
jne 0x406edc
or byte [eax], 2
jmp 0x406ee1
mov al, byte [ecx]
mov byte [esi], al
inc esi
mov eax, esi
sub eax, dword [ebp - 0xc]
cmp byte [ebp - 2], 1
mov dword [ebp - 0x10], eax
jne 0x406fc3
test eax, eax
je 0x406fc3
dec esi
mov cl, byte [esi]
test cl, cl
js 0x406f08
inc esi
jmp 0x406f8e
xor eax, eax
movzx ecx, cl
inc eax
jmp 0x406f1f
cmp eax, 4
jg 0x406f28
cmp esi, dword [ebp - 0xc]
jb 0x406f28
dec esi
inc eax
movzx ecx, byte [esi]
cmp byte [ecx + 0x412e58], 0
je 0x406f10
mov dl, byte [esi]
movzx ecx, dl
movsx ecx, byte [ecx + 0x412e58]
or ecx, ecx
jne 0x406f45
call fcn.00404ec8
mov dword [eax], 0x2a
jmp 0x406fbf
inc ecx
cmp ecx, eax
jne 0x406f4e
add esi, eax
jmp 0x406f8e
mov ecx, dword [ebx]
add ecx, edi
test byte [ecx + 4], 0x48
je 0x406f7c
mov byte [ecx + 5], dl
inc esi
cmp eax, 2
jl 0x406f6a
mov dl, byte [esi]
inc esi
mov ecx, dword [ebx]
mov byte [edi + ecx + 0x25], dl
cmp eax, 3
jne 0x406f78
mov dl, byte [esi]
mov ecx, dword [ebx]
mov byte [edi + ecx + 0x26], dl
inc esi
sub esi, eax
jmp 0x406f8e
neg eax
cdq
push 1
push edx
push eax
push dword [ebp + 8]
call fcn.0040b25b
add esp, 0x10
mov eax, dword [ebp - 0x1c]
sub esi, dword [ebp - 0xc]
shr eax, 1
push eax
push dword [ebp + 0xc]
push esi
push dword [ebp - 0xc]
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [ebp - 0x10], eax
or eax, eax
jne 0x406fe6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00404eee
pop ecx
or dword [ebp - 0x14], 0xffffffff
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp + 0xc]
je 0x406fd2
push eax
call fcn.00404267
pop ecx
mov eax, dword [ebp - 0x14]
cmp eax, 0xfffffffe
jne 0x40715b
mov eax, dword [ebp - 0x10]
jmp 0x40715b
add eax, eax
mov dword [ebp - 0x10], eax
jmp 0x406fc3
or esi, esi
je 0x406fff
mov ecx, dword [ebp - 0xc]
cmp word [ecx], 0xa
jne 0x406fff
or byte [eax], 4
jmp 0x407002
and byte [eax], 0xfb
mov esi, dword [ebp - 0xc]
mov eax, dword [ebp - 0x10]
mov dword [ebp + 0x10], esi
add eax, esi
cmp esi, eax
mov dword [ebp - 0x10], eax
jae 0x407118
mov eax, dword [ebp + 0x10]
movzx ecx, word [eax]
cmp cx, 0x1a
je 0x407100
cmp cx, 0xd
je 0x40703d
mov word [esi], cx
inc esi
inc esi
inc eax
inc eax
mov dword [ebp + 0x10], eax
jmp 0x4070f2
mov ecx, dword [ebp - 0x10]
sub ecx, 2
cmp eax, ecx
jae 0x407068
lea ecx, [eax + 2]
cmp word [ecx], 0xa
jne 0x407060
add eax, 4
mov dword [ebp + 0x10], eax
mov word [esi], 0xa
jmp 0x4070f0
mov dword [ebp + 0x10], ecx
jmp 0x4070eb
add dword [ebp + 0x10], 2
push 0
lea eax, [ebp - 0x18]
push eax
push 2
lea eax, [ebp - 8]
push eax
mov eax, dword [ebx]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x407091
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4070eb
cmp dword [ebp - 0x18], 0
je 0x4070eb
mov eax, dword [ebx]
test byte [edi + eax + 4], 0x48
je 0x4070c7
cmp word [ebp - 8], 0xa
je 0x407056
mov word [esi], 0xd
mov eax, dword [ebx]
mov cl, byte [ebp - 8]
mov byte [edi + eax + 5], cl
mov eax, dword [ebx]
mov cl, byte [ebp - 7]
mov byte [edi + eax + 0x25], cl
mov eax, dword [ebx]
mov byte [edi + eax + 0x26], 0xa
jmp 0x4070f0
cmp esi, dword [ebp - 0xc]
jne 0x4070d3
cmp word [ebp - 8], 0xa
je 0x407056
push 1
push 0xffffffffffffffff
push 0xfffffffffffffffe
push dword [ebp + 8]
call fcn.0040b25b
add esp, 0x10
cmp word [ebp - 8], 0xa
je 0x4070f2
mov word [esi], 0xd
inc esi
inc esi
mov eax, dword [ebp - 0x10]
cmp dword [ebp + 0x10], eax
jb 0x407018
jmp 0x407118
mov ecx, dword [ebx]
lea edi, [edi + ecx + 4]
test byte [edi], 0x40
jne 0x407110
or byte [edi], 2
jmp 0x407118
mov ax, word [eax]
mov word [esi], ax
inc esi
inc esi
sub esi, dword [ebp - 0xc]
mov dword [ebp - 0x10], esi
jmp 0x406fc3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop ebx
cmp eax, ebx
jne 0x407147
call fcn.00404ec8
mov dword [eax], 9
call fcn.00404edb
mov dword [eax], ebx
jmp 0x406fbf
cmp eax, 0x6d
jne 0x406fb8
and dword [ebp - 0x14], 0
jmp 0x406fc3
xor eax, eax
pop ebx
pop esi
pop edi
leave
ret