Function at 0x402f5c
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Get file attributes
Query environment variable
Set environment variable

Disassembly:
sub esp, 0xc40
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_lstrcpyA]
xor eax, eax
push ebp
push esi
push edi
xor esi, esi
mov dword [esp + 0x14], edx
push str._Djava.application.version
mov edi, 0x4070a0
mov dword [esp + 0x20], ecx
inc esi
mov byte [0x406520], al
push edi
mov dword [0x4063b0], esi
mov byte [0x408220], al
mov byte [0x4078e0], al
mov byte [0x406640], al
call ebx
push 0x10
push esi
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceA]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_LoadResource]
push eax
call dword [sym.imp.KERNEL32.dll_LockResource]
mov ecx, dword [eax + 0x34]
mov edx, dword [eax + 0x30]
movzx eax, cx
push eax
shr ecx, 0x10
push ecx
movzx eax, dx
push eax
shr edx, 0x10
lea eax, [esp + 0x45c]
push edx
push str._d._d._d._d
push eax
call dword [sym.imp.msvcrt.dll_sprintf]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [esp + 0x468]
add esp, 0x18
push eax
push edi
call esi
lea ecx, [esp + 0x34c]
call fcn.004038c6
push str._Djava.application.path
mov edi, 0x4080e0
push edi
call ebx
lea eax, [esp + 0x34c]
push eax
push edi
call esi
push str._Djava.security.policy
mov ebp, 0x4063e0
push ebp
call ebx
lea eax, [esp + 0x34c]
push eax
push ebp
call esi
push 0x104
lea eax, [esp + 0x454]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push str._Djava.application.name
mov ebp, 0x406f60
push ebp
call ebx
mov edi, dword [sym.imp.msvcrt.dll_strrchr]
lea eax, [esp + 0x450]
push 0x5c
push eax
call edi
pop ecx
pop ecx
inc eax
push eax
push ebp
call esi
push 0x405094
mov ebp, 0x4063e0
push ebp
call esi
lea eax, [esp + 0x450]
push 0x2e
push eax
call edi
push 0x5c
mov byte [eax], 0
lea eax, [esp + 0x45c]
push eax
call edi
add esp, 0x10
inc eax
push eax
push ebp
call esi
push str..policy
push ebp
call esi
push 0x4063f7
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
movzx ecx, byte [0x4063e0]
xor edx, edx
cmp eax, 0xffffffff
cmove ecx, edx
mov byte [0x4063e0], cl
lea ecx, [esp + 0x244]
call fcn.004038c6
push str.jre
lea eax, [esp + 0x248]
push eax
call esi
lea ecx, [esp + 0x244]
call fcn.004038e9
mov ebp, dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
test eax, eax
je 0x40315f
lea eax, [esp + 0x244]
push eax
push str.JAVA_HOME
call ebp
lea eax, [esp + 0x244]
mov ebp, 0x406520
push eax
push ebp
call ebx
push str._bin
push ebp
call esi
lea eax, [esp + 0x244]
mov ebp, 0x406e40
push eax
push ebp
call ebx
push str.libext
push ebp
call esi
push dword [esp + 0xc54]
lea edx, [esp + 0x140]
call fcn.0040358f
pop ecx
test eax, eax
jne 0x403258
xor al, al
mov byte [0x408220], al
jmp 0x40325d
lea ecx, [esp + 0x13c]
call fcn.004038c6
lea eax, [esp + 0x13c]
push 0x5c
push eax
call edi
pop ecx
pop ecx
test eax, eax
je 0x403258
lea eax, [esp + 0x13c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp eax, 4
jl 0x403258
push str._bin
lea eax, [esp + 0x140]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ecx, [esp + 0x140]
sub ecx, 4
add eax, ecx
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
jne 0x403258
lea eax, [esp + 0x13c]
push 0x5c
push eax
call edi
pop ecx
pop ecx
push str.jre
mov byte [eax], 0
lea eax, [esp + 0x140]
push eax
call esi
lea ecx, [esp + 0x13c]
call fcn.004038e9
test eax, eax
je 0x403258
lea eax, [esp + 0x13c]
push eax
push str.JAVA_HOME
call ebp
lea eax, [esp + 0x13c]
mov ebp, 0x406520
push eax
push ebp
call ebx
push str._bin
push ebp
call esi
lea eax, [esp + 0x13c]
mov ebp, 0x406e40
push eax
push ebp
call ebx
push str.libext
push ebp
call esi
push dword [esp + 0xc54]
lea edx, [esp + 0x140]
call fcn.0040358f
neg eax
pop ecx
sbb al, al
and al, byte [0x408220]
jmp 0x403155
mov al, byte [0x408220]
mov ebp, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
test al, al
jne 0x4033b3
push 0x104
lea eax, [esp + 0x38]
mov byte [esp + 0x38], 0
push eax
push str.JAVA_HOME
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
jne 0x40331e
and dword [esp + 0x30], eax
mov edi, str.SOFTWAREWow6432NodeJavaSoftJava_Development_Kit
push 0x104
push eax
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], str.SOFTWAREWow6432NodeJavaSoftJava_Runtime_Environment
mov dword [esp + 0x30], str.SOFTWAREJavaSoftJava_Development_Kit
mov dword [esp + 0x34], str.SOFTWAREJavaSoftJava_Runtime_Environment
call ebp
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
and dword [esp + 0x10], 0
mov dword [esp + 0x18], eax
mov edx, eax
mov ecx, edi
call fcn.0040370d
test eax, eax
jne 0x4032f0
mov eax, dword [esp + 0x10]
inc eax
mov dword [esp + 0x10], eax
mov edi, dword [esp + eax*4 + 0x20]
mov eax, dword [esp + 0x18]
test edi, edi
jne 0x4032ca
mov edi, eax
jmp 0x40330c
mov edi, dword [esp + 0x18]
lea eax, [esp + 0x34]
push edi
push eax
call ebx
lea eax, [esp + 0x34]
push eax
push str.JAVA_HOME
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
push edi
push 0
call ebp
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov edi, dword [sym.imp.msvcrt.dll_strrchr]
cmp byte [esp + 0x34], 0
je 0x4033b3
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ecx, [esp + 0x34]
cmp byte [eax + ecx - 1], 0x5c
mov eax, ecx
jne 0x403348
push 0x405188
jmp 0x40334d
push str.jre
push eax
call esi
lea ecx, [esp + 0x34]
call fcn.004038e9
test eax, eax
jne 0x40336b
lea eax, [esp + 0x34]
push 0x5c
push eax
call edi
pop ecx
pop ecx
mov byte [eax], 0
lea ecx, [esp + 0x34]
call fcn.004038e9
test eax, eax
je 0x4033b3
lea eax, [esp + 0x34]
mov edi, 0x406520
push eax
push edi
call ebx
push str._bin
push edi
call esi
lea eax, [esp + 0x34]
mov edi, 0x406e40
push eax
push edi
call ebx
push str.libext
push edi
call esi
push dword [esp + 0xc54]
lea edx, [esp + 0x38]
call fcn.0040358f
pop ecx
push str._Djava.class.path
push 0x4070e0
call ebx
push str._Djava.ext.dirs
push 0x4078e0
call ebx
push str._Djava.library.path._
push 0x406640
call ebx
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x40343a
push 0x4051cc
push eax
jmp 0x40342c
push 0x40451c
push edi
call dword [sym.imp.msvcrt.dll_strstr]
pop ecx
pop ecx
test eax, eax
jne 0x403414
lea eax, [esp + 0x34c]
push eax
push 0x4070e0
call esi
push 0x405094
push 0x4070e0
call esi
push edi
mov edi, 0x4070e0
push edi
call esi
push 0x4051cc
push edi
call esi
push 0x4051cc
push 0
call dword [sym.imp.msvcrt.dll_strtok]
mov edi, eax
pop ecx
pop ecx
test edi, edi
jne 0x4033e7
push 0x4051d0
push 0x4070e0
call esi
cmp dword [esp + 0x14], 0
je 0x403539
push 0x104
push 0
call ebp
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push dword [esp + 0x14]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
inc eax
push eax
push 0
call ebp
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push dword [esp + 0x14]
mov dword [esp + 0x14], eax
push eax
call ebx
push 0x4051cc
push dword [esp + 0x14]
jmp 0x40350e
push 0x40451c
push ebx
mov byte [edi], 0
call dword [sym.imp.msvcrt.dll_strstr]
pop ecx
pop ecx
test eax, eax
jne 0x4034b8
lea eax, [esp + 0x34c]
push eax
push edi
call esi
push 0x405094
push edi
call esi
push ebx
push edi
call esi
mov ecx, edi
call fcn.004038e9
test eax, eax
je 0x403506
push 0x4051cc
mov ebx, 0x4070e0
push ebx
call esi
push edi
push ebx
call esi
push edi
push 0x4078e0
call esi
mov ebx, 0x4051cc
push ebx
push 0x4078e0
call esi
push edi
push 0x406640
call esi
push ebx
push 0x406640
call esi
mov ecx, edi
call fcn.00403840
jmp 0x40350b
mov ebx, 0x4051cc
push ebx
push 0
call dword [sym.imp.msvcrt.dll_strtok]
mov ebx, eax
pop ecx
pop ecx
test ebx, ebx
jne 0x403490
push dword [esp + 0x10]
push 0
call ebp
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
push eax
call ebx
push edi
push 0
call ebp
push eax
call ebx
push 0x406e40
push 0x4078e0
call esi
push 0x800
lea eax, [esp + 0x454]
push eax
push str.PATH
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x403570
lea eax, [esp + 0x450]
push eax
push 0x406640
call esi
mov ecx, 0x406520
call fcn.00403840
mov ecx, 0x408220
call fcn.00403840
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc40
ret