16
R-C-D
5y

I was trying to understand the source code of aircrack-ng which is written in C today.
Suddenly I saw sth strange !
WTF !! what is #ifdef ??? I've never seen that before !
So I told myself : hey ! You have to download a complete C programming course!
so I did , but when I skimmed through the titles , again:
WTF ! I know all of them! So why the fuck I could not fully understand the code ? Where can I find anything I missed ?

So... I'm asking U :)

Comments
  • 2
    @theNSA is this your work? to get all the WiFi passwords?
  • 3
    @heyheni well I'm a pentester :)
    Wireless pentest is also my duty
  • 6
    The actual WTF is that there are C courses out there that don't even mention #ifdef. And probably not #error either.

    Maybe the classic book by Kernighan & Ritchie? Though of course this is missing some newer stuff like C99 and C11.
  • 3
    @R1100 Well I'm a graphic designer who can't code. I downloaded Kali Linux. So I'm a pentester myself now, right? 😆
  • 6
    @heyheni That's for noobs. I got a Kali wallpaper on my Windows machine. h4xx0r 1337 alert!
  • 4
  • 4
    @heyheni cool ! CSS stuff ?
  • 2
    @R1100 css with kali? No that would be wastetd 13373$. ARP poisening and creating pdfs that execute remote code. Teaching Blue Team what fear means. 😆
  • 3
    @heyheni cool 👊
    Keep going but also try to read the codes (otherwise you'll be just a skiddie and you won't penetrate cool servers)
  • 5
    Most courses are basics only, what you should have learned is to fucking look for shit in the documentation.

    Here, let me give you the most important skill there is:
    http://bfy.tw/O8Jj
  • 2
    @mundo03 never knew this site existed. This will help me deal with a lot of people, thank you!
  • 2
    @nofckingcluedev it is an internet oldie :p you are welcome
  • 2
    #ifdef is a compiler preprocessor, it needs to allways be followed by some symbol. (e. g.
    #ifdef MY_SYM) A ifdef block is ended with a #endif .

    It does the following. Let's say we have this code:

    #ifdef WIN64
    ... my c code...
    #endif

    Then `... my c code...` only gets _compiled_ if the symbol `WIN64` is defined. The symbol `WIN64` is defined when using some windows compiler on a 64bit system. The purpose of this is to allow one codebase to contain the code for many systems.

    There also are the directives:
    #elifdef
    #else

    These work as you would expect.
    Here one longer example to show how these work. (NOTE: I am making up the symbol names as this is dependent on the compiler you use)

    #ifdef WIN64
    ... c code for 64bit windows...
    #elifdef WIN32
    ... c code for 32bit windows...
    #elifdef LINUX64
    ... c code for 64bit linux...
    #else
    ... c code for 32bit linux...

    #endif
  • 1
    just blunder your way through with badly-written language docs.
Add Comment