Very simple code has weird errors

Very simple code has weird errors

Post by Israel on Thu Nov 19, 2009 11:47 pm
([msg=30584]see Very simple code has weird errors[/msg])

Having some trouble with this code I found in Phrack 61. It looks very simple though.
Code: Select all
int _init(void)
{
        _dumm ();
        cmn_err(1,"evil: successfully installed");
        return 0;
}


I simply renamed the _init function to local_int and the error went away. However that did not work for _dumm. I have tried many different #include files too and can't get cmn_err working either. Any help would be appreciated.
User avatar
Israel
Experienced User
Experienced User
 
Posts: 74
Joined: Thu Sep 18, 2008 9:53 pm
Blog: View Blog (0)


Re: Very simple code has weird errors

Post by tgoe on Fri Nov 20, 2009 5:26 am
([msg=30589]see Re: Very simple code has weird errors[/msg])

You must defer linking to the final step by using the -c option on your code pieces
Code: Select all
gcc -c -o evil.o evil.c
User avatar
tgoe
Contributor
Contributor
 
Posts: 668
Joined: Sun Sep 28, 2008 2:33 pm
Location: q3dm7
Blog: View Blog (0)


Re: Very simple code has weird errors

Post by Israel on Mon Nov 23, 2009 7:59 pm
([msg=30706]see Re: Very simple code has weird errors[/msg])

Thank you.
User avatar
Israel
Experienced User
Experienced User
 
Posts: 74
Joined: Thu Sep 18, 2008 9:53 pm
Blog: View Blog (0)



Return to C and C++

Who is online

Users browsing this forum: No registered users and 0 guests