Skip to content
View sunny73cr's full-sized avatar
💭
instructions
💭
instructions
  • New Zealand

Highlights

  • Pro

Block or report sunny73cr

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Maximum 250 characters. Please don't include any personal information such as legal names or email addresses. Markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned Loading

  1. setup-netfilter setup-netfilter Public

    A collection of shell scripts that build a config file for use with NetFilter.

    Shell

  2. Minimising required CPU cycles for a... Minimising required CPU cycles for a task
    1
    Would a compiler or AI LLM ever generate the following code?
    2
    I needed to convert IP addresses in CIDR format to a numeric `u32` value for it's start and end addresses.
    3
    
                  
    4
    Typically, one would iterate forward. In this case, iterating in reverse is best:
    5
    
                  
  3. Analysis of Stanford's "Bit Twiddlin... Analysis of Stanford's "Bit Twiddling Hacks" (Kinda)
    1
    https://graphics.stanford.edu/~seander/bithacks.html
    2
    
                  
    3
    Determining if an integer is a power of 2
    4
    
                  
    5
    ```
  4. "Best Practices" for 'C' compilation... "Best Practices" for 'C' compilation, assembly and linkage
    1
    As during development; YAGNI: you ain't gonna need it.
    2
    `gcc` has some cool features to ensure that you're putting out minimal, correct code:
    3
    
                  
    4
    ### ! -g
    5
    If it's available outside your network; don't include debugging symbols with the `-g` flag: it makes it far too easy to reverse engineer.
  5. Defending against static analysis Defending against static analysis
    1
    In the above example, strings are passed to `void handle_exit(str, strlen)` literally. These would be stored in the binary closely to how they are written, and this would make it fairly easy to understand the flow of execution with a little effort.
    2
    
                  
    3
    A method to harden your program could be:
    4
    
                  
    5
    Call a `vec8* get_message(enum_msg_code message_code)`,
  6. Memory Layout Hardening or '++ASLR' Memory Layout Hardening or '++ASLR'
    1
    Randomise your struct layout!
    2
    
                  
    3
    Instead of the following:
    4
    ```
    5
    #define VEC8_INITIAL_SIZE 32