I was wondering if it makes sense to just insert hardcoded junkcode like
Code:
if (20913 == 20913) {
int dh;
for (dh=59; dh > 0; dh--) {
continue;
}
}
that i got from a junkcode generator...
...or is it wise to create a Junkcode() function wich randomly executes different statements each time it is called, like
- for-loops
- if-statements
- __asm statements
- other
Question: is a Junkcode() function (even if it randomly executes stuff each time) going to change the signature in any way?
Originally Posted by KF1337
Question: is a Junkcode() function (even if it randomly executes stuff each time) going to change the signature in any way?
Junk code is useless in my opinion. It only slows a program down and shifts a function(s) position in memory. As long as you're updating the cheat on a regular basis there is no need for junk code.
It only slows a program down and shifts a function(s) position in memory.
But this is the whole point of junk code, isn't it? Placing unrelated/useless code between actual calculations to break this specific signature that was created otherwise.
Agreeing on that slowing down thing though.
Originally Posted by Sandwich
As long as you're updating the cheat on a regular basis there is no need for junk code.
Depends on what do you consider updating I think What is updating other than adding a new function between the formerly existing ones?
Junk Code is a huge topic everyone seems to see different, I am aware of that. I still appreciate the reply
But if I wanted to add junk, does it make a difference if i hardcode junk or use a function to execute randomly chosen code (considering the random code might be the same as in the hardcoded version)
Originally Posted by KF1337
What is updating other than adding a new function between the formerly existing ones?
You can change a function(s) signature without adding to existing code. Press CRTL + . and change the signature. You can create a for loop to change the variable signatures to save the hassle of doing it manually.
Originally Posted by KF1337
But if I wanted to add junk, does it make a difference if i hardcode junk or use a function to execute randomly chosen code (considering the random code might be the same as in the hardcoded version)
Both methods will work similarly, it just depends on what you want to do.
Originally Posted by Sandwich
You can change a function(s) signature without adding to existing code. Press CRTL + . and change the signature. You can create a for loop to change the variable signatures to save the hassle of doing it manually.
Feeling slightly embarrased now. Why isn't this info spread much wider if it's that easy
Originally Posted by Sandwich
Both methods will work similarly, it just depends on what you want to do.
Thanks! My idea was just to add very small functions/single commands in between the actual code that is possibly detected/blacklisted/whatever...
Originally Posted by KF1337
Feeling slightly embarrased now. Why isn't this info spread much wider if it's that easy
We all started somewhere, the key is striving to learn and improve. With that mindset, you can do anything.
Most of it wont even get compiled if you keep code optimization enabled.
And even if disabled, your if statement will just get compiled to "if (true)".
Originally Posted by OfficerX
your if statement will just get compiled to "if (true)".
...thus executing the for-loop.
Originally Posted by KF1337
...thus executing the for-loop.
Code:
//Cleaner junk code but its still junk.
static void UselessJunk()
{
auto junk = rand() % 1337 + 1;
for(auto i = 0; i < junk; i++)
continue;
}
Now that is a really nice and clean example I have not thought of yet.
All I was thinking about was, how can I make the compiled code even more random?
That's why i came up with solutions that i got from junk generators in this sub-forum.