Function at 0x140002220
Capabilities:
Copy file
Get hostname
Query environment variable

Disassembly:
push rdi
sub rsp, 0x910
mov rax, qword [0x140021220]
xor rax, rsp
mov qword [rsp + 0x908], rax
mov dword [rsp + 0x260], 0
movzx eax, word [0x1400179c4]
mov word [rsp + 0x270], ax
lea rdi, [rsp + 0x272]
xor eax, eax
mov ecx, 0x206
rep stosb byte [rdi], al
movzx eax, word [0x140017a88]
mov word [rsp + 0x40], ax
lea rdi, [rsp + 0x42]
xor eax, eax
mov ecx, 0x206
rep stosb byte [rdi], al
mov r8d, 0x104
lea rdx, [rsp + 0x270]
lea rcx, [0x140017a90]
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
mov r8d, 0x104
lea rdx, [rsp + 0x40]
lea rcx, [0x140017ab0]
call qword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
lea r8, str.metaLLDP.xml
mov edx, 0x104
lea rcx, [rsp + 0x270]
call qword [sym.imp.MSVCR90.dll_wcscat_s]
lea r8, str.dataLLDP.xml
mov edx, 0x104
lea rcx, [rsp + 0x40]
call qword [sym.imp.MSVCR90.dll_wcscat_s]
lea r8, str.SIMATIC_PC
mov edx, 0xff
lea rcx, [0x1400213b0]
call qword [sym.imp.MSVCR90.dll_strcpy_s]
lea r8, str.SIEMENS_AG_SIMATIC_PC
mov edx, 0xff
lea rcx, [0x140021280]
call qword [sym.imp.MSVCR90.dll_strcpy_s]
mov r8d, 1
lea rdx, [rsp + 0x40]
lea rcx, [rsp + 0x270]
call qword [sym.imp.KERNEL32.dll_CopyFileW]
mov dword [rsp + 0x254], eax
cmp dword [rsp + 0x254], 0
jne 0x140002547
cmp qword [0x1400214e8], 0
je 0x140002547
cmp qword [0x1400214f0], 0
je 0x140002547
mov dword [rsp + 0x690], 0x104
lea rax, [rsp + 0x690]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x480]
mov qword [rsp + 0x20], rax
lea r9, [0x140017b40]
lea r8, [0x140017b50]
xor edx, edx
lea rcx, [0x140017b60]
call qword [0x1400214e8]
test eax, eax
jne 0x14000251e
lea rdx, [0x140017b70]
lea rcx, [rsp + 0x480]
call qword [sym.imp.MSVCR90.dll_wcscmp]
test eax, eax
je 0x14000251c
mov dword [rsp + 0x690], 0x104
lea rax, [rsp + 0x690]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x480]
mov qword [rsp + 0x20], rax
lea r9, [0x140017b80]
lea r8, [0x140017b98]
xor edx, edx
lea rcx, [0x140017ba8]
call qword [0x1400214e8]
test eax, eax
jne 0x14000246f
mov dword [rsp + 0x250], 0
jmp 0x14000242b
mov eax, dword [rsp + 0x250]
add eax, 1
mov dword [rsp + 0x250], eax
mov eax, dword [rsp + 0x690]
cmp dword [rsp + 0x250], eax
jae 0x14000245d
mov eax, dword [rsp + 0x250]
mov edx, dword [rsp + 0x250]
lea rcx, [0x1400213b0]
movzx eax, byte [rsp + rax*2 + 0x480]
mov byte [rcx + rdx], al
jmp 0x14000241a
mov ecx, dword [rsp + 0x250]
lea rax, [0x1400213b0]
mov byte [rax + rcx], 0
mov dword [rsp + 0x690], 0x104
lea rax, [rsp + 0x690]
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x480]
mov qword [rsp + 0x20], rax
lea r9, [0x140017bb8]
lea r8, [0x140017bd0]
xor edx, edx
lea rcx, str.data
call qword [0x1400214e8]
test eax, eax
jne 0x140002517
mov dword [rsp + 0x250], 0
jmp 0x1400024d3
mov eax, dword [rsp + 0x250]
add eax, 1
mov dword [rsp + 0x250], eax
mov eax, dword [rsp + 0x690]
cmp dword [rsp + 0x250], eax
jae 0x140002505
mov eax, dword [rsp + 0x250]
mov edx, dword [rsp + 0x250]
lea rcx, [0x140021280]
movzx eax, byte [rsp + rax*2 + 0x480]
mov byte [rcx + rdx], al
jmp 0x1400024c2
mov ecx, dword [rsp + 0x250]
lea rax, [0x140021280]
mov byte [rax + rcx], 0
jmp 0x140002a2a
jmp 0x140002547
lea rax, str.bool
mov qword [rsp + 0x20], rax
lea r9, str.true
lea r8, str.Auto
lea rdx, [0x140017c20]
xor ecx, ecx
call qword [0x1400214f0]
call fcn.140001ed0
test eax, eax
jne 0x140002567
call fcn.140001c30
test eax, eax
je 0x140002567
mov byte [0x1400213b9], 0x47
mov byte [0x140021294], 0x47
mov dword [rsp + 0x264], 0xff
lea rdx, [rsp + 0x264]
lea rcx, [0x1400213b0]
call qword [sym.imp.KERNEL32.dll_GetComputerNameA]
lea rax, [0x1400213b0]
mov qword [rsp + 0x698], rax
mov byte [rsp + 0x6a0], 0
lea rdi, [rsp + 0x6a1]
xor eax, eax
mov ecx, 0x3f
rep stosb byte [rdi], al
mov rax, qword [rsp + 0x698]
movsx eax, byte [rax]
cmp eax, 0x2d
jne 0x1400025d3
mov rax, qword [rsp + 0x698]
add rax, 1
mov qword [rsp + 0x698], rax
mov dword [rsp + 0x694], 0
jmp 0x1400025f4
mov rax, qword [rsp + 0x698]
add rax, 1
mov qword [rsp + 0x698], rax
cmp dword [rsp + 0x694], 0x3f
jge 0x1400026e8
mov rax, qword [rsp + 0x698]
movsx eax, byte [rax]
cmp eax, 0x41
jl 0x140002622
mov rax, qword [rsp + 0x698]
movsx eax, byte [rax]
cmp eax, 0x5a
jle 0x140002672
mov rax, qword [rsp + 0x698]
movsx eax, byte [rax]
cmp eax, 0x61
jl 0x140002642
mov rax, qword [rsp + 0x698]
movsx eax, byte [rax]
cmp eax, 0x7a
jle 0x140002672
mov rax, qword [rsp + 0x698]
movsx eax, byte [rax]
cmp eax, 0x30
jl 0x140002662
mov rax, qword [rsp + 0x698]
movsx eax, byte [rax]
cmp eax, 0x39
jle 0x140002672
mov rax, qword [rsp + 0x698]
movsx eax, byte [rax]
cmp eax, 0x2d
jne 0x14000269f
movsxd rcx, dword [rsp + 0x694]
mov rax, qword [rsp + 0x698]
movzx eax, byte [rax]
mov byte [rsp + rcx + 0x6a0], al
mov eax, dword [rsp + 0x694]
add eax, 1
mov dword [rsp + 0x694], eax
jmp 0x1400026e3
mov rax, qword [rsp + 0x698]
movsx eax, byte [rax]
cmp eax, 0x5f
jne 0x1400026d2
movsxd rax, dword [rsp + 0x694]
mov byte [rsp + rax + 0x6a0], 0x2d
mov eax, dword [rsp + 0x694]
add eax, 1
mov dword [rsp + 0x694], eax
jmp 0x1400026e3
mov rax, qword [rsp + 0x698]
movsx eax, byte [rax]
test eax, eax
jne 0x1400026e3
jmp 0x1400026e8
jmp 0x1400025e0
mov eax, dword [rsp + 0x694]
sub eax, 1
cdqe
movsx eax, byte [rsp + rax + 0x6a0]
cmp eax, 0x2d
jne 0x140002712
mov eax, dword [rsp + 0x694]
sub eax, 1
mov dword [rsp + 0x694], eax
movsxd rax, dword [rsp + 0x694]
mov byte [rsp + rax + 0x6a0], 0
lea r8, [rsp + 0x6a0]
mov edx, 0x40
lea rcx, [0x1400213b0]
call qword [sym.imp.MSVCR90.dll_strcpy_s]
lea rax, [rsp + 0x258]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
lea rdx, [0x140017c30]
mov rcx, 0xffffffff80000001
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x14000278b
mov eax, dword [rsp + 0x260]
or eax, 1
mov dword [rsp + 0x260], eax
mov rcx, qword [rsp + 0x258]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x1400027d8
lea rax, [rsp + 0x258]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
lea rdx, str.SOFTWAREWow6432NodeSiemensAUTSWSTEP7
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x1400027d8
mov eax, dword [rsp + 0x260]
or eax, 1
mov dword [rsp + 0x260], eax
mov rcx, qword [rsp + 0x258]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea rax, [rsp + 0x258]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
lea rdx, [0x140017c90]
mov rcx, 0xffffffff80000001
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x140002827
mov eax, dword [rsp + 0x260]
or eax, 2
mov dword [rsp + 0x260], eax
mov rcx, qword [rsp + 0x258]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
jmp 0x140002874
lea rax, [rsp + 0x258]
mov qword [rsp + 0x20], rax
mov r9d, 0x20019
xor r8d, r8d
lea rdx, str.SOFTWAREWow6432NodeSiemensAUTSWWinCC
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x140002874
mov eax, dword [rsp + 0x260]
or eax, 2
mov dword [rsp + 0x260], eax
mov rcx, qword [rsp + 0x258]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [rsp + 0x260]
mov dword [rsp + 0x900], eax
cmp dword [rsp + 0x900], 1
je 0x1400028a2
cmp dword [rsp + 0x900], 2
je 0x1400028bd
cmp dword [rsp + 0x900], 3
je 0x1400028d8
jmp 0x1400028f1
lea r8, str.__engineering
mov edx, 0xff
lea rcx, [0x140021280]
call qword [sym.imp.MSVCR90.dll_strcat_s]
jmp 0x1400028f1
lea r8, str.__HMI
mov edx, 0xff
lea rcx, [0x140021280]
call qword [sym.imp.MSVCR90.dll_strcat_s]
jmp 0x1400028f1
lea r8, str.__TIA
mov edx, 0xff
lea rcx, [0x140021280]
call qword [sym.imp.MSVCR90.dll_strcat_s]
cmp qword [0x1400214f0], 0
je 0x140002a2a
xor eax, eax
mov word [rsp + 0x6f0], ax
lea rdi, [rsp + 0x6f2]
xor eax, eax
mov ecx, 0x206
rep stosb byte [rdi], al
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov r9d, 0xffffffff
lea r8, [0x1400213b0]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [rsp + 0x6e0], eax
mov eax, dword [rsp + 0x6e0]
mov dword [rsp + 0x28], eax
lea rax, [rsp + 0x6f0]
mov qword [rsp + 0x20], rax
mov r9d, 0xffffffff
lea r8, [0x1400213b0]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea rdx, [0x140017d10]
mov qword [rsp + 0x20], rdx
lea r9, [rsp + 0x6f0]
lea r8, str.SystemName
lea rdx, [0x140017d38]
xor ecx, ecx
call qword [0x1400214f0]
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov r9d, 0xffffffff
lea r8, [0x140021280]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov dword [rsp + 0x6e0], eax
mov eax, dword [rsp + 0x6e0]
mov dword [rsp + 0x28], eax
lea rax, [rsp + 0x6f0]
mov qword [rsp + 0x20], rax
mov r9d, 0xffffffff
lea r8, [0x140021280]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea rdx, str.string
mov qword [rsp + 0x20], rdx
lea r9, [rsp + 0x6f0]
lea r8, str.SystemDesc
lea rdx, str.LLDP
xor ecx, ecx
call qword [0x1400214f0]
mov rcx, qword [rsp + 0x908]
xor rcx, rsp
call fcn.140015270
add rsp, 0x910
pop rdi
ret