Function at 0x422b10
Capabilities:
Get file size
Query environment variable
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x61c
mov eax, dword [0x6a0f4c]
xor eax, ebp
mov dword [ebp - 8], eax
mov dword [ebp - 0x5fc], 0
mov byte [ebp - 0x450], 0
push 0x3ff
push 0
lea eax, [ebp - 0x44f]
push eax
call sub.MSVCR90.dll_memset
add esp, 0xc
push 0x400
lea ecx, [ebp - 0x450]
push ecx
mov edx, dword [ebp + 8]
push edx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
lea eax, [ebp - 0x450]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x45c], eax
cmp dword [ebp - 0x45c], 0xffffffff
jne 0x422bda
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x460], eax
push 1
lea ecx, [ebp - 0x4e8]
call fcn.00409eb0
mov dword [ebp - 0x600], eax
lea ecx, [ebp - 0x49c]
mov dword [ebp - 0x604], ecx
mov ecx, dword [ebp - 0x604]
sub ecx, 4
call fcn.004016e0
lea ecx, [ebp - 0x49c]
call dword [sym.imp.MSVCP90.dll_public_virtual:_void___thiscall_std::basic_ios_char__struct_std::char_traits_char__::destructor_void_]
xor al, al
jmp 0x422d72
push 0
mov edx, dword [ebp - 0x45c]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
push eax
call fcn.0047ce38
add esp, 4
mov dword [ebp - 0x4ec], eax
mov ecx, dword [ebp - 0x4ec]
mov dword [ebp - 0x458], ecx
mov dword [ebp - 0x454], 0
push 0
lea edx, [ebp - 0x454]
push edx
mov eax, dword [ebp - 4]
push eax
mov ecx, dword [ebp - 0x458]
push ecx
mov edx, dword [ebp - 0x45c]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x422c9e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x464], eax
push 1
lea ecx, [ebp - 0x56c]
call fcn.00409eb0
mov dword [ebp - 0x608], eax
lea ecx, [ebp - 0x520]
call fcn.00409fa0
lea ecx, [ebp - 0x520]
call dword [sym.imp.MSVCP90.dll_public_virtual:_void___thiscall_std::basic_ios_char__struct_std::char_traits_char__::destructor_void_]
mov eax, dword [ebp - 0x458]
mov dword [ebp - 0x570], eax
mov ecx, dword [ebp - 0x570]
push ecx
call sub.MSVCR90.dll_void___cdecl_operator_delete___void__
add esp, 4
mov edx, dword [ebp - 0x45c]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
jmp 0x422d72
mov eax, dword [ebp - 0x45c]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
cmp ecx, dword [ebp - 0x454]
je 0x422d0b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x468], eax
push 1
lea ecx, [ebp - 0x5f0]
call fcn.00409eb0
mov dword [ebp - 0x614], eax
lea ecx, [ebp - 0x5a4]
call fcn.00409fa0
lea ecx, [ebp - 0x5a4]
call dword [sym.imp.MSVCP90.dll_public_virtual:_void___thiscall_std::basic_ios_char__struct_std::char_traits_char__::destructor_void_]
mov edx, dword [ebp - 0x458]
mov dword [ebp - 0x5f4], edx
mov eax, dword [ebp - 0x5f4]
push eax
call sub.MSVCR90.dll_void___cdecl_operator_delete___void__
add esp, 4
xor al, al
jmp 0x422d72
mov byte [ebp - 0x50], 0
push 0x40
push 0
lea ecx, [ebp - 0x4f]
push ecx
call sub.MSVCR90.dll_memset
add esp, 0xc
lea edx, [ebp - 0x50]
push edx
mov eax, dword [ebp - 0x454]
push eax
mov ecx, dword [ebp - 0x458]
push ecx
call fcn.00452e90
add esp, 0xc
push 0x20
lea edx, [ebp - 0x50]
push edx
mov eax, dword [ebp + 0xc]
push eax
call sub.MSVCR90.dll_memcpy
add esp, 0xc
mov ecx, dword [ebp - 0x458]
mov dword [ebp - 0x5f8], ecx
mov edx, dword [ebp - 0x5f8]
push edx
call sub.MSVCR90.dll_void___cdecl_operator_delete___void__
add esp, 4
mov dword [ebp - 0x458], 0
mov al, 1
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.005fff12
mov esp, ebp
pop ebp
ret