Function at 0x40e360
Capabilities:
Read file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4181a0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x24
push ebx
push ebp
push esi
push edi
mov eax, dword [esp + 0x48]
xor ebp, ebp
cmp eax, ebp
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x18], ebp
jne 0x40e393
mov eax, 0x41921c
push ebp
push 0x80
push 3
push ebp
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
mov dword [esp + 0x14], esi
jne 0x40e4de
mov al, byte [esp + 0x44]
push ebp
lea ecx, [esp + 0x28]
mov byte [esp + 0x28], al
call fcn.00401d10
mov edi, str.unable_to_open_file:
or ecx, esi
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebx, ecx
lea ecx, [esp + 0x28]
push ebx
call fcn.00402510
test al, al
je 0x40e410
mov edi, dword [esp + 0x28]
mov ecx, ebx
mov edx, ecx
mov esi, str.unable_to_open_file:
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
push ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x28]
call fcn.004024f0
xor ebp, ebp
mov eax, dword [0x419218]
lea ecx, [esp + 0x44]
push eax
push ebp
push ecx
lea ecx, [esp + 0x30]
mov byte [esp + 0x48], 1
call fcn.0040f2f0
mov edi, 0x41c2dc
or ecx, 0xffffffff
xor eax, eax
mov edx, dword [0x419218]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov esi, ecx
mov ecx, dword [esp + 0x2c]
sub edx, ecx
cmp edx, esi
ja 0x40e450
call fcn.0040f879
cmp esi, ebp
jbe 0x40e496
mov eax, dword [esp + 0x2c]
push ebp
lea ecx, [esp + 0x28]
lea ebx, [eax + esi]
push ebx
call fcn.00402510
test al, al
je 0x40e496
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x2c]
push ebx
lea edi, [edx + ecx]
mov ecx, esi
mov eax, ecx
mov esi, 0x41c2dc
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x28]
call fcn.004024f0
xor ebp, ebp
mov cl, byte [esp + 0x24]
sub esp, 0x10
mov esi, esp
mov dword [esp + 0x2c], esp
push ebp
mov byte [esi], cl
mov ecx, esi
call fcn.00401d10
mov edx, dword [0x419218]
lea eax, [esp + 0x34]
push edx
push ebp
push eax
mov ecx, esi
call fcn.00401b10
call fcn.004051f0
add esp, 0x10
lea ecx, [esp + 0x24]
mov byte [esp + 0x3c], 0
push 1
call fcn.00401d10
jmp 0x40e620
lea ecx, [esp + 0x1c]
push ebp
push ecx
lea edx, [esp + 0x18]
push 2
push edx
push esi
mov dword [esp + 0x30], ebp
mov dword [esp + 0x24], ebp
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40e5b3
cmp word [esp + 0x10], 0xfeff
jne 0x40e554
mov al, byte [esp + 0x44]
sub esp, 0x10
mov edx, esp
mov edi, str.file_is_Unicode_n
or ecx, 0xffffffff
mov dword [esp + 0x28], esp
mov byte [edx], al
xor eax, eax
mov dword [edx + 4], ebp
mov dword [edx + 8], ebp
mov dword [edx + 0xc], ebp
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push str.file_is_Unicode_n
mov ecx, edx
call fcn.00402330
call fcn.004051f0
add esp, 0x10
mov dword [esp + 0x18], 1
jmp 0x40e619
mov cl, byte [esp + 0x44]
sub esp, 0x10
mov ebx, esp
mov dword [esp + 0x30], esp
push ebp
mov byte [ebx], cl
mov ecx, ebx
call fcn.00401d10
mov edi, str.file_is_not_Unicode_n
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
mov ecx, ebx
push ebp
call fcn.00402510
test al, al
je 0x40e611
mov edi, dword [ebx + 4]
mov ecx, ebp
mov edx, ecx
mov esi, str.file_is_not_Unicode_n
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [ebx + 8], ebp
mov ebx, dword [ebx + 4]
add ebx, ebp
mov byte [ebx], 0
jmp 0x40e60d
mov al, byte [esp + 0x44]
sub esp, 0x10
mov ebx, esp
mov dword [esp + 0x30], esp
push ebp
mov ecx, ebx
mov byte [ebx], al
call fcn.00401d10
mov edi, str.unable_to_read_from_file_n
or ecx, 0xffffffff
xor eax, eax
push 1
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
mov ecx, ebx
push ebp
call fcn.00402510
test al, al
je 0x40e611
mov edi, dword [ebx + 4]
mov ecx, ebp
mov edx, ecx
mov esi, str.unable_to_read_from_file_n
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebx + 4]
mov dword [ebx + 8], ebp
add ebp, eax
mov byte [ebp], 0
mov esi, dword [esp + 0x24]
call fcn.004051f0
add esp, 0x10
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 1
lea ecx, [esp + 0x48]
mov dword [esp + 0x40], 0xffffffff
call fcn.00401d10
mov ecx, dword [esp + 0x34]
mov eax, dword [esp + 0x18]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x30
ret