-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Broken sqlite3 program to extract databases (email,sms,etc)
- Loading branch information
Showing
22 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.0.1-31 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
include theos/makefiles/common.mk | ||
|
||
TOOL_NAME = sql1 | ||
sql1_FILES = main.mm | ||
sql1_LDFLAGS = -lsqlite3 | ||
include $(THEOS_MAKE_PATH)/tool.mk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Package: com.yourcompany.sql1 | ||
Name: sql1 | ||
Depends: | ||
Version: 0.0.1-31 | ||
Architecture: iphoneos-arm | ||
Description: An awesome tool of some sort!! | ||
Maintainer: System Administrator | ||
Author: System Administrator | ||
Section: System | ||
Tag: role::hacker | ||
Installed-Size: 16 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
Package: com.yourcompany.sql1 | ||
Name: sql1 | ||
Depends: | ||
Version: 0.0.1 | ||
Architecture: iphoneos-arm | ||
Description: An awesome tool of some sort!! | ||
Maintainer: System Administrator | ||
Author: System Administrator | ||
Section: System | ||
Tag: role::hacker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#import <sqlite3.h> | ||
//#import "/usr/include/sqlite3.h" | ||
|
||
#define allTrim( object ) [object stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet] | ||
|
||
int main(int argc, char **argv, char **envp) { | ||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | ||
NSString *addressBook = @"/private/var/mobile/Library/AddressBook/AddressBook.sqlitedb"; | ||
NSString *smsDB = @"/private/var/mobile/Library/SMS/sms.db"; | ||
NSString *cellTowerLocation = @"/private/var/root/Library/Caches/locationd/consolidated.db"; | ||
NSString *callHistoryMobile = @"/private/var/mobile/Library/CallHistory/call_history.db"; | ||
NSString *callHistoryWireless = @"/private/var/wireless/Library/CallHistory/call_history.db"; | ||
NSString *googleMaps = @"/mobile/Library/Caches/Map/Tiles/MapTiles.sqlitedb"; | ||
NSString *emailDB = @"/mobile/Library/Mail/Envelope Index"; | ||
NSString *voiceMail = @"/mobile/Library/Voicemail/voicemail.db"; | ||
|
||
sqlite3 *database; | ||
sqlite3_stmt *statement; | ||
|
||
if(sqlite3_open([addressBook UTF8String],&database)==SQLITE_OK){ | ||
const char *sqlStatement = "select ABPerson.prefix, ABPerson.first,ABPerson.last, ABMultiValue.value from ABPerson,ABMultiValue where ABMultiValue.record_id=ABPerson.ROWID"; | ||
NSError* error = nil; | ||
sqlite3_prepare_v2(database,sqlStatement,-1,&statement,nil); | ||
if(error!=nil){ | ||
NSLog(@"Error: %@ %@",error, [error userInfo]); | ||
}else{ | ||
|
||
while(sqlite3_step(statement)==SQLITE_ROW) | ||
{ | ||
char *firstNameMessage1 = (char *)sqlite3_column_text(statement,1); | ||
NSString *firstNameMessage2 = nil; | ||
if(firstNameMessage1 != NULL){ | ||
firstNameMessage2 = [NSString stringWithUTF8String:(char *) sqlite3_column_text(statement,1)]; | ||
} | ||
|
||
char *lastNameMessage1 = (char *)sqlite3_column_text(statement,2); | ||
NSString *lastNameMessage2 = nil; | ||
if(lastNameMessage1 != NULL){ | ||
lastNameMessage2 = [NSString stringWithUTF8String:(char *) sqlite3_column_text(statement,2)]; | ||
} | ||
printf("%s\t\t%s\n", | ||
[firstNameMessage2 UTF8String],[lastNameMessage2 UTF8String]); | ||
|
||
} | ||
} | ||
} | ||
sqlite3_finalize(statement); | ||
[pool release]; | ||
[smsDB release]; | ||
[callHistoryMobile release]; | ||
[callHistoryWireless release]; | ||
[cellTowerLocation release]; | ||
[googleMaps release]; | ||
[emailDB release]; | ||
[voiceMail release]; | ||
printf("exit program\n"); | ||
return 0; | ||
} |
Empty file.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/opt/theos |