Function at 0x401664
Capabilities:
Get user security identifier

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x25c
push ebx
push esi
push edi
push 1
pop eax
xor ebx, ebx
push 0x1f
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x28], eax
pop ecx
xor eax, eax
lea edi, [ebp - 0xdb]
mov byte [ebp - 0xdc], bl
push 0x1f
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x1db]
mov byte [ebp - 0x1dc], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0x4008
push ebx
mov dword [ebp - 4], ebx
stosb byte es:[edi], al
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
lea eax, [ebp - 0x34]
push eax
push 0x800
push edi
push 4
push dword [ebp + 8]
mov dword [ebp - 0x30], edi
call dword [sym.imp.ADVAPI32.dll_GetFileSecurityA]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0xc]
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_GetSecurityDescriptorDacl]
call esi
cmp dword [ebp - 0xc], ebx
je 0x401850
cmp dword [ebp - 4], ebx
je 0x401850
push 2
lea eax, [ebp - 0x48]
push 0xc
push eax
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_GetAclInformation]
mov eax, dword [ebp - 0x48]
mov dword [ebp - 8], ebx
cmp eax, ebx
mov dword [ebp - 0x14], eax
jbe 0x40184b
mov esi, 0x80
lea eax, [ebp - 0x24]
push eax
push dword [ebp - 8]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_GetAce]
lea eax, [ebp - 0x3c]
mov dword [ebp - 0x1c], esi
push eax
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x1dc]
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0xdc]
push eax
mov eax, dword [ebp - 0x24]
add eax, 8
mov dword [ebp - 0x2c], esi
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_LookupAccountSidA]
test eax, eax
je 0x401845
push 0x1f
xor eax, eax
pop ecx
lea edi, [ebp - 0x15b]
mov byte [ebp - 0x15c], bl
push 1
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x5c]
mov dword [ebp - 0x20], esi
push eax
mov dword [ebp - 0x18], esi
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x401834
lea eax, [ebp - 0x38]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x15c]
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x25c]
push eax
push str.Everyone
push ebx
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameA]
test eax, eax
je 0x401845
lea eax, [ebp - 0x25c]
push eax
push 0x101f01ff
push 2
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
je 0x401845
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 4]
movzx ecx, word [eax + 4]
dec ecx
push ecx
push eax
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x401845
mov eax, dword [ebp - 0x10]
push ebx
mov byte [eax], bl
mov eax, dword [ebp - 0x10]
mov byte [eax + 1], 3
push dword [ebp - 4]
lea eax, [ebp - 0x5c]
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x40182e
lea eax, [ebp - 0x5c]
push eax
push 4
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_SetFileSecurityA]
test eax, eax
jne 0x40184b
jmp 0x401834
call dword [sym.imp.KERNEL32.dll_GetLastError]
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
cmp eax, dword [ebp - 0x14]
jb 0x401726
jmp 0x40184b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x30]
jmp 0x401851
push edi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
pop edi
pop esi
xor eax, eax
pop ebx
leave
ret