Jun 15, 2016 03:33 PM
(This post was last modified: Jun 15, 2016 03:36 PM by FireNice.)
Hello.
Many of you use malware that uses multiple options to beautify their malware.
Some of you save the data in the form of string, like this:
There is a system called Flags which is simple and easy to implement, and provides an economic level memory.
A flag represents a bit in a sequence of bits (typically an integer).
A Int32 (or int) is formed of 4 bytes, or 32 bits, so we can make 32 flags.
A flag is a bit, and who say bit, say 1 or 0, true or false.
Only options requiring only a true or false to be activated can be used.
That's the example that will be used.
Here, only 8 flags are used, one byte is sufficient to store them.
Creating a structure that represents all this:
Comments shows as well how are made each flag.
Now, if an option is selected, you must force the bit (or flag) corresponding to 1.
The logical binary OR allows to do this because:
If an option is not selected, the bit is forced to 0 with AND:
Creating a variable that will hold our flags:
To enable XOR and ANTI UAC:
Now we stock it in our malware as you normally would.
To see if a flag is used or not, a simple condition:
Etc...
You just put up a clever and economic system that uses the bit!
By reading this tutorial from beginning to end, you have become smarter than you were before. Continue like this and you'll accomplish great things.
Many of you use malware that uses multiple options to beautify their malware.
Some of you save the data in the form of string, like this:
Code
ANTISANDOBOXIE|ON
ANTISANDOBOXIE|OFFThere is a system called Flags which is simple and easy to implement, and provides an economic level memory.
A flag represents a bit in a sequence of bits (typically an integer).
A Int32 (or int) is formed of 4 bytes, or 32 bits, so we can make 32 flags.
A flag is a bit, and who say bit, say 1 or 0, true or false.
Only options requiring only a true or false to be activated can be used.
- Anti Sandoxie
- Anti VirusTotal
- Anti Firewall
- Anti UAC
- RC4 Encryption
- XOR Encryption
- DES Encryption
- Base64 Encryption
That's the example that will be used.
Here, only 8 flags are used, one byte is sufficient to store them.
Creating a structure that represents all this:
Code
[Flags]
public enum BuildFlags : byte {
AntiSandoxie = 0x01, // 0000 0001 = 1
AntiVirusTotal = 0x02, // 0000 0010 = 2
AntiFirewall = 0x04, // 0000 0100 = 4
AntiUAC = 0x08, // 0000 1000 = 8
RC4Encryption = 0x10, // 0001 0000 = 16
XOREncryption = 0x20, // 0010 0000 = 32
DESEncryption = 0x40, // 0100 0000 = 64
Base64Encryption = 0x80 // 1000 0000 = 128
}Comments shows as well how are made each flag.
Now, if an option is selected, you must force the bit (or flag) corresponding to 1.
The logical binary OR allows to do this because:
Code
x | 1 = 1If an option is not selected, the bit is forced to 0 with AND:
Code
x & 0 = 0Creating a variable that will hold our flags:
Code
BuildFlags oFlags = 0;To enable XOR and ANTI UAC:
Code
oFlags |= BuildFlags.XOREncryption;
oFlags |= BuildFlags.AntiUAC;Now we stock it in our malware as you normally would.
To see if a flag is used or not, a simple condition:
Code
if ((oFlags | BuildFlags.XOREncryption) == BuildFlags.XOREncryption) {
Console.WriteLine("XOR!");
}Etc...
You just put up a clever and economic system that uses the bit!
By reading this tutorial from beginning to end, you have become smarter than you were before. Continue like this and you'll accomplish great things.



![[Image: IQE6i8G.png]](https://i.imgur.com/IQE6i8G.png)
![[Image: WY2HvDV.png]](https://i.imgur.com/WY2HvDV.png)
![[Image: 79d59e0c0e06da9a5040f2da02a02bf3.png]](https://i.gyazo.com/79d59e0c0e06da9a5040f2da02a02bf3.png)