Erwin Ried 3 лет назад
Родитель
Сommit
d4c3edfa12

+ 310 - 115
esp32_marauder/CommandLine.cpp

@@ -1,4 +1,179 @@
 #include "CommandLine.h"
 #include "CommandLine.h"
+#ifdef ESP32_CAM
+
+bool is_configESPCamera = false;
+bool is_initMicroSDCard = false;
+
+#include "FS.h"                // SD Card ESP32
+#include "SD_MMC.h"            // SD Card ESP32
+#include "esp_camera.h"
+#include "soc/soc.h"           // Disable brownout problems
+#include "soc/rtc_cntl_reg.h"  // Disable brownout problems
+#include "driver/rtc_io.h"
+
+// Pin definition for CAMERA_MODEL_AI_THINKER
+#define PWDN_GPIO_NUM     32
+#define RESET_GPIO_NUM    -1
+#define XCLK_GPIO_NUM      0
+#define SIOD_GPIO_NUM     26
+#define SIOC_GPIO_NUM     27
+
+#define Y9_GPIO_NUM       35
+#define Y8_GPIO_NUM       34
+#define Y7_GPIO_NUM       39
+#define Y6_GPIO_NUM       36
+#define Y5_GPIO_NUM       21
+#define Y4_GPIO_NUM       19
+#define Y3_GPIO_NUM       18
+#define Y2_GPIO_NUM        5
+#define VSYNC_GPIO_NUM    25
+#define HREF_GPIO_NUM     23
+#define PCLK_GPIO_NUM     22
+
+void configESPCamera() {
+  if(is_configESPCamera) { Serial.println("cam1"); return; }
+  else is_configESPCamera = true;
+  Serial.println("cam2");
+  WRITE_PERI_REG(RTC_CNTL_BROWN_OUT_REG, 0); //disable brownout detector
+  // Configure Camera parameters
+ 
+  // Object to store the camera configuration parameters
+  camera_config_t config;
+ 
+  config.ledc_channel = LEDC_CHANNEL_0;
+  config.ledc_timer = LEDC_TIMER_0;
+  config.pin_d0 = Y2_GPIO_NUM;
+  config.pin_d1 = Y3_GPIO_NUM;
+  config.pin_d2 = Y4_GPIO_NUM;
+  config.pin_d3 = Y5_GPIO_NUM;
+  config.pin_d4 = Y6_GPIO_NUM;
+  config.pin_d5 = Y7_GPIO_NUM;
+  config.pin_d6 = Y8_GPIO_NUM;
+  config.pin_d7 = Y9_GPIO_NUM;
+  config.pin_xclk = XCLK_GPIO_NUM;
+  config.pin_pclk = PCLK_GPIO_NUM;
+  config.pin_vsync = VSYNC_GPIO_NUM;
+  config.pin_href = HREF_GPIO_NUM;
+  config.pin_sscb_sda = SIOD_GPIO_NUM;
+  config.pin_sscb_scl = SIOC_GPIO_NUM;
+  config.pin_pwdn = PWDN_GPIO_NUM;
+  config.pin_reset = RESET_GPIO_NUM;
+  config.xclk_freq_hz = 20000000;
+  config.pixel_format = PIXFORMAT_JPEG; // Choices are YUV422, GRAYSCALE, RGB565, JPEG
+ 
+  // Select lower framesize if the camera doesn't support PSRAM
+  if (psramFound()) {
+    config.frame_size = FRAMESIZE_UXGA; // FRAMESIZE_ + QVGA|CIF|VGA|SVGA|XGA|SXGA|UXGA
+    config.jpeg_quality = 10; //10-63 lower number means higher quality
+    config.fb_count = 2;
+  } else {
+    config.frame_size = FRAMESIZE_SVGA;
+    config.jpeg_quality = 12;
+    config.fb_count = 1;
+  }
+ 
+  // Initialize the Camera
+  esp_err_t err = esp_camera_init(&config);
+  if (err != ESP_OK) {
+    Serial.printf("Camera init failed with error 0x%x", err);
+    return;
+  }
+ 
+  // Camera quality adjustments
+  sensor_t * s = esp_camera_sensor_get();
+ 
+  // BRIGHTNESS (-2 to 2)
+  s->set_brightness(s, 0);
+  // CONTRAST (-2 to 2)
+  s->set_contrast(s, 0);
+  // SATURATION (-2 to 2)
+  s->set_saturation(s, 0);
+  // SPECIAL EFFECTS (0 - No Effect, 1 - Negative, 2 - Grayscale, 3 - Red Tint, 4 - Green Tint, 5 - Blue Tint, 6 - Sepia)
+  s->set_special_effect(s, 0);
+  // WHITE BALANCE (0 = Disable , 1 = Enable)
+  s->set_whitebal(s, 1);
+  // AWB GAIN (0 = Disable , 1 = Enable)
+  s->set_awb_gain(s, 1);
+  // WB MODES (0 - Auto, 1 - Sunny, 2 - Cloudy, 3 - Office, 4 - Home)
+  s->set_wb_mode(s, 0);
+  // EXPOSURE CONTROLS (0 = Disable , 1 = Enable)
+  s->set_exposure_ctrl(s, 1);
+  // AEC2 (0 = Disable , 1 = Enable)
+  s->set_aec2(s, 0);
+  // AE LEVELS (-2 to 2)
+  s->set_ae_level(s, 0);
+  // AEC VALUES (0 to 1200)
+  s->set_aec_value(s, 300);
+  // GAIN CONTROLS (0 = Disable , 1 = Enable)
+  s->set_gain_ctrl(s, 1);
+  // AGC GAIN (0 to 30)
+  s->set_agc_gain(s, 0);
+  // GAIN CEILING (0 to 6)
+  s->set_gainceiling(s, (gainceiling_t)0);
+  // BPC (0 = Disable , 1 = Enable)
+  s->set_bpc(s, 0);
+  // WPC (0 = Disable , 1 = Enable)
+  s->set_wpc(s, 1);
+  // RAW GMA (0 = Disable , 1 = Enable)
+  s->set_raw_gma(s, 1);
+  // LENC (0 = Disable , 1 = Enable)
+  s->set_lenc(s, 1);
+  // HORIZ MIRROR (0 = Disable , 1 = Enable)
+  s->set_hmirror(s, 0);
+  // VERT FLIP (0 = Disable , 1 = Enable)
+  s->set_vflip(s, 0);
+  // DCW (0 = Disable , 1 = Enable)
+  s->set_dcw(s, 1);
+  // COLOR BAR PATTERN (0 = Disable , 1 = Enable)
+  s->set_colorbar(s, 0);
+}
+ 
+void initMicroSDCard() {
+  /*if(is_initMicroSDCard) { Serial.println("sd1"); return; }
+  else is_initMicroSDCard = true;
+  Serial.println("sd2");*/
+  // Start the MicroSD card
+ 
+  Serial.println("Mounting MicroSD Card");
+  if (!SD_MMC.begin("/sdcard", true, false, SDMMC_FREQ_DEFAULT)) {
+    Serial.println("MicroSD Card Mount Failed");
+    return;
+  }
+  uint8_t cardType = SD_MMC.cardType();
+  if (cardType == CARD_NONE) {
+    Serial.println("No MicroSD Card found");
+    return;
+  }
+}
+ 
+void takeNewPhoto(String path) {
+  // Take Picture with Camera
+ 
+  // Setup frame buffer
+  camera_fb_t  * fb = esp_camera_fb_get();
+ 
+  if (!fb) {
+    Serial.println("Camera capture failed");
+    return;
+  }
+ 
+  // Save picture to microSD card
+  fs::FS &fs = SD_MMC;
+  File file = fs.open(path.c_str(), FILE_WRITE);
+  if (!file) {
+    Serial.println("Failed to open file in write mode");
+  }
+  else {
+    file.write(fb->buf, fb->len); // payload (image), payload length
+    Serial.printf("Saved file to path: %s\n", path.c_str());
+  }
+  // Close the file
+  file.close();
+ 
+  // Return the frame buffer back to the driver for reuse
+  esp_camera_fb_return(fb);
+}
+#endif
 
 
 CommandLine::CommandLine() {
 CommandLine::CommandLine() {
 }
 }
@@ -11,7 +186,7 @@ void CommandLine::RunSetup() {
   Serial.println("            " + version_number + "\n");
   Serial.println("            " + version_number + "\n");
   Serial.println(F("       By: justcallmekoko\n"));
   Serial.println(F("       By: justcallmekoko\n"));
   Serial.println(F("--------------------------------\n\n"));
   Serial.println(F("--------------------------------\n\n"));
-  
+
   Serial.print("> ");
   Serial.print("> ");
 }
 }
 
 
@@ -36,17 +211,17 @@ void CommandLine::main(uint32_t currentTime) {
 
 
 LinkedList<String> CommandLine::parseCommand(String input, char* delim) {
 LinkedList<String> CommandLine::parseCommand(String input, char* delim) {
   LinkedList<String> cmd_args;
   LinkedList<String> cmd_args;
-  
+
   if (input != "") {
   if (input != "") {
-    
+
     char fancy[input.length() + 1] = {};
     char fancy[input.length() + 1] = {};
     input.toCharArray(fancy, input.length() + 1);
     input.toCharArray(fancy, input.length() + 1);
-        
+
     char* ptr = strtok(fancy, delim);
     char* ptr = strtok(fancy, delim);
-  
+
     while (ptr != NULL) {
     while (ptr != NULL) {
       cmd_args.add(String(ptr));
       cmd_args.add(String(ptr));
-  
+
       ptr = strtok(NULL, delim);
       ptr = strtok(NULL, delim);
     }
     }
   }
   }
@@ -66,7 +241,7 @@ int CommandLine::argSearch(LinkedList<String>* cmd_args_list, String key) {
 bool CommandLine::checkValueExists(LinkedList<String>* cmd_args_list, int index) {
 bool CommandLine::checkValueExists(LinkedList<String>* cmd_args_list, int index) {
   if (index < cmd_args_list->size() - 1)
   if (index < cmd_args_list->size() - 1)
     return true;
     return true;
-    
+
   return false;
   return false;
 }
 }
 
 
@@ -111,7 +286,7 @@ void CommandLine::runCommand(String input) {
     Serial.println(HELP_CLEARAP_CMD_A);
     Serial.println(HELP_CLEARAP_CMD_A);
     Serial.println(HELP_REBOOT_CMD);
     Serial.println(HELP_REBOOT_CMD);
     Serial.println(HELP_UPDATE_CMD_A);
     Serial.println(HELP_UPDATE_CMD_A);
-    
+
     // WiFi sniff/scan
     // WiFi sniff/scan
     Serial.println(HELP_SCANAP_CMD);
     Serial.println(HELP_SCANAP_CMD);
     Serial.println(HELP_SCANSTA_CMD);
     Serial.println(HELP_SCANSTA_CMD);
@@ -123,10 +298,10 @@ void CommandLine::runCommand(String input) {
     Serial.println(HELP_SNIFF_DEAUTH_CMD);
     Serial.println(HELP_SNIFF_DEAUTH_CMD);
     Serial.println(HELP_SNIFF_PMKID_CMD);
     Serial.println(HELP_SNIFF_PMKID_CMD);
     Serial.println(HELP_STOPSCAN_CMD);
     Serial.println(HELP_STOPSCAN_CMD);
-    
+
     // WiFi attack
     // WiFi attack
     Serial.println(HELP_ATTACK_CMD);
     Serial.println(HELP_ATTACK_CMD);
-    
+
     // WiFi Aux
     // WiFi Aux
     Serial.println(HELP_LIST_AP_CMD_A);
     Serial.println(HELP_LIST_AP_CMD_A);
     Serial.println(HELP_LIST_AP_CMD_B);
     Serial.println(HELP_LIST_AP_CMD_B);
@@ -134,7 +309,7 @@ void CommandLine::runCommand(String input) {
     Serial.println(HELP_SEL_CMD_A);
     Serial.println(HELP_SEL_CMD_A);
     Serial.println(HELP_SSID_CMD_A);
     Serial.println(HELP_SSID_CMD_A);
     Serial.println(HELP_SSID_CMD_B);
     Serial.println(HELP_SSID_CMD_B);
-    
+
     // Bluetooth sniff/scan
     // Bluetooth sniff/scan
     Serial.println(HELP_BT_SNIFF_CMD);
     Serial.println(HELP_BT_SNIFF_CMD);
     Serial.println(HELP_BT_SKIM_CMD);
     Serial.println(HELP_BT_SKIM_CMD);
@@ -153,22 +328,22 @@ void CommandLine::runCommand(String input) {
       web_obj.shutdownServer();
       web_obj.shutdownServer();
       return;
       return;
     }
     }
-    
+
     wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
     wifi_scan_obj.StartScan(WIFI_SCAN_OFF);
 
 
     Serial.println("Stopping WiFi tran/recv");
     Serial.println("Stopping WiFi tran/recv");
 
 
     // If we don't do this, the text and button coordinates will be off
     // If we don't do this, the text and button coordinates will be off
-    #ifdef HAS_SCREEN
-      display_obj.tft.init();
-      menu_function_obj.changeMenu(menu_function_obj.current_menu);
-    #endif
+#ifdef HAS_SCREEN
+    display_obj.tft.init();
+    menu_function_obj.changeMenu(menu_function_obj.current_menu);
+#endif
   }
   }
   // Channel command
   // Channel command
   else if (cmd_args.get(0) == CH_CMD) {
   else if (cmd_args.get(0) == CH_CMD) {
     // Search for channel set arg
     // Search for channel set arg
     int ch_set = this->argSearch(&cmd_args, "-s");
     int ch_set = this->argSearch(&cmd_args, "-s");
-    
+
     if (cmd_args.size() == 1) {
     if (cmd_args.size() == 1) {
       Serial.println("Current channel: " + (String)wifi_scan_obj.set_channel);
       Serial.println("Current channel: " + (String)wifi_scan_obj.set_channel);
     }
     }
@@ -178,17 +353,37 @@ void CommandLine::runCommand(String input) {
       Serial.println("Set channel: " + (String)wifi_scan_obj.set_channel);
       Serial.println("Set channel: " + (String)wifi_scan_obj.set_channel);
     }
     }
   }
   }
-  #ifdef ESP32_CAM
-    else if (cmd_args.get(0) == CAM_PHOTO) {
-      pinMode(4,OUTPUT);
-      digitalWrite(4,HIGH);
-      delay(200);
-      digitalWrite(4,LOW);
-      Serial.println("Saved to SD");
-      
-    }
-  #endif
-  
+#ifdef ESP32_CAM
+  if (cmd_args.get(0) == CAM_PHOTO) {
+    Serial.println("Camera capture start");
+    pinMode(4, OUTPUT);
+    digitalWrite(4, HIGH);
+    // Initialize the camera
+    configESPCamera(); Serial.println("Camera OK!");
+
+    // Initialize the MicroSD
+    Serial.print("Initializing the MicroSD card module... ");
+    initMicroSDCard();
+
+    int i = 0;
+    while(true)
+    {
+      String path = "/photo_" + String(i++) + ".jpg";
+      if (!SD_MMC.exists(path.c_str()))
+      {
+        takeNewPhoto(path);
+        break;
+      }
+    }
+
+    // Turns off the ESP32-CAM white on-board LED (flash) connected to GPIO 4
+    digitalWrite(4, LOW);
+    //rtc_gpio_hold_en(GPIO_NUM_4);
+
+    Serial.println("Camera capture finish");
+  }
+#endif
+
   // Clear APs
   // Clear APs
   else if (cmd_args.get(0) == CLEARAP_CMD) {
   else if (cmd_args.get(0) == CLEARAP_CMD) {
     int ap_sw = this->argSearch(&cmd_args, "-a"); // APs
     int ap_sw = this->argSearch(&cmd_args, "-a"); // APs
@@ -196,23 +391,23 @@ void CommandLine::runCommand(String input) {
     int cl_sw = this->argSearch(&cmd_args, "-c"); // Stations
     int cl_sw = this->argSearch(&cmd_args, "-c"); // Stations
 
 
     if (ap_sw != -1) {
     if (ap_sw != -1) {
-      #ifdef HAS_SCREEN
-        menu_function_obj.changeMenu(&menu_function_obj.clearAPsMenu);
-      #endif
+#ifdef HAS_SCREEN
+      menu_function_obj.changeMenu(&menu_function_obj.clearAPsMenu);
+#endif
       wifi_scan_obj.RunClearAPs();
       wifi_scan_obj.RunClearAPs();
     }
     }
 
 
     if (ss_sw != -1) {
     if (ss_sw != -1) {
-      #ifdef HAS_SCREEN
-        menu_function_obj.changeMenu(&menu_function_obj.clearSSIDsMenu);
-      #endif
+#ifdef HAS_SCREEN
+      menu_function_obj.changeMenu(&menu_function_obj.clearSSIDsMenu);
+#endif
       wifi_scan_obj.RunClearSSIDs();
       wifi_scan_obj.RunClearSSIDs();
     }
     }
 
 
     if (cl_sw != -1) {
     if (cl_sw != -1) {
-      #ifdef HAS_SCREEN
-        menu_function_obj.changeMenu(&menu_function_obj.clearAPsMenu);
-      #endif
+#ifdef HAS_SCREEN
+      menu_function_obj.changeMenu(&menu_function_obj.clearAPsMenu);
+#endif
       wifi_scan_obj.RunClearStations();
       wifi_scan_obj.RunClearStations();
     }
     }
   }
   }
@@ -261,10 +456,10 @@ void CommandLine::runCommand(String input) {
     // AP Scan
     // AP Scan
     if (cmd_args.get(0) == SCANAP_CMD) {
     if (cmd_args.get(0) == SCANAP_CMD) {
       int full_sw = -1;
       int full_sw = -1;
-      #ifdef HAS_SCREEN
-        display_obj.clearScreen();
-        menu_function_obj.drawStatusBar();
-      #endif
+#ifdef HAS_SCREEN
+      display_obj.clearScreen();
+      menu_function_obj.drawStatusBar();
+#endif
 
 
       if (full_sw == -1) {
       if (full_sw == -1) {
         Serial.println("Starting AP scan. Stop with " + (String)STOPSCAN_CMD);
         Serial.println("Starting AP scan. Stop with " + (String)STOPSCAN_CMD);
@@ -278,76 +473,76 @@ void CommandLine::runCommand(String input) {
     // Raw sniff
     // Raw sniff
     else if (cmd_args.get(0) == SNIFF_RAW_CMD) {
     else if (cmd_args.get(0) == SNIFF_RAW_CMD) {
       Serial.println("Starting Raw sniff. Stop with " + (String)STOPSCAN_CMD);
       Serial.println("Starting Raw sniff. Stop with " + (String)STOPSCAN_CMD);
-      #ifdef HAS_SCREEN
-        display_obj.clearScreen();
-        menu_function_obj.drawStatusBar();
-      #endif
+#ifdef HAS_SCREEN
+      display_obj.clearScreen();
+      menu_function_obj.drawStatusBar();
+#endif
       wifi_scan_obj.StartScan(WIFI_SCAN_RAW_CAPTURE, TFT_WHITE);
       wifi_scan_obj.StartScan(WIFI_SCAN_RAW_CAPTURE, TFT_WHITE);
     }
     }
     // Scan stations
     // Scan stations
-    else if (cmd_args.get(0) == SCANSTA_CMD) {    
-      Serial.println("Starting Station scan. Stop with " + (String)STOPSCAN_CMD);  
-      #ifdef HAS_SCREEN
-        display_obj.clearScreen();
-        menu_function_obj.drawStatusBar();
-      #endif
+    else if (cmd_args.get(0) == SCANSTA_CMD) {
+      Serial.println("Starting Station scan. Stop with " + (String)STOPSCAN_CMD);
+#ifdef HAS_SCREEN
+      display_obj.clearScreen();
+      menu_function_obj.drawStatusBar();
+#endif
       wifi_scan_obj.StartScan(WIFI_SCAN_STATION, TFT_ORANGE);
       wifi_scan_obj.StartScan(WIFI_SCAN_STATION, TFT_ORANGE);
     }
     }
     // Beacon sniff
     // Beacon sniff
     else if (cmd_args.get(0) == SNIFF_BEACON_CMD) {
     else if (cmd_args.get(0) == SNIFF_BEACON_CMD) {
       Serial.println("Starting Beacon sniff. Stop with " + (String)STOPSCAN_CMD);
       Serial.println("Starting Beacon sniff. Stop with " + (String)STOPSCAN_CMD);
-      #ifdef HAS_SCREEN
-        display_obj.clearScreen();
-        menu_function_obj.drawStatusBar();
-      #endif
+#ifdef HAS_SCREEN
+      display_obj.clearScreen();
+      menu_function_obj.drawStatusBar();
+#endif
       wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);
       wifi_scan_obj.StartScan(WIFI_SCAN_AP, TFT_MAGENTA);
     }
     }
     // Probe sniff
     // Probe sniff
     else if (cmd_args.get(0) == SNIFF_PROBE_CMD) {
     else if (cmd_args.get(0) == SNIFF_PROBE_CMD) {
       Serial.println("Starting Probe sniff. Stop with " + (String)STOPSCAN_CMD);
       Serial.println("Starting Probe sniff. Stop with " + (String)STOPSCAN_CMD);
-      #ifdef HAS_SCREEN
-        display_obj.clearScreen();
-        menu_function_obj.drawStatusBar();
-      #endif
+#ifdef HAS_SCREEN
+      display_obj.clearScreen();
+      menu_function_obj.drawStatusBar();
+#endif
       wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_MAGENTA);
       wifi_scan_obj.StartScan(WIFI_SCAN_PROBE, TFT_MAGENTA);
     }
     }
     // Deauth sniff
     // Deauth sniff
     else if (cmd_args.get(0) == SNIFF_DEAUTH_CMD) {
     else if (cmd_args.get(0) == SNIFF_DEAUTH_CMD) {
       Serial.println("Starting Deauth sniff. Stop with " + (String)STOPSCAN_CMD);
       Serial.println("Starting Deauth sniff. Stop with " + (String)STOPSCAN_CMD);
-      #ifdef HAS_SCREEN
-        display_obj.clearScreen();
-        menu_function_obj.drawStatusBar();
-      #endif
+#ifdef HAS_SCREEN
+      display_obj.clearScreen();
+      menu_function_obj.drawStatusBar();
+#endif
       wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);
       wifi_scan_obj.StartScan(WIFI_SCAN_DEAUTH, TFT_RED);
     }
     }
     // Pwn sniff
     // Pwn sniff
     else if (cmd_args.get(0) == SNIFF_PWN_CMD) {
     else if (cmd_args.get(0) == SNIFF_PWN_CMD) {
       Serial.println("Starting Pwnagotchi sniff. Stop with " + (String)STOPSCAN_CMD);
       Serial.println("Starting Pwnagotchi sniff. Stop with " + (String)STOPSCAN_CMD);
-      #ifdef HAS_SCREEN
-        display_obj.clearScreen();
-        menu_function_obj.drawStatusBar();
-      #endif
+#ifdef HAS_SCREEN
+      display_obj.clearScreen();
+      menu_function_obj.drawStatusBar();
+#endif
       wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_MAGENTA);
       wifi_scan_obj.StartScan(WIFI_SCAN_PWN, TFT_MAGENTA);
     }
     }
     // Espressif sniff
     // Espressif sniff
     else if (cmd_args.get(0) == SNIFF_ESP_CMD) {
     else if (cmd_args.get(0) == SNIFF_ESP_CMD) {
       Serial.println("Starting Espressif device sniff. Stop with " + (String)STOPSCAN_CMD);
       Serial.println("Starting Espressif device sniff. Stop with " + (String)STOPSCAN_CMD);
-      #ifdef HAS_SCREEN
-        display_obj.clearScreen();
-        menu_function_obj.drawStatusBar();
-      #endif
+#ifdef HAS_SCREEN
+      display_obj.clearScreen();
+      menu_function_obj.drawStatusBar();
+#endif
       wifi_scan_obj.StartScan(WIFI_SCAN_ESPRESSIF, TFT_MAGENTA);
       wifi_scan_obj.StartScan(WIFI_SCAN_ESPRESSIF, TFT_MAGENTA);
     }
     }
     // PMKID sniff
     // PMKID sniff
     else if (cmd_args.get(0) == SNIFF_PMKID_CMD) {
     else if (cmd_args.get(0) == SNIFF_PMKID_CMD) {
       int ch_sw = this->argSearch(&cmd_args, "-c");
       int ch_sw = this->argSearch(&cmd_args, "-c");
       int d_sw = this->argSearch(&cmd_args, "-d"); // Deauth for pmkid
       int d_sw = this->argSearch(&cmd_args, "-d"); // Deauth for pmkid
-      
+
       if (ch_sw != -1) {
       if (ch_sw != -1) {
         wifi_scan_obj.set_channel = cmd_args.get(ch_sw + 1).toInt();
         wifi_scan_obj.set_channel = cmd_args.get(ch_sw + 1).toInt();
         wifi_scan_obj.changeChannel();
         wifi_scan_obj.changeChannel();
         Serial.println("Set channel: " + (String)wifi_scan_obj.set_channel);
         Serial.println("Set channel: " + (String)wifi_scan_obj.set_channel);
-        
+
       }
       }
 
 
       if (d_sw == -1) {
       if (d_sw == -1) {
@@ -370,14 +565,14 @@ void CommandLine::runCommand(String input) {
       int src_addr_sw = this->argSearch(&cmd_args, "-s");
       int src_addr_sw = this->argSearch(&cmd_args, "-s");
       int dst_addr_sw = this->argSearch(&cmd_args, "-d");
       int dst_addr_sw = this->argSearch(&cmd_args, "-d");
       int targ_sw = this->argSearch(&cmd_args, "-c");
       int targ_sw = this->argSearch(&cmd_args, "-c");
-  
+
       if (attack_type_switch == -1) {
       if (attack_type_switch == -1) {
         Serial.println("You must specify an attack type");
         Serial.println("You must specify an attack type");
         return;
         return;
       }
       }
       else {
       else {
         String attack_type = cmd_args.get(attack_type_switch + 1);
         String attack_type = cmd_args.get(attack_type_switch + 1);
-  
+
         // Branch on attack type
         // Branch on attack type
         // Deauth
         // Deauth
         if (attack_type == ATTACK_TYPE_DEAUTH) {
         if (attack_type == ATTACK_TYPE_DEAUTH) {
@@ -401,10 +596,10 @@ void CommandLine::runCommand(String input) {
               Serial.println("You don't have any targets selected. Use " + (String)SEL_CMD);
               Serial.println("You don't have any targets selected. Use " + (String)SEL_CMD);
               return;
               return;
             }
             }
-            #ifdef HAS_SCREEN
-              display_obj.clearScreen();
-              menu_function_obj.drawStatusBar();
-            #endif
+#ifdef HAS_SCREEN
+            display_obj.clearScreen();
+            menu_function_obj.drawStatusBar();
+#endif
             Serial.println("Starting Deauthentication attack. Stop with " + (String)STOPSCAN_CMD);
             Serial.println("Starting Deauthentication attack. Stop with " + (String)STOPSCAN_CMD);
             // Station list not specified
             // Station list not specified
             if (targ_sw == -1)
             if (targ_sw == -1)
@@ -416,15 +611,15 @@ void CommandLine::runCommand(String input) {
           // Source addr specified
           // Source addr specified
           else {
           else {
             String src_mac_str = cmd_args.get(src_addr_sw + 1);
             String src_mac_str = cmd_args.get(src_addr_sw + 1);
-            sscanf(src_mac_str.c_str(), "%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx", 
-              &wifi_scan_obj.src_mac[0], &wifi_scan_obj.src_mac[1], &wifi_scan_obj.src_mac[2], &wifi_scan_obj.src_mac[3], &wifi_scan_obj.src_mac[4], &wifi_scan_obj.src_mac[5]);
+            sscanf(src_mac_str.c_str(), "%2hhx:%2hhx:%2hhx:%2hhx:%2hhx:%2hhx",
+                   &wifi_scan_obj.src_mac[0], &wifi_scan_obj.src_mac[1], &wifi_scan_obj.src_mac[2], &wifi_scan_obj.src_mac[3], &wifi_scan_obj.src_mac[4], &wifi_scan_obj.src_mac[5]);
 
 
-            #ifdef HAS_SCREEN
-              display_obj.clearScreen();
-              menu_function_obj.drawStatusBar();
-            #endif
+#ifdef HAS_SCREEN
+            display_obj.clearScreen();
+            menu_function_obj.drawStatusBar();
+#endif
             Serial.println("Starting Manual Deauthentication attack. Stop with " + (String)STOPSCAN_CMD);
             Serial.println("Starting Manual Deauthentication attack. Stop with " + (String)STOPSCAN_CMD);
-            wifi_scan_obj.StartScan(WIFI_ATTACK_DEAUTH_MANUAL, TFT_RED);            
+            wifi_scan_obj.StartScan(WIFI_ATTACK_DEAUTH_MANUAL, TFT_RED);
           }
           }
         }
         }
         // Beacon
         // Beacon
@@ -435,19 +630,19 @@ void CommandLine::runCommand(String input) {
               Serial.println("You don't have any SSIDs in your list. Use " + (String)SSID_CMD);
               Serial.println("You don't have any SSIDs in your list. Use " + (String)SSID_CMD);
               return;
               return;
             }
             }
-            #ifdef HAS_SCREEN
-              display_obj.clearScreen();
-              menu_function_obj.drawStatusBar();
-            #endif
+#ifdef HAS_SCREEN
+            display_obj.clearScreen();
+            menu_function_obj.drawStatusBar();
+#endif
             Serial.println("Starting Beacon list spam. Stop with " + (String)STOPSCAN_CMD);
             Serial.println("Starting Beacon list spam. Stop with " + (String)STOPSCAN_CMD);
             wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_LIST, TFT_RED);
             wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_LIST, TFT_RED);
           }
           }
           // spam with random
           // spam with random
           else if (rand_beacon_sw != -1) {
           else if (rand_beacon_sw != -1) {
-            #ifdef HAS_SCREEN
-              display_obj.clearScreen();
-              menu_function_obj.drawStatusBar();
-            #endif
+#ifdef HAS_SCREEN
+            display_obj.clearScreen();
+            menu_function_obj.drawStatusBar();
+#endif
             Serial.println("Starting random Beacon spam. Stop with " + (String)STOPSCAN_CMD);
             Serial.println("Starting random Beacon spam. Stop with " + (String)STOPSCAN_CMD);
             wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);
             wifi_scan_obj.StartScan(WIFI_ATTACK_BEACON_SPAM, TFT_ORANGE);
           }
           }
@@ -457,10 +652,10 @@ void CommandLine::runCommand(String input) {
               Serial.println("You don't have any targets selected. Use " + (String)SEL_CMD);
               Serial.println("You don't have any targets selected. Use " + (String)SEL_CMD);
               return;
               return;
             }
             }
-            #ifdef HAS_SCREEN
-              display_obj.clearScreen();
-              menu_function_obj.drawStatusBar();
-            #endif
+#ifdef HAS_SCREEN
+            display_obj.clearScreen();
+            menu_function_obj.drawStatusBar();
+#endif
             Serial.println("Starting Targeted AP Beacon spam. Stop with " + (String)STOPSCAN_CMD);
             Serial.println("Starting Targeted AP Beacon spam. Stop with " + (String)STOPSCAN_CMD);
             wifi_scan_obj.StartScan(WIFI_ATTACK_AP_SPAM, TFT_MAGENTA);
             wifi_scan_obj.StartScan(WIFI_ATTACK_AP_SPAM, TFT_MAGENTA);
           }
           }
@@ -474,18 +669,18 @@ void CommandLine::runCommand(String input) {
             return;
             return;
           }
           }
           Serial.println("Starting Probe spam. Stop with " + (String)STOPSCAN_CMD);
           Serial.println("Starting Probe spam. Stop with " + (String)STOPSCAN_CMD);
-          #ifdef HAS_SCREEN
-            display_obj.clearScreen();
-            menu_function_obj.drawStatusBar();
-          #endif
+#ifdef HAS_SCREEN
+          display_obj.clearScreen();
+          menu_function_obj.drawStatusBar();
+#endif
           wifi_scan_obj.StartScan(WIFI_ATTACK_AUTH, TFT_RED);
           wifi_scan_obj.StartScan(WIFI_ATTACK_AUTH, TFT_RED);
         }
         }
         else if (attack_type == ATTACK_TYPE_RR) {
         else if (attack_type == ATTACK_TYPE_RR) {
           Serial.println("Starting Rick Roll Beacon spam. Stop with " + (String)STOPSCAN_CMD);
           Serial.println("Starting Rick Roll Beacon spam. Stop with " + (String)STOPSCAN_CMD);
-          #ifdef HAS_SCREEN
-            display_obj.clearScreen();
-            menu_function_obj.drawStatusBar();
-          #endif
+#ifdef HAS_SCREEN
+          display_obj.clearScreen();
+          menu_function_obj.drawStatusBar();
+#endif
           wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);
           wifi_scan_obj.StartScan(WIFI_ATTACK_RICK_ROLL, TFT_YELLOW);
         }
         }
         else {
         else {
@@ -499,19 +694,19 @@ void CommandLine::runCommand(String input) {
     // Bluetooth scan
     // Bluetooth scan
     if (cmd_args.get(0) == BT_SNIFF_CMD) {
     if (cmd_args.get(0) == BT_SNIFF_CMD) {
       Serial.println("Starting Bluetooth scan. Stop with " + (String)STOPSCAN_CMD);
       Serial.println("Starting Bluetooth scan. Stop with " + (String)STOPSCAN_CMD);
-      #ifdef HAS_SCREEN
-        display_obj.clearScreen();
-        menu_function_obj.drawStatusBar();
-      #endif
+#ifdef HAS_SCREEN
+      display_obj.clearScreen();
+      menu_function_obj.drawStatusBar();
+#endif
       wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);
       wifi_scan_obj.StartScan(BT_SCAN_ALL, TFT_GREEN);
     }
     }
     // Bluetooth CC Skimmer scan
     // Bluetooth CC Skimmer scan
     else if (cmd_args.get(0) == BT_SKIM_CMD) {
     else if (cmd_args.get(0) == BT_SKIM_CMD) {
       Serial.println("Starting Bluetooth CC Skimmer scan. Stop with " + (String)STOPSCAN_CMD);
       Serial.println("Starting Bluetooth CC Skimmer scan. Stop with " + (String)STOPSCAN_CMD);
-      #ifdef HAS_SCREEN
-        display_obj.clearScreen();
-        menu_function_obj.drawStatusBar();
-      #endif
+#ifdef HAS_SCREEN
+      display_obj.clearScreen();
+      menu_function_obj.drawStatusBar();
+#endif
       wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);
       wifi_scan_obj.StartScan(BT_SCAN_SKIMMERS, TFT_MAGENTA);
     }
     }
 
 
@@ -646,7 +841,7 @@ void CommandLine::runCommand(String input) {
     }
     }
     else if (cl_sw != -1) {
     else if (cl_sw != -1) {
       LinkedList<String> sta_index = this->parseCommand(cmd_args.get(cl_sw + 1), ",");
       LinkedList<String> sta_index = this->parseCommand(cmd_args.get(cl_sw + 1), ",");
-      
+
       // Select all Stations
       // Select all Stations
       if (cmd_args.get(cl_sw + 1) == "all") {
       if (cmd_args.get(cl_sw + 1) == "all") {
         for (int i = 0; i < stations->size(); i++) {
         for (int i = 0; i < stations->size(); i++) {

+ 5 - 0
esp32_marauder/CommandLine.h

@@ -10,7 +10,12 @@
 
 
 #include "WiFiScan.h"
 #include "WiFiScan.h"
 #include "Web.h"
 #include "Web.h"
+
+#ifdef USE_SD_MMC_ALTERNATIVE
+#include "SD_MMCInterface.h"
+#else
 #include "SDInterface.h"
 #include "SDInterface.h"
+#endif
 #include "settings.h"
 #include "settings.h"
 
 
 #ifdef HAS_SCREEN
 #ifdef HAS_SCREEN

+ 4 - 0
esp32_marauder/MenuFunctions.h

@@ -10,7 +10,11 @@
 #include "WiFiScan.h"
 #include "WiFiScan.h"
 #include "Display.h"
 #include "Display.h"
 #include "BatteryInterface.h"
 #include "BatteryInterface.h"
+#ifdef USE_SD_MMC_ALTERNATIVE
+#include "SD_MMCInterface.h"
+#else
 #include "SDInterface.h"
 #include "SDInterface.h"
+#endif
 #include "Web.h"
 #include "Web.h"
 #include "esp_interface.h"
 #include "esp_interface.h"
 #include "a32u4_interface.h"
 #include "a32u4_interface.h"

+ 2 - 2
esp32_marauder/SDInterface.cpp

@@ -1,4 +1,4 @@
-#include "SDInterface.h"
+/*#include "SDInterface.h"
 #include "lang_var.h"
 #include "lang_var.h"
 
 
 bool SDInterface::initSD() {
 bool SDInterface::initSD() {
@@ -226,4 +226,4 @@ void SDInterface::main() {
       this->initSD();
       this->initSD();
     }
     }
   }
   }
-}
+}*/

+ 206 - 0
esp32_marauder/SD_MMCInterface.cpp

@@ -0,0 +1,206 @@
+#include "SD_MMCInterface.h"
+#include "lang_var.h"
+
+bool SDInterface::initSD() {
+  //String display_string = "";
+  /*if (!SD_MMC.begin()) {
+    Serial.println(F("Failed to mount SD Card"));
+    this->supported = false;
+    return false;
+  }
+  else {
+    this->supported = true;
+
+    this->cardType = SD_MMC.cardType();
+    this->cardSizeMB = SD_MMC.cardSize() / (1024 * 1024);
+
+    Serial.printf("SD Card Size: %lluMB\n", this->cardSizeMB);
+
+    if (this->supported) {
+      const int NUM_DIGITS = log10(this->cardSizeMB) + 1;
+
+      char sz[NUM_DIGITS + 1];
+
+      sz[NUM_DIGITS] =  0;
+      for ( size_t i = NUM_DIGITS; i--; this->cardSizeMB /= 10)
+      {
+        sz[i] = '0' + (this->cardSizeMB % 10);
+        //display_string.concat((String)sz[i]);
+      }
+
+      this->card_sz = sz;
+    }
+
+    buffer_obj = Buffer();
+
+    if (!SD_MMC.exists("/SCRIPTS")) {
+      Serial.println("/SCRIPTS does not exist. Creating...");
+
+      SD_MMC.mkdir("/SCRIPTS");
+      Serial.println("/SCRIPTS created");
+    }
+
+    return true;
+  }*/
+  return false;
+}
+
+void SDInterface::addPacket(uint8_t* buf, uint32_t len) {
+  if ((this->supported) && (this->do_save)) {
+    buffer_obj.addPacket(buf, len);
+  }
+}
+
+void SDInterface::openCapture(String file_name) {
+  if (this->supported)
+    buffer_obj.open(&SD_MMC, file_name);
+}
+
+void SDInterface::runUpdate() {
+#ifdef HAS_SCREEN
+  display_obj.tft.setTextWrap(false);
+  display_obj.tft.setFreeFont(NULL);
+  display_obj.tft.setCursor(0, 100);
+  display_obj.tft.setTextSize(1);
+  display_obj.tft.setTextColor(TFT_WHITE);
+
+  display_obj.tft.println(F(text15));
+#endif
+  File updateBin = SD_MMC.open("/update.bin");
+  if (updateBin) {
+    if (updateBin.isDirectory()) {
+#ifdef HAS_SCREEN
+      display_obj.tft.setTextColor(TFT_RED);
+      display_obj.tft.println(F(text_table2[0]));
+#endif
+      Serial.println(F("Error, update.bin is not a file"));
+#ifdef HAS_SCREEN
+      display_obj.tft.setTextColor(TFT_WHITE);
+#endif
+      updateBin.close();
+      return;
+    }
+
+    size_t updateSize = updateBin.size();
+
+    if (updateSize > 0) {
+#ifdef HAS_SCREEN
+      display_obj.tft.println(F(text_table2[1]));
+#endif
+      Serial.println(F("Try to start update"));
+      this->performUpdate(updateBin, updateSize);
+    }
+    else {
+#ifdef HAS_SCREEN
+      display_obj.tft.setTextColor(TFT_RED);
+      display_obj.tft.println(F(text_table2[2]));
+#endif
+      Serial.println(F("Error, file is empty"));
+#ifdef HAS_SCREEN
+      display_obj.tft.setTextColor(TFT_WHITE);
+#endif
+      return;
+    }
+
+    updateBin.close();
+
+    // whe finished remove the binary from sd card to indicate end of the process
+#ifdef HAS_SCREEN
+    display_obj.tft.println(F(text_table2[3]));
+#endif
+    Serial.println(F("rebooting..."));
+    //SD.remove("/update.bin");
+    delay(1000);
+    ESP.restart();
+  }
+  else {
+#ifdef HAS_SCREEN
+    display_obj.tft.setTextColor(TFT_RED);
+    display_obj.tft.println(F(text_table2[4]));
+#endif
+    Serial.println(F("Could not load update.bin from sd root"));
+#ifdef HAS_SCREEN
+    display_obj.tft.setTextColor(TFT_WHITE);
+#endif
+  }
+}
+
+void SDInterface::performUpdate(Stream &updateSource, size_t updateSize) {
+  if (Update.begin(updateSize)) {
+#ifdef HAS_SCREEN
+    display_obj.tft.println(text_table2[5] + String(updateSize));
+    display_obj.tft.println(F(text_table2[6]));
+#endif
+    size_t written = Update.writeStream(updateSource);
+    if (written == updateSize) {
+#ifdef HAS_SCREEN
+      display_obj.tft.println(text_table2[7] + String(written) + text_table2[10]);
+#endif
+      Serial.println("Written : " + String(written) + " successfully");
+    }
+    else {
+#ifdef HAS_SCREEN
+      display_obj.tft.println(text_table2[8] + String(written) + "/" + String(updateSize) + text_table2[9]);
+#endif
+      Serial.println("Written only : " + String(written) + "/" + String(updateSize) + ". Retry?");
+    }
+    if (Update.end()) {
+      Serial.println("OTA done!");
+      if (Update.isFinished()) {
+#ifdef HAS_SCREEN
+        display_obj.tft.println(F(text_table2[11]));
+#endif
+        Serial.println(F("Update successfully completed. Rebooting."));
+      }
+      else {
+#ifdef HAS_SCREEN
+        display_obj.tft.setTextColor(TFT_RED);
+        display_obj.tft.println(text_table2[12]);
+#endif
+        Serial.println("Update not finished? Something went wrong!");
+#ifdef HAS_SCREEN
+        display_obj.tft.setTextColor(TFT_WHITE);
+#endif
+      }
+    }
+    else {
+#ifdef HAS_SCREEN
+      display_obj.tft.println(text_table2[13] + String(Update.getError()));
+#endif
+      Serial.println("Error Occurred. Error #: " + String(Update.getError()));
+    }
+
+  }
+  else
+  {
+#ifdef HAS_SCREEN
+    display_obj.tft.println(text_table2[14]);
+#endif
+    Serial.println("Not enough space to begin OTA");
+  }
+}
+
+bool SDInterface::checkDetectPin() {
+/*#ifdef KIT
+  if (digitalRead(SD_DET) == LOW)
+    return true;
+  else
+    return false;
+#endif
+
+  return false;*/
+  return false;
+}
+
+void SDInterface::main() {
+  if ((this->supported) && (this->do_save)) {
+    //Serial.println("Saving packet...");
+    buffer_obj.forceSave(&SD_MMC);
+  }
+  else if (!this->supported) {
+    if (checkDetectPin()) {
+      delay(100);
+      this->initSD();
+    }
+  }
+}

+ 46 - 0
esp32_marauder/SD_MMCInterface.h

@@ -0,0 +1,46 @@
+#ifndef SD_MMCInterface_h
+#define SD_MMCInterface_h
+
+#include "configs.h"
+
+#include "FS.h"
+#include "SD_MMC.h"
+
+#include "Buffer.h"
+#ifdef HAS_SCREEN
+  #include "Display.h"
+#endif
+#include <Update.h>
+
+extern Buffer buffer_obj;
+#ifdef HAS_SCREEN
+  extern Display display_obj;
+#endif
+
+class SDInterface {
+
+  private:
+    bool checkDetectPin();
+
+  public:
+    uint8_t cardType;
+    //uint64_t cardSizeBT;
+    //uint64_t cardSizeKB;
+    uint64_t cardSizeMB;
+    //uint64_t cardSizeGB;
+    bool supported = false;
+    bool do_save = true;
+
+    String card_sz;
+  
+    bool initSD();
+
+    void addPacket(uint8_t* buf, uint32_t len);
+    void openCapture(String file_name = "");
+    void runUpdate();
+    void performUpdate(Stream &updateSource, size_t updateSize);
+    void main();
+    //void savePacket(uint8_t* buf, uint32_t len);
+};
+
+#endif

+ 4 - 0
esp32_marauder/WiFiScan.h

@@ -24,7 +24,11 @@
 #ifdef HAS_SCREEN
 #ifdef HAS_SCREEN
   #include "Display.h"
   #include "Display.h"
 #endif
 #endif
+#ifdef USE_SD_MMC_ALTERNATIVE
+#include "SD_MMCInterface.h"
+#else
 #include "SDInterface.h"
 #include "SDInterface.h"
+#endif
 #include "Buffer.h"
 #include "Buffer.h"
 #include "BatteryInterface.h"
 #include "BatteryInterface.h"
 #include "TemperatureInterface.h"
 #include "TemperatureInterface.h"

+ 1 - 4
esp32_marauder/configs.h

@@ -12,6 +12,7 @@
   #define MARAUDER_FLIPPER
   #define MARAUDER_FLIPPER
   #define ESP32_CAM
   #define ESP32_CAM
   #define DISABLE_RGB_LED
   #define DISABLE_RGB_LED
+  #define USE_SD_MMC_ALTERNATIVE
   
   
   //#define ESP32_LDDB
   //#define ESP32_LDDB
 
 
@@ -361,10 +362,6 @@
   #ifdef ESP32_LDDB
   #ifdef ESP32_LDDB
     #define SD_CS 4
     #define SD_CS 4
   #endif
   #endif
-
-  #ifdef ESP32_CAM
-    #define SD_CS 12 // not 4, not 15, not 13
-  #endif
   //// END SD DEFINITIONS
   //// END SD DEFINITIONS
 
 
   //// SCREEN STUFF
   //// SCREEN STUFF

+ 7 - 5
esp32_marauder/esp32_marauder.ino

@@ -11,7 +11,6 @@ https://www.online-utility.org/image/convert/to/XBM
   #define MenuFunctions_h
   #define MenuFunctions_h
   #define Display_h
   #define Display_h
 #endif
 #endif
-
 #include <WiFi.h>
 #include <WiFi.h>
 #include <Wire.h>
 #include <Wire.h>
 #include "esp_wifi.h"
 #include "esp_wifi.h"
@@ -24,7 +23,11 @@ https://www.online-utility.org/image/convert/to/XBM
 
 
 #include "Assets.h"
 #include "Assets.h"
 #include "WiFiScan.h"
 #include "WiFiScan.h"
+#ifdef USE_SD_MMC_ALTERNATIVE
+#include "SD_MMCInterface.h"
+#else
 #include "SDInterface.h"
 #include "SDInterface.h"
+#endif
 #include "Web.h"
 #include "Web.h"
 #include "Buffer.h"
 #include "Buffer.h"
 #include "BatteryInterface.h"
 #include "BatteryInterface.h"
@@ -103,10 +106,9 @@ void backlightOff() {
 
 
 void setup()
 void setup()
 {
 {
-    #ifndef ESP32_CAM
+  #ifndef ESP32_CAM
     pinMode(FLASH_BUTTON, INPUT);
     pinMode(FLASH_BUTTON, INPUT);
   #endif
   #endif
-  
 
 
   #ifdef HAS_SCREEN
   #ifdef HAS_SCREEN
     pinMode(TFT_BL, OUTPUT);
     pinMode(TFT_BL, OUTPUT);
@@ -123,13 +125,13 @@ void setup()
     digitalWrite(TFT_CS, HIGH);
     digitalWrite(TFT_CS, HIGH);
   #endif
   #endif
 
 
-  pinMode(SD_CS, OUTPUT);
+  /*pinMode(SD_CS, OUTPUT);
 
 
   delay(10);
   delay(10);
   
   
   digitalWrite(SD_CS, HIGH);
   digitalWrite(SD_CS, HIGH);
 
 
-  delay(10);
+  delay(10);*/
 
 
   Serial.begin(115200);
   Serial.begin(115200);