From: Christoph Egger Date: Thu, 5 Mar 2015 13:39:17 +0000 (+0100) Subject: Add binary to saved archive X-Git-Tag: v0.1~67 X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=commitdiff_plain;h=efaafdaf4a18b5f2f4dd743aa3f0e609d428b15a Add binary to saved archive --- diff --git a/src/core/InformationManager.cxx b/src/core/InformationManager.cxx index 1ea4ba0..73ea5ef 100644 --- a/src/core/InformationManager.cxx +++ b/src/core/InformationManager.cxx @@ -21,6 +21,7 @@ InformationManager::~InformationManager() { } void InformationManager::reset(const std::string& filename) { + this->filename = filename; disassembler.reset(createLLVMDisassembler(filename, this)); if (disassembler.get() != NULL) disassembler.get()->start(); @@ -32,6 +33,20 @@ void InformationManager::save(const QString& filename) { zip.setComment("FRIDA 0.0"); QuaZipFile outZipFile(&zip); + { + QFile binary(this->filename.c_str()); + binary.open(QIODevice::ReadOnly); + QuaZipNewInfo zipinfo("binary"); + zipinfo.setPermissions(static_cast(0x6444)); + outZipFile.open(QIODevice::WriteOnly, zipinfo); + QByteArray buffer; + while (!binary.atEnd()) { + buffer = binary.read(4096); + outZipFile.write(buffer); + } + outZipFile.close(); + } + for (auto funpair : functions) { Function* fun = funpair.second; QuaZipNewInfo zipinfo(fun->getName().c_str()); diff --git a/src/core/InformationManager.hxx b/src/core/InformationManager.hxx index 243ca94..2e9358c 100644 --- a/src/core/InformationManager.hxx +++ b/src/core/InformationManager.hxx @@ -91,6 +91,7 @@ private: std::unique_ptr disassembler; std::map functions; std::map blocks; + std::string filename; log4cxx::LoggerPtr logger; };