Function at 0x412740
Capabilities:
Get common file path
Query environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x810
mov eax, dword [0x4210a8]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, dword [ebp + 0xc]
lea eax, [ebp - 0x804]
push edi
mov edi, dword [ebp + 8]
push eax
push 0x400
mov dword [ebp - 0x80c], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
test eax, eax
jne 0x4127cc
call dword [sym.imp.MSVCR120.dll__errno]
push dword [eax]
call dword [sym.imp.MSVCR120.dll_strerror]
add esp, 4
push eax
push str.could_not_identify_current_directory:__s
call sub.libintl_8.dll_libintl_gettext
mov esi, dword [sym.imp.MSVCR120.dll___iob_func]
add esp, 4
push eax
call esi
add eax, 0x40
push eax
call fcn.00413530
call esi
add eax, 0x40
push eax
push 0xa
call dword [sym.imp.MSVCR120.dll_fputc]
add esp, 0x14
or eax, 0xffffffff
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004175a2
mov esp, ebp
pop ebp
ret
push edi
call fcn.00415b00
add esp, 4
test eax, eax
je 0x412899
mov al, byte [edi]
cmp al, 0x2f
je 0x412819
cmp al, 0x5c
je 0x412819
movzx eax, al
push eax
call dword [sym.imp.MSVCR120.dll_isalpha]
add esp, 4
test eax, eax
je 0x412809
cmp byte [edi + 1], 0x3a
jne 0x412809
mov al, byte [edi + 2]
cmp al, 0x2f
je 0x412819
cmp al, 0x5c
je 0x412819
push edi
lea eax, [ebp - 0x804]
push eax
push esi
call fcn.00415b90
jmp 0x41282d
push 0x400
push edi
push esi
call dword [sym.imp.MSVCR120.dll_strncpy]
mov byte [esi + 0x3ff], 0
add esp, 0xc
push esi
call fcn.00415c40
push esi
call fcn.00412ec0
add esp, 8
test eax, eax
jne 0x412855
pop edi
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004175a2
mov esp, ebp
pop ebp
ret
push esi
push str.invalid_binary___s_
call sub.libintl_8.dll_libintl_gettext
mov esi, dword [sym.imp.MSVCR120.dll___iob_func]
add esp, 4
push eax
call esi
add eax, 0x40
push eax
call fcn.00413530
call esi
add eax, 0x40
push eax
push 0xa
call dword [sym.imp.MSVCR120.dll_fputc]
add esp, 0x14
or eax, 0xffffffff
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004175a2
mov esp, ebp
pop ebp
ret
push edi
lea eax, [ebp - 0x804]
push eax
push esi
call fcn.00415b90
push esi
call fcn.00412ec0
add esp, 0x10
test eax, eax
je 0x412843
push ebx
push str.PATH
call dword [sym.imp.MSVCR120.dll_getenv]
mov ebx, dword [sym.imp.MSVCR120.dll___iob_func]
mov ecx, eax
add esp, 4
mov dword [ebp - 0x810], ecx
test ecx, ecx
je 0x412a37
cmp byte [ecx], 0
je 0x412a37
xor ebx, ebx
xor eax, eax
test ebx, ebx
mov ebx, ecx
je 0x4128ef
lea ebx, [eax + 1]
push ebx
call fcn.00415b60
add esp, 4
mov dword [ebp - 0x808], eax
test eax, eax
jne 0x412919
mov ecx, ebx
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x412907
sub ecx, edx
lea eax, [ecx + ebx]
mov dword [ebp - 0x808], eax
sub eax, ebx
lea edi, [eax + 1]
cmp edi, 0x400
jge 0x41292c
test edi, edi
je 0x41294b
jmp 0x412931
mov edi, 0x400
push edi
lea eax, [ebp - 0x404]
push ebx
push eax
call dword [sym.imp.MSVCR120.dll_strncpy]
add esp, 0xc
mov byte [ebp + edi - 0x405], 0
mov al, byte [ebp - 0x404]
cmp al, 0x2f
je 0x4129a8
cmp al, 0x5c
je 0x4129a8
movzx eax, al
push eax
call dword [sym.imp.MSVCR120.dll_isalpha]
add esp, 4
test eax, eax
je 0x412981
cmp byte [ebp - 0x403], 0x3a
jne 0x412981
mov al, byte [ebp - 0x402]
cmp al, 0x2f
je 0x4129a8
cmp al, 0x5c
je 0x4129a8
lea eax, [ebp - 0x404]
push eax
lea eax, [ebp - 0x804]
push eax
push esi
call fcn.00415b90
mov edi, dword [ebp - 0x80c]
push edi
push esi
push esi
call fcn.00415b90
add esp, 0x18
jmp 0x4129bf
mov edi, dword [ebp - 0x80c]
lea eax, [ebp - 0x404]
push edi
push eax
push esi
call fcn.00415b90
add esp, 0xc
push esi
call fcn.00415c40
push esi
call fcn.00412ec0
add esp, 8
cmp eax, 0xfffffffe
je 0x4129e8
test eax, eax
jne 0x412a1b
pop ebx
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004175a2
mov esp, ebp
pop ebp
ret
push esi
push str.could_not_read_binary___s_
call sub.libintl_8.dll_libintl_gettext
add esp, 4
push eax
call dword [sym.imp.MSVCR120.dll___iob_func]
add eax, 0x40
push eax
call fcn.00413530
call dword [sym.imp.MSVCR120.dll___iob_func]
add eax, 0x40
push eax
push 0xa
call dword [sym.imp.MSVCR120.dll_fputc]
add esp, 0x14
mov eax, dword [ebp - 0x808]
cmp byte [eax], 0
je 0x412a31
mov ecx, dword [ebp - 0x810]
jmp 0x4128e6
mov ebx, dword [sym.imp.MSVCR120.dll___iob_func]
push edi
push str.could_not_find_a___s__to_execute
call sub.libintl_8.dll_libintl_gettext
add esp, 4
push eax
call ebx
add eax, 0x40
push eax
call fcn.00413530
call ebx
add eax, 0x40
push eax
push 0xa
call dword [sym.imp.MSVCR120.dll_fputc]
mov ecx, dword [ebp - 4]
add esp, 0x14
xor ecx, ebp
or eax, 0xffffffff
pop ebx
pop edi
pop esi
call fcn.004175a2
mov esp, ebp
pop ebp
ret