Function at 0x4031f6
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
push edi
push esi
push ebx
sub esp, 0xf2c
mov dword [ebp - 0x940], 0x104
lea edi, [ebp - 0x9c8]
mov esi, str.SOFTWAREJavaSoftJava_Runtime_Environment
cld
mov ecx, 0x2b
rep movsb byte es:[edi], byte [esi]
lea edx, [ebp - 0x99d]
mov eax, 0x55
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], edx
call sub.msvcrt.dll_memset
mov dword [0x407474], 1
mov byte [0x407490], 0
mov byte [0x4075b0], 0
mov byte [0x407ff0], 0
mov byte [0x4087f0], 0
mov dword [esp + 4], str._Djava.application.version
mov dword [esp], 0x407310
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
lea eax, [ebp - 0x938]
mov dword [esp], eax
call fcn.00403e84
mov dword [esp + 4], eax
mov dword [esp], 0x407310
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 4], 0x104
lea eax, [ebp - 0x138]
mov dword [esp], eax
call fcn.00403e46
mov dword [esp + 4], str._Djava.application.path
mov dword [esp], 0x407090
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
lea eax, [ebp - 0x138]
mov dword [esp + 4], eax
mov dword [esp], 0x407090
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 4], str._Djava.security.policy
mov dword [esp], 0x407350
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
lea eax, [ebp - 0x138]
mov dword [esp + 4], eax
mov dword [esp], 0x407350
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov eax, dword [ebp - 0x940]
mov dword [esp + 8], eax
lea eax, [ebp - 0x938]
mov dword [esp + 4], eax
mov dword [esp], 0
call sub.KERNEL32.dll_GetModuleFileNameA
sub esp, 0xc
mov dword [esp + 4], str._Djava.application.name
mov dword [esp], 0x4071d0
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], 0x5c
lea eax, [ebp - 0x938]
mov dword [esp], eax
call fcn.00403f60
inc eax
mov dword [esp + 4], eax
mov dword [esp], 0x4071d0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 4], 0x4068c2
mov dword [esp], 0x407350
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 4], 0x2e
lea eax, [ebp - 0x938]
mov dword [esp], eax
call fcn.00403f60
mov byte [eax], 0
mov dword [esp + 4], 0x5c
lea eax, [ebp - 0x938]
mov dword [esp], eax
call fcn.00403f60
inc eax
mov dword [esp + 4], eax
mov dword [esp], 0x407350
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 4], str..policy
mov dword [esp], 0x407350
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp], 0x407367
call sub.KERNEL32.dll_GetFileAttributesA
sub esp, 4
cmp eax, 0xffffffff
jne 0x403402
mov byte [0x407350], 0
mov dword [esp + 4], 0x104
lea eax, [ebp - 0xad8]
mov dword [esp], eax
call fcn.00403e46
mov dword [esp + 4], str.jre
lea eax, [ebp - 0xad8]
mov dword [esp], eax
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xad8]
mov dword [esp], eax
call fcn.00403f1c
test eax, eax
je 0x4034f5
lea eax, [ebp - 0xad8]
mov dword [esp + 4], eax
mov dword [esp], str.JAVA_HOME
call sub.KERNEL32.dll_SetEnvironmentVariableA
sub esp, 8
lea eax, [ebp - 0xad8]
mov dword [esp + 4], eax
mov dword [esp], 0x407490
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], str._bin
mov dword [esp], 0x407490
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xad8]
mov dword [esp + 4], eax
mov dword [esp], 0x4075b0
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], str._binclient
mov dword [esp], 0x4075b0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xad8]
mov dword [esp + 4], eax
mov dword [esp], 0x4076d0
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], str.libext
mov dword [esp], 0x4076d0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
jmp 0x403663
mov dword [esp + 4], 0x104
lea eax, [ebp - 0xbe8]
mov dword [esp], eax
call fcn.00403e46
mov dword [esp + 4], 0x5c
lea eax, [ebp - 0xbe8]
mov dword [esp], eax
call fcn.00403f60
test eax, eax
je 0x403663
lea eax, [ebp - 0xbe8]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
cmp eax, 3
jbe 0x403663
lea ebx, [ebp - 0xbe8]
lea eax, [ebp - 0xbe8]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea eax, [ebx + eax]
sub eax, 4
mov dword [esp + 4], str._bin
mov dword [esp], eax
call sub.msvcrt.dll__stricmp
test eax, eax
jne 0x403663
mov dword [esp + 4], 0x5c
lea eax, [ebp - 0xbe8]
mov dword [esp], eax
call fcn.00403f60
mov byte [eax], 0
mov dword [esp + 4], str.jre
lea eax, [ebp - 0xbe8]
mov dword [esp], eax
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xbe8]
mov dword [esp], eax
call fcn.00403f1c
test eax, eax
je 0x403663
lea eax, [ebp - 0xbe8]
mov dword [esp + 4], eax
mov dword [esp], str.JAVA_HOME
call sub.KERNEL32.dll_SetEnvironmentVariableA
sub esp, 8
lea eax, [ebp - 0xbe8]
mov dword [esp + 4], eax
mov dword [esp], 0x407490
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], str._bin
mov dword [esp], 0x407490
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xbe8]
mov dword [esp + 4], eax
mov dword [esp], 0x4075b0
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], str._binclient
mov dword [esp], 0x4075b0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xbe8]
mov dword [esp + 4], eax
mov dword [esp], 0x4076d0
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], str.libext
mov dword [esp], 0x4076d0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
cmp byte [0x4075b0], 0
jne 0x40378b
mov dword [esp + 8], 0x104
lea eax, [ebp - 0xcf8]
mov dword [esp + 4], eax
mov dword [esp], str.JAVA_HOME
call sub.KERNEL32.dll_GetEnvironmentVariableA
sub esp, 0xc
test eax, eax
je 0x40378b
lea eax, [ebp - 0xcf8]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
cmp byte [ebp + eax - 0xcf9], 0x5c
je 0x4036cc
mov dword [esp + 4], str.jre
lea eax, [ebp - 0xcf8]
mov dword [esp], eax
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
jmp 0x4036e5
mov dword [esp + 4], 0x4068f5
lea eax, [ebp - 0xcf8]
mov dword [esp], eax
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xcf8]
mov dword [esp], eax
call fcn.00403f1c
test eax, eax
je 0x40378b
lea eax, [ebp - 0xcf8]
mov dword [esp + 4], eax
mov dword [esp], 0x407490
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], str._bin
mov dword [esp], 0x407490
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xcf8]
mov dword [esp + 4], eax
mov dword [esp], 0x4075b0
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], str._binclient
mov dword [esp], 0x4075b0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xcf8]
mov dword [esp + 4], eax
mov dword [esp], 0x4076d0
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], str.libext
mov dword [esp], 0x4076d0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
cmp byte [0x4075b0], 0
jne 0x4039e2
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x20019
mov dword [esp + 8], 0
lea eax, [ebp - 0x9c8]
mov dword [esp + 4], eax
mov dword [esp], 0x80000002
call sub.ADVAPI32.DLL_RegOpenKeyExA
sub esp, 0x14
test eax, eax
je 0x4037d1
jmp 0x403da7
lea eax, [ebp - 0x940]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x938]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], str.CurrentVersion
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegQueryValueExA
sub esp, 0x18
test eax, eax
je 0x403814
jmp 0x403da7
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegCloseKey
sub esp, 4
mov dword [esp + 4], 0x4068c2
lea eax, [ebp - 0x9c8]
mov dword [esp], eax
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0x938]
mov dword [esp + 4], eax
lea eax, [ebp - 0x9c8]
mov dword [esp], eax
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x20019
mov dword [esp + 8], 0
lea eax, [ebp - 0x9c8]
mov dword [esp + 4], eax
mov dword [esp], 0x80000002
call sub.ADVAPI32.DLL_RegOpenKeyExA
sub esp, 0x14
test eax, eax
je 0x40388f
jmp 0x403da7
mov dword [ebp - 0x940], 0x104
lea eax, [ebp - 0x940]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x938]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], str.RuntimeLib
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegQueryValueExA
sub esp, 0x18
test eax, eax
je 0x4038dc
jmp 0x403da7
mov dword [esp + 4], 0x5c
lea eax, [ebp - 0x938]
mov dword [esp], eax
call fcn.00403f60
mov byte [eax], 0
lea eax, [ebp - 0x938]
mov dword [esp + 4], eax
mov dword [esp], 0x4075b0
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
lea eax, [ebp - 0x938]
mov dword [esp + 4], eax
mov dword [esp], 0x407490
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], 0x5c
mov dword [esp], 0x407490
call fcn.00403f60
mov byte [eax], 0
mov dword [ebp - 0x940], 0x104
lea eax, [ebp - 0x940]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x938]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], str.JavaHome
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegQueryValueExA
sub esp, 0x18
test eax, eax
je 0x40398b
jmp 0x403da7
lea eax, [ebp - 0x938]
mov dword [esp + 4], eax
mov dword [esp], 0x4076d0
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], str.libext
mov dword [esp], 0x4076d0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0x938]
mov dword [esp + 4], eax
mov dword [esp], str.JAVA_HOME
call sub.KERNEL32.dll_SetEnvironmentVariableA
sub esp, 8
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegCloseKey
sub esp, 4
mov dword [esp + 4], str._Djava.class.path
mov dword [esp], 0x4077f0
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], str._Djava.ext.dirs
mov dword [esp], 0x407ff0
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
mov dword [esp + 4], str._Djava.library.path._
mov dword [esp], 0x4087f0
call sub.KERNEL32.dll_lstrcpyA
sub esp, 8
cmp dword [ebp + 8], 0
je 0x403add
mov dword [esp + 4], 0x406957
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strtok
mov dword [ebp - 0x93c], eax
cmp dword [ebp - 0x93c], 0
je 0x403add
mov dword [esp + 4], 0x406959
mov eax, dword [ebp - 0x93c]
mov dword [esp], eax
call sub.msvcrt.dll_strstr
test eax, eax
jne 0x403aa1
lea eax, [ebp - 0x138]
mov dword [esp + 4], eax
mov dword [esp], 0x4077f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 4], 0x4068c2
mov dword [esp], 0x4077f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov eax, dword [ebp - 0x93c]
mov dword [esp + 4], eax
mov dword [esp], 0x4077f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 4], 0x406957
mov dword [esp], 0x4077f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [ebp + 8], 0
jmp 0x403a31
mov dword [esp + 4], 0x4067d8
mov dword [esp], 0x4077f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 4], 0x104
lea eax, [ebp - 0xe08]
mov dword [esp], eax
call fcn.00403e46
mov dword [esp + 4], str.lib
lea eax, [ebp - 0xe08]
mov dword [esp], eax
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xe08]
mov dword [esp], eax
call fcn.00403f1c
test eax, eax
je 0x403bd7
mov dword [esp + 4], 0x406957
mov dword [esp], 0x4077f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xe08]
mov dword [esp + 4], eax
mov dword [esp], 0x4077f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xe08]
mov dword [esp + 4], eax
mov dword [esp], 0x407ff0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 4], 0x406957
mov dword [esp], 0x407ff0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xe08]
mov dword [esp + 4], eax
mov dword [esp], 0x4087f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 4], 0x406957
mov dword [esp], 0x4087f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xe08]
mov dword [esp], eax
call fcn.00403db0
mov dword [esp + 4], 0x104
lea eax, [ebp - 0xf18]
mov dword [esp], eax
call fcn.00403e46
mov dword [esp + 4], 0x5c
lea eax, [ebp - 0xf18]
mov dword [esp], eax
call fcn.00403f60
test eax, eax
je 0x403d3a
lea eax, [ebp - 0xf18]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
cmp eax, 3
jbe 0x403d3a
lea ebx, [ebp - 0xf18]
lea eax, [ebp - 0xf18]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
lea eax, [ebx + eax]
sub eax, 4
mov dword [esp + 4], str._bin
mov dword [esp], eax
call sub.msvcrt.dll__stricmp
test eax, eax
jne 0x403d3a
mov dword [esp + 4], 0x5c
lea eax, [ebp - 0xf18]
mov dword [esp], eax
call fcn.00403f60
mov byte [eax], 0
mov dword [esp + 4], str.lib
lea eax, [ebp - 0xf18]
mov dword [esp], eax
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xf18]
mov dword [esp], eax
call fcn.00403f1c
test eax, eax
je 0x403d3a
mov dword [esp + 4], 0x406957
mov dword [esp], 0x4077f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xf18]
mov dword [esp + 4], eax
mov dword [esp], 0x4077f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xf18]
mov dword [esp + 4], eax
mov dword [esp], 0x407ff0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 4], 0x406957
mov dword [esp], 0x407ff0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xf18]
mov dword [esp + 4], eax
mov dword [esp], 0x4087f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 4], 0x406957
mov dword [esp], 0x4087f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
lea eax, [ebp - 0xf18]
mov dword [esp], eax
call fcn.00403db0
mov dword [esp + 4], 0x4076d0
mov dword [esp], 0x407ff0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp + 8], 0x800
lea eax, [ebp - 0x938]
mov dword [esp + 4], eax
mov dword [esp], str.PATH
call sub.KERNEL32.dll_GetEnvironmentVariableA
sub esp, 0xc
test eax, eax
je 0x403d8f
lea eax, [ebp - 0x938]
mov dword [esp + 4], eax
mov dword [esp], 0x4087f0
call sub.KERNEL32.dll_lstrcatA
sub esp, 8
mov dword [esp], 0x407490
call fcn.00403db0
mov dword [esp], 0x4075b0
call fcn.00403db0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret