Function at 0x477b90
Capabilities:
Check if file exists
Get user security identifier

Disassembly:
sub esp, 0x2c
mov eax, dword [esp + 0x30]
push ebx
xor ebx, ebx
mov dword [esp + 0x14], 5
mov dword [esp + 4], ebx
mov dword [esp + 8], ebx
mov dword [esp + 0xc], ebx
cmp eax, ebx
je 0x477e49
push esi
mov esi, dword [esp + 0x3c]
cmp esi, ebx
je 0x477e48
push ebp
mov ebp, dword [esp + 0x44]
cmp ebp, ebx
je 0x477e47
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x477e47
lea eax, [esp + 0xc]
push eax
push 0x1f6
push esi
push ebx
call sub.NETAPI32.dll_NetShareGetInfo
test eax, eax
jne 0x477c11
mov ecx, dword [esp + 0xc]
push ecx
mov dword [esp + 0x20], 0x846
call sub.NETAPI32.dll_NetApiBufferFree
mov eax, dword [esp + 0x1c]
pop ebp
pop esi
pop ebx
add esp, 0x2c
ret
mov esi, dword [sym.imp.ADVAPI32.dll_LookupAccountNameW]
lea edx, [esp + 0x20]
push edx
lea eax, [esp + 0x14]
push eax
push ebx
lea ecx, [esp + 0x20]
push ecx
push ebx
push ebp
push ebx
call esi
mov eax, dword [esp + 0x14]
cmp eax, ebx
jbe 0x477e47
cmp dword [esp + 0x10], ebx
jbe 0x477e47
push edi
push eax
call fcn.0048690e
mov edi, eax
mov eax, dword [esp + 0x18]
xor ecx, ecx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0048690e
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x20]
push eax
push 0
push edi
call fcn.00487630
mov ecx, dword [esp + 0x28]
mov eax, dword [esp + 0x30]
lea edx, [ecx + ecx]
push edx
push 0
push eax
call fcn.00487630
mov eax, dword [esp + 0x3c]
add esp, 0x20
lea ecx, [esp + 0x24]
push ecx
lea edx, [esp + 0x18]
push edx
push eax
lea ecx, [esp + 0x24]
push ecx
push edi
push ebp
push 0
call esi
test eax, eax
je 0x477e1b
push 1
lea edx, [esp + 0x2c]
push edx
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x477e1b
push edi
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov esi, eax
add esi, 0x10
push esi
call fcn.0048690e
push esi
mov ebx, eax
push 0
push ebx
call fcn.00487630
add esp, 0x10
push 2
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x477e1b
mov al, byte [esp + 0x50]
test al, al
jne 0x477d11
mov esi, dword [esp + 0x4c]
push edi
push esi
push 3
push 2
push ebx
call dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAceEx]
jmp 0x477d2a
cmp al, 1
jne 0x477e1b
mov esi, dword [esp + 0x4c]
push edi
push esi
push 3
push 2
push ebx
call dword [sym.imp.ADVAPI32.dll_AddAccessDeniedAceEx]
test eax, eax
je 0x477e1b
push 0
push ebx
push 1
lea eax, [esp + 0x34]
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x477e1b
cmp esi, 0x1f01ff
jne 0x477d59
mov esi, 0x7f
jmp 0x477d6b
cmp esi, 0x1301bf
mov esi, 2
je 0x477d6b
mov esi, 1
push 0x28
call fcn.004872c3
mov dword [esp + 0x14], eax
xor ecx, ecx
mov dword [eax], ecx
mov edx, dword [esp + 0x14]
mov dword [edx + 4], ecx
mov eax, dword [esp + 0x14]
mov dword [eax + 8], ecx
mov edx, dword [esp + 0x14]
mov dword [edx + 0xc], ecx
mov eax, dword [esp + 0x14]
mov dword [eax + 0x10], ecx
mov edx, dword [esp + 0x14]
mov dword [edx + 0x14], ecx
mov eax, dword [esp + 0x14]
mov dword [eax + 0x18], ecx
mov edx, dword [esp + 0x14]
mov dword [edx + 0x1c], ecx
mov eax, dword [esp + 0x14]
mov dword [eax + 0x20], ecx
mov edx, dword [esp + 0x14]
mov dword [edx + 0x24], ecx
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x48]
mov dword [eax], ecx
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x5c]
mov dword [edx + 4], 0
mov eax, dword [esp + 0x14]
mov dword [eax + 8], ecx
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x58]
mov dword [edx + 0x10], eax
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x44]
mov dword [ecx + 0xc], esi
mov edx, dword [esp + 0x14]
mov dword [edx + 0x18], eax
mov edx, dword [esp + 0x14]
add esp, 4
lea ecx, [esp + 0x28]
push 0
mov dword [edx + 0x24], ecx
mov eax, dword [esp + 0x14]
push eax
push 0x1f6
push 0
call sub.NETAPI32.dll_NetShareAdd
mov dword [esp + 0x20], eax
test edi, edi
je 0x477e28
push edi
call fcn.00487d04
add esp, 4
mov eax, dword [esp + 0x1c]
pop edi
test eax, eax
je 0x477e3a
push eax
call fcn.00487d04
add esp, 4
test ebx, ebx
je 0x477e47
push ebx
call fcn.00487d04
add esp, 4
pop ebp
pop esi
mov eax, dword [esp + 0x14]
pop ebx
add esp, 0x2c
ret