Image
 
linkedin_logo.png rss_logo.jpg
twitter_logo.png youtube_logo.jpg
Latest Additions
 
EH-Net Login
Welcome Guest.






Lost Password?
No account yet? Register
Who's Online
We have 35 guests and 1 member online
 
Free Business and Tech Magazines and eBooks

You are here: Home arrow Ethical Hacking Discussions and Related Certificationsarrow Programmingarrow find libraries include in c programming
EH-Net
May 22, 2013, 04:02:54 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Go back to The Ethical Hacker Network Online Magazine Home Page
 
   Home   Help Calendar Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: find libraries include in c programming  (Read 4959 times)
0 Members and 1 Guest are viewing this topic.
nubie
Newbie
*
Offline Offline

Posts: 31


View Profile
« on: October 07, 2008, 05:27:05 AM »

hi all, i want to ask some question,
how to solve some problem about libraries in c ?
cause sometimes i got some code and when i try it, it shows error
like this "unable to open include file'hack.h'.
and i realize it happen cause i don't have file hack.h on my folder include.
Is there any way to fix it cause i had download file hack.h from internet and copy paste to folder include but after that it shows error again cause in file hack.h there are more another file must need, or i must had knowledge
about create my own libraries cause i think it's very complex for me to do
that?

Thank's a lot and i'm need an advices about this.  Smiley
Logged
Andrew Waite
Hero Member
*****
Offline Offline

Posts: 928



View Profile WWW
« Reply #1 on: October 07, 2008, 05:38:15 AM »

Nubie,

sounds like you are going down the right track. Basically find each *.h (along with asociated *.c) file that is missing and make sure the compiler knows where to find it. Once you've traced everything down it *should* compile.

I wouldn't recomment trying to recreate the libraries yourself.....
Logged

jimbob
Guest
« Reply #2 on: October 07, 2008, 05:59:47 AM »

Rather than waiting for compile-time errors, check your .c source files for #include directives.

#include hack.h
#include foo.h

That should at least give you a list of the headers you need. Don't forget to check if there's a README file in the source bundle ;-)

Jimbob
Logged
nubie
Newbie
*
Offline Offline

Posts: 31


View Profile
« Reply #3 on: October 10, 2008, 11:42:01 PM »

Hi, this is a code that come from the ebook and i had try to modify this code in order that to running this code in my pc but it's useless cause i failed and even i had download hack.h from koders.com it failed too because it's a lot more include file i need to run this code,
     
Code:
#include <stdio.h>
#incude "hack.h"

int main(int argc, char * argv[])
{
int port = 8080;
char* targetip;

if (argc < 2)
{
      printf("Webgrab Usage:\r\n");
      printf("    %s <TargetIP> [port]\r\n", argv[0]);
      return(0);
}
   
targetip = argv[1];
char* output;
   
if (argc >= 3)
{
        port = atoi(argv[2]);
}
if (argc >= 4)
{
        output = get_http(targetip, port, argv[3]);
}
else
{
        output = get_http(targetip, port, "/");
}
 
         if( is_string_in("Error 40", output )                ||
             is_string_in("302 Object Moved", output )        ||
              is_string_in("404 Not Found", output )          ||
              is_string_in("404 Object Not Found", output ))
         {
              printf("Page doesn't Exist");
         }
         else
         {
              printf("%s", output);
         }

return(0);
 
}

And also i want to know what can we do if got a c code that we don't have enough include file in our system? that code must be can't be compiled/running isn't it?, or we can just download an include file that we don't have like i do with a code above(but i failed)?, This question i ask if i got a code that don't have any readme files and in a future if something happens i had prepared.

Thank's a lot for a replies guys and i'm need an advices again, sorry  Smiley
Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!
Page created in 0.062 seconds with 23 queries.
 
Exclusive Deal

sansfire13_245x90_cw90.jpg
SANSFIRE 2013
June 15 - 22

5% Off w/ Code: EHN_5

SANS Deals 4 EH-Netters
5% OFF Any SANS Course in Any Format!
Coupon Code: EHN_5 Including SANS Rocky Mountain 2013 & SANS Boston 2013
Polls
Compared to this year, 2013 will be:
 
Recent Forum Topics
EH-Net News Feeds
Latest Additions
 
         
Free Business and Tech Magazines and eBooks

© 2013 The Ethical Hacker Network
Joomla! is Free Software released under the GNU/GPL License.