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, 0xa860
call fcn.10007b80
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 - 0xa860], ecx
xor ebx, ebx
mov dword [ebp - 0xa85c], 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.10007bb0
push 0x206
lea eax, [ebp - 0x642]
xor edx, edx
push ebx
push eax
mov word [ebp - 0x644], dx
call fcn.10007bb0
push 0x206
lea edx, [ebp - 0x84a]
xor ecx, ecx
push ebx
push edx
mov word [ebp - 0x84c], cx
call fcn.10007bb0
push 0x3ffe
lea ecx, [ebp - 0x484a]
xor eax, eax
push ebx
push ecx
mov word [ebp - 0x484c], ax
call fcn.10007bb0
push 0x3ffe
lea eax, [ebp - 0x884a]
xor edx, edx
push ebx
push eax
mov word [ebp - 0x884c], dx
call fcn.10007bb0
push 0x206
lea edx, [ebp - 0x232]
xor ecx, ecx
push ebx
push edx
mov word [ebp - 0x234], cx
call fcn.10007bb0
add esp, 0x48
push 0x104
lea eax, [ebp - 0x2c]
push eax
push 0x3ed
push esi
call dword [sym.imp.USER32.dll_LoadStringW]
push 0x2000
lea ecx, [ebp - 0x484c]
push ecx
push 0x1001b38c
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea edx, [ebp - 0xa850]
push edx
mov dword [ebp - 0xa858], 0x104
mov dword [ebp - 0xa854], 1
mov dword [ebp - 0xa850], ebx
push 1
push ebx
push str.SoftwareSybase
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x10001a48
mov eax, dword [ebp - 0xa850]
cmp eax, ebx
je 0x10001a48
lea ecx, [ebp - 0xa858]
push ecx
lea edx, [ebp - 0x84c]
push edx
lea ecx, [ebp - 0xa854]
push ecx
push ebx
push str.MSRedist
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edx, dword [ebp - 0xa850]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x84c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x10001ae8
lea ecx, [ebp - 0x84c]
push ecx
mov edx, ecx
push edx
lea eax, [ebp - 0x884c]
push str._sx86__sx64_
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [ebp - 0x484c]
add esp, 0x10
mov edx, eax
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001a85
lea edi, [ebp - 0x884c]
sub eax, edx
add edi, 0xfffffffe
jmp 0x10001aa0
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x10001aa0
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 - 0x884c]
push ecx
push 0x1001b4ec
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
xor eax, eax
movzx ecx, word [ebp + eax - 0x884c]
mov word [ebp + eax - 0x484c], cx
add eax, 2
cmp cx, bx
jne 0x10001ad0
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
lea edx, [ebp - 0xa850]
push edx
mov edi, 1
push edi
push ebx
push 0x1001b520
push 0x80000002
mov dword [ebp - 0xa854], 0x104
mov dword [ebp - 0xa858], edi
mov dword [ebp - 0xa850], ebx
call esi
test eax, eax
jne 0x10001b5b
mov eax, dword [ebp - 0xa850]
cmp eax, ebx
je 0x10001b5b
lea ecx, [ebp - 0xa854]
push ecx
lea edx, [ebp - 0x644]
push edx
lea ecx, [ebp - 0xa858]
push ecx
push ebx
push str.Location
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edx, dword [ebp - 0xa850]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0xa850]
push eax
push edi
push ebx
push str.SoftwareSybasePowerBuilder19.0
push 0x80000002
mov dword [ebp - 0xa854], 0x104
mov dword [ebp - 0xa858], edi
mov dword [ebp - 0xa850], ebx
call esi
test eax, eax
jne 0x10001bc3
mov eax, dword [ebp - 0xa850]
cmp eax, ebx
je 0x10001bc3
lea ecx, [ebp - 0xa854]
push ecx
lea edx, [ebp - 0x234]
push edx
lea ecx, [ebp - 0xa858]
push ecx
push ebx
push str.IPS_Name
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edx, dword [ebp - 0xa850]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0x234]
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001bd0
sub eax, edx
sar eax, 1
je 0x10001c88
lea eax, [ebp - 0x644]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001bf0
sub eax, edx
sar eax, 1
je 0x10001c88
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 - 0x884c]
push str._s_sIDE__s_sIDEx64_
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [ebp - 0x484c]
add esp, 0x18
mov edx, eax
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001c36
lea edi, [ebp - 0x884c]
sub eax, edx
add edi, 0xfffffffe
lea esp, [esp]
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x10001c50
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 - 0x884c]
mov word [ebp + eax - 0x484c], cx
add eax, 2
cmp cx, bx
jne 0x10001c70
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 0x10001ca0
lea eax, [ebp - 0x234]
push 0x5c
push eax
call fcn.10007ab4
add esp, 8
cmp eax, ebx
je 0x10001cd2
xor ecx, ecx
mov word [eax], cx
lea edi, [ebp - 0x234]
add edi, 0xfffffffe
jmp 0x10001ce0
mov ax, word [edi + 2]
add edi, 2
cmp ax, bx
jne 0x10001ce0
mov edx, dword [0x1001b5dc]
mov eax, dword [ebp - 0xa85c]
mov dword [edi], edx
mov edx, eax
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001d00
lea edi, [ebp - 0x234]
sub eax, edx
add edi, 0xfffffffe
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x10001d16
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 0x10001d99
lea ecx, [ebp - 0x234]
push ecx
call fcn.100015d0
add esp, 4
test eax, eax
je 0x10001d99
lea edx, [ebp - 0x234]
push edx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
cmp eax, ebx
jne 0x10002113
mov ecx, dword [ebp - 0xa860]
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.10007b4d
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 0x10001ee3
lea edx, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001dc0
sub eax, edx
sar eax, 1
jne 0x10001df9
mov ecx, dword [ebp - 0xa860]
push 0x1001b5e0
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.10007b4d
mov esp, ebp
pop ebp
ret
lea edx, [ebp - 0x43c]
push 0x1001b644
push edx
call fcn.10007ae2
add esp, 8
test eax, eax
jne 0x10001e6b
push 2
lea eax, [ebp - 0x43c]
push 0x1001b648
push eax
call fcn.10008347
add esp, 0xc
test eax, eax
je 0x10001e6b
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 - 0x884c]
push str._s.._s__s.._sx64_
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x18
lea eax, [ebp - 0x884c]
push eax
push str.path
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
jmp 0x100020e4
lea ecx, [ebp - 0x43c]
push ecx
mov edx, ecx
push edx
lea eax, [ebp - 0x884c]
push str._s__sx64_
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [ebp - 0x484c]
add esp, 0x10
mov edx, eax
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x10001e92
lea edi, [ebp - 0x884c]
sub eax, edx
add edi, 0xfffffffe
jmp 0x10001eb0
mov cx, word [edi + 2]
add edi, 2
cmp cx, bx
jne 0x10001eb0
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 - 0x884c]
push ecx
push 0x1001b668
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
jmp 0x100020e4
mov edx, dword [ebp - 0xa85c]
push edx
push eax
lea ecx, [ebp - 0x2c]
push ecx
lea edx, [ebp - 0x484c]
push edx
call fcn.10001190
add esp, 0x10
test eax, eax
jne 0x100020e4
push 0x1ffe
lea ecx, [ebp - 0xa84a]
push ebx
push ecx
mov word [ebp - 0xa84c], ax
call fcn.10007bb0
add esp, 0xc
lea edx, [ebp - 0xa850]
push edx
push 1
push ebx
push str.SoftwareSybasePowerBuilder_Runtime
push 0x80000002
mov dword [ebp - 0xa854], 0x2000
mov dword [ebp - 0xa858], 1
mov dword [ebp - 0xa850], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x10001f93
mov eax, dword [ebp - 0xa850]
cmp eax, ebx
je 0x10001f93
lea ecx, [ebp - 0xa854]
push ecx
lea edx, [ebp - 0xa84c]
push edx
lea ecx, [ebp - 0xa858]
push ecx
push ebx
push str.RuntimeVersion
push eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edx, dword [ebp - 0xa850]
push edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
lea eax, [ebp - 0xa84c]
push 0x2c
push eax
xor edi, edi
call fcn.10007a8d
add esp, 8
cmp eax, ebx
je 0x10001fc3
lea ebx, [ebx]
add eax, 2
push 0x2c
push eax
inc edi
call fcn.10007a8d
add esp, 8
cmp eax, ebx
jne 0x10001fb0
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.10008219
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 - 0xa850], ebx
call fcn.10007bb0
lea eax, [ebp - 0xa84c]
push 0x1001b71c
push eax
call fcn.10008299
add esp, 0x18
test eax, eax
je 0x10002052
mov esi, ebx
nop
mov edx, esi
add esi, 0x28
sub edx, eax
jmp 0x10002030
movzx ecx, word [eax]
mov word [edx + eax], cx
add eax, 2
test cx, cx
jne 0x10002030
push 0x1001b720
push 0
call fcn.10008299
add esp, 8
test eax, eax
jne 0x10002020
push edi
push ebx
call fcn.10001060
add esp, 8
xor esi, esi
test edi, edi
jle 0x100020d9
mov ebx, dword [ebp - 0xa850]
lea ecx, [ebp - 0x2c]
mov eax, ebx
lea ecx, [ecx]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x10002096
test dx, dx
je 0x10002092
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x10002096
add eax, 4
add ecx, 4
test dx, dx
jne 0x10002070
xor eax, eax
jmp 0x1000209b
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jg 0x100020a9
inc esi
add ebx, 0x28
cmp esi, edi
jl 0x10002068
jmp 0x100020d3
mov ecx, dword [ebp - 0xa85c]
push ecx
mov ecx, dword [ebp - 0xa850]
lea edx, [ebp - 0x43c]
push edx
lea eax, [esi + esi*4]
lea edx, [ecx + eax*8]
push edx
lea eax, [ebp - 0x484c]
push eax
call fcn.10001190
add esp, 0x10
mov ebx, dword [ebp - 0xa850]
push ebx
call fcn.10007b42
add esp, 4
xor ebx, ebx
mov ecx, dword [ebp - 0xa85c]
push ecx
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov esi, eax
cmp esi, ebx
jne 0x10002111
mov eax, dword [ebp - 0xa860]
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.10007b4d
mov esp, ebp
pop ebp
ret