Function at 0x490460
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x2034
call fcn.005925e0
mov eax, dword [ebp + 0x14]
push ebx
push esi
push edi
xor edi, edi
cmp eax, edi
mov esi, ecx
mov dword [esp + 0x30], edx
mov dword [esp + 0xc], esi
mov dword [esi + 0x16c], edi
mov dword [esi + 0x170], edi
je 0x4904c2
mov ecx, dword [esi + 0x168]
push edi
push edi
xor edx, edx
call fcn.00490410
and eax, edx
cmp eax, 0xffffffff
jne 0x4904c2
mov eax, 1
mov dword [esi + 0x170], eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov esi, dword [esp + 0xc]
xor edi, edi
mov eax, dword [esi + 0x168]
push 1
lea ecx, [esp + 0x28]
push ecx
push edi
push eax
mov dword [esp + 0x30], edi
mov dword [esp + 0x34], edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [esp + 0x20], ebx
jne 0x4904f8
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4904a8
mov ebx, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov edx, ebx
and edx, ecx
cmp edx, 0xffffffff
je 0x4904a8
mov edx, dword [esi + 0x168]
mov dword [esp + 0x1c], edi
xor eax, eax
push eax
mov ecx, 0x802
lea edi, [esp + 0x3c]
rep stosd dword es:[edi], eax
lea eax, [esp + 0x20]
push eax
push 0x2000
lea ecx, [esp + 0x44]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4904a8
mov edx, dword [esp + 0x1c]
test edx, edx
je 0x4907f5
xor eax, eax
xor esi, esi
xor edi, edi
test eax, eax
jl 0x4904bc
jg 0x490560
test edx, edx
jbe 0x4904bc
nop
mov ecx, dword [ebp + 0xc]
test ecx, ecx
jl 0x49058b
jg 0x490570
mov ecx, dword [ebp + 8]
test ecx, ecx
jbe 0x49058b
add dword [ebp + 8], 0xffffffff
adc dword [ebp + 0xc], 0xffffffff
js 0x490809
jg 0x49058b
mov ecx, dword [ebp + 8]
test ecx, ecx
jbe 0x490809
cmp edi, eax
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], edi
jg 0x490669
jl 0x4905a5
cmp esi, edx
jae 0x490657
mov cl, byte [esp + esi + 0x38]
cmp cl, 0xd
je 0x4905d0
cmp cl, 0xa
je 0x49064c
add esi, 1
adc edi, 0
cmp edi, eax
jl 0x4905a5
jg 0x490657
cmp esi, edx
jb 0x4905a5
jmp 0x490657
mov byte [esp + esi + 0x38], 0
add esi, 1
adc edi, 0
cmp edi, eax
jl 0x490635
jg 0x4905e5
cmp esi, edx
jb 0x490635
mov edx, dword [esp + 0xc]
push 0
lea eax, [esp + 0x38]
push eax
mov eax, dword [edx + 0x168]
push 1
lea ecx, [esp + 0x27]
push ecx
push eax
mov dword [esp + 0x48], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x490874
mov eax, dword [esp + 0x34]
test eax, eax
je 0x49088c
cmp byte [esp + 0x1b], 0xa
jne 0x490635
mov eax, dword [esp + 0x1c]
inc eax
mov byte [esp + esi + 0x38], 0xa
mov dword [esp + 0x1c], eax
mov edx, dword [esp + 0x1c]
xor eax, eax
cmp edi, eax
jg 0x490669
jl 0x490645
cmp esi, edx
jae 0x490657
cmp byte [esp + esi + 0x38], 0xa
jne 0x490657
mov byte [esp + esi + 0x38], 0
add esi, 1
adc edi, 0
cmp edi, eax
jl 0x4906f9
jg 0x490669
cmp esi, edx
jb 0x4906f9
mov ecx, dword [esp + 0x28]
mov eax, dword [esp + 0x2c]
mov edx, ecx
or edx, eax
je 0x4906fd
mov eax, dword [ebp + 0xc]
test eax, eax
jl 0x49069d
jg 0x49068b
mov eax, dword [ebp + 8]
test eax, eax
jbe 0x49069d
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
add edx, 1
adc eax, 0
mov dword [ebp + 8], edx
mov dword [ebp + 0xc], eax
mov edx, dword [esp + 0x24]
mov edi, dword [esp + 0x2c]
mov esi, dword [esp + 0xc]
mov eax, dword [esi + 0x168]
add ebx, ecx
adc edx, edi
push 0
mov dword [esp + 0x18], edx
lea edx, [esp + 0x18]
mov ecx, ebx
push edx
push ecx
push eax
mov dword [esp + 0x20], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
jne 0x4906e7
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4904a8
mov eax, dword [esp + 0x10]
and eax, dword [esp + 0x14]
cmp eax, 0xffffffff
je 0x4904a8
jmp 0x4904bc
mov ecx, dword [esp + 0x28]
mov eax, dword [ebp + 0x10]
cmp eax, 2
jne 0x49078d
push 1
lea edx, [esp + ecx + 0x3c]
mov ecx, dword [esp + 0x34]
push 0
call fcn.00560640
test eax, eax
je 0x4907d4
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x24]
mov edi, dword [esp + 0x2c]
mov esi, dword [esp + 0xc]
mov eax, dword [esi + 0x168]
add ebx, ecx
adc edx, edi
push 0
mov dword [esp + 0x18], edx
lea edx, [esp + 0x18]
mov ecx, ebx
push edx
push ecx
push eax
mov dword [esp + 0x20], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
jne 0x49076c
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x490775
mov eax, dword [esp + 0x10]
and eax, dword [esp + 0x14]
cmp eax, 0xffffffff
jne 0x49077f
mov dword [esi + 0x170], 1
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
cmp eax, 3
jne 0x4907d4
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0
mov edx, dword [esp + 0x58]
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0
lea ecx, [esp + ecx + 0x8c]
call fcn.005066d0
test eax, eax
jg 0x490722
mov edx, dword [esp + 0x1c]
xor eax, eax
cmp edi, eax
jl 0x490560
jg 0x4904bc
cmp esi, edx
jb 0x490560
jmp 0x4904bc
mov eax, 1
mov dword [esi + 0x16c], eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0xc]
mov eax, dword [eax + 0x168]
add ebx, esi
adc edx, edi
push 0
mov dword [esp + 0x18], edx
lea edx, [esp + 0x18]
mov ecx, ebx
push edx
push ecx
push eax
mov dword [esp + 0x20], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esp + 0x10], eax
jne 0x49084b
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x490858
mov eax, dword [esp + 0x10]
and eax, dword [esp + 0x14]
cmp eax, 0xffffffff
jne 0x49077f
mov eax, dword [esp + 0xc]
mov dword [eax + 0x170], 1
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [esp + 0xc]
mov eax, 1
mov dword [ecx + 0x170], eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov edx, dword [esp + 0xc]
pop edi
mov eax, 1
pop esi
mov dword [edx + 0x16c], eax
pop ebx
mov esp, ebp
pop ebp
ret 0x10