Function at 0x487580
Capabilities:
Check if file exists
Get common file path
Get file attributes
Query environment variable
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x4fadcc
push eax
mov eax, 0x2a38
mov dword fs:[0], esp
call fcn.004ea940
push ebx
push esi
push edi
xor eax, eax
mov edi, ecx
push 0x1ffe
push eax
mov word [ebp - 0x2a40], ax
lea eax, [ebp - 0x2a3e]
push eax
call fcn.004d36e0
xor eax, eax
mov dword [ebp - 0x10], 7
add esp, 0xc
mov dword [ebp - 0x14], 0
mov word [ebp - 0x24], ax
mov dword [ebp - 4], eax
mov ebx, dword [ebp + 8]
mov ecx, dword [ebx + 0x14]
cmp ecx, 8
jb 0x4875eb
mov esi, dword [ebx]
jmp 0x4875ed
mov esi, ebx
cmp ecx, 8
jb 0x4875f6
mov edx, dword [ebx]
jmp 0x4875f8
mov edx, ebx
mov eax, dword [ebx + 0x10]
lea eax, [edx + eax*2]
cmp ecx, 8
jb 0x487607
mov edx, dword [ebx]
jmp 0x487609
mov edx, ebx
cmp edx, eax
je 0x48761b
push ecx
push esi
push eax
lea ecx, [ebp - 0x74]
call fcn.00477410
add esp, 0xc
mov edx, ebx
lea ecx, [ebp - 0x3c]
call fcn.004806e0
push 7
push ecx
push str.ext_ms_
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 1
call fcn.00470980
test eax, eax
jne 0x487648
push 4
push eax
lea ecx, [ebp - 0x3c]
call fcn.0046b240
mov esi, dword [edi]
lea eax, [ebp - 0x3c]
push eax
push esi
lea ecx, [ebp - 0x78]
push dword [esi]
call fcn.00489040
add esp, 0xc
mov edi, dword [eax]
cmp edi, esi
je 0x48771f
mov eax, dword [ebp + 0xc]
mov ecx, dword [edi + 0x20]
cmp dword [eax + 0x14], 8
mov edx, dword [eax + 0x10]
jb 0x487677
mov eax, dword [eax]
push edx
push eax
push dword [ecx + 0x10]
push ecx
call fcn.00473600
test eax, eax
je 0x48768b
mov eax, dword [edi + 0x20]
jmp 0x487691
mov eax, dword [edi + 0x24]
sub eax, 0x18
cmp ebx, eax
je 0x4876a1
push 0xffffffffffffffff
push 0
push eax
mov ecx, ebx
call fcn.0046b300
push dword [ebp + 0x1c]
push ebx
call fcn.00487d40
test eax, eax
je 0x487b81
test byte [ebp + 0x14], 2
je 0x48775a
xor eax, eax
push 0x1fc
push eax
mov word [ebp - 0x840], ax
lea eax, [ebp - 0x83e]
push eax
call fcn.004d36e0
add esp, 0xc
lea eax, [ebp - 0x840]
push 0xff
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
push ebx
lea edx, [ebp - 0x840]
lea ecx, [ebp - 0x90]
call fcn.00481f30
add esp, 4
mov ecx, ebx
push eax
call fcn.00478c00
cmp dword [ebp - 0x7c], 8
jb 0x48775a
push dword [ebp - 0x90]
call fcn.004cd56c
add esp, 4
jmp 0x48775a
test byte [ebp + 0x14], 1
jne 0x487cd7
push dword [ebp + 0x1c]
push ebx
call fcn.00487d40
test eax, eax
je 0x48775a
test byte [ebp + 0x14], 4
jne 0x487cd7
cmp dword [ebx + 0x14], 8
jb 0x48774a
mov eax, dword [ebx]
jmp 0x48774c
mov eax, ebx
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
push eax
call esi
cmp eax, 0xffffffff
je 0x487771
mov eax, dword fs:[0x18]
xor esi, esi
mov dword [eax + 0xbf4], 0
jmp 0x487cec
lea eax, [ebp + 8]
mov dword [ebp + 8], 0
push eax
push 0x534f10
push closesocket
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyW]
mov edi, eax
test edi, edi
jne 0x487885
xor esi, esi
test edi, edi
jne 0x487876
xor eax, eax
push 0x1fc
push eax
mov word [ebp - 0xa40], ax
lea eax, [ebp - 0xa3e]
push eax
call fcn.004d36e0
add esp, 0xc
xor eax, eax
mov word [ebp - 0x440], ax
push 0x1fc
push eax
lea eax, [ebp - 0x43e]
push eax
call fcn.004d36e0
add esp, 0xc
mov dword [ebp + 0x14], 0xff
lea eax, [ebp + 0x14]
mov dword [ebp + 0x1c], edi
push eax
lea eax, [ebp - 0x440]
push eax
lea eax, [ebp + 0x1c]
push eax
push edi
lea eax, [ebp + 0x14]
push eax
lea eax, [ebp - 0xa40]
push eax
push esi
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
cmp dword [ebp - 0x28], 8
mov edi, eax
lea eax, [ebp - 0x3c]
cmovae eax, dword [ebp - 0x3c]
push eax
lea eax, [ebp - 0x440]
push eax
call fcn.004cfb6b
add esp, 8
test eax, eax
jne 0x487869
push 0x1fc
push eax
mov word [ebp - 0x640], ax
lea eax, [ebp - 0x63e]
push eax
call fcn.004d36e0
add esp, 0xc
mov dword [ebp + 0x14], 0xff
lea eax, [ebp - 0x640]
push 0xff
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test edi, edi
je 0x487b88
inc esi
cmp esi, 0x1000
jl 0x487798
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov edx, dword [ebp + 0x10]
cmp dword [edx + 0x10], 0
je 0x4878ef
push ecx
lea ecx, [ebp - 0x240]
call fcn.00488be0
add esp, 4
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 4
push ecx
mov edx, eax
lea ecx, [ebp - 0x120]
call fcn.00488c90
add esp, 4
lea ecx, [ebp - 0x24]
push eax
call fcn.00478c00
lea ecx, [ebp - 0x120]
call fcn.0046b210
lea ecx, [ebp - 0x240]
mov byte [ebp - 4], 1
call fcn.0046b210
cmp dword [ebp - 0x10], 8
lea eax, [ebp - 0x24]
cmovae eax, dword [ebp - 0x24]
push eax
call esi
cmp eax, 0xffffffff
jne 0x487b6e
push dword [ebp + 0x18]
lea eax, [ebp - 0xa8]
push eax
call fcn.00488020
push 0x534f90
mov edx, eax
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x70]
call fcn.00481e30
add esp, 4
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 6
push ecx
mov edx, eax
lea ecx, [ebp - 0x58]
call fcn.00488c90
add esp, 4
lea ecx, [ebp - 0x24]
push eax
call fcn.00478c00
cmp dword [ebp - 0x44], 8
jb 0x487943
push dword [ebp - 0x58]
call fcn.004cd56c
add esp, 4
xor eax, eax
mov dword [ebp - 0x44], 7
cmp dword [ebp - 0x5c], 8
mov dword [ebp - 0x48], 0
mov word [ebp - 0x58], ax
jb 0x487968
push dword [ebp - 0x70]
call fcn.004cd56c
add esp, 4
xor eax, eax
mov byte [ebp - 4], 1
cmp dword [ebp - 0x94], 8
mov dword [ebp - 0x5c], 7
mov dword [ebp - 0x60], 0
mov word [ebp - 0x70], ax
jb 0x487997
push dword [ebp - 0xa8]
call fcn.004cd56c
add esp, 4
cmp dword [ebp - 0x10], 8
lea eax, [ebp - 0x24]
cmovae eax, dword [ebp - 0x24]
push eax
call esi
cmp eax, 0xffffffff
jne 0x487b6e
push 0x1000
lea eax, [ebp - 0x2a40]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
lea eax, [ebp - 0x2a40]
push eax
lea ecx, [ebp - 0x180]
call fcn.0046b820
push 0x534f8c
mov edx, eax
mov byte [ebp - 4], 7
lea ecx, [ebp - 0xc0]
call fcn.00481e30
add esp, 4
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 8
push ecx
mov edx, eax
lea ecx, [ebp - 0x150]
call fcn.00488c90
add esp, 4
lea ecx, [ebp - 0x24]
push eax
call fcn.00478c00
lea ecx, [ebp - 0x150]
call fcn.0046b210
lea ecx, [ebp - 0xc0]
call fcn.0046b210
lea ecx, [ebp - 0x180]
mov byte [ebp - 4], 1
call fcn.0046b210
cmp dword [ebp - 0x10], 8
lea eax, [ebp - 0x24]
cmovae eax, dword [ebp - 0x24]
push eax
call esi
cmp eax, 0xffffffff
jne 0x487b6e
push 0x1000
lea eax, [ebp - 0x2a40]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryW]
lea eax, [ebp - 0x2a40]
push eax
lea ecx, [ebp - 0x210]
call fcn.0046b820
push 0x534f98
mov edx, eax
mov byte [ebp - 4], 9
lea ecx, [ebp - 0x1b0]
call fcn.00481e30
add esp, 4
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 0xa
push ecx
mov edx, eax
lea ecx, [ebp - 0x1f8]
call fcn.00488c90
add esp, 4
lea ecx, [ebp - 0x24]
push eax
call fcn.00478c00
lea ecx, [ebp - 0x1f8]
call fcn.0046b210
lea ecx, [ebp - 0x1b0]
call fcn.0046b210
lea ecx, [ebp - 0x210]
mov byte [ebp - 4], 1
call fcn.0046b210
lea ecx, [ebp - 0x24]
call fcn.00480d00
test al, al
jne 0x487b6e
lea eax, [ebp - 0x2a40]
push eax
push 0x1000
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
lea eax, [ebp - 0x2a40]
push eax
lea ecx, [ebp - 0x138]
call fcn.0046b820
push 0x534f94
mov edx, eax
mov byte [ebp - 4], 0xb
lea ecx, [ebp - 0x108]
call fcn.00481e30
add esp, 4
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 0xc
push ecx
mov edx, eax
lea ecx, [ebp - 0xd8]
call fcn.00488c90
add esp, 4
lea ecx, [ebp - 0x24]
push eax
call fcn.00478c00
lea ecx, [ebp - 0xd8]
call fcn.0046b210
lea ecx, [ebp - 0x108]
call fcn.0046b210
lea ecx, [ebp - 0x138]
mov byte [ebp - 4], 1
call fcn.0046b210
lea ecx, [ebp - 0x24]
call fcn.00480d00
test al, al
je 0x487c07
lea eax, [ebp - 0x24]
cmp ebx, eax
je 0x487b81
push 0xffffffffffffffff
push 0
push eax
mov ecx, ebx
call fcn.0046b300
xor esi, esi
jmp 0x487cec
lea eax, [ebp - 0x640]
push eax
lea ecx, [ebp - 0x1e0]
call fcn.0046b820
push str._
mov edx, eax
mov byte [ebp - 4], 2
lea ecx, [ebp - 0xf0]
call fcn.00481e30
add esp, 4
lea ecx, [ebp - 0x440]
mov byte [ebp - 4], 3
push ecx
mov edx, eax
lea ecx, [ebp - 0x228]
call fcn.00481e30
add esp, 4
mov ecx, ebx
push eax
call fcn.00478c00
lea ecx, [ebp - 0x228]
call fcn.0046b210
lea ecx, [ebp - 0xf0]
call fcn.0046b210
lea ecx, [ebp - 0x1e0]
call fcn.0046b210
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
xor esi, esi
jmp 0x487cec
push 0x1000
lea eax, [ebp - 0x2a40]
push eax
push 0x534fa0
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
lea eax, [ebp - 0x40]
push eax
lea eax, [ebp - 0x2a40]
push 0x534f9c
push eax
call fcn.004d0018
add esp, 0xc
test eax, eax
je 0x487cd7
mov edi, edi
push eax
lea ecx, [ebp - 0x1c8]
call fcn.0046b820
push 0x534fac
mov edx, eax
mov byte [ebp - 4], 0xd
lea ecx, [ebp - 0x198]
call fcn.00481e30
add esp, 4
lea ecx, [ebp - 0x3c]
mov byte [ebp - 4], 0xe
push ecx
mov edx, eax
lea ecx, [ebp - 0x168]
call fcn.00488c90
add esp, 4
lea ecx, [ebp - 0x24]
push eax
call fcn.00478c00
lea ecx, [ebp - 0x168]
call fcn.0046b210
lea ecx, [ebp - 0x198]
call fcn.0046b210
lea ecx, [ebp - 0x1c8]
mov byte [ebp - 4], 1
call fcn.0046b210
lea ecx, [ebp - 0x24]
call fcn.00480d00
test al, al
jne 0x487b6e
lea eax, [ebp - 0x40]
push eax
push 0x534fb0
push dword [ebp - 0x40]
call fcn.004d0018
add esp, 0xc
test eax, eax
jne 0x487c40
mov eax, dword fs:[0x18]
mov esi, 0xc0000225
mov dword [eax + 0xbf4], 0xc0000225
cmp dword [ebp - 0x28], 8
jb 0x487cfd
push dword [ebp - 0x3c]
call fcn.004cd56c
add esp, 4
xor eax, eax
mov dword [ebp - 0x28], 7
cmp dword [ebp - 0x10], 8
mov dword [ebp - 0x2c], 0
mov word [ebp - 0x3c], ax
jb 0x487d22
push dword [ebp - 0x24]
call fcn.004cd56c
add esp, 4
mov ecx, dword [ebp - 0xc]
mov eax, esi
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret 0x18