Advertisement
alien_fx_fiend

API-Hooking-Example

Jun 29th, 2024
679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.99 KB | None | 0 0
  1. #include <windows.h>
  2. #include <iostream>
  3.  
  4. int main() {
  5.     HWND hwnd = FindWindow(NULL, L"*Untitled - Notepad"); // search for "*Untitled - Notepad"
  6.     if (hwnd != NULL) {
  7.         SetWindowText(hwnd, L"Wormhole Vortex"); // change the title of the window
  8.         std::cout << "Code Injected Successfully into Notepad Process!" << std::endl; // print the message to the console
  9.     }
  10.     else {
  11.         hwnd = FindWindow(NULL, L"Untitled - Notepad"); // search for "Untitled - Notepad"
  12.         if (hwnd != NULL) {
  13.             SetWindowText(hwnd, L"Wormhole Vortex"); // change the title of the window
  14.             std::cout << "Code Injected Successfully into Notepad Process!" << std::endl; // print the message to the console
  15.         }
  16.         else {
  17.             std::cout << "No window with the specified title was found." << std::endl;
  18.         }
  19.     }
  20.  
  21.     // Keep the console window open
  22.     std::cout << "Press any key to exit..." << std::endl;
  23.     std::cin.get();
  24.  
  25.     return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement