Hacking with strace on ls

$ls 1 $strace ls execve(“/bin/ls”, [“ls”], [/* 38 vars */]) = 0 brk(0) = 0x7ae000 access(“/etc/ld.so.nohwcap”, F_OK) = -1 ENOENT (No such file or directory) mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fb78ab18000 access(“/etc/ld.so.preload”, R_OK) = -1 ENOENT (No such file or directory) open(“/etc/ld.so.cache”, O_RDONLY|O_CLOEXEC) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=136302, …}) = 0 mmap(NULL, 136302, …

Examining an ELF binary with binutils

$strings a.out /lib64/ld-linux-x86-64.so.2 libc.so.6 printf __libc_start_main __gmon_start__ GLIBC_2.2.5 fffff. []A\A]A^A_ hello ;*3$” GCC: (Debian 4.9.2-10) 4.9.2 GCC: (Debian 4.8.3-13) 4.8.3 hello.c long unsigned int short unsigned int short int GNU C 4.9.2 -mtune=generic -march=x86-64 -g unsigned char long int sizetype main hello.c /home/jeffrin .symtab .strtab .shstrtab .interp .note.ABI-tag .note.gnu.build-id .gnu.hash .dynsym .dynstr .gnu.version .gnu.version_r .rela.dyn …

Hacking with listing local system locks

ABOUT lslocks lslocks lists information about all the currently held file locks in a Linux system. File locking is a mechanism that restricts access to a computer file by allowing only one user or process access at any specific time. Systems implement locking to prevent the classic interceding update scenario (see race condition). [bash] $lslocks …

Hacking with an arbitrary precision calculator

dc is a reverse-polish desk calculator which supports unlimited preci‐ sion arithmetic. It also allows you to define and call macros. Nor‐ mally dc reads from the standard input; if any command arguments are given to it, they are filenames, and dc reads and executes the contents of the files before reading from standard input. …

A program to solve project euler problem 11

[python] # This program is copied from http://code.jasonbhill.com/python/project-euler-problem-11/ # Largest product in a grid # https://projecteuler.net/problem=11 import time start = time.time() L = [] L.append("08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 08") L.append("49 49 99 40 17 81 18 57 60 87 17 …