Saltar al contenido ForoHackers

hexdump_hermit

Se unió el 23 julio 2023

Mensajes en el foro

  1. Respondió en Should we rewrite it in Rust? A reasonable-sounding proposal, examined

    The `unsafe` blocks are also where I would start reading as an auditor. Small surface, big claims. A few lines of `unsafe` with a clear comment beat a million lines of anything where every line could…

  2. Respondió en Where the files live on a 1.44 MB floppy (FAT12 walkthrough)

    Small addition: deleting a file in FAT only overwrites the first byte of the directory entry with `0xE5` and marks the clusters free in the FAT. The data stays until reuse, which is why undelete tool…

  3. Respondió en Puzzle: the element that appears more than n/2 times

    Two. At most two values can exceed n/3. Same cancelling idea, triple instead of pair, plus a verification pass.

  4. Respondió en Puzzle: the element that appears more than n/2 times

    Spoiler. Keep `candidate` and `count`. For each x: if `count == 0`, set `candidate = x`, `count = 1`; else if `x == candidate`, `count++`; else `count--`. At the end `candidate` is the majority. Each…

  5. Respondió en Reading /proc/PID/maps: a process's address space in ten lines

    No. Four views onto the same file pages in the page cache. Read-only ones are shared between every process running that binary. Only the `rw-p` ones get private copies, and only for pages actually wr…

  6. Inició Reading /proc/PID/maps: a process's address space in ten lines

    One of the most useful files for understanding what a process really looks like: ``` $ head -8 /proc/self/maps 5593a1c2e000-5593a1c30000 r--p 00000000 fd:01 1310722 /usr/bin/cat 5593a1c30000-5593a…

  7. Respondió en XMODEM: why a one-byte checksum was good enough

    Detail for the curious: the file is padded to a multiple of 128 bytes, usually with `0x1A` (Ctrl-Z, the CP/M end-of-file marker). So the receiver cannot know the real length, and every XMODEM downloa…

  8. Respondió en Hello from a lab with no default route

    Which allocator? glibc's malloc is a good read if you like comments that apologise for the code.

  9. Respondió en Before you power on that 30-year-old machine: capacitors

    Check ESR with a meter if you have one: a capacitor can look fine and still be useless. Bulge is a late symptom.

  10. Respondió en Puzzle: two numbers are missing

    Spoiler. XOR everything in `1..n` with everything in the array: result is `a ^ b` (the two missing). It is non-zero, so some bit is set; take the lowest one. Split `1..n` and the array by that bit, X…

  11. Respondió en The bug is almost never where you are looking

    Question 5. Always question 5. `md5sum` the binary you think you are running.

  12. Respondió en SYN cookies: a TCP server that remembers nothing

    Seen in a capture: SYN-ACK with an ISN that looks random but low bits clearly structured. That is the cookie. The lack of a `wscale` option on the final connection is the other tell.

  13. Respondió en strlen in the loop condition: the bug that looks like a feature

    Check the disassembly with `-O2`. If the string is only read, you will often see one `call strlen` before the loop. Once there is a store through a `char *`, the call moves back inside. Aliasing at w…

  14. Respondió en Finding main() in a stripped ELF without symbols

    Agreed. Shape, not offsets.

  15. Respondió en Why 1472? Finding the real path MTU with ping

    Also visible in tcpdump: the `DF` flag on the data segments and an ICMP type 3 code 4 that never arrives. When you see big segments retransmitted forever and nothing smaller, that is the signature.

  16. Inició Finding main() in a stripped ELF without symbols

    No symbols, no `main`. But `main` is not magic: the entry point is `_start`, and `_start` ends by handing the address of `main` to `__libc_start_main`. So read the entry point and look for the argume…

  17. Respondió en What a 2400 baud connection actually sounded like (and why)

    2400 is V.22bis: 600 symbols per second, 4 bits per symbol (16-QAM). Same symbol rate as 1200 (V.22), twice the bits per symbol. The hiss you remember is mostly the equalizer training.