mirror of
https://github.com/hasherezade/pe-bear.git
synced 2026-10-12 02:15:21 +00:00
[BUGFIX] Enabled searching signaures
This commit is contained in:
@@ -65,8 +65,8 @@ class SignFinderThreadManager : public CollectorThreadManager
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SignFinderThreadManager(PEFile* pe, offset_t offset=0)
|
||||
: m_PE(pe), startOffset(offset)
|
||||
SignFinderThreadManager(AbstractByteBuffer* buf, offset_t offset=0)
|
||||
: m_Buf(buf), startOffset(offset)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -81,9 +81,10 @@ public:
|
||||
|
||||
bool setupThread()
|
||||
{
|
||||
if (!m_PE) return false;
|
||||
#ifdef SIGN_THREAD
|
||||
SignFinderThread *thread = new SignFinderThread(m_PE, m_patternFinder, m_matched, startOffset);
|
||||
ByteBuffer* tmpBuf = new ByteBuffer(m_Buf->getContent(), m_Buf->getContentSize());
|
||||
SignFinderThread *thread = new SignFinderThread(tmpBuf, m_patternFinder, m_matched, startOffset);
|
||||
ByteBuffer::release(tmpBuf);
|
||||
|
||||
this->myThread = thread;
|
||||
|
||||
QObject::connect(thread, SIGNAL(gotMatches(MatchesCollection* )),
|
||||
@@ -94,7 +95,7 @@ public:
|
||||
|
||||
QObject::connect(thread, SIGNAL(searchStarted(bool)),
|
||||
this, SLOT(onSearchStarted(bool)), Qt::UniqueConnection);
|
||||
#endif //SIGN_THREAD
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -134,7 +135,7 @@ protected slots:
|
||||
|
||||
protected:
|
||||
|
||||
PEFile* m_PE;
|
||||
AbstractByteBuffer* m_Buf;
|
||||
offset_t startOffset;
|
||||
sig_finder::Node m_patternFinder;
|
||||
MatchesCollection m_matched;
|
||||
|
||||
@@ -53,17 +53,17 @@ void PatternSearchWindow::onSearchClicked()
|
||||
}
|
||||
|
||||
if (!this->m_peHndl) return;
|
||||
PEFile* peFile = m_peHndl->getPe();
|
||||
if (!peFile) return;
|
||||
MappedExe* exe = m_peHndl->getPe();
|
||||
if (!exe) return;
|
||||
|
||||
offset_t maxOffset = peFile->getContentSize();
|
||||
const offset_t maxOffset = exe->getContentSize();
|
||||
offset_t offset = startOffsetBox.value();
|
||||
|
||||
size_t fullSize = peFile->getContentSize();
|
||||
const size_t fullSize = exe->getContentSize();
|
||||
if (offset >= fullSize) return;
|
||||
|
||||
if (!this->threadMngr) {
|
||||
threadMngr = new SignFinderThreadManager(peFile);
|
||||
threadMngr = new SignFinderThreadManager(exe);
|
||||
}
|
||||
threadMngr->setStartOffset(offset);
|
||||
if (!threadMngr->loadSignature(tr("Searched"), text)) {
|
||||
|
||||
Reference in New Issue
Block a user