Function at 0x46aae0
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x348
mov eax, dword [ebp + 8]
push ebx
push esi
xor ebx, ebx
push ebx
push ebx
push 3
push ebx
push 1
push SysReAllocString
push eax
mov dword [ebp - 4], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x46ae5a
push ebx
lea ecx, [ebp + 8]
push ecx
push 0xc
lea edx, [ebp - 0x28]
push edx
push esi
mov dword [ebp + 8], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x46ae5a
cmp dword [ebp + 8], 0xc
jne 0x46ae5a
mov eax, dword [ebp - 0x24]
movzx edx, byte [ebp - 0x24]
shr eax, 8
shl dx, 8
movzx cx, al
mov eax, dword [ebp - 0x28]
or cx, dx
movzx edx, byte [ebp - 0x28]
shr eax, 8
shl dx, 8
movzx ax, al
or ax, dx
mov word [ebp - 0x24], cx
mov edx, dword [ebp - 0x26]
push edi
movzx di, byte [ebp - 0x26]
shr edx, 8
movzx dx, dl
shl di, 8
or dx, di
mov word [ebp - 0x28], ax
mov word [ebp - 0x26], dx
cmp ax, 1
jne 0x46ae59
cmp dx, bx
jne 0x46ae59
xor eax, eax
xor edi, edi
cmp ax, cx
jae 0x46ae59
push ebx
lea ecx, [ebp + 8]
push ecx
push 0x10
lea edx, [ebp - 0x3c]
push edx
push esi
mov dword [ebp + 8], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x46abda
cmp dword [ebp + 8], ebx
je 0x46abda
push 4
lea eax, [ebp - 0x3c]
push 0x4fb9e8
push eax
call fcn.004d5074
add esp, 0xc
test eax, eax
je 0x46abe8
movzx ecx, word [ebp - 0x24]
inc edi
cmp edi, ecx
jl 0x46aba5
jmp 0x46ae59
mov ecx, dword [ebp - 0x30]
movzx dx, cl
mov eax, ecx
shl dx, 8
movzx edx, dx
shr ecx, 8
movzx ecx, cl
or edx, ecx
shr eax, 0x10
movzx cx, al
shr eax, 8
shl cx, 8
shl edx, 0x10
movzx eax, al
movzx ecx, cx
or edx, ecx
or edx, eax
mov dword [ebp - 0x30], edx
mov edx, dword [ebp - 0x34]
movzx ax, dl
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, edx
shl ax, 8
shr edx, 8
movzx eax, ax
movzx edx, dl
or eax, edx
shr ecx, 0x10
movzx dx, cl
shl dx, 8
movzx edx, dx
shr ecx, 8
shl eax, 0x10
movzx ecx, cl
push ebx
or eax, edx
or eax, ecx
push ebx
push eax
push esi
mov dword [ebp - 0x34], eax
call edi
cmp eax, 0xffffffff
je 0x46ae59
push ebx
lea edx, [ebp + 8]
push edx
push 6
lea eax, [ebp - 0xc]
push eax
push esi
mov dword [ebp + 8], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x46ae59
cmp dword [ebp + 8], ebx
je 0x46ae59
mov ecx, dword [ebp - 0xa]
movzx dx, byte [ebp - 0xa]
shr ecx, 8
movzx ax, cl
mov ecx, dword [ebp - 8]
shl dx, 8
or ax, dx
shr ecx, 8
movzx dx, cl
movzx cx, byte [ebp - 8]
shl cx, 8
or dx, cx
mov word [ebp - 8], dx
xor edx, edx
mov word [ebp - 0xa], ax
mov dword [ebp - 0x2c], ebx
cmp dx, ax
jae 0x46ae59
push ebx
lea eax, [ebp + 8]
push eax
push 0xc
lea ecx, [ebp - 0x1c]
push ecx
push esi
mov dword [ebp + 8], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x46adbd
cmp dword [ebp + 8], ebx
je 0x46adbd
mov edx, dword [ebp - 0x16]
movzx cx, byte [ebp - 0x16]
shr edx, 8
movzx ax, dl
shl cx, 8
or ax, cx
mov word [ebp - 0x16], ax
cmp ax, 1
jne 0x46adbd
mov edx, dword [ebp - 0x14]
movzx ecx, byte [ebp - 0x14]
shr edx, 8
movzx ax, dl
mov edx, dword [ebp - 0x12]
shl cx, 8
or ax, cx
movzx ecx, byte [ebp - 0x12]
push 1
mov word [ebp - 0x14], ax
shr edx, 8
movzx ax, dl
push ebx
shl cx, 8
push ebx
or ax, cx
push esi
mov word [ebp - 0x12], ax
call edi
movzx edx, word [ebp - 0x12]
add edx, dword [ebp - 0x34]
mov ebx, eax
movzx eax, word [ebp - 8]
push 0
push 0
add eax, edx
push eax
push esi
call edi
cmp eax, 0xffffffff
je 0x46adb3
movzx eax, word [ebp - 0x14]
lea ecx, [eax + 1]
cmp ecx, 0x21
jge 0x46adb3
push 0
lea edx, [ebp + 8]
push edx
mov byte [ebp + eax - 0x13f], 0
push ecx
lea eax, [ebp - 0x140]
push eax
push esi
mov dword [ebp + 8], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x46adb3
cmp dword [ebp + 8], 0
je 0x46adb3
cmp byte [ebp - 0x140], 0
jne 0x46add5
push 0
push 0
push ebx
push esi
call edi
xor ebx, ebx
mov eax, dword [ebp - 0x2c]
movzx ecx, word [ebp - 0xa]
inc eax
cmp eax, ecx
mov dword [ebp - 0x2c], eax
jl 0x46acd1
jmp 0x46ae59
movzx ecx, word [ebp - 0x14]
mov eax, ecx
test eax, eax
jl 0x46adf7
nop
cmp byte [ebp + eax - 0x140], 0x20
jne 0x46adf7
sub eax, 1
mov byte [ebp + eax - 0x13f], 0
jns 0x46ade0
mov byte [ebp + ecx - 0x140], 0
cmp byte [ebp - 0x140], 0
je 0x46ae57
push 0x20
lea edx, [ebp - 0x348]
push edx
push 0xffffffffffffffff
lea eax, [ebp - 0x140]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov eax, dword [ebp + 0xc]
lea edx, [ebp - 0x348]
push edx
xor ecx, ecx
push eax
mov word [ebp - 0x30a], cx
mov dword [ebp - 4], 1
call fcn.00401a00
mov edx, dword [ebp + 0x10]
lea ecx, [ebp - 0x348]
push ecx
push edx
call fcn.00401a00
add esp, 0x10
xor ebx, ebx
pop edi
cmp esi, ebx
je 0x46ae6a
cmp esi, 0xffffffff
je 0x46ae6a
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 4]
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc