@ OP: I really don't know how you ended up at that site, but that is not an exploit database.
This is an exploit data-base:
http://www.cve.mitre.org/index.html
and so is this:
http://nvd.nist.gov/
But that site you linked to is just here say and garbage posted by script kiddies trying to look cool for their friends. Before you even say it, no, I do not except a social media profile as evidence of someones credibility, especially not when they post the kind of crap that you are polluting this site with.
You do not write assembly code with a char array of arbitrary hexadecimal values cast to integers. The fact that they didn't just start off with an array of integers in the first place maybe should have been a hint to you. Assembly code in C++ requires the 'asm'
declaration (hey look at me! I finally found out what it was.):
http://en.cppreference.com/w/cpp/language/asm
Now we can start in on the fun part, that is tearing apart this wretched excuse of a main function:
1 2 3 4 5
|
int main(int argc, char **argv) {
int *ret;
ret = (int *)&ret + 2;
(*ret) = (int) shellcode;
}
|
Literally speaking, the only part of this that was done correctly is the entry point. The first thing the author does here is declare a pointer. OK fine, but a pointer to what exactly? The answer at best is nothing, otherwise it is undefined which is so much worse then nothing. The very next line, he tries to assign the address of an undefined pointer, so a pointer to a (not?)pointer (which by the way they cast to be a pointer, probably because the concept of indirection is just too much for this one to handle) which they try to off-set by 2 for some reason... I don't even know what they are attempting here. With you I think I was at least able to discern what you're trying to do, your entire premise is flawed by the way, but heuristics is an issue worthy of a thread all on its own. This is just like someone feel asleep on the keyboard and posted when ever was written to the screen. This only compiles because neither C or C++ care one tiny bit if you shoot your self in the foot.
If you see an errant superscript in there it's because I was trying to be clever and keep track of the red flags. But that whole thing is a red flag. I'm not doing this to insult you OP, it's better that you learn now why "script kiddie" is used as a derogatory term.