Permalink
Browse files

Further C++ implementation

  • Loading branch information...
1 parent 90ad28b commit eb7f77c5843f1ee112b9c164923c80b39c3ae12b X committed Aug 26, 2009
Showing with 8 additions and 7 deletions.
  1. BIN c_test/a.out
  2. +2 −2 c_test/lib/wep_cracker.cpp
  3. +2 −2 c_test/lib/wep_cracker.h
  4. +4 −3 c_test/main.cpp
View
Binary file not shown.
@@ -4,12 +4,12 @@ using namespace std;
WepCracker::WepCracker() {}
-WepCracker::WepCracker (string _bssid, string _essid, string _file) {
+void WepCracker::set_attributes (string _bssid, string _essid, string _file) {
bssid = _bssid;
essid = _essid;
file = _file;
- //printf("Detected bssid %s, essid %s and captures file %s\n", bssid.c_str(), essid.c_str(), file.c_str());
+ printf("Detected bssid %s, essid %s and captures file %s\n", bssid.c_str(), essid.c_str(), file.c_str());
try{ validate_attributes(); }
catch(int err) { throw err; }
View
@@ -4,11 +4,11 @@ class WepCracker {
string bssid;
string essid;
string file;
- vector <string> options;
+ vector<string> options;
public:
WepCracker();
- WepCracker(string, string, string);
+ void set_attributes(string, string, string);
int crack();
private:
void validate_attributes();
View
@@ -1,5 +1,6 @@
#include <iostream>
-#include <boost/regex.hpp>
+#include <vector>
+//#include <boost/regex.hpp>
#include "lib/wep_cracker.cpp"
using namespace std;
@@ -34,7 +35,7 @@ int main(int argc, char *argv[]) {
WepCracker wep_cracker;
try {
- wep_cracker.WepCracker(bssid, essid, file);
+ wep_cracker.set_attributes(bssid, essid, file);
}
catch(int error){
switch(error)
@@ -51,7 +52,7 @@ int main(int argc, char *argv[]) {
default:
break;
}
- return NULL;
+ return -1;
}
// If it's all ok, crack!

0 comments on commit eb7f77c

Please sign in to comment.