Function at 0x100018b0
Capabilities:
Check if file exists
Get file attributes
Query environment variable
Query or enumerate registry value
Set environment variable

Disassembly:
push ebp
mov ebp, esp
mov eax, 0xa658
call fcn.10007a80
mov eax, dword [0x10020170]
xor eax, ebp
mov dword [ebp - 4], eax
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
push 0x206
mov dword [ebp - 0xa658], ecx
xor ebx, ebx
mov dword [ebp - 0xa654], eax
xor eax, eax
lea ecx, [ebp - 0x43a]
xor edx, edx
push ebx
push ecx
mov word [ebp - 0x2c], dx
mov dword [ebp - 0x2a], eax
mov dword [ebp - 0x26], eax
mov dword [ebp - 0x22], eax
mov dword [ebp - 0x1e], eax
mov dword [ebp - 0x1a], eax
mov dword [ebp - 0x16], eax
mov dword [ebp - 0x12], eax
mov dword [ebp - 0xe], eax
mov dword [ebp - 0xa], eax
mov word [ebp - 6], ax
mov word [ebp - 0x43c], ax
call fcn.10007ab0
push 0x206
lea eax, [ebp - 0x642]
xor edx, edx
push ebx
push eax
mov word [ebp - 0x644], dx
call fcn.10007ab0
push 0x3ffe
lea edx, [ebp - 0x8642]
xor ecx, ecx
push ebx
push edx
mov word [ebp - 0x8644], cx
call fcn.10007ab0
push 0x3ffe
lea ecx, [ebp - 0x4642]
xor eax, eax
push ebx
push ecx
mov word [ebp - 0x4644], ax
call fcn.10007ab0
push 0x206
lea eax, [ebp - 0x232]
xor edx, edx
push ebx
push eax
mov word [ebp - 0x234], dx
call fcn.10007ab0
add esp, 0x3c
mov edi, 0x104
push edi
lea ecx, [ebp - 0x2c]
push ecx
push 0x3ed
push esi
call dword [sym.imp.USER32.dll_LoadStringW]
push 0x2000
lea edx, [ebp - 0x8644]
push edx
push 0x1001b38c
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea eax, [ebp - 0xa648]
push eax
push 1
push ebx
push 0x1001b4c0
push 0x80000002
mov dword [ebp - 0xa650], edi
mov dword [ebp - 0xa64c], 1
mov dword [ebp - 0xa648], ebx
call esi
test eax, eax
jne 0x10001a2c
mov eax, dword [ebp - 0xa648]
cmp eax, ebx
je 0x10001a2c
lea ecx, [ebp - 0xa650]
push ecx
lea edx, [ebp - 0x644]
push edx
lea ecx, [ebp - 0xa64c]
push ecx
push ebx
push str.Location
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edx, dword [ebp - 0xa648]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0xa648]
push eax
push 1
push ebx
push str.SoftwareSybasePowerBuilder21.0
push 0x80000002
mov dword [ebp - 0xa64c], edi
mov dword [ebp - 0xa650], 1
mov dword [ebp - 0xa648], ebx
call esi
test eax, eax
jne 0x10001a95
mov eax, dword [ebp - 0xa648]
cmp eax, ebx
je 0x10001a95
lea ecx, [ebp - 0xa64c]
push ecx
lea edx, [ebp - 0x234]
push edx
lea ecx, [ebp - 0xa650]
push ecx
push ebx
push str.IPS_Name
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edx, dword [ebp - 0xa648]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x234]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001aa0
sub eax, edx
sar eax, 1
je 0x10001b58
lea eax, [ebp - 0x644]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001ac0
sub eax, edx
sar eax, 1
je 0x10001b58
lea eax, [ebp - 0x234]
push eax
lea ecx, [ebp - 0x644]
push ecx
mov edx, eax
push edx
mov eax, ecx
push eax
lea ecx, [ebp - 0x4644]
push str._s_sIDE__s_sIDEx64_
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [ebp - 0x8644]
add esp, 0x18
mov edx, eax
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001b06
lea edi, [ebp - 0x4644]
sub eax, edx
add edi, 0xfffffffe
lea esp, [esp]
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x10001b20
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
xor eax, eax
mov edi, edi
movzx ecx, word [ebp + eax - 0x4644]
mov word [ebp + eax - 0x8644], cx
add eax, 2
cmp cx, bx
jne 0x10001b40
push 0x104
lea edx, [ebp - 0x644]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor eax, eax
lea ecx, [ecx]
movzx ecx, word [ebp + eax - 0x644]
mov word [ebp + eax - 0x234], cx
add eax, 2
cmp cx, bx
jne 0x10001b70
lea eax, [ebp - 0x234]
push 0x5c
push eax
call fcn.100079b4
add esp, 8
cmp eax, ebx
je 0x10001ba2
xor ecx, ecx
mov word [eax], cx
lea edi, [ebp - 0x234]
add edi, 0xfffffffe
jmp 0x10001bb0
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x10001bb0
mov edx, dword [0x1001b57c]
mov eax, dword [ebp - 0xa654]
mov dword [edi], edx
mov edx, eax
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001bd0
lea edi, [ebp - 0x234]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x10001be6
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea eax, [ebp - 0x234]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x10001c69
lea ecx, [ebp - 0x234]
push ecx
call fcn.100015d0
add esp, 4
test eax, eax
je 0x10001c69
lea edx, [ebp - 0x234]
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
jne 0x10002018
mov ecx, dword [ebp - 0xa658]
lea eax, [ebp - 0x2c]
push eax
push ecx
lea edx, [ebp - 0x234]
push edx
call fcn.100014b0
add esp, 0xc
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10007a4d
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x43c]
push eax
call fcn.10001670
add esp, 4
test eax, eax
lea eax, [ebp - 0x43c]
je 0x10001de9
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001c90
sub eax, edx
sar eax, 1
jne 0x10001cc9
mov ecx, dword [ebp - 0xa658]
push 0x1001b580
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 8
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.10007a4d
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 0x43c]
push 0x1001b5e4
push edx
call fcn.100079e2
add esp, 8
test eax, eax
jne 0x10001d79
push 2
lea eax, [ebp - 0x43c]
push 0x1001b5e8
push eax
call fcn.10008247
add esp, 0xc
test eax, eax
je 0x10001d79
lea ecx, [ebp - 0x43c]
push ecx
lea edx, [ebp - 0x644]
push edx
mov eax, ecx
push eax
mov ecx, edx
push ecx
lea edx, [ebp - 0x4644]
push str._s.._s__s.._sx64_
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [ebp - 0x8644]
add esp, 0x18
mov edx, eax
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001d30
lea edi, [ebp - 0x4644]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x10001d46
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea eax, [ebp - 0x4644]
push eax
and ecx, 3
push str.path
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
jmp 0x10001fe9
lea ecx, [ebp - 0x43c]
push ecx
mov edx, ecx
push edx
lea eax, [ebp - 0x4644]
push str._s__sx64_
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [ebp - 0x8644]
add esp, 0x10
mov edx, eax
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001da0
lea edi, [ebp - 0x4644]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x10001db6
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebp - 0x4644]
push ecx
push 0x1001b608
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
jmp 0x10001fe9
mov edx, dword [ebp - 0xa654]
push edx
push eax
lea ecx, [ebp - 0x2c]
push ecx
lea edx, [ebp - 0x8644]
push edx
call fcn.10001190
add esp, 0x10
test eax, eax
jne 0x10001fe9
push 0x1ffe
lea ecx, [ebp - 0xa642]
push ebx
push ecx
mov word [ebp - 0xa644], ax
call fcn.10007ab0
add esp, 0xc
lea edx, [ebp - 0xa648]
push edx
push 1
push ebx
push str.SoftwareSybasePowerBuilder_Runtime
push 0x80000002
mov dword [ebp - 0xa64c], 0x2000
mov dword [ebp - 0xa650], 2
mov dword [ebp - 0xa648], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x10001e99
mov eax, dword [ebp - 0xa648]
cmp eax, ebx
je 0x10001e99
lea ecx, [ebp - 0xa64c]
push ecx
lea edx, [ebp - 0xa644]
push edx
lea ecx, [ebp - 0xa650]
push ecx
push ebx
push str.RuntimeVersion
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edx, dword [ebp - 0xa648]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0xa644]
push 0x2c
push eax
xor edi, edi
call fcn.1000798d
add esp, 8
cmp eax, ebx
je 0x10001ec3
add eax, 2
push 0x2c
push eax
inc edi
call fcn.1000798d
add esp, 8
cmp eax, ebx
jne 0x10001eb0
xor ecx, ecx
mov eax, edi
mov edx, 0x14
mul edx
seto cl
xor ebx, ebx
neg ecx
or eax, ecx
mov ecx, 2
mul ecx
seto bl
neg ebx
or ebx, eax
push ebx
call fcn.10008119
lea edx, [edi + edi*4]
add edx, edx
add edx, edx
add edx, edx
push edx
mov ebx, eax
push 0
push ebx
mov dword [ebp - 0xa648], ebx
call fcn.10007ab0
lea eax, [ebp - 0xa644]
push 0x1001b6bc
push eax
call fcn.10008199
add esp, 0x18
test eax, eax
je 0x10001f52
mov esi, ebx
nop
mov edx, esi
add esi, 0x28
sub edx, eax
jmp 0x10001f30
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x10001f30
push 0x1001b6c0
push 0
call fcn.10008199
add esp, 8
test eax, eax
jne 0x10001f20
push edi
push ebx
call fcn.10001060
add esp, 8
xor esi, esi
test edi, edi
jle 0x10001fde
mov ebx, dword [ebp - 0xa648]
lea esp, [esp]
lea ecx, [ebp - 0x2c]
mov eax, ebx
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x10001f9b
test dx, dx
je 0x10001f97
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x10001f9b
add eax, 4
add ecx, 4
test dx, dx
jne 0x10001f75
xor eax, eax
jmp 0x10001fa0
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jg 0x10001fae
inc esi
add ebx, 0x28
cmp esi, edi
jl 0x10001f70
jmp 0x10001fd8
mov ecx, dword [ebp - 0xa654]
push ecx
mov ecx, dword [ebp - 0xa648]
lea edx, [ebp - 0x43c]
push edx
lea eax, [esi + esi*4]
lea edx, [ecx + eax*8]
push edx
lea eax, [ebp - 0x8644]
push eax
call fcn.10001190
add esp, 0x10
mov ebx, dword [ebp - 0xa648]
push ebx
call fcn.10007a42
add esp, 4
xor ebx, ebx
mov ecx, dword [ebp - 0xa654]
push ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov esi, eax
cmp esi, ebx
jne 0x10002016
mov eax, dword [ebp - 0xa658]
lea edx, [ebp - 0x2c]
push edx
push eax
lea ecx, [ebp - 0x43c]
push ecx
call fcn.100014b0
add esp, 0xc
mov eax, esi
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.10007a4d
mov esp, ebp
pop ebp
ret