SignReport, a Tool for Batch Verification of PE Signatures

Code signing is one of the most popular ways of confirming the integrity of software packages. This is made possible by the author of the PE (such as *exe, *.dll and so on) using a Sign tool to add their signature (a certificate) to the PE file. Checking the signature of PE files on the other hand can be done by using WinVerifyTrust function. This example demonstrates how WinVerifyTrust can be used. In this post I’ll share the slight changes needed to make WinVerifyTrust work with Qt Framework, along with a tool built with Qt Framework, that can be used to verify the signature of all PE files within a chosen folder.

Continue reading “SignReport, a Tool for Batch Verification of PE Signatures”

Creating a Pure C++11 Generic Timer Class

One thing I noticed while searching for a simple, generic and pure C++ Timer class online, was the huge amount of answers that were floating around and none of them fit the exact description I was looking for. As a Qt Framework user I wanted to have something as close to QTimer as possible, or maybe even something like Timer class in .NET Framework and C# language. Well, I ended up writing one myself using what I could gather and this post is the summary of it all.

Continue reading “Creating a Pure C++11 Generic Timer Class”

How to Convert QString to Wide C String (wchar_t *)

The same as standard C String, for this also you can go through standard C++ as shown below:

Let’s say you have a QString, like this:

QString s = "www.amin-ahmadi.com";

First convert it to std::wstring and then use its c_str method, like this:

s.toStdWString().c_str()


How to convert QString to C String (char *)

The best solution for this would be to go through standard C++ and it means this:

Let’s say you have a QString, like this:

QString s = "www.amin-ahmadi.com";

First convert it to std::string and then use its c_str method, like this:

s.toStdString().c_str()