Function at 0x412890
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x88
mov eax, dword [0x4c1830]
push ebp
mov ebp, dword [esp + 0x9c]
push esi
mov esi, dword [esp + 0x94]
mov dword [esp + 0x8c], eax
push edi
xor eax, eax
test ebp, ebp
mov ecx, 0x23
mov edi, esi
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0xa0]
mov dword [esi + 0x70], eax
mov byte [esi + 0x6c], 0
je 0x412960
mov ecx, dword [esp + 0x9c]
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x41293e
push 0
push 0
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea edx, [esp + 0x10]
push edx
push 0x80
lea eax, [esp + 0x1c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0xc]
and ecx, 0xffffff80
cmp ecx, 0x80
jne 0x412937
cmp word [esp + 0x50], 0x4457
je 0x412941
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or edi, 0xffffffff
cmp edi, 0xffffffff
mov dword [esi], edi
jne 0x41299b
or eax, edi
pop edi
pop esi
pop ebp
mov ecx, dword [esp + 0x84]
call fcn.0047471e
add esp, 0x88
ret
mov eax, dword [esp + 0x9c]
push 0x4457
lea edx, [esp + 0x14]
push edx
push 0x72
push eax
call fcn.00412630
add esp, 0x10
cmp eax, 0xffffffff
mov dword [esi], eax
jne 0x41299b
pop edi
pop esi
or eax, eax
pop ebp
mov ecx, dword [esp + 0x84]
call fcn.0047471e
add esp, 0x88
ret
mov al, byte [esp + 0x10]
test al, al
lea ecx, [esi + 4]
je 0x4129c3
lea edx, [esp + 0x10]
sub edx, ecx
lea esp, [esp]
cmp al, 0xa
je 0x4129c3
cmp al, 0x1a
je 0x4129c3
mov byte [ecx], al
mov al, byte [edx + ecx + 1]
inc ecx
test al, al
jne 0x4129b0
mov eax, dword [esp + 0x88]
mov dl, byte [esp + 0x59]
mov byte [ecx], 0
mov cl, byte [esp + 0x58]
mov byte [esi + 0x68], cl
mov ecx, dword [esp + 0x8c]
mov dword [esi + 0x50], eax
mov al, byte [esp + 0x5f]
mov dword [esi + 0x54], ecx
mov cl, byte [esp + 0x5a]
mov byte [esi + 0x6f], al
mov byte [esi + 0x69], cl
mov cl, byte [esp + 0x5d]
mov byte [esi + 0x6d], dl
mov dl, byte [esp + 0x5e]
mov eax, 1
shl eax, cl
test cl, cl
push ebx
mov bl, byte [esp + 0x60]
mov byte [esi + 0x6e], dl
mov dl, byte [esp + 0x5f]
mov byte [esi + 0x6a], dl
mov byte [esi + 0x6b], bl
mov dword [esi + 0x74], eax
je 0x412a22
or dword [esi + 0x70], 0x10
mov edi, dword [esp + 0x78]
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x74]
lea eax, [edi + ebp]
mov dword [esi + 0x5c], eax
mov eax, dword [esp + 0x7c]
add edx, ebp
mov dword [esi + 0x44], ecx
mov ecx, dword [esp + 0x6c]
add eax, ebp
mov dword [esi + 0x58], edx
lea edx, [edi + ecx*4]
mov dword [esi + 0x64], eax
mov eax, dword [esp + 0x88]
mov dword [esi + 0x60], edx
call fcn.00402410
test eax, eax
je 0x412bae
test byte [esi + 0x70], 1
je 0x412aca
mov cl, bl
mov eax, 0x40
shl eax, cl
lea edi, [eax*4]
push edi
call fcn.00474346
add esp, 4
test eax, eax
mov dword [esi + 0x7c], eax
jne 0x412ab0
push esi
mov byte [esi + 0x6c], 6
call fcn.00402490
add esp, 4
pop ebx
pop edi
pop esi
or eax, 0xffffffff
pop ebp
mov ecx, dword [esp + 0x84]
call fcn.0047471e
add esp, 0x88
ret
mov edx, dword [esi]
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
push 0
lea ecx, [esp + 0x14]
push ecx
push edi
push eax
push edx
call ebp
mov edi, dword [esp + 0x78]
jmp 0x412ad0
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
test byte [esi + 0x70], 2
je 0x412b3f
sub edi, dword [esp + 0x74]
shr edi, 2
shl edi, 2
push edi
call fcn.00474346
add esp, 4
test eax, eax
mov dword [esi + 0x80], eax
jne 0x412b1a
push esi
mov byte [esi + 0x6c], 5
call fcn.00402490
add esp, 4
pop ebx
pop edi
pop esi
or eax, 0xffffffff
pop ebp
mov ecx, dword [esp + 0x84]
call fcn.0047471e
add esp, 0x88
ret
mov eax, dword [esi + 0x58]
mov ecx, dword [esi]
push 0
push 0
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esi + 0x80]
mov ecx, dword [esi]
push 0
lea edx, [esp + 0x14]
push edx
push edi
push eax
push ecx
call ebp
mov al, byte [esi + 0x70]
mov bl, 4
test bl, al
je 0x412c1c
mov edx, dword [esp + 0x6c]
lea eax, [edx*4]
push eax
call fcn.00474346
add esp, 4
test eax, eax
mov dword [esi + 0x84], eax
jne 0x412b90
push esi
mov byte [esi + 0x6c], bl
call fcn.00402490
add esp, 4
pop ebx
pop edi
pop esi
or eax, 0xffffffff
pop ebp
mov ecx, dword [esp + 0x84]
call fcn.0047471e
add esp, 0x88
ret
mov ecx, dword [esp + 0x70]
lea edx, [ecx + ecx]
push edx
call fcn.00474346
add esp, 4
test eax, eax
mov dword [esi + 0x88], eax
jne 0x412bd1
mov byte [esi + 0x6c], 3
push esi
call fcn.00402490
add esp, 4
pop ebx
pop edi
pop esi
or eax, 0xffffffff
pop ebp
mov ecx, dword [esp + 0x84]
call fcn.0047471e
add esp, 0x88
ret
mov eax, dword [esi + 0x5c]
mov ecx, dword [esi]
push 0
push 0
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esp + 0x6c]
push 0
lea edx, [esp + 0x14]
push edx
mov edx, dword [esi + 0x84]
lea ecx, [eax*4]
mov eax, dword [esi]
push ecx
push edx
push eax
call ebp
mov edx, dword [esp + 0x70]
push 0
lea ecx, [esp + 0x14]
push ecx
mov ecx, dword [esi + 0x88]
lea eax, [edx + edx]
mov edx, dword [esi]
push eax
push ecx
push edx
call ebp
mov ecx, dword [esp + 0x94]
pop ebx
pop edi
pop esi
xor eax, eax
pop ebp
call fcn.0047471e
add esp, 0x88
ret