Function at 0x40ce80
Capabilities:
Get common file path
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x420
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
xor ebx, ebx
test edi, edi
je 0x40cf71
cmp word [edi], 0x40
jne 0x40cf71
push ebx
push ebx
push 3
push ebx
push 1
lea eax, [edi + 2]
push SysReAllocString
push eax
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
test ebx, ebx
je 0x40d08f
cmp ebx, 0xffffffff
je 0x40d08f
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
test esi, esi
je 0x40d026
cmp esi, 0x100000
ja 0x40d026
lea eax, [esi + 4]
push 1
push eax
call fcn.004412c0
add esp, 8
push 0
lea ecx, [ebp - 8]
push ecx
push esi
mov edi, eax
push edi
push ebx
mov dword [ebp - 8], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0xc], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0xc], 0
je 0x40cfc8
cmp dword [ebp - 8], esi
jne 0x40cfc8
mov al, byte [edi]
cmp al, 0xef
jne 0x40cf7c
cmp byte [edi + 1], 0xbb
jne 0x40cf7c
cmp byte [edi + 2], 0xbf
jne 0x40cf7c
lea edx, [esi + 2]
push 2
push edx
call fcn.004412c0
add esp, 8
push esi
mov ebx, eax
push ebx
push 0xffffffffffffffff
add edi, 3
push edi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 4
cmp al, 0xff
jne 0x40cf9d
cmp byte [edi + 1], 0xfe
jne 0x40cf9d
add edi, 2
push edi
call fcn.00441380
add esp, 4
pop edi
pop esi
mov ebx, eax
pop ebx
mov esp, ebp
pop ebp
ret 4
lea eax, [esi + 2]
push 2
push eax
call fcn.004412c0
add esp, 8
inc esi
push esi
mov ebx, eax
push ebx
push 0xffffffffffffffff
push edi
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret 4
push edi
call fcn.00441300
mov eax, dword [ebp + 8]
add esp, 4
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40cfd7
sub eax, edx
sar eax, 1
add eax, 0x64
push 2
push eax
call fcn.004412c0
add esp, 8
mov esi, eax
push str.Reading_console_batch_file_failed:_n
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov ecx, dword [ebp - 4]
mov edi, dword [sym.imp.KERNEL32.dll_lstrcatW]
push ecx
push esi
call edi
push 0x4c2e78
push esi
call edi
mov edx, dword [ebp - 0x10]
push 0
push 0
push 0
push edx
jmp 0x40d135
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
mov dword [ebp + 8], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
lea edx, [eax + 2]
jmp 0x40d040
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d040
sub eax, edx
sar eax, 1
add eax, 0x64
push 2
push eax
call fcn.004412c0
add esp, 8
mov esi, eax
push str.Console_batch_file_is_too_large_or_empty:_n
push esi
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov eax, dword [ebp - 4]
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcatW]
push eax
push esi
call ebx
push 0x4c2e78
push esi
call ebx
mov ecx, dword [ebp + 8]
push 0
push 0
push 0
push ecx
jmp 0x40d135
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
lea eax, [ebp - 0x420]
push eax
xor edx, edx
push 0x208
mov word [ebp - 0x420], dx
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d0b7
sub eax, edx
sar eax, 1
mov edx, eax
lea eax, [ebp - 0x420]
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x40d0d1
sub eax, esi
sar eax, 1
lea edi, [eax + edx + 0x64]
push 2
push edi
call fcn.004412c0
add esp, 8
push str.Cant_open_console_batch_file:_n
mov esi, eax
push edi
push esi
call fcn.00401800
mov ecx, dword [ebp - 4]
push ecx
push edi
push esi
call fcn.00401880
push 0x4c2da8
push edi
push esi
call fcn.00401880
lea edx, [ebp - 0x420]
push edx
push edi
push esi
call fcn.00401880
push 0x4c2e78
push edi
push esi
call fcn.00401880
push 0
push 0
push 0
push ebx
push esi
call fcn.004200b0
push esi
call fcn.00441300
add esp, 0x18
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 4