Skip to content

Instantly share code, notes, and snippets.

@mcpower
Created December 30, 2016 05:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcpower/19ddfadc73e20999bcdf7ba00bd9317d to your computer and use it in GitHub Desktop.
Save mcpower/19ddfadc73e20999bcdf7ba00bd9317d to your computer and use it in GitHub Desktop.
diff -ur old/extractwifi.c new/extractwifi.c
--- old/extractwifi.c 2016-12-29 23:04:40.000000000 +1100
+++ new/extractwifi.c 2016-12-30 16:00:29.106186400 +1100
@@ -51,7 +51,7 @@
int main(int argc, char** argv) {
if(argc<2) {
printf("Usage:\n");
- printf("./extractwifi filename\n");
+ printf("./extractwifi filename [offset=b730]\n");
return -1;
}
FILE* f = fopen(argv[1],"rb");
@@ -71,7 +71,14 @@
fclose(f);
return -1;
}
- fseek(f,0xB730,SEEK_SET);
+ int offset = 0xB730;
+ if(argc != 2) {
+ int temp = strtol(argv[2], NULL, 16);
+ if (temp) {
+ offset = temp;
+ }
+ }
+ fseek(f,offset,SEEK_SET);
for(int i=0;i<3;i++) {
printConnectionInformation(f,i);
fseek(f,0xC00,SEEK_CUR);
diff -ur old/simclist.c new/simclist.c
--- old/simclist.c 2016-12-29 23:04:40.000000000 +1100
+++ new/simclist.c 2016-12-30 15:15:27.468135300 +1100
@@ -25,15 +25,16 @@
#include <string.h>
#include <errno.h> /* for setting errno */
#include <sys/types.h>
-#include <sys/uio.h> /* for READ_ERRCHECK() and write() */
+// #include <sys/uio.h> /* for READ_ERRCHECK() and write() */
#include <fcntl.h> /* for open() etc */
-#include <arpa/inet.h> /* for htons() */
+// #include <arpa/inet.h> /* for htons() */
#include <unistd.h>
#include <time.h> /* for time() for random seed */
#include <sys/time.h> /* for gettimeofday() */
#include <sys/stat.h> /* for open()'s access modes S_IRUSR etc */
#include <limits.h>
#include <stdint.h>
+#define SIMCLIST_NO_DUMPRESTORE
/* work around lack of inttypes.h support in broken Microsoft Visual Studio compilers */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment