Joined: 28 Oct 2003
|Posted: Tue May 02, 2006 11:34 pm Post subject: User privileges...
|I am trying to determine the logged in user privileges, (admin, power user, etc.). I am certain I'm doing this the hard way, but this seemed to be the most promising way I could find... Here is some test code I wrote:
%a = @fill(256,,Z)
%s = @binary(dword,256)
%%user = @lib(advapi32,GetUserNameA,bool:,@addr("%a"),@addr("%s"))
%x = @adjust(%a )
info length @len(%x)
%B = @Fill(@Prod(@Sum(@len(%x),1),2))
%R = @lib(kernel32,MultiByteToWideChar,INT:,0,0,STR:%x,-1,@ADDR("%B"),@Prod(@Sum(@len(%x),1),2))
%c = @Prod(@Sum(@len(%x),1),2)
%f = @binary(BYTE,0)
%R = @lib(netapi32,NetUserGetInfo,INT:,NIL,STR:%B,1,@addr("%f"))
rem how do I extract the data that is contained in the location that %f points to?
%g = @addr("%f")
%%start = @Sum(8,%c)
%%end = @Sum(%%start, 4)
%%privilege = @SUBSTR(@val(%g),%%start,%%end)
Anyone have any clue what is missing? I can't seem to access the data contained in the location that %f points to...
This is making my peanut brain hurt!
Thanks in advance,
Why be normal?