mirror of
https://github.com/naksyn/GregsBestFriend
synced 2026-06-06 16:14:37 +00:00
Building with Clang
To build GregsBestFriend with Clang using mingw64, follow these steps:
- Download and install mingw-w64 for your system.
- Open the mingw-w64 terminal or command prompt.
- Navigate to the
clang++folder in the GregsBestFriend repository. - Run the following command to build the executable with Clang:
clang++.exe -s -Os GregsBestFriend.cpp -o GregsBestFriend.exe
Compiler Flags
Here's what each flag does:
-s: Strip the executable of all symbol table and relocation information, reducing its size.-Os: Optimize the executable for size. This flag tells Clang to prioritize reducing the size of the generated code over its execution speed.
- The resulting
GregsBestFriend.exeexecutable should be located in theclang++folder.
Adding Shellcode to GregsBestFriend
Note that adding your own shellcode to GregsBestFriend may cause the program to be detected by some AV/EDR systems, depending on the specifics of your shellcode. To add your own shellcode, follow these steps:
- Open the
GregsBestFriend.cppfile in your preferred code editor. - Locate the
shellcode()function, which contains the shellcode that will be executed when the program runs. - Replace the existing shellcode with your own shellcode. Make sure that the shellcode is in the form of a byte array, where each byte is represented in hexadecimal format.
- Save the changes to the
GregsBestFriend.cppfile. - Follow the instructions for building the executable with Clang. Once the executable is built, your shellcode will be executed when the program runs.