Function at 0x407a95
Capabilities:
Compare security identifiers
Get session user name
Get user security identifier
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x600
push ebx
lea eax, [ebp - 0x18]
push eax
xor ebx, ebx
push 0xe0100
push ebx
push dword [ebp + 0xc]
mov dword [ebp - 0x1c], ebx
push dword [ebp + 8]
mov dword [ebp - 8], ebx
mov dword [ebp - 0x18], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
je 0x407acb
xor eax, eax
jmp 0x407db4
push esi
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x180]
mov esi, 0x80
push eax
mov dword [ebp - 0x24], esi
call dword [sym.imp.ADVAPI32.dll_GetUserNameA]
test eax, eax
je 0x407da7
lea eax, [ebp - 0x34]
push eax
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x200]
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x80]
push eax
lea eax, [ebp - 0x180]
push eax
push ebx
mov dword [ebp - 0x20], 0x44
mov dword [ebp - 0x28], esi
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameA]
test eax, eax
je 0x407da7
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x600]
push eax
push 5
push dword [ebp - 0x18]
mov dword [ebp - 0x2c], 0x400
call dword [sym.imp.ADVAPI32.dll_RegGetKeySecurity]
test eax, eax
jne 0x407da7
push edi
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 0x600]
push eax
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorOwner]
test eax, eax
je 0x407bb8
push dword [ebp - 0xc]
lea eax, [ebp - 0x80]
push eax
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x407bb8
xor edi, edi
push 0x14
inc edi
push 0x40
mov dword [ebp - 8], edi
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
cmp esi, ebx
je 0x407bb8
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x407bb1
push ebx
lea eax, [ebp - 0x80]
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorOwner]
test eax, eax
je 0x407bb1
push esi
push edi
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegSetKeySecurity]
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x600]
push eax
mov dword [ebp - 0x14], ebx
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
test eax, eax
je 0x407da6
mov eax, dword [ebp - 0x1c]
cmp eax, ebx
je 0x407da6
xor ecx, ecx
xor edi, edi
mov dword [ebp - 4], ebx
cmp cx, word [eax + 4]
jae 0x407da6
lea ecx, [ebp - 0x10]
push ecx
push dword [ebp - 4]
push eax
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x407cc6
mov eax, dword [ebp - 0x10]
add eax, 8
xor esi, esi
mov dword [ebp - 0xc], eax
cmp edi, ebx
jle 0x407c4f
push dword [ebp - 0xc]
push dword [ebp + esi*4 - 0x100]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
test eax, eax
jne 0x407c36
inc esi
cmp esi, edi
jl 0x407c1d
cmp esi, edi
jge 0x407c4f
push dword [ebp - 4]
push dword [ebp - 0x1c]
call dword [sym.imp.ADVAPI32.dll_DeleteAce]
mov dword [ebp - 0x14], 1
jmp 0x407cc9
cmp edi, 0x20
jge 0x407c5f
mov eax, dword [ebp - 0xc]
mov dword [ebp + edi*4 - 0x100], eax
inc edi
push dword [ebp - 0xc]
lea eax, [ebp - 0x80]
push eax
call dword [sym.imp.ADVAPI32.dll_EqualSid]
mov ecx, dword [ebp - 0x10]
test eax, eax
je 0x407c86
mov eax, dword [ebp + 0x10]
neg eax
sbb eax, eax
and eax, 0x10006
add eax, 0xe0039
jmp 0x407c8b
mov eax, 0x20000
cmp dword [ecx + 4], eax
je 0x407c9d
mov dword [ecx + 4], eax
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x14], 1
cmp byte [ecx], bl
jne 0x407ca7
test byte [ecx + 1], 0x10
je 0x407cc6
mov byte [ecx], bl
mov eax, dword [ebp - 0xc]
cmp dword [eax + 8], ebx
mov ecx, dword [ebp - 0x10]
sete al
mov dword [ebp - 0x14], 1
lea eax, [eax*8 + 2]
mov byte [ecx + 1], al
inc dword [ebp - 4]
mov eax, dword [ebp - 0x1c]
movzx ecx, word [eax + 4]
cmp dword [ebp - 4], ecx
jb 0x407bf8
cmp dword [ebp - 0x14], ebx
je 0x407da6
cmp byte [0x4121a8], bl
je 0x407d5a
cmp dword [0x412cc0], ebx
je 0x407d5a
lea eax, [ebp - 8]
push eax
push 0x103
push ebx
push dword [ebp + 0xc]
mov dword [ebp - 8], ebx
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x407d5a
mov ecx, 0x4121a8
mov eax, ecx
lea esi, [eax + 1]
mov dl, byte [eax]
inc eax
cmp dl, bl
jne 0x407d19
sub eax, esi
inc eax
push eax
push ecx
push 2
push ebx
push 0xc8
push 0xe4
push 0xa
push 0x4106dc
push 0x4122f8
call fcn.00402544
add esp, 0x14
push eax
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
test eax, eax
jne 0x407d5a
mov dword [0x412cc0], ebx
xor edi, edi
push 0x14
inc edi
push 0x40
mov dword [ebp - 8], edi
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov esi, eax
cmp esi, ebx
je 0x407da6
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x407d9f
push ebx
push dword [ebp - 0x1c]
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x407d9f
push esi
push 4
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegSetKeySecurity]
test eax, eax
jne 0x407d9f
mov dword [ebp - 8], edi
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
pop edi
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 8]
pop esi
pop ebx
leave
ret