Function at 0x409fd0
Capabilities:
Check if file exists
Get common file path
Get file attributes
Get hostname
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x344
mov eax, dword [0x4355ec]
mov cl, byte [0x4355f0]
push ebx
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push edi
lea edx, [ebp - 0x344]
push edx
push 0x104
mov dword [ebp - 0xc], 0x10
mov dword [ebp - 8], eax
mov byte [ebp - 4], cl
call esi
mov ebx, dword [ebp + 8]
cmp ebx, 1
mov edi, dword [ebp + 0xc]
jle 0x40a05d
mov eax, dword [edi + 4]
mov ecx, str._verify
jmp 0x40a020
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x40a040
test dl, dl
je 0x40a03c
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x40a040
add eax, 2
add ecx, 2
test dl, dl
jne 0x40a020
xor eax, eax
jmp 0x40a045
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x40a05d
push str.ptc_setvars.exe_Version_2.0_n
call fcn.00414a30
add esp, 4
push 0
call fcn.00401475
cmp ebx, 4
jge 0x40a080
push str.Usage:_ptc_setvars.exe__command_line___command_name___extention__n
call fcn.00414a30
push str.Example:_ptc_setvars.exe_C:ptcproe_bin_runpro.bat_runpro_bat_n
call fcn.00414a30
add esp, 8
push 0xffffffffffffffff
call fcn.00401475
mov eax, dword [edi + 4]
push eax
lea ecx, [ebp - 0x134]
push ecx
call fcn.00413800
add esp, 8
cmp byte [ebp - 0x134], 0
je 0x40a0cc
lea edx, [ebp - 0x134]
push 0x5c
push edx
call fcn.0041aef0
add esp, 8
test eax, eax
je 0x40a0b4
mov byte [eax], 0
lea eax, [ebp - 0x134]
push 0x5c
push eax
call fcn.0041aef0
add esp, 8
test eax, eax
je 0x40a0cc
mov byte [eax], 0
mov ebx, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
lea ecx, [ebp - 0x134]
push ecx
call ebx
lea edx, [ebp - 0x134]
push edx
push 0x104
call esi
mov eax, dword [edi + 0xc]
mov ecx, dword [edi + 8]
push eax
push ecx
lea edx, [ebp - 0x134]
push edx
lea eax, [ebp - 0x23c]
push str._s_bin_s._s
push eax
call fcn.00413800
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
add esp, 0x14
lea ecx, [ebp - 0x23c]
push ecx
call esi
cmp eax, 0xffffffff
jne 0x40a1c7
cmp dword [ebp + 8], 3
mov byte [ebp - 0x134], 0
jle 0x40a1d0
mov edx, dword [edi + 0xc]
mov eax, dword [edi + 8]
push edx
push eax
lea ecx, [ebp - 0x23c]
push str._s._s
push ecx
call fcn.00413800
lea edx, [ebp - 0x134]
push edx
lea eax, [ebp - 8]
push eax
lea ecx, [ebp - 0x23c]
push ecx
call fcn.0040bfd0
add esp, 0x1c
cmp byte [ebp - 0x134], 0
je 0x40a196
lea edx, [ebp - 0x134]
push 0x5c
push edx
call fcn.0041aef0
mov byte [eax], 0
lea eax, [ebp - 0x134]
push 0x5c
push eax
call fcn.0041aef0
add esp, 0x10
mov byte [eax], 0
mov ecx, dword [edi + 0xc]
mov edx, dword [edi + 8]
push ecx
push edx
lea eax, [ebp - 0x134]
push eax
lea ecx, [ebp - 0x23c]
push str._s_bin_s._s
push ecx
call fcn.00413800
add esp, 0x14
lea edx, [ebp - 0x23c]
push edx
call esi
cmp eax, 0xffffffff
je 0x40a1d0
cmp byte [ebp - 0x134], 0
jne 0x40a1de
mov byte [ebp - 0x134], 0x2e
mov byte [ebp - 0x133], 0
lea eax, [ebp - 0xc]
push eax
lea ecx, [ebp - 0x2c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetComputerNameA]
lea edx, [ebp - 0x1c]
push edx
lea eax, [ebp - 0x2c]
push eax
call fcn.00409e00
push 0x104
lea ecx, [ebp - 0x23c]
push ecx
lea edx, [ebp - 0x134]
push edx
call fcn.00409e50
add esp, 0x14
xor eax, eax
jmp 0x40a220
mov cl, byte [ebp + eax - 0x23c]
mov byte [ebp + eax - 0x134], cl
inc eax
test cl, cl
jne 0x40a220
lea eax, [ebp - 0x344]
push eax
call ebx
push 0x435524
push str.ptc_setvars.bat
call fcn.0040c6f0
mov esi, eax
add esp, 8
test esi, esi
je 0x40a285
lea ecx, [ebp - 0x1c]
push ecx
push str.set_PTC_HOSTNAME_s_n
push esi
call fcn.004149b0
lea edx, [ebp - 0x134]
push edx
push str.set_PRODIR_s_n
push esi
call fcn.004149b0
push esi
call fcn.0040c700
add esp, 0x1c
push 0
call fcn.00401475
push str.ERROR:_could_not_write_ptc_setvars.bat_to_current_directory_n
call fcn.0040c6b0
push eax
call fcn.004149b0
add esp, 8
push 0xffffffffffffffff
call fcn.00401475
int3