Function at 0x40a640
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 [0x413c14], 0x40
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x40adbe
mov edi, 0x410278
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 0x40adbe
push 0x3e80
push 0x42
call edi
push eax
call ebx
mov ebp, eax
test ebp, ebp
jne 0x40a70b
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 0x40aa11
mov edx, dword [0x413c6c]
mov ebx, dword [sym.imp.ADVAPI32.dll_RegQueryValueA]
lea ecx, [esp + 0x10]
mov dword [esp + 0x10], 0x3e80
push ecx
push ebp
push 0x410258
push edx
call ebx
test eax, eax
je 0x40a951
push 0x104
push esi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
mov edi, 0x410398
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 0x40a811
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 0x40a7fc
test eax, eax
jne 0x40a7fc
lea ecx, [esp + 0x1c]
push 4
push ecx
push esi
call edi
cmp dword [esp + 0x1c], 0x14
jne 0x40a7e2
push 4
push 0x413c18
push esi
call edi
push esi
call dword [sym.imp.KERNEL32.dll__lclose]
mov esi, dword [esp + 0x14]
jmp 0x40a962
push esi
mov dword [0x413c18], 0
call dword [sym.imp.KERNEL32.dll__lclose]
mov esi, dword [esp + 0x14]
jmp 0x40a962
push esi
mov dword [0x413c18], eax
call dword [sym.imp.KERNEL32.dll__lclose]
mov esi, dword [esp + 0x14]
jmp 0x40a962
mov edx, dword [0x413c0c]
and edx, 0xffff
push edx
call fcn.0040e1f0
call fcn.0040e1fa
mov dword [esp + 0x14], eax
xor eax, eax
mov ax, word [0x413c0a]
push eax
call fcn.0040e1f0
call fcn.0040e1fa
mov edx, dword [esp + 0x18]
mov dword [esp + 0x28], eax
shl eax, 0x10
or eax, edx
xor ecx, ecx
mov cx, word [0x413c06]
cdq
xor eax, edx
push ecx
sub eax, edx
mov dword [0x413c18], eax
call fcn.0040e1f0
call fcn.0040e1fa
mov edx, dword [0x413c08]
mov dword [esp + 0x1c], eax
and edx, 0xffff
push edx
call fcn.0040e1f0
add esp, 0x10
call fcn.0040e1fa
mov edx, dword [esp + 0x10]
mov dword [esp + 0x20], eax
shl eax, 0x10
or eax, edx
mov ecx, dword [0x413c6c]
cdq
xor eax, edx
sub eax, edx
mov edx, dword [0x413c18]
add edx, eax
lea eax, [esp + 0x30]
push eax
push 0x410258
push ecx
mov dword [0x413c18], edx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
test eax, eax
je 0x40a940
mov eax, dword [0x413c6c]
lea edx, [esp + 0x30]
push edx
push 0x410258
push eax
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyA]
test eax, eax
je 0x40a917
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 [0x413c18]
push 0xa
push ebp
push ecx
call fcn.0040df78
mov edx, dword [0x413c6c]
add esp, 0xc
push 0x14
push ebp
push 1
push 0x410258
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 0x40a962
mov edx, 0x410390
mov ecx, ebp
call fcn.0040d8e0
mov dword [0x413c18], eax
mov edx, dword [0x413c4c]
mov eax, dword [0x413c6c]
lea ecx, [esp + 0x10]
mov dword [esp + 0x10], 0x3e80
push ecx
push esi
push edx
push eax
call ebx
test eax, eax
je 0x40a9eb
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 [0x413e14]
or byte [0x413c14], 8
mov eax, 0xe000
test eax, ecx
jne 0x40a9db
mov edx, ecx
mov ecx, dword [0x413d80]
or edx, eax
xor ecx, eax
mov dword [0x413e14], edx
mov dword [0x413d80], 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 [0x413c14], 4
jmp 0x40ae37
mov ecx, dword [0x413e14]
mov eax, 0xe000
test eax, ecx
jne 0x40aa38
mov edx, ecx
mov ecx, dword [0x413d80]
or edx, eax
xor ecx, eax
mov dword [0x413e14], edx
mov dword [0x413d80], 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 0x40aaf2
test eax, eax
jne 0x40aaf2
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 0x40aaf0
push 4
push 0x413c18
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 0x40ab9d
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 [0x413c18], eax
mov dword [esp + 0x28], 0xa
call dword [sym.imp.KERNEL32.dll__llseek]
cmp eax, 4
mov dword [esp + 0x28], eax
jb 0x40ab1e
push 0
push 4
push ebx
call dword [sym.imp.KERNEL32.dll__llseek]
cmp dword [esp + 0x18], 4
je 0x40ab9d
mov edx, dword [0x413c6c]
lea ecx, [esp + 0x10]
push ecx
push ebp
push 0x410258
push edx
mov dword [esp + 0x20], 0x3e80
call dword [sym.imp.ADVAPI32.dll_RegQueryValueA]
test eax, eax
je 0x40ab8c
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, 0x410388
mov ecx, ebp
call fcn.0040d8e0
mov dword [0x413c18], eax
mov ecx, dword [0x413c4c]
mov edx, dword [0x413c6c]
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 0x40acc7
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 0x40ac3a
jmp 0x40abed
mov ecx, dword [esp + 0x18]
cmp ecx, dword [esp + 0x28]
jg 0x40ac3a
mov eax, dword [ebp + 0xc]
mov esi, dword [0x413c4c]
mov ecx, 3
mov edi, ebp
xor edx, edx
mov dword [esp + 0x20], eax
repe cmpsd dword [esi], dword es:[edi]
je 0x40ac84
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 0x40abe9
mov edi, dword [sym.imp.KERNEL32.dll_GlobalHandle]
or byte [0x413c14], 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 [0x413c14], 2
mov esi, dword [esp + 0x14]
jmp 0x40ae31
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 0x40adfa
jmp 0x40aced
mov ecx, dword [esp + 0x18]
cmp ecx, dword [esp + 0x28]
jg 0x40adfa
mov eax, dword [ebp + 0xc]
mov esi, dword [0x413c4c]
mov ecx, 3
mov edi, ebp
xor edx, edx
mov dword [esp + 0x20], eax
repe cmpsd dword [esi], dword es:[edi]
je 0x40ad43
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 0x40ace9
jmp 0x40adfa
mov ecx, dword [esp + 0x10]
or byte [0x413c14], 1
lea edx, [eax + 1]
cmp ecx, edx
je 0x40ad72
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 0x40ad9e
push eax
push ebp
push ebx
call dword [sym.imp.KERNEL32.dll__lread]
mov ecx, dword [esp + 0x20]
cmp eax, ecx
jae 0x40adce
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 0x40adf6
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 0x40ae31
test byte [0x413c14], 1
jne 0x40ae31
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 [0x413c14], 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.0040d5d0
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, 0x413b80
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, 0x413da4
mov eax, dword [esi]
test eax, eax
je 0x40aea5
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 0x40aec0
call fcn.0040d950
lea ecx, [esp + 0x2c]
mov dword [esi], eax
call fcn.0040d2b0
jmp 0x40aecb
inc ecx
mov dword [esi], 0
mov dword [esp + 0x2c], ecx
add esi, 4
cmp esi, 0x413df4
jl 0x40ae89
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 [0x413c14], 1
je 0x40b038
test ebp, ebp
je 0x40b038
lea edx, [esp + 0x20]
lea eax, [esp + 0x24]
push edx
mov edx, dword [esp + 0x24]
push eax
mov ecx, ebp
call fcn.0040d5d0
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 [0x413bdd], ax
jb 0x40af43
mov word [0x413bdd], ax
mov ax, word [ecx + 0x5f]
cmp word [0x413bdf], ax
jb 0x40af56
mov word [0x413bdf], ax
xor eax, eax
mov ax, word [0x413be1]
sub eax, 0x7bc
lea edx, [eax + eax*8]
lea eax, [eax + edx*8]
lea edx, [eax + eax*4]
xor eax, eax
mov ax, word [0x413be3]
mov edi, eax
shl edi, 4
sub edi, eax
xor eax, eax
mov ax, word [0x413be7]
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 0x40afe2
mov edx, dword [ecx + 0x61]
mov dword [0x413be1], edx
mov eax, dword [ecx + 0x65]
mov dword [0x413be5], eax
mov edx, dword [ecx + 0x69]
mov dword [0x413be9], edx
mov eax, dword [ecx + 0x6d]
mov dword [0x413bed], eax
mov eax, dword [ecx + 0x74]
mov edx, dword [0x413bf4]
cmp edx, eax
jb 0x40aff4
mov dword [0x413bf4], eax
mov eax, dword [ecx + 0x78]
mov edx, dword [0x413bf8]
cmp edx, eax
jb 0x40b006
mov dword [0x413bf8], eax
mov ax, word [ecx + 0x71]
mov edi, dword [0x413afc]
movsx edx, ax
shl edx, 6
cmp word [edx + edi + 0x28], 0
jne 0x40b024
mov word [0x413bf1], 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