Packet sniffer in Python with Scapy

The common method of making a packet sniffer in User-Space is to use low-level operations on RAW sockets. But, instead of that, you can just use a powerful Python library – Scapy (see documentation), which exposes a user-friendly high level API. So, it hides all unfortunately low-level abstraction which we don’t really like in Python. … Read more

Fast string comparison for microcontrollers (C/C++)

This short article presents trivial but fast and memory efficient function to compare two strings. Function returns “0” (zero) on success (strings are the same), otherwise function returns the position where different characters occurred. Example code #include <stdint.h> #include <assert.h> static int8_t xstrcmp(const char *s1, const char *s2) { while(*s1 != ‘\0’ && *s1 == … Read more

How to add custom section to ELF file?

All linux binary applications have a common ELF format (Executable and Linking Format). This format consist of header and variouse sections (see ELF Specification). The ELF allows you to attach custom sections with some extra user-data. It means that you can hide some usefull information inside a binary file (like library for example). Why you … Read more