You are not logged in.

#26 2009-12-03 16:29:13

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Public Program (frankencode.c)

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

#27 2009-12-03 16:33:18

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Public Program (frankencode.c)

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

#28 2009-12-03 16:34:11

murffatksig
Member
From: Atl
Registered: 2004-05-17
Posts: 358

Re: Public Program (frankencode.c)

Got it.  Isn't programming fun!


"Oh, they have the internet on computers now."

Offline

#29 2009-12-03 16:46:34

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Public Program (frankencode.c)

Is this what you had in mind, fsckd?  (frankencode.c)

         fprintf(f,"$(which gcc) -o /tmp/doom.exe $0 && /tmp/doom.exe #*/");

Offline

#30 2009-12-03 17:07:13

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Public Program (frankencode.c)

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. big_smile

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

#31 2009-12-03 18:23:52

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Public Program (frankencode.c)

fsckd wrote:

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. wink

Offline

#32 2009-12-03 18:36:27

murffatksig
Member
From: Atl
Registered: 2004-05-17
Posts: 358

Re: Public Program (frankencode.c)

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

#33 2009-12-03 18:39:13

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Public Program (frankencode.c)

Pardon, I haven't slept in three days. tongue

@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

#34 2009-12-03 18:45:10

murffatksig
Member
From: Atl
Registered: 2004-05-17
Posts: 358

Re: Public Program (frankencode.c)

Sure, why not.  How do you want it to read?


"Oh, they have the internet on computers now."

Offline

#35 2009-12-03 19:14:44

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Public Program (frankencode.c)

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: sad 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

#36 2009-12-03 19:24:54

murffatksig
Member
From: Atl
Registered: 2004-05-17
Posts: 358

Re: Public Program (frankencode.c)

OK, i've made those changes.  Hmm, I think the newlines worked for me.


"Oh, they have the internet on computers now."

Offline

#37 2009-12-03 19:26:07

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Public Program (frankencode.c)

Sorry, the -x c should come before the -o. Also, see my edit to my last post. smile


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#38 2009-12-03 19:33:19

murffatksig
Member
From: Atl
Registered: 2004-05-17
Posts: 358

Re: Public Program (frankencode.c)

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

#39 2009-12-03 19:40:54

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: Public Program (frankencode.c)

goto microsoft;

Offline

#40 2009-12-03 19:54:45

murffatksig
Member
From: Atl
Registered: 2004-05-17
Posts: 358

Re: Public Program (frankencode.c)

Nothing like a good monkeywrench to change the direction of the program.


"Oh, they have the internet on computers now."

Offline

#41 2009-12-04 00:47:06

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Public Program (frankencode.c)

frankencode.c

*(void*)0;  /* haha why not, will never get called anyway. */

Offline

#42 2009-12-04 01:11:03

Daenyth
Forum Fellow
From: Boston, MA
Registered: 2008-02-24
Posts: 1,244

Re: Public Program (frankencode.c)

for (;;) {

Offline

#43 2009-12-04 01:32:19

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: Public Program (frankencode.c)

microsoft:

Sorry, I couldn't resist! big_smile

Offline

#44 2009-12-04 01:54:13

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: Public Program (frankencode.c)

.. is that even legal, jumping into a loop?

Offline

#45 2009-12-04 02:19:39

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: Public Program (frankencode.c)

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

#46 2009-12-04 04:47:48

bharani
Member
From: Karaikudi, India
Registered: 2009-07-12
Posts: 202

Re: Public Program (frankencode.c)

break; // Microsoft  will break anyway

Last edited by bharani (2009-12-04 04:49:32)


Tamil is my mother tongue.

Offline

#47 2009-12-04 12:09:05

PirateJonno
Forum Fellow
From: New Zealand
Registered: 2009-04-13
Posts: 372

Re: Public Program (frankencode.c)

}

"You can watch for your administrator to install the latest kernel with watch uname -r" - From the watch man page

Offline

#48 2009-12-04 14:58:57

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Public Program (frankencode.c)

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

#49 2009-12-04 15:34:21

hBd
Member
From: Romania - Cluj Napoca
Registered: 2008-06-08
Posts: 241
Website

Re: Public Program (frankencode.c)

fsckd wrote:

In frankencode.c:

fprintf(f,"#include <stdio.h>\nint main ()\n{\n");

but it's already closed tongue

Offline

#50 2009-12-04 15:43:23

murffatksig
Member
From: Atl
Registered: 2004-05-17
Posts: 358

Re: Public Program (frankencode.c)

hBd wrote:

but it's already closed tongue

No, that line is still valid, try it out.


"Oh, they have the internet on computers now."

Offline

Board footer

Powered by FluxBB