How to find a value in a .DB file?

1

I'm trying to find hotkey data in the settings.db file for TS3. When I open the .DB file in NotePad++, and hit CTRL+F, and type "SCROLL, you'll find the hotkey data. Whenever I edit anything in the .DB file using NotePad++, the file gets corrupted, so I need to edit it using an actual .DB file viewer/editor.
I'm using DB Browser for SQLite

I've looked through everywhere in this file, and I can't find the hotkey data. There is no Control+F in DB Browser, which makes it 10x harder.

Can someone help me find the hotkey data in this file?

DOWNLOAD

Josh Silveous

Posted 2017-03-07T15:10:58.013

Reputation: 345

Answers

1

I'm expanding my comments to an answer, the main point being that while I agree with Alex on everything he writes, I recognize that a Windows user might be better off using graphical tools.

How to open, browse and edit a Sqlite .DB file

Sqlite databases are not plaintext files, and need to be handled with specific software. If you are using Firefox, I would recommend the SQLite Manager Add-on, otherwise there is the excellent standalone DB Browser for SQLite, which is available for Windows, Mac and Linux and even as a Portable App. This is what the OP already is using.

With either of these programs, you can connect to (or open) a SQLite file and then browse, search and edit its contents. If you made any changes, you can save them back to the original file and you are done.

How to find a value in a database

Simple searches in databases are done on a column in a table. This means that you have to know beforehand which table contains the data you are looking for, select it and then run the query against one of its columns. Database manager software, both graphical and command-line, will usually follow this pattern.

But what if you don't know in advance where the string you are looking for could be? How to look for a specific sequence anywhere in the whole database? The easiest way is to transform the database into a flat text file and search within it. This could reveal all occurrences of a certain string and will let us know which tables and columns are relevant so that we can go back and work on them with the manager tool of our choice. Alternatively, we could carefully edit the exported database and then reimport it to the original .DB file format.

Nearly every database manager tool has an export (or dump) and import function that will do exactly that.

Specific: finding "SCROLL in this file -- failed

By following the aforementioned methods, I was unable to find the string "SCROLL in the file provided by the OP. What dazzles me is that the original .DB file contains it (when viewed as text) and the exported SQL does not contain it; when however it is reimported back to the .DB format, the new file contains it (again, when viewed as text). The explanation is beyond me at the moment.

simlev

Posted 2017-03-07T15:10:58.013

Reputation: 3 184

1

SQLite database is in binary form, you can't access it directly with text editor. If you want to see content of database as a text you need to export it as SQL dump file:

Run cmd (command line console) then navigate to the folder (with cd command) with database file and issue following command (replace database-file.db with actual file)

 sqlite3 database-file.db .dump > database-file.txt

You can download command line utility sqlite3 here

After that you can explore this database-file.txt file with Notepad++.

If you edited dumped SQL file and want to make it again as SQLite database, use this:

 sqlite3 database-file.db < database-file.txt

P.S.

Regarding HotKey data you looking inside database you referenced, the only records related to HotKey are:

INSERT INTO "Application" VALUES(1488894941,'HotkeyMode','2');
INSERT INTO "Application" VALUES(1488894941,'HotkeyProfile','160cc86f-8082-4bad-afbd-7ae9b96482ca');
INSERT INTO "Global" VALUES(1488894937,'HotkeyDialog','297 433');
INSERT INTO "Connecting" VALUES(1487550188,'LastUsedServerHotkeyProfile','160cc86f-8082-4bad-afbd-7ae9b96482ca');

If you don't know internals of TeamSpeak's what does means 'HotkeyMode','2' and 'HotkeyProfile','160cc86f-8082-4bad-afbd-7ae9b96482ca' then it wouldn't be so easy to change something you want

Alex

Posted 2017-03-07T15:10:58.013

Reputation: 5 606

Can you elaborate on how to do this? Also, will I be able to convert the dump file back to a normal file? – Josh Silveous – 2017-03-07T15:51:42.240

@JoshSilveous You don't need to convert it back, it makes a copy of database as SQL text file. Just download sqlite3 and run sqlite3 settings.db .dump > settings.txt then open settings.txt with Notepad++ and use Ctrl+f to find what you want – Alex – 2017-03-07T15:56:20.620

What do I need to run that command in? CMD? Or the sqlite3.exe? also do I need to move it to the directory that has the settings.db? – Josh Silveous – 2017-03-07T15:59:26.990

Of course, look at the instructions here under section 10. The fact is, I had done this and wasn't able to locate the string "Scroll in the exported sql. You might want an easier-to-use (graphical) tool like this.

– simlev – 2017-03-07T16:00:00.533

@simlev when following those instructions, I just get "'sqlite3' is not recognized as an internal or external command, operable program or batch file." when typing "sqlite3" in CMD. How do I install sqlite? – Josh Silveous – 2017-03-07T16:02:36.443

@JoshSilveous Did you unpacked zip file you downloaded ? sqlite3 inside of archive. It isn't require any installation, it is a single utility. Unpack it then copy to this directory your database file, then run cmd in this directory and issue command from answer – Alex – 2017-03-07T16:07:05.327

You should put all files in the same directory, open a Powershell prompt, cd to it and issue the command echo '.dump' | .\sqlite3 .\settings.db > dump.sql. Given the difficulties you are encountering, I would recommend you use a graphical tool to do the same. – simlev – 2017-03-07T16:08:33.043

@simlev Alright, I've got that working and I see what you mean. The hotkey data that was in the original settings.db is gone. – Josh Silveous – 2017-03-07T16:48:09.953