Function at 0x5af640
Capabilities:
Get common file path
Query or enumerate registry value
Set registry value

Disassembly:
sub esp, 0x128
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x34]
push 0x104
push eax
mov dword [esp + 0x30], 0x18
mov dword [esp + 0x24], 0
mov word [0x5b8c14], 0x40
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x5afdbe
mov edi, 0x5b5278
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x34]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push 0x3e80
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
push 0x42
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [sym.imp.KERNEL32.dll_GlobalAlloc]
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalLock]
push eax
call ebx
mov esi, eax
test esi, esi
mov dword [esp + 0x14], esi
je 0x5afdbe
push 0x3e80
push 0x42
call edi
push eax
call ebx
mov ebp, eax
test ebp, ebp
jne 0x5af70b
mov edi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push esi
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x128
ret
lea eax, [esp + 0x34]
push 0
push eax
call dword [sym.imp.KERNEL32.dll__lopen]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x5afa11
mov edx, dword [0x5b8c6c]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegQueryValueA]
lea ecx, [esp + 0x10]
mov dword [esp + 0x10], 0x3e80
push ecx
push ebp
push 0x5b5258
push edx
call ebx
test eax, eax
je 0x5af951
push 0x104
push esi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov edi, 0x5b5398
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x34]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push eax
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [esp + 0x18]
push edi
call dword [sym.imp.KERNEL32.dll__lopen]
mov esi, eax
cmp esi, 0xffffffff
je 0x5af811
mov edi, dword [sym.imp.KERNEL32.dll__lread]
lea eax, [esp + 0x1c]
push 4
push eax
push esi
call edi
cmp eax, 4
mov eax, dword [esp + 0x1c]
jne 0x5af7fc
test eax, eax
jne 0x5af7fc
lea ecx, [esp + 0x1c]
push 4
push ecx
push esi
call edi
cmp dword [esp + 0x1c], 0x14
jne 0x5af7e2
push 4
push 0x5b8c18
push esi
call edi
push esi
call dword [sym.imp.KERNEL32.dll__lclose]
mov esi, dword [esp + 0x14]
jmp 0x5af962
push esi
mov dword [0x5b8c18], 0
call dword [sym.imp.KERNEL32.dll__lclose]
mov esi, dword [esp + 0x14]
jmp 0x5af962
push esi
mov dword [0x5b8c18], eax
call dword [sym.imp.KERNEL32.dll__lclose]
mov esi, dword [esp + 0x14]
jmp 0x5af962
mov edx, dword [0x5b8c0c]
and edx, 0xffff
push edx
call fcn.005b31f0
call fcn.005b31fa
mov dword [esp + 0x14], eax
xor eax, eax
mov ax, word [0x5b8c0a]
push eax
call fcn.005b31f0
call fcn.005b31fa
mov edx, dword [esp + 0x18]
mov dword [esp + 0x28], eax
shl eax, 0x10
or eax, edx
xor ecx, ecx
mov cx, word [0x5b8c06]
cdq
xor eax, edx
push ecx
sub eax, edx
mov dword [0x5b8c18], eax
call fcn.005b31f0
call fcn.005b31fa
mov edx, dword [0x5b8c08]
mov dword [esp + 0x1c], eax
and edx, 0xffff
push edx
call fcn.005b31f0
add esp, 0x10
call fcn.005b31fa
mov edx, dword [esp + 0x10]
mov dword [esp + 0x20], eax
shl eax, 0x10
or eax, edx
mov ecx, dword [0x5b8c6c]
cdq
xor eax, edx
sub eax, edx
mov edx, dword [0x5b8c18]
add edx, eax
lea eax, [esp + 0x30]
push eax
push 0x5b5258
push ecx
mov dword [0x5b8c18], edx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
je 0x5af940
mov eax, dword [0x5b8c6c]
lea edx, [esp + 0x30]
push edx
push 0x5b5258
push eax
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyA]
test eax, eax
je 0x5af917
mov esi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push edi
call esi
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push eax
call ebx
push edi
call esi
mov edi, dword [sym.imp.KERNEL32.dll_GlobalFree]
push eax
call edi
push ebp
call esi
push eax
call ebx
push ebp
call esi
push eax
call edi
mov eax, 2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x128
ret
mov ecx, dword [0x5b8c18]
push 0xa
push ebp
push ecx
call fcn.005b2f78
mov edx, dword [0x5b8c6c]
add esp, 0xc
push 0x14
push ebp
push 1
push 0x5b5258
push edx
call dword [sym.imp.ADVAPI32.dll_RegSetValueA]
mov eax, dword [esp + 0x30]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov esi, dword [esp + 0x14]
jmp 0x5af962
mov edx, 0x5b5390
mov ecx, ebp
call fcn.005b28e0
mov dword [0x5b8c18], eax
mov edx, dword [0x5b8c4c]
mov eax, dword [0x5b8c6c]
lea ecx, [esp + 0x10]
mov dword [esp + 0x10], 0x3e80
push ecx
push esi
push edx
push eax
call ebx
test eax, eax
je 0x5af9eb
mov edi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push esi
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push eax
call ebx
push esi
call edi
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
push eax
call esi
push ebp
call edi
push eax
call ebx
push ebp
call edi
push eax
call esi
mov ecx, dword [0x5b8e14]
or byte [0x5b8c14], 8
mov eax, 0xe000
test eax, ecx
jne 0x5af9db
mov edx, ecx
mov ecx, dword [0x5b8d80]
or edx, eax
xor ecx, eax
mov dword [0x5b8e14], edx
mov dword [0x5b8d80], ecx
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x128
ret
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push ebp
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebp
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or byte [0x5b8c14], 4
jmp 0x5afe37
mov ecx, dword [0x5b8e14]
mov eax, 0xe000
test eax, ecx
jne 0x5afa38
mov edx, ecx
mov ecx, dword [0x5b8d80]
or edx, eax
xor ecx, eax
mov dword [0x5b8e14], edx
mov dword [0x5b8d80], ecx
mov edi, dword [sym.imp.KERNEL32.dll__lread]
lea ecx, [esp + 0x1c]
push 4
push ecx
push ebx
call edi
cmp eax, 4
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x1c]
jne 0x5afaf2
test eax, eax
jne 0x5afaf2
lea edx, [esp + 0x1c]
push 4
push edx
push ebx
call edi
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x1c]
cmp eax, 0x14
jne 0x5afaf0
push 4
push 0x5b8c18
push ebx
call edi
mov dword [esp + 0x18], eax
lea eax, [esp + 0x28]
push 4
push eax
push ebx
call edi
mov ecx, dword [esp + 0x18]
push 8
add ecx, eax
push esi
push ebx
mov dword [esp + 0x24], ecx
call edi
add eax, dword [esp + 0x18]
cmp eax, 0x10
je 0x5afb9d
mov edi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push esi
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call edi
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
push eax
call esi
push ebp
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebp
call edi
push eax
call esi
push ebx
call dword [sym.imp.KERNEL32.dll__lclose]
mov eax, 2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x128
ret
xor eax, eax
push 2
push 0
push ebx
mov dword [0x5b8c18], eax
mov dword [esp + 0x28], 0xa
call dword [sym.imp.KERNEL32.dll__llseek]
cmp eax, 4
mov dword [esp + 0x28], eax
jb 0x5afb1e
push 0
push 4
push ebx
call dword [sym.imp.KERNEL32.dll__llseek]
cmp dword [esp + 0x18], 4
je 0x5afb9d
mov edx, dword [0x5b8c6c]
lea ecx, [esp + 0x10]
push ecx
push ebp
push 0x5b5258
push edx
mov dword [esp + 0x20], 0x3e80
call dword [sym.imp.ADVAPI32.dll_RegQueryValueA]
test eax, eax
je 0x5afb8c
mov edi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push esi
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call edi
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
push eax
call esi
push ebp
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebp
call edi
push eax
call esi
push ebx
call dword [sym.imp.KERNEL32.dll__lclose]
mov eax, 2
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x128
ret
mov edx, 0x5b5388
mov ecx, ebp
call fcn.005b28e0
mov dword [0x5b8c18], eax
mov ecx, dword [0x5b8c4c]
mov edx, dword [0x5b8c6c]
lea eax, [esp + 0x10]
mov dword [esp + 0x10], 0x3e80
push eax
push esi
push ecx
push edx
call dword [sym.imp.ADVAPI32.dll_RegQueryValueA]
test eax, eax
push 0x10
push ebp
push ebx
je 0x5afcc7
call edi
mov ecx, dword [esp + 0x1c]
sub ecx, 0x14
neg ecx
sbb ecx, ecx
and ecx, 0xffffffec
add ecx, 0x28
cmp eax, 0x10
mov dword [esp + 0x18], ecx
jne 0x5afc3a
jmp 0x5afbed
mov ecx, dword [esp + 0x18]
cmp ecx, dword [esp + 0x28]
jg 0x5afc3a
mov eax, dword [ebp + 0xc]
mov esi, dword [0x5b8c4c]
mov ecx, 3
mov edi, ebp
xor edx, edx
mov dword [esp + 0x20], eax
repe cmpsd dword [esi], dword es:[edi]
je 0x5afc84
push 1
push eax
push ebx
call dword [sym.imp.KERNEL32.dll__llseek]
push 0x10
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll__lread]
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
add ecx, eax
add edx, ecx
cmp eax, 0x10
mov dword [esp + 0x18], edx
je 0x5afbe9
mov edi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
or byte [0x5b8c14], 8
push esi
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call edi
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
push eax
call esi
push ebp
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebp
call edi
push eax
call esi
push ebx
call dword [sym.imp.KERNEL32.dll__lclose]
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x128
ret
mov edx, dword [esp + 0x14]
push eax
push edx
push ebx
call dword [sym.imp.KERNEL32.dll__lread]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
inc eax
push ebp
mov dword [esp + 0x14], eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebp
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push ebx
call dword [sym.imp.KERNEL32.dll__lclose]
or byte [0x5b8c14], 2
mov esi, dword [esp + 0x14]
jmp 0x5afe31
call edi
mov ecx, dword [esp + 0x1c]
sub ecx, 0x14
neg ecx
sbb ecx, ecx
and ecx, 0xffffffec
add ecx, 0x28
cmp eax, 0x10
mov dword [esp + 0x18], ecx
jne 0x5afdfa
jmp 0x5afced
mov ecx, dword [esp + 0x18]
cmp ecx, dword [esp + 0x28]
jg 0x5afdfa
mov eax, dword [ebp + 0xc]
mov esi, dword [0x5b8c4c]
mov ecx, 3
mov edi, ebp
xor edx, edx
mov dword [esp + 0x20], eax
repe cmpsd dword [esi], dword es:[edi]
je 0x5afd43
push 1
push eax
push ebx
call dword [sym.imp.KERNEL32.dll__llseek]
push 0x10
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll__lread]
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
add ecx, eax
add edx, ecx
cmp eax, 0x10
mov dword [esp + 0x18], edx
je 0x5afce9
jmp 0x5afdfa
mov ecx, dword [esp + 0x10]
or byte [0x5b8c14], 1
lea edx, [eax + 1]
cmp ecx, edx
je 0x5afd72
mov eax, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push eax
call esi
mov edi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push eax
call edi
mov ecx, dword [esp + 0x14]
push ecx
jmp 0x5afd9e
push eax
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll__lread]
mov ecx, dword [esp + 0x20]
cmp eax, ecx
jae 0x5afdce
mov edx, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push edx
call esi
mov edi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push eax
call edi
mov eax, dword [esp + 0x14]
push eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push ebp
call esi
push eax
call edi
push ebp
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push ebx
call dword [sym.imp.KERNEL32.dll__lclose]
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x128
ret
mov esi, dword [esp + 0x14]
mov edi, ebp
xor edx, edx
repe cmpsb byte [esi], byte es:[edi]
jne 0x5afdf6
mov esi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push ebp
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebp
call esi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor ebp, ebp
mov esi, dword [esp + 0x14]
push ebx
call dword [sym.imp.KERNEL32.dll__lclose]
test ebp, ebp
je 0x5afe31
test byte [0x5b8c14], 1
jne 0x5afe31
mov edi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
push ebp
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebp
call edi
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor ebp, ebp
or byte [0x5b8c14], 4
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalHandle]
mov edx, dword [esp + 0x10]
lea eax, [esp + 0x10]
lea ecx, [esp + 0x24]
push eax
dec edx
push ecx
mov ecx, esi
mov dword [esp + 0x18], edx
mov dword [esp + 0x28], edx
call fcn.005b25d0
push esi
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, 0x20
mov edi, 0x5b8b80
mov eax, dword [esp + 0x24]
mov esi, eax
add eax, 0x80
rep movsd dword es:[edi], dword [esi]
mov dword [esp + 0x2c], eax
mov esi, 0x5b8da4
mov eax, dword [esi]
test eax, eax
je 0x5afea5
push eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov edx, dword [esi]
push edx
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [esp + 0x2c]
cmp byte [ecx], 0
je 0x5afec0
call fcn.005b2950
lea ecx, [esp + 0x2c]
mov dword [esi], eax
call fcn.005b22b0
jmp 0x5afecb
inc ecx
mov dword [esi], 0
mov dword [esp + 0x2c], ecx
add esi, 4
cmp esi, 0x5b8df4
jl 0x5afe89
mov eax, dword [esp + 0x24]
push eax
call ebx
mov esi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push eax
call esi
mov ecx, dword [esp + 0x24]
push ecx
call ebx
mov edi, dword [sym.imp.KERNEL32.dll_GlobalFree]
push eax
call edi
test byte [0x5b8c14], 1
je 0x5b0038
test ebp, ebp
je 0x5b0038
lea edx, [esp + 0x20]
lea eax, [esp + 0x24]
push edx
mov edx, dword [esp + 0x24]
push eax
mov ecx, ebp
call fcn.005b25d0
push ebp
call ebx
push eax
call esi
push ebp
call ebx
push eax
call edi
mov ecx, dword [esp + 0x24]
mov ax, word [ecx + 0x5d]
cmp word [0x5b8bdd], ax
jb 0x5aff43
mov word [0x5b8bdd], ax
mov ax, word [ecx + 0x5f]
cmp word [0x5b8bdf], ax
jb 0x5aff56
mov word [0x5b8bdf], ax
xor eax, eax
mov ax, word [0x5b8be1]
sub eax, 0x7bc
lea edx, [eax + eax*8]
lea eax, [eax + edx*8]
lea edx, [eax + eax*4]
xor eax, eax
mov ax, word [0x5b8be3]
mov edi, eax
shl edi, 4
sub edi, eax
xor eax, eax
mov ax, word [0x5b8be7]
lea edx, [edx + edi*2]
add edx, eax
xor eax, eax
mov dword [esp + 0x10], edx
mov ax, word [ecx + 0x61]
sub eax, 0x7bc
lea edi, [eax + eax*8]
lea eax, [eax + edi*8]
lea edi, [eax + eax*4]
xor eax, eax
mov ax, word [ecx + 0x63]
mov ebp, eax
shl ebp, 4
sub ebp, eax
lea eax, [edi + ebp*2]
xor edi, edi
mov di, word [ecx + 0x67]
add eax, edi
cmp edx, eax
mov dword [esp + 0x20], eax
jle 0x5affe2
mov edx, dword [ecx + 0x61]
mov dword [0x5b8be1], edx
mov eax, dword [ecx + 0x65]
mov dword [0x5b8be5], eax
mov edx, dword [ecx + 0x69]
mov dword [0x5b8be9], edx
mov eax, dword [ecx + 0x6d]
mov dword [0x5b8bed], eax
mov eax, dword [ecx + 0x74]
mov edx, dword [0x5b8bf4]
cmp edx, eax
jb 0x5afff4
mov dword [0x5b8bf4], eax
mov eax, dword [ecx + 0x78]
mov edx, dword [0x5b8bf8]
cmp edx, eax
jb 0x5b0006
mov dword [0x5b8bf8], eax
mov ax, word [ecx + 0x71]
mov edi, dword [0x5b8afc]
movsx edx, ax
shl edx, 6
cmp word [edx + edi + 0x28], 0
jne 0x5b0024
mov word [0x5b8bf1], ax
push ecx
call ebx
push eax
call esi
mov eax, dword [esp + 0x24]
push eax
call ebx
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x128
ret