dhtmlextreme

My Fake Sendmail Source

Jun 17th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. 1. #include "stdafx.h"
  2. 2. #include <iostream>
  3. 3. #include <fstream>
  4. 4. #include "process.h"
  5.  
  6.  
  7. 5. #include <stdio.h>
  8. 6. #include <stdlib.h>
  9.  
  10. 7. #define BUFFERSIZE
  11.  
  12.  
  13. 8. using namespace std;
  14.  
  15. 9. int main (int argc, char **argv) {
  16.  
  17.  
  18.  
  19. 10. unsigned char buffer[BUFFERSIZE];
  20. 11. int bytes_read=0;
  21. 12. int buffer_size=0;
  22.  
  23.  
  24. 13. FILE * myfile;
  25. 14. myfile = fopen ("/wamp/sendmail/output.txt","w");
  26.  
  27.  
  28. 15. buffer_size=sizeof(unsigned char)*BUFFERSIZE;
  29. /* open stdin for reading */
  30. 16. while((bytes_read=fread(&buffer, buffer_size, 1, stdin))==buffer_size){
  31. 17. fprintf(myfile, "%c", buffer[0]);
  32. 18. }
  33. //close output file
  34. 19. fclose(myfile);
  35.  
  36. 20. system("/wamp/sendmail/save.bat");
  37.  
  38. 21. return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment