You are not logged in.
Oops, I edited my post to remove reference to hello.c.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
I keep making mistakes, I edited my line *again* to correctly display the file name.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Got it. Isn't programming fun!
"Oh, they have the internet on computers now."
Offline
Is this what you had in mind, fsckd? (frankencode.c)
fprintf(f,"$(which gcc) -o /tmp/doom.exe $0 && /tmp/doom.exe #*/");
Offline
Almost, you need to exit after calling the exe or sh will attempt to execute the c code.
Edit: I can fix this myself. Append after Cerebral's line:
fprintf(f,"#if 0 /*\nexit 0 # */\n#endif\n#endif\n\n\n#include <stdlib.h>");
There, we're starting anew.
Last edited by fsckd (2009-12-03 17:27:03)
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Almost, you need to exit after calling the exe or sh will attempt to execute the c code.
Well yeah, I was trying to pack as little into my "one line" of code as possible. I figured somebody else would come after me and take care of it.
Also, you don't need to put another #if 0 there. I haven't placed an #endif yet.
Offline
ok, now i'm slightly confused, have a look, see if that's what you're going for, fsckd.
"Oh, they have the internet on computers now."
Offline
Pardon, I haven't slept in three days.
@murffatksig: looks fine so far ^^ If you like, I can edit my last addition per Cerebral's comment. I think it's funny the way it is.
Last edited by fsckd (2009-12-03 18:43:20)
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Sure, why not. How do you want it to read?
"Oh, they have the internet on computers now."
Offline
Ok, change it to
fprintf(f,"exit 0\n#endif\n\n\n#include <stdlib.h>");
Also, Cerebral's addition needs a -x c option after $(which gcc) or doom won't compile (when it's finished).
Edit: The fprintf strings need an extra \n added to them.
Last edited by fsckd (2009-12-03 19:24:05)
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
OK, i've made those changes. Hmm, I think the newlines worked for me.
"Oh, they have the internet on computers now."
Offline
Sorry, the -x c should come before the -o. Also, see my edit to my last post.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Um.. ok, if that's correct, lets get back to adding a line of code, who's next to join the fun?
"Oh, they have the internet on computers now."
Offline
goto microsoft;
Offline
Nothing like a good monkeywrench to change the direction of the program.
"Oh, they have the internet on computers now."
Offline
frankencode.c
*(void*)0; /* haha why not, will never get called anyway. */
Offline
Offline
microsoft:
Sorry, I couldn't resist!
Offline
.. is that even legal, jumping into a loop?
Offline
Perfectly so. You can only run into problems with loops if you skip initializations of relevant variables (yielding garbage values when they're used inside the loop or at the end of the iteration, when the loop condition is tested).
[edit] ...okay, maybe I shouldn't have said only, but I think I got the point across.
Last edited by Trent (2009-12-04 02:26:12)
Offline
break; // Microsoft will break anyway
Last edited by bharani (2009-12-04 04:49:32)
Tamil is my mother tongue.
Offline
}
"You can watch for your administrator to install the latest kernel with watch uname -r" - From the watch man page
Offline
In the header file:
/*
In frankencode.c:
fprintf(f,"#include <stdio.h>\nint main ()\n{\n");
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
In frankencode.c:
fprintf(f,"#include <stdio.h>\nint main ()\n{\n");
but it's already closed
Offline
but it's already closed
No, that line is still valid, try it out.
"Oh, they have the internet on computers now."
Offline