>>20,22
Your troll ``shellcode'' doesn't even compile. If you change it to int main it causes a segfault because you're trying to run code from the data segment. It won't be able to exploit a buffer overflow even on its intended architecture/OS because it's full of embedded nulls. You should be glad your trolling got so many replies. Now go back to /g/.
Name:
Anonymous2012-03-21 16:35
>>27 It compiles and executes.
No it doesn't you stupid piece of shit. It's dependent on a shitty compiler and some shitty platform, this isn't cross-platform code.
Name:
Anonymous2012-03-21 16:37
>>28
ok lets take one problem at a time, see if i can help you
1)doesn't compile, try save the code with a .c extension its c code
if you haven't compiled a .c file before, use google there plenty of guides.
>>29 cross-platform dependent on a shitty compiler doesn't even compile exploit a buffer overflow full of embedded nulls
Today /prog/ has shown its true face.
Name:
Anonymous2012-03-21 16:48
>>36
Except this time the faggot doesn't tell you what the specific architecture/OS/compiler/compiler flags are.
Name:
Anonymous2012-03-21 16:49
>>35
Listen you stupid piece of shit, this is taken from the C standard.
5.1.2.2.1 Program startup
The function called at program startup is named main. The implementation declares no prototype for this function. It shall be defined with a return type of int ...
In C, main has to return int, how the fuck don't you understand that? Your program isn't C and it's complete shit, now fuck off back to /g/.
Name:
Anonymous2012-03-21 16:50
>>33 wrong thread >>36 no the arguments made about specific os,compilers etc are totally fictitious, by people who just lost their faith in /prog/
but dont worry the Cleansing has begun, thou shall be saved, my fellow proggers
Name:
Anonymous2012-03-21 16:51
>>38
I think he actually believes that this is C, and that ELF is a portable format.
>>34 >>36
You fucking retards do you realize that it's some small homework that you can adjust to run if you were not fucking loosers complaining about totally not interesting details because that's the only thing you can do?
>>40 no the arguments made about specific os,compilers etc are totally fictitious
So this compiles with C compilers? (no it doesn't, illegal conversion, main has wrong type, both illegal per the C standard)
So this works on both little endian and big endian machines? (no it doesn't)
So this works on something else than 32 bit machines? (no it doesn't)
So this works on something else than x86? (no it doesn't)
So this works on OS'es that mark data segments as non-executable? (no it doesn't)
Name:
Anonymous2012-03-21 17:05
>>49 no don't make fun of him, just because he's frustrated
doesn't mean we cant help him, his excessive use of words like shit and fuck, should only be a flag to this person's age and ethnicity, and i be damned if i give up to another keen but not able soul like him
Name:
Anonymous2012-03-21 17:05
>>52
Please cite from the C standard where it mentions otherwise.
Specifically try to look at section 6.3.2.3 of the ISO/IEC 9899:2011 standard, I think you'll be surprised.
>>55
Ok, here are some facts: You're
1) Interested in this thread
2) Not interested in figuring out what that machine code does
3) Interested in repeating excerpt from C standard that everybody knows and no one cares because GCC will compile it (and Clang too if you're not faggot)
>>1
Since this is undefined behavior (void main and trying to execute data as a function) and either fails to compile or segfaults with all compilers I've used, what OS, architecture, compiler, and compiler flags did you use to get this to run.
Not interested in figuring out what that machine code does
It doesn't do anything, because it's not valid C code, you have to specify some compiler, platform and architecture before this becomes valid code.
Interested in repeating excerpt from C standard that everybody knows and no one cares because GCC will compile it (and Clang too if you're not faggot)
This is nonsensical, newer GCC and clang will compile this as GNU-C code. This still means that there are versions and flags you can't use, so you're dependent on a specific version of GCC and a specific version of clang, and then after you have specified those you are dependent on specific compiler flags.
Face it, you're just a looser.
First of all, it's called loser and not looser. I thought I would help you out since you're obviously mentally challenged. Second of all, ad hominem attacks will get you nowhere, you're wrong and you can either deal with it or go cry in a corner.
Name:
Anonymous2012-03-21 17:13
>>60
LOL idiot how can you say these are the same people
obviously not same person ROFL how can you believe that...
Name:
Anonymous2012-03-21 17:15
>>61 >>63
haha I'm laughing so much right now LOL how he thinks they are same person amazing...
Name:
Anonymous2012-03-21 17:16
>>62
OMG listen here are some more facts:
1) you are an idiot
2) you dont know what your talking about
3) you dont know how to compile code with GCC
Name:
Anonymous2012-03-21 17:16
i had no idea /prog/ was this dumb cant even compile and run C code LOL
Name:
Anonymous2012-03-21 17:17
>>62
you are just being too anal about things, without any particular
reason other than being a buster, i mean relax, if you don't want to participate then don't, but don't bring everyone down just because you are grumpy
Name:
Anonymous2012-03-21 17:18
That kind of shellcode won't work if the memory is marked as non executable. Use return to libc instead.
I like how he included stdio without using any part of it.
Name:
Anonymous2012-03-21 17:24
wow i ran this code this is so cool thanks OP
also cant believe that /prog/ isnt smart enough to run C code LOL ROFL haha they should really go back to /g/ LOL
>>57 Interested in repeating excerpt from C standard that everybody knows and no one cares because GCC will compile it (and Clang too if you're not faggot)
You can go back to /g/ now.
>>72
You're probably not very far off, but I haven't posted in this thread before >>71. I don't think my post really looks like the ones you linked to either.
Name:
Anonymous2012-03-21 17:30
>>73
agreed c, and creating shellcode is way too advanced
for the average /prog/
try some python for god's sake
If you post non-conforming code don't get butthurt when someone points it out, >>53 sums it up pretty well, and that doesn't even mention the ELF format.
Name:
Anonymous2012-03-21 17:36
>>79
ROFL LOL if you dont know how to run C code how are you on /prog/???
>>86
It will. Again, you must not be complete faggot.
Name:
Anonymous2012-03-21 17:52
>>87
No it won't sys/mman.h doesn't even exist on Windows, it's a POSIX header, not part of the C standard library.
Name:
Anonymous2012-03-21 17:53
Why don't you just specify which platform you are on, which architecture you're using, which version of GCC and which flags you are using? If you do all that then the behavior will probably have an actual meaning.
if (mprotect(p, pagesize, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) {
perror("mprotect");
exit(1);
}
int (*func)();
func = (int (*)()) a;
(int)(*func)();
return 'c'; /* u mad? */
}
prints "mprotect: Cannot allocate memory"
Name:
Anonymous2012-03-21 17:59
>>90
Doesn't work on Windows, Windows isn't POSIX.
Name:
Anonymous2012-03-21 18:02
Guess what you stupid sack of shit I just did a grep of the entire ISO/IEC 9899:2011 standard for mprotect, no results. Same with unistd and sysconf, guess what? No results.
None of those are part of C.
Go read the fucking standard, it's part of POSIX so it won't work on non-POSIX platforms.
You can just keep on bringing in more platform dependent behavior, it will just make you look even more retarded than you already do.