Function at 0x489010
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x2034
call fcn.00565660
push ebx
push esi
mov esi, ecx
mov ecx, dword [ebp + 0x14]
xor eax, eax
cmp ecx, eax
push edi
mov dword [esp + 0x30], edx
mov dword [esp + 0xc], esi
mov dword [esi + 0x16c], eax
mov dword [esi + 0x170], eax
je 0x489070
mov ecx, dword [esi + 0x168]
push eax
push eax
xor edx, edx
call fcn.00488fc0
and eax, edx
cmp eax, 0xffffffff
jne 0x489070
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]
mov eax, dword [esi + 0x168]
push 1
xor ecx, ecx
lea edx, [esp + 0x28]
push edx
push ecx
push eax
mov dword [esp + 0x30], ecx
mov dword [esp + 0x34], ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebx, eax
cmp ebx, 0xffffffff
mov dword [esp + 0x20], ebx
jne 0x4890ac
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x489330
mov ebx, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
mov eax, ebx
and eax, edx
cmp eax, 0xffffffff
je 0x489330
xor eax, eax
push eax
mov ecx, 0x802
lea edi, [esp + 0x3c]
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x20]
push ecx
push 0x2000
lea edx, [esp + 0x44]
mov dword [esp + 0x28], eax
mov eax, dword [esi + 0x168]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x489058
mov edx, dword [esp + 0x1c]
test edx, edx
je 0x489387
xor eax, eax
xor esi, esi
xor edi, edi
test eax, eax
jl 0x48906c
jg 0x489117
test edx, edx
jbe 0x48906c
mov ecx, dword [ebp + 0xc]
test ecx, ecx
jl 0x489142
jg 0x489127
mov ecx, dword [ebp + 8]
test ecx, ecx
jbe 0x489142
add dword [ebp + 8], 0xffffffff
adc dword [ebp + 0xc], 0xffffffff
js 0x48939b
jg 0x489142
mov ecx, dword [ebp + 8]
test ecx, ecx
jbe 0x48939b
cmp edi, eax
mov dword [esp + 0x28], esi
mov dword [esp + 0x2c], edi
jg 0x489224
jl 0x489160
cmp esi, edx
jae 0x489212
lea esp, [esp]
mov cl, byte [esp + esi + 0x38]
cmp cl, 0xd
je 0x48918b
cmp cl, 0xa
je 0x489207
add esi, 1
adc edi, 0
cmp edi, eax
jl 0x489160
jg 0x489212
cmp esi, edx
jb 0x489160
jmp 0x489212
mov byte [esp + esi + 0x38], 0
add esi, 1
adc edi, 0
cmp edi, eax
jl 0x4891f0
jg 0x4891a0
cmp esi, edx
jb 0x4891f0
mov eax, dword [esp + 0xc]
push 0
lea ecx, [esp + 0x38]
push ecx
mov ecx, dword [eax + 0x168]
push 1
lea edx, [esp + 0x27]
push edx
push ecx
mov dword [esp + 0x48], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x489406
mov eax, dword [esp + 0x34]
test eax, eax
je 0x48941e
cmp byte [esp + 0x1b], 0xa
jne 0x4891f0
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 0x489224
jl 0x489200
cmp esi, edx
jae 0x489212
cmp byte [esp + esi + 0x38], 0xa
jne 0x489212
mov byte [esp + esi + 0x38], 0
add esi, 1
adc edi, 0
cmp edi, eax
jl 0x4892b4
jg 0x489224
cmp esi, edx
jb 0x4892b4
mov ecx, dword [esp + 0x28]
mov eax, dword [esp + 0x2c]
mov edx, ecx
or edx, eax
je 0x4892b8
mov eax, dword [ebp + 0xc]
test eax, eax
jl 0x489258
jg 0x489246
mov eax, dword [ebp + 8]
test eax, eax
jbe 0x489258
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 0x4892a2
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x489058
mov eax, dword [esp + 0x10]
and eax, dword [esp + 0x14]
cmp eax, 0xffffffff
je 0x489058
jmp 0x48906c
mov ecx, dword [esp + 0x28]
mov eax, dword [ebp + 0x10]
cmp eax, 2
jne 0x489348
push 1
lea edx, [esp + ecx + 0x3c]
mov ecx, dword [esp + 0x34]
push 0
call fcn.00535d60
test eax, eax
je 0x489366
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 0x489327
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x489330
mov eax, dword [esp + 0x10]
and eax, dword [esp + 0x14]
cmp eax, 0xffffffff
jne 0x48933a
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 0x489366
mov edx, dword [esp + 0x30]
push 0
push 0
lea ecx, [esp + ecx + 0x40]
call fcn.004efb40
test eax, eax
jg 0x4892dd
mov edx, dword [esp + 0x1c]
xor eax, eax
cmp edi, eax
jl 0x489117
jg 0x48906c
cmp esi, edx
jb 0x489117
jmp 0x48906c
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 0x4893dd
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x4893ea
mov eax, dword [esp + 0x10]
and eax, dword [esp + 0x14]
cmp eax, 0xffffffff
jne 0x48933a
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