Skip to content Skip to footer
0 items - $0.00 0

Hacktical C: practical hacker’s guide to the C programming language by signa11

Hacktical C: practical hacker’s guide to the C programming language by signa11

Hacktical C: practical hacker’s guide to the C programming language by signa11

10 Comments

  • Post Author
    kelsey978126
    Posted April 14, 2025 at 12:49 pm

    For those also wondering like myself, this refers to hacker in the whiny "security hacking is only called cracking Reeeee" manner, so this is just aimed at programmers and not security professionals.

  • Post Author
    akdev1l
    Posted April 14, 2025 at 12:50 pm

    > Microsoft has unfortunately chosen to neglect C for a long time, its compilers dragging far behind the rest of the pack.

    Is this still true? MSVC is pretty good at compiling C++ nowadays

  • Post Author
    lou1306
    Posted April 14, 2025 at 1:31 pm

    > Using a stricter language helps with reducing some classes of bugs, at the cost of reduced flexibility in expressing a solution and increased effort creating the software.

    First of all, those languages do not "help" "reducing" some classes of bugs. They often entirely remove them.

    Then, even assuming that any safe language with unsafe regions (Rust, C#, etc) would not give you comparable flexibility at a fraction of the risk… if your flexible, effortless solution contains entire classes of bugs, then there is no point in comparing "effort". You should at least take into account the effort in providing a software with a high confidence that those bugs are not there.

  • Post Author
    throwaway7894
    Posted April 14, 2025 at 1:39 pm

      #define hc_task_yield(task)   
      do {     
        task->state = __LINE__;   
        return;     
        case __LINE__:;           
      } while (0) 
    
    

    That's just diabolical. I would not have thought to write "case __LINE__". In the case of a macro, using __LINE__ twice expands to the same value where the macro is used, even if the macro has newlines. It makes sense, but TIL.

  • Post Author
    pjmlp
    Posted April 14, 2025 at 1:43 pm

    > The reason I believe C is and always will be important is that it stands in a class of its own as a mostly portable assembler language, offering similar levels of freedom.

    When your computer is a PDP-11, otherwise it is a high level systems language like any other.

  • Post Author
    9d
    Posted April 14, 2025 at 1:49 pm

    > C doesn't try to save you from making mistakes. It has very few opinions about your code and happily assumes that you know exactly what you're doing. Freedom with responsibility.

    I love C because it doesn't make my life very inconvenient to protect me from stubbing my toe in it. I hate C when I stub my toe in it.

  • Post Author
    throwaway7894
    Posted April 14, 2025 at 1:50 pm

    As someone who has a file with similar hacks, I will say this: I am not a C++ fan, but if you find yourself writing C code where you simulate methods via structs with function pointers often, just use C++ as a basic "C with classes" at that point. You want methods anyway, you have to go through a pointer dereference to call the function, it's just not worth the code weirdness. If you have the grit to use structs with function pointers everywhere, you have the grit to stick to the simpler subset of C++.

  • Post Author
    steinuil
    Posted April 14, 2025 at 1:53 pm

    Some points about the introduction, but otherwise this seems like an interesting collection of (slightly deranged?) patterns in C.

    > The truth is that any reasonably complicated software system created by humans will have bugs, regardless of what technology was used to create it.

    "Drivers wearing seatbelts still die in car accidents and in some cases seatbelts prevent drivers from getting out of the wreckage so we're better off without them." This is cope.

    > Using a stricter language helps with reducing some classes of bugs, at the cost of reduced flexibility in expressing a solution and increased effort creating the software.

    …and a much smaller effort debugging the software. A logic error is much easier to reason about than memory corruption or race condition on shared memory. The time you spend designing your system and handling the errors upfront pays dividends later when you get the inevitable errors.

    I'm not saying that all software should be rewritten in memory-safe languages, but I'd rather those who choose to use the only language where this kind of errors regularly happens be honest about it.

  • Post Author
    _false
    Posted April 14, 2025 at 3:06 pm

    Honest q: after skimming through the book it's unclear how it's targeted towards hackers (c.f. academics)?

  • Post Author
    talles
    Posted April 14, 2025 at 3:42 pm

    Any quick way to make a PDF out of this?

Leave a comment

In the Shadows of Innovation”

© 2025 HackTech.info. All Rights Reserved.

Sign Up to Our Newsletter

Be the first to know the latest updates

Whoops, you're not connected to Mailchimp. You need to enter a valid Mailchimp API key.