Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Best method to generate a lot of random if else and other statements in each build?

Hello all,

Lets say i have written a c/c++ code, i want to build thousands of different versions of this that have a lot of junk code inside them (Currently i compile it using VS but i can move to other compilers if needed)



basically i want to insert a lot of random junk but complex code into each of them

for example insert an if else statement with random values that i know only one branch is going to execute, and the other branch calls a lot of junk APIs that will never get executed (therefore the IAT changes for each build too) and each of these API calls and values for the if else stuff and their placement need to change each build (therefore making it a complex USG)



or insert a switch statement with random cases and values that only one of them going to get executed





is there any open-source/leaked project that has implemented this? i have collected a lot of leaked source codes for different crypters over the years and i assume some of the complex USG ones do implement this, anyone has any suggestion? i just want to look at some c/c++ code or even different languages that have implemented something like this

Thanks!
something like https://github.com/xoreaxeaxeax/movfuscator
good luck with 'your' crypter
I whipped this up in around 15 mins for you and anyone else who might want to use it. It generates quite a lot of junk code, although it is not that diverse in what the junk does.

You open cmd.exe, drag the jnk_gen.exe file into it and give it a number, which will be the number of junk blocks to generate.

It will create a junk.h file in the same folder as the jnk_gen.exe file and it will contain macros for different junk code blocks in the format __JUNK_CODE0__, __JUNK_CODE1__, etc.

Only add it once at the beginning of a function. Also, if you call that function frequently, it will definitely slow it down a bit.

Here is the source and .exe: https://github(dot)com/xora12345/JunkCodeGenerator

Also, remember, any kind of junk code will really only stop beginners, especially since they won't be able to decompile your functions in IDA.
(Jul 16, 2020 03:15 AM)Xora Wrote:  I whipped this up in around 15 mins for you and anyone else who might want to use it. It generates quite a lot of junk code, although it is not that diverse in what the junk does.

You open cmd.exe, drag the jnk_gen.exe file into it and give it a number, which will be the number of junk blocks to generate.

It will create a junk.h file in the same folder as the jnk_gen.exe file and it will contain macros for different junk code blocks in the format __JUNK_CODE0__, __JUNK_CODE1__, etc.

Only add it once at the beginning of a function. Also, if you call that function frequently, it will definitely slow it down a bit.

Here is the source and .exe: https://github(dot)com/xora12345/JunkCodeGenerator

Also, remember, any kind of junk code will really only stop beginners, especially since they won't be able to decompile your functions in IDA.


Wow thank you for sharing. the code gave me some good ideas

also do you know any good leaked USG crypter with source code that does stuff like this too? i have collected a lot of crypter source codes over the years but its hard to check which of them have a good USG
(Jul 17, 2020 11:52 PM)Tr0jandog Wrote:  Wow thank you for sharing. the code gave me some good ideas

also do you know any good leaked USG crypter with source code that does stuff like this too? i have collected a lot of crypter source codes over the years but its hard to check which of them have a good USG

I have no clue what USG is.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by draxyeeDec 28, 2019 03:44 PM 2 290 Dec 28, 2019 03:44 PM
Last Post: Eternal Darkness
[Python] by Smirking_EmojiDec 5, 2019 09:26 PM 13 376 Dec 5, 2019 09:26 PM
Last Post: magicparty
[C] by pmtobefriendNov 18, 2018 12:16 AM 14 436 Nov 18, 2018 12:16 AM
Last Post: Sajuuk