forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


User privileges...

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Help for VDS 5 & Up
View previous topic :: View next topic  
Author Message
Hooligan
VDS Developer
VDS Developer


Joined: 28 Oct 2003
Posts: 479
Location: California

PostPosted: Tue May 02, 2006 11:34 pm    Post subject: User privileges... Reply with quote

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:

Code:
loadlib netapi32.dll
loadlib advapi32.dll
loadlib kernel32.dll
%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))
info %B
%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")
info %g
info @len(%g)
%%start = @Sum(8,%c)
%%end = @Sum(%%start, 4)
%%privilege = @SUBSTR(@val(%g),%%start,%%end)
info  %%privilege
freelib advapi32.dll
freelib kernel32.dll
freelib netapi32.dll
exit


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,
Hooligan

_________________
Hooligan

Why be normal?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced Help for VDS 5 & Up All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group