当前位置:编程学习 > 网站相关 >>

添加用户的汇编代码

;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;code by asm http://www.asm32.cn/
;2007-9-29
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    .386
    .model flat, stdcall
    option casemap :none   ; case sensitive
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
;    Include 数据
;>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    include        windows.inc
    include        user32.inc
    include        kernel32.inc
   include       Netapi32.inc
  
    includelib    user32.lib
    includelib    kernel32.lib
    includelib    Netapi32.lib

.data?
oUserInfo USER_INFO_1<?>
oUser LOCALGROUP_MEMBERS_INFO_3 <?>
dwErr DWORD ?
.data
szUser dw "a","s","m",0
szPass dw "p","a","s","s",0
szAdministrators dw "A","d","m","i","n","i","s","t","r","a","t","o","r","s",0
.code
start:
      invoke RtlZeroMemory,addr oUserInfo,sizeof oUserInfo
      push offset szUser
      pop oUserInfo.usri1_name
      push offset szPass
      pop oUserInfo.usri1_password
      mov oUserInfo.usri1_priv,USER_PRIV_USER
      mov oUserInfo.usri1_flags,UF_NORMAL_ACCOUNT
      invoke NetUserAdd,NULL, 1,addr oUserInfo,addr dwErr
      push oUserInfo.usri1_name
      pop oUser.lgrmi3_domainandname
      invoke NetLocalGroupAddMembers,NULL,addr szAdministrators,3,addr oUser,1
      invoke ExitProcess,0
      end start

补充:综合编程 , 安全编程 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,