When I insert an ELF into a SQLite database via the command:
$ sqlite3 insert into TABLE values('name', readfile('executable'));
I can execute the extracted pendant to it. But when I insert the blob file via the following python command:
>>> cursor.execute('''INSERT INTO table(Name,Executable) VALUES(?,?)''',('name',sqlite3.Binary(file)))
I get the error message
cannot execute binary file: Fehler im Format der Programmdatei
So it seems that sql.Binary()
changes the file. The ELF extracted after the second method is way smaller than the other one.
Whan am I doing wrong? Actually both methods should do the same, right?
io.open() is doing the job. It doesn't convert the file to octet-stream