Function at 0x406ca0
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x24
lea eax, [esp]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x34]
push edi
push eax
push esi
call dword [sym.imp.MSVCRT.dll__stat]
add esp, 8
cmp eax, 0xffffffff
jne 0x406ce4
push esi
push 0x448bc0
call dword [sym.imp.MSVCRT.dll_printf]
push 0x448bb8
call dword [sym.imp.MSVCRT.dll_perror]
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
mov ecx, dword [esp + 0x24]
mov ebp, dword [sym.imp.MSVCRT.dll_printf]
push ecx
push esi
push 0x448b98
call ebp
mov edx, dword [esp + 0x30]
mov edi, dword [esp + 0x48]
lea eax, [edx + 1]
cdq
sub eax, edx
sar eax, 1
shl eax, 3
push eax
push 0x448b80
mov dword [edi], eax
call ebp
push 0x1b6
push 0x8000
push esi
call dword [sym.imp.MSVCRT.dll__open]
mov ebx, eax
add esp, 0x20
cmp ebx, 0xffffffff
jne 0x406d44
push esi
push 0x448b60
call ebp
add esp, 8
or eax, ebx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
mov eax, dword [esp + 0x24]
push eax
call dword [sym.imp.MSVCRT.dll_malloc]
mov esi, eax
add esp, 4
test esi, esi
jne 0x406d74
push 0x448b40
call ebp
push ebx
call dword [sym.imp.MSVCRT.dll__close]
add esp, 8
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
mov ecx, dword [esp + 0x24]
push ecx
push esi
push ebx
call dword [sym.imp.MSVCRT.dll__read]
mov ecx, dword [esp + 0x30]
add esp, 0xc
cmp eax, ecx
je 0x406daf
push 0x448b24
call ebp
push ebx
call dword [sym.imp.MSVCRT.dll__close]
push esi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 0xc
or eax, 0xffffffff
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
push ebx
call dword [sym.imp.MSVCRT.dll__close]
mov ecx, dword [esp + 0x28]
add esp, 4
xor ebx, ebx
lea eax, [ecx + 1]
cdq
sub eax, edx
sar eax, 1
sub edi, eax
add edi, 0x104
mov ebp, edi
xor edi, edi
test ecx, ecx
mov dword [esp + 0x38], ebp
jle 0x406ee5
lea eax, [ecx + 1]
cdq
sub eax, edx
sar eax, 1
cmp ebx, eax
jge 0x406ee5
test edi, edi
jne 0x406e4a
and ecx, 0x80000001
jns 0x406e00
dec ecx
or ecx, 0xfffffffe
inc ecx
je 0x406e4a
mov al, byte [esi]
cmp al, 0x41
jb 0x406e2f
cmp al, 0x61
jb 0x406e10
sub al, 0x20
mov byte [esi], al
xor edx, edx
mov dl, byte [esi]
sub edx, 0x37
and edx, 0x8000000f
jns 0x406e24
dec edx
or edx, 0xfffffff0
inc edx
and dl, 0xf
mov byte [ebx + ebp], dl
jmp 0x406ed7
and eax, 0xff
mov ecx, 0xa
sub eax, 0x30
cdq
idiv ecx
and dl, 0xf
mov byte [ebx + ebp], dl
jmp 0x406ed7
mov al, byte [edi + esi]
cmp al, 0x41
jb 0x406e73
cmp al, 0x61
jb 0x406e5a
sub al, 0x20
mov byte [edi + esi], al
xor edx, edx
mov dl, byte [edi + esi]
mov ecx, edx
sub ecx, 0x37
and ecx, 0x8000000f
jns 0x406e85
dec ecx
or ecx, 0xfffffff0
inc ecx
jmp 0x406e85
and eax, 0xff
mov ecx, 0xa
sub eax, 0x30
cdq
idiv ecx
mov ecx, edx
mov al, byte [edi + esi + 1]
and ecx, 0xf
shl ecx, 4
cmp al, 0x41
jb 0x406eba
cmp al, 0x61
jb 0x406e9d
sub al, 0x20
mov byte [edi + esi + 1], al
xor edx, edx
mov dl, byte [edi + esi + 1]
sub edx, 0x37
and edx, 0x8000000f
jns 0x406eb3
dec edx
or edx, 0xfffffff0
inc edx
and dl, 0xf
add dl, cl
jmp 0x406ed3
and eax, 0xff
mov ebp, 0xa
sub eax, 0x30
cdq
idiv ebp
mov ebp, dword [esp + 0x38]
and dl, 0xf
add dl, cl
mov byte [ebx + ebp], dl
inc edi
mov ecx, dword [esp + 0x24]
inc edi
inc ebx
cmp edi, ecx
jl 0x406ddf
push esi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret