You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C++11 introduced the constexpr keyword for defining a constant expression.
A constant expression is a variable or function that may be evaluated at compile time. This has many uses, including extending a switch statement to support full strings.
Constant Expression Hash Functions
C++ only supports using an integer as the condition in a switch statement and an integer that is known at compile time in a case statement.
You can define a hash function and use it to convert a string to an integer to use in a switch statement.
If you define that hash function as a constexpr you can use it to convert a string literal to an integer to use in a case statement as well.
A common programming idiom when writing position independent code (PIC) is to expand a string literal into its individual characters when instantiating a local variable.
voidf() {
// Example 1: A normal instantiation with a string literalchar a[]{ "a long string" };
// Example 2: The Pic idiom for instantiating a string
Microsoft purchased the software Softricity SoftGrid in 2006 and renamed it to Microsoft Application Virtualization, or App-V for short.
Windows shipped with several libraries in System32 and SysWOW64 to support App-V.
AppVTerminator.dll
One App-V library stands out from all the rest because it only has one exported function named IllBeBack...
That's right!
A library signed by Microsoft, with Terminator in the name, that only has a single callable function named IllBeBack.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I previously wrote about how to use macro metaprogramming to simplify using string literals in position independent code (PIC).
The results are summarized in the below code snippet and the article can be read on GitHub.
voidf() {
// Example 1: The Pic idiom for instantiating a stringchar picString1[]{ 'a', 'b', 'c' };
SCCM Credential Recovery for Network Access Accounts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thank you to SpecterOps for supporting this research and to Duane and Matt for proofreading and editing!
Crossposted on the SpecterOps Blog.
TLDR: You may use this header file for reliable compile time string encryption without needing any additional dependencies.
Programmers of DRM software, security products, or other sensitive code bases are commonly required to minimize the amount of human readable strings in binary output files. The goal of the minimization is to hinder others from reverse engineering their proprietary technology.
Common approaches that are taken to meet this requirement often add an additional maintenance burden to the developer and are prone to error. These approaches will be presented along with t
An example bypass of FMAPI's MiniNT check using a registry transaction
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thank you to SpecterOps for supporting this research and to Lee and Sarah for proofreading and editing!
Crossposted on the SpecterOps Blog.
TLDR: You may use fuse-loader or perfect-loader as examples for extending an OS's native loader to support in-memory libraries.
Some software applications require the ability to load dynamic libraries from the memory of the application's own process.
The majority of desktop OSes do not support this use case, so a number of developers have reimplemented the process of loading a library to overcome this limitation.