Function at 0x401a50
Capabilities:
Check if file exists
Get file attributes
Query environment variable

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x40a571
mov eax, dword fs:[0]
push eax
push ecx
sub esp, 0x3b4
push ebx
push esi
push edi
lea edi, [ebp - 0x3c4]
mov ecx, 0xed
mov eax, 0xcccccccc
rep stosd dword es:[edi], eax
mov eax, dword [0x410028]
xor eax, ebp
mov dword [ebp - 0x14], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, esp
push 0x104
lea eax, [ebp - 0x220]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
cmp esi, esp
call fcn.00408b45
mov dword [ebp - 0x228], eax
cmp dword [ebp - 0x228], 0
jne 0x401ae2
mov esi, esp
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, esp
call fcn.00408b45
push eax
push 0x40b3a0
push 0xdc
call fcn.00401420
add esp, 0xc
movzx ecx, byte [section..data]
test ecx, ecx
je 0x401b4b
lea edx, [ebp - 0x220]
push edx
push str.EXE_containing_current_process_is__S
lea eax, [ebp - 0x314]
push eax
call fcn.00405710
add esp, 0xc
mov dword [ebp - 0x364], eax
mov ecx, dword [ebp - 0x364]
mov dword [ebp - 0x368], ecx
mov dword [ebp - 4], 0
mov ecx, dword [ebp - 0x368]
call fcn.00406790
push eax
call fcn.004011e0
add esp, 4
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x314]
call fcn.00406200
jmp 0x401b4b
mov esi, esp
lea edx, [ebp - 0x220]
push edx
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
cmp esi, esp
call fcn.00408b45
test eax, eax
jne 0x401b86
push str.PathRemoveFileSpec_failed
lea ecx, [ebp - 0x320]
call fcn.004060f0
push 0x40e480
lea eax, [ebp - 0x320]
push eax
call sub.VCRUNTIME140.dll__CxxThrowException
movzx ecx, byte [section..data]
test ecx, ecx
je 0x401bef
lea edx, [ebp - 0x220]
push edx
push str.parent_of_EXE_containing_current_process_is__S
lea eax, [ebp - 0x328]
push eax
call fcn.00405710
add esp, 0xc
mov dword [ebp - 0x36c], eax
mov ecx, dword [ebp - 0x36c]
mov dword [ebp - 0x370], ecx
mov dword [ebp - 4], 1
mov ecx, dword [ebp - 0x370]
call fcn.00406790
push eax
call fcn.004011e0
add esp, 4
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x328]
call fcn.00406200
jmp 0x401bef
lea edx, [ebp - 0x220]
push edx
lea ecx, [ebp - 0x240]
call fcn.00405b80
mov dword [ebp - 0x374], eax
mov eax, dword [ebp - 0x374]
mov dword [ebp - 0x378], eax
mov dword [ebp - 4], 2
push str.AppleVersions
mov ecx, dword [ebp - 0x378]
push ecx
lea edx, [ebp - 0x25c]
push edx
call fcn.00404540
add esp, 0xc
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x240]
call fcn.004063a0
push str..dll
lea ecx, [ebp - 0x25c]
call fcn.004069b0
lea eax, [ebp - 0x220]
push eax
lea ecx, [ebp - 0x278]
call fcn.00405b80
mov dword [ebp - 0x37c], eax
mov ecx, dword [ebp - 0x37c]
mov dword [ebp - 0x380], ecx
mov byte [ebp - 4], 5
push str.MobileDevice.dll
mov edx, dword [ebp - 0x380]
push edx
lea eax, [ebp - 0x294]
push eax
call fcn.00404540
add esp, 0xc
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x278]
call fcn.004063a0
lea ecx, [ebp - 0x294]
call fcn.00407ad0
mov esi, esp
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp esi, esp
call fcn.00408b45
cmp eax, 0xffffffff
je 0x401cd2
mov dword [ebp - 0x384], 1
jmp 0x401cdc
mov dword [ebp - 0x384], 0
mov cl, byte [ebp - 0x384]
mov byte [ebp - 0x299], cl
movzx edx, byte [section..data]
test edx, edx
je 0x401d50
lea ecx, [ebp - 0x294]
call fcn.00407ad0
push eax
push str.found__S
lea eax, [ebp - 0x330]
push eax
call fcn.00405710
add esp, 0xc
mov dword [ebp - 0x388], eax
mov ecx, dword [ebp - 0x388]
mov dword [ebp - 0x38c], ecx
mov byte [ebp - 4], 8
mov ecx, dword [ebp - 0x38c]
call fcn.00406790
push eax
call fcn.004011e0
add esp, 4
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x330]
call fcn.00406200
jmp 0x401d50
movzx edx, byte [section..data]
test edx, edx
je 0x401db8
lea ecx, [ebp - 0x25c]
call fcn.00407ad0
push eax
push str.potential_path_to_AppleVersions_DLL_is__S
lea eax, [ebp - 0x338]
push eax
call fcn.00405710
add esp, 0xc
mov dword [ebp - 0x390], eax
mov ecx, dword [ebp - 0x390]
mov dword [ebp - 0x394], ecx
mov byte [ebp - 4], 9
mov ecx, dword [ebp - 0x394]
call fcn.00406790
push eax
call fcn.004011e0
add esp, 4
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x338]
call fcn.00406200
jmp 0x401db8
lea ecx, [ebp - 0x25c]
call fcn.00407ad0
mov esi, esp
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp esi, esp
call fcn.00408b45
mov dword [ebp - 0x2a0], eax
cmp dword [ebp - 0x2a0], 0xffffffff
jne 0x401e3e
mov esi, esp
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, esp
call fcn.00408b45
mov dword [ebp - 0x2a4], eax
cmp dword [ebp - 0x2a4], 2
je 0x401e22
cmp dword [ebp - 0x2a4], 3
je 0x401e22
mov edx, dword [ebp - 0x2a4]
push edx
push 0x40b4d8
push 0xf1
call fcn.00401420
add esp, 0xc
movzx eax, byte [section..data]
test eax, eax
je 0x401e3e
push str.found_no_file_system_object_along_path_to_AppleVersions_DLL
call fcn.004011e0
add esp, 4
jmp 0x401e3e
mov ecx, dword [ebp - 0x2a0]
and ecx, 0x10
jne 0x401f4d
movzx edx, byte [section..data]
test edx, edx
je 0x401ea9
push str.found_file_along_path_to_AppleVersions_DLL
lea eax, [ebp - 0x340]
push eax
call fcn.00405710
add esp, 8
mov dword [ebp - 0x398], eax
mov ecx, dword [ebp - 0x398]
mov dword [ebp - 0x39c], ecx
mov byte [ebp - 4], 0xa
mov ecx, dword [ebp - 0x39c]
call fcn.00406790
push eax
call fcn.004011e0
add esp, 4
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x340]
call fcn.00406200
jmp 0x401ea9
mov esi, esp
lea edx, [ebp - 0x220]
push edx
call dword [sym.imp.KERNEL32.dll_SetDllDirectoryW]
cmp esi, esp
call fcn.00408b45
test eax, eax
jne 0x401ee5
mov esi, esp
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, esp
call fcn.00408b45
push eax
push 0x40b57c
push 0x109
call fcn.00401420
add esp, 0xc
movzx eax, byte [section..data]
test eax, eax
je 0x401f48
lea ecx, [ebp - 0x220]
push ecx
push 0x40b5b8
lea edx, [ebp - 0x348]
push edx
call fcn.00405710
add esp, 0xc
mov dword [ebp - 0x3a0], eax
mov eax, dword [ebp - 0x3a0]
mov dword [ebp - 0x3a4], eax
mov byte [ebp - 4], 0xb
mov ecx, dword [ebp - 0x3a4]
call fcn.00406790
push eax
call fcn.004011e0
add esp, 4
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x348]
call fcn.00406200
jmp 0x401f48
jmp 0x402297
mov esi, esp
push 0x104
lea ecx, [ebp - 0x220]
push ecx
push str.AppleApplicationSupportSDK
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
cmp esi, esp
call fcn.00408b45
mov dword [ebp - 0x2a8], eax
cmp dword [ebp - 0x2a8], 0
je 0x402089
movzx edx, byte [section..data]
test edx, edx
je 0x401f9c
push str.environment_variable_AppleApplicationSupportSDK_is_defined
call fcn.004011e0
add esp, 4
jmp 0x401f9c
mov dword [ebp - 0x2ac], str.Program_Files__x86_Common_FilesAppleApple_Application_Support
mov eax, dword [ebp - 0x2ac]
push eax
lea ecx, [ebp - 0x220]
push ecx
push str._s_s
lea edx, [ebp - 0x2b8]
push edx
call fcn.00405850
add esp, 0x10
mov byte [ebp - 4], 0xc
lea ecx, [ebp - 0x2b8]
call fcn.00406790
mov esi, esp
push eax
call dword [sym.imp.KERNEL32.dll_SetDllDirectoryW]
cmp esi, esp
call fcn.00408b45
test eax, eax
jne 0x40200d
mov esi, esp
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, esp
call fcn.00408b45
push eax
push 0x40b6f0
push 0x124
call fcn.00401420
add esp, 0xc
movzx eax, byte [section..data]
test eax, eax
je 0x402075
lea ecx, [ebp - 0x2b8]
call fcn.00406790
push eax
push 0x40b72c
lea ecx, [ebp - 0x350]
push ecx
call fcn.00405710
add esp, 0xc
mov dword [ebp - 0x3a8], eax
mov edx, dword [ebp - 0x3a8]
mov dword [ebp - 0x3ac], edx
mov byte [ebp - 4], 0xd
mov ecx, dword [ebp - 0x3ac]
call fcn.00406790
push eax
call fcn.004011e0
add esp, 4
mov byte [ebp - 4], 0xc
lea ecx, [ebp - 0x350]
call fcn.00406200
jmp 0x402075
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x2b8]
call fcn.00406200
jmp 0x402297
movzx eax, byte [section..data]
test eax, eax
je 0x4020a5
push str.environment_variable_AppleApplicationSupportSDK_NOT_defined__falling_back_to_customer_installation
call fcn.004011e0
add esp, 4
jmp 0x4020a5
lea ecx, [ebp - 0x2d8]
call fcn.00405c80
mov byte [ebp - 4], 0xe
movzx ecx, byte [ebp - 0x299]
test ecx, ecx
je 0x40211e
mov byte [ebp - 4], 0xf
push str.AASInstallDir
push str.Apple_Mobile_Device_Support
lea edx, [ebp - 0x2f4]
push edx
call fcn.004018e0
add esp, 0xc
mov dword [ebp - 0x3b0], eax
mov eax, dword [ebp - 0x3b0]
push eax
lea ecx, [ebp - 0x2d8]
call fcn.00406620
lea ecx, [ebp - 0x2f4]
call fcn.004063a0
jmp 0x40210e
mov dword [ebp - 4], 0xe
jmp 0x40211e
movzx ecx, byte [ebp - 0x299]
test ecx, ecx
je 0x40213b
lea ecx, [ebp - 0x2d8]
call fcn.00407c20
movzx edx, al
test edx, edx
je 0x402177
push str.InstallDir
push str.Apple_Application_Support
lea eax, [ebp - 0x30c]
push eax
call fcn.004018e0
add esp, 0xc
mov dword [ebp - 0x3b4], eax
mov ecx, dword [ebp - 0x3b4]
push ecx
lea ecx, [ebp - 0x2d8]
call fcn.00406620
lea ecx, [ebp - 0x30c]
call fcn.004063a0
movzx edx, byte [section..data]
test edx, edx
je 0x4021df
lea ecx, [ebp - 0x2d8]
call fcn.00407ad0
push eax
push str.AAS_path_is__S
lea eax, [ebp - 0x358]
push eax
call fcn.00405710
add esp, 0xc
mov dword [ebp - 0x3b8], eax
mov ecx, dword [ebp - 0x3b8]
mov dword [ebp - 0x3bc], ecx
mov byte [ebp - 4], 0x11
mov ecx, dword [ebp - 0x3bc]
call fcn.00406790
push eax
call fcn.004011e0
add esp, 4
mov byte [ebp - 4], 0xe
lea ecx, [ebp - 0x358]
call fcn.00406200
jmp 0x4021df
lea ecx, [ebp - 0x2d8]
call fcn.00407ad0
mov esi, esp
push eax
call dword [sym.imp.KERNEL32.dll_SetDllDirectoryW]
cmp esi, esp
call fcn.00408b45
test eax, eax
jne 0x402220
mov esi, esp
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp esi, esp
call fcn.00408b45
push eax
push 0x40b874
push 0x13e
call fcn.00401420
add esp, 0xc
movzx edx, byte [section..data]
test edx, edx
je 0x402288
lea ecx, [ebp - 0x2d8]
call fcn.00407ad0
push eax
push str.called_SetDllDirectoryW_successfully_with_path__S
lea eax, [ebp - 0x360]
push eax
call fcn.00405710
add esp, 0xc
mov dword [ebp - 0x3c0], eax
mov ecx, dword [ebp - 0x3c0]
mov dword [ebp - 0x3c4], ecx
mov byte [ebp - 4], 0x12
mov ecx, dword [ebp - 0x3c4]
call fcn.00406790
push eax
call fcn.004011e0
add esp, 4
mov byte [ebp - 4], 0xe
lea ecx, [ebp - 0x360]
call fcn.00406200
jmp 0x402288
mov byte [ebp - 4], 7
lea ecx, [ebp - 0x2d8]
call fcn.004063a0
mov byte [ebp - 4], 4
lea ecx, [ebp - 0x294]
call fcn.004063a0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x25c]
call fcn.004063a0
push edx
mov ecx, ebp
push eax
lea edx, [0x4022f4]
call fcn.00408af1
pop eax
pop edx
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.00408b74
add esp, 0x3c4
cmp ebp, esp
call fcn.00408b45
mov esp, ebp
pop ebp
ret