Function at 0x4a7940
Capabilities:
Get user security identifier

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4fbb80
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x2c
push ebx
push esi
push edi
mov eax, 0x6a
mov dword [ebp - 0x10], esp
push 1
push 0x5272b0
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 4], 0
call fcn.004a7880
mov eax, dword [ebp - 0x24]
mov ebx, dword [sym.imp.KERNEL32.dll_LocalAlloc]
add esp, 8
push eax
push 0x40
call ebx
mov ecx, dword [ebp - 0x20]
mov dword [ebp - 0x14], eax
push ecx
push 0x40
call ebx
mov edi, dword [ebp + 0x14]
mov ecx, 0xf558a0
push edi
mov esi, eax
call fcn.004f0087
push 0xa
mov ecx, eax
call fcn.004eff40
push 0x402150
mov ecx, eax
call fcn.004016a0
lea edx, [ebp - 0x2c]
lea eax, [ebp - 0x20]
push edx
mov edx, dword [ebp - 0x14]
push eax
lea ecx, [ebp - 0x24]
push esi
push ecx
push edx
push edi
push 0
call dword [sym.imp.ADVAPI32.dll_LookupAccountNameA]
test eax, eax
jne 0x4a7a00
push str.Error__lu___LookupAccountName_n
call fcn.004f172e
add esp, 4
or ax, 0xffff
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
push esi
push str.Adding_ACE_for__s_s_n
call fcn.004f172e
mov esi, dword [ebp + 8]
add esp, 0xc
mov ecx, 0xf558a0
push esi
call fcn.004f0087
push 0xa
mov ecx, eax
call fcn.004eff40
push 0x402150
mov ecx, eax
call fcn.004016a0
lea eax, [ebp - 0x28]
lea ecx, [ebp - 0x18]
push eax
push 0
push ecx
push 0
push 0
push 4
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_GetNamedSecurityInfoA]
neg eax
sbb eax, eax
neg eax
mov dword [ebp + 0x14], eax
je 0x4a7a91
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
push str.GetNamedSecurityInfo
call esi
push eax
call fcn.004a7590
add esp, 8
call esi
push eax
push str.Error__d:GetNamedSecurityInfo_n
call fcn.004f172e
add esp, 8
or ax, 0xffff
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x4a7aee
push 2
lea edx, [ebp - 0x38]
push 0xc
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_GetAclInformation]
test eax, eax
jne 0x4a7ad4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error__d:GetAclInformation_n
call fcn.004f172e
add esp, 8
or ax, 0xffff
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x4a7aee
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov ecx, dword [ebp - 0x34]
lea edi, [eax + ecx + 8]
jmp 0x4a7afd
mov edx, dword [ebp - 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov edi, eax
add edi, 0x10
push edi
push 0x40
call ebx
mov esi, eax
push 2
push edi
push esi
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
jne 0x4a7b23
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error__d:InitializeAcl_n
jmp 0x4a7c7d
mov al, byte [ebp + 0x18]
test al, al
jne 0x4a7b74
push str._Add_the_access_denied_ACE_to_the_new_DACL
mov ecx, 0xf558a0
call fcn.004f0087
push 0xa
mov ecx, eax
call fcn.004eff40
push 0x402150
mov ecx, eax
call fcn.004016a0
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp + 0xc]
push eax
push ecx
push 2
push esi
call dword [sym.imp.ADVAPI32.dll_AddAccessDeniedAce]
test eax, eax
jne 0x4a7bc2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error__d:AddAccessDeniedAce_n
jmp 0x4a7c7d
cmp al, 1
jne 0x4a7bc2
push str._Add_the_access_allowed_ACE_to_the_new_DACL
mov ecx, 0xf558a0
call fcn.004f0087
push 0xa
mov ecx, eax
call fcn.004eff40
push 0x402150
mov ecx, eax
call fcn.004016a0
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp + 0xc]
push edx
push eax
push 2
push esi
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
test eax, eax
jne 0x4a7bc2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error__d:AddAccessAllowedAce_n
jmp 0x4a7c7d
lea ecx, [ebp - 0x1c]
push ecx
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
jne 0x4a7bdc
mov eax, dword [ebp - 0x1c]
mov dl, byte [ebp + 0x10]
mov byte [eax + 1], dl
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x4a7c3f
mov eax, dword [ebp - 0x38]
test eax, eax
je 0x4a7c3f
mov ebx, dword [sym.imp.ADVAPI32.dll_AddAce]
xor edi, edi
cmp edi, dword [ebp - 0x38]
jae 0x4a7c3f
mov edx, dword [ebp - 0x18]
lea ecx, [ebp - 0x1c]
push ecx
push edi
push edx
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
jne 0x4a7c18
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error__d:_GetAce_n
jmp 0x4a7c7d
mov eax, dword [ebp - 0x1c]
xor ecx, ecx
mov cx, word [eax + 2]
push ecx
push eax
push 0xffffffffffffffff
push 2
push esi
call ebx
test eax, eax
jne 0x4a7c3c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error__d:AddAce_n
jmp 0x4a7c7d
inc edi
jmp 0x4a7bf2
mov edx, dword [ebp + 8]
push 0
push esi
push 0
push 0
push 4
push 1
push edx
call dword [sym.imp.ADVAPI32.dll_SetNamedSecurityInfoA]
neg eax
sbb eax, eax
neg eax
mov dword [ebp + 0x14], eax
je 0x4a7ca1
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
push str.SetNamedSecurityInfo
call edi
push eax
call fcn.004a7590
add esp, 8
call edi
push eax
push str.Error__d:SetNamedSecurityInfo_n
call fcn.004f172e
add esp, 8
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
or ax, 0xffff
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0
push 0x5272b0
call fcn.004a7880
add esp, 8
push esi
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
call esi
mov eax, dword [ebp - 0x28]
push eax
call esi
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
mov ax, 1
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret