/*
 * Malware Development for Ethical Hackers
 * hack.c - Anti-debugging tricks
 * detect debugger
 * author: @cocomelonc
*/

#include <stdio.h>
#include <stdlib.h>
#include <windows.h>

// Function to check if a debugger is present
bool IsDebuggerPresentCheck() {
  return IsDebuggerPresent() == TRUE;
}

// Function that simulates the main functionality
void hack() {
  MessageBox(NULL, "Meow!", "=^..^=", MB_OK);
}

int main() {
  // Check if a debugger is present
  if (IsDebuggerPresentCheck()) {
    MessageBox(NULL, "Debugger detected!", "=^..^=", MB_OK);
    return 1;  // exit if a debugger is present
  }
  // Main functionality
  hack();
  return 0;
}
