Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Simple File Pumper */
- /* by: den5e @ <den5e.blogspot.com> */
- /* Greetz to dk21, c0ax, baltazar, MikiSoft itd. */
- const char NULLBYTE = '0';
- const char* TP_MB = "-mb";
- const char* TP_KB = "-kb";
- const long MB = 1048576;
- const int KB = 1024;
- #include <iostream>
- #include <fstream>
- #include <string>
- #include <cstring>
- #include <stdlib.h>
- bool pumpThatBitch(char *filename, int size, char *type);
- void helpThatBitch();
- int main(int argc, char *args[]){
- if(argc == 2){
- if(strcmp(args[1],"-help")){
- helpThatBitch();
- return 0;
- }
- else{
- std::cout << "[-] Unknown argument: " << args[1] << "\n";
- return 1;
- }
- }
- else if(argc == 4){
- char *filename = args[1];
- int size = atoi(args[2]);
- char *type = args[3];
- if(strcmp(type, TP_MB) == 0 || strcmp(type, TP_KB) == 0){
- pumpThatBitch(filename, size, type);
- }
- else{
- std::cout << "Unknown type: " << type << "\n";
- helpThatBitch();
- return 1;
- }
- }
- return 0;
- }
- bool pumpThatBitch(char *filename, int size, char *type){
- std::cout << "[+] Pumping " << filename << "\n";
- std::ofstream file(filename, std::ios::out | std::ios::binary | std::ios::ate | std::ios::app);
- int tp_size;
- if(strcmp(type, TP_KB) == 0) tp_size = KB;
- else tp_size = MB;
- if(file.is_open()){
- for(int i = 0; i < size; i++){
- for(int x = 0; x < tp_size; x++){
- file << NULLBYTE;
- }
- }
- std::cout << "[+] Success!\n";
- }else{
- file.close();
- std::cout << "[-] Fuck, failed to open file.\n";
- return false;
- }
- file.close();
- return true;
- }
- void helpThatBitch(){
- std::cout << "Usage: \n"
- << "[filename]\n"
- << "[size]\n"
- << "[-mb/-kb]\n";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement