Skip to content

Instantly share code, notes, and snippets.

View Unam3dd's full-sized avatar
🌑
Passionate about Cyber-Sécurity

sam0verfl0w Unam3dd

🌑
Passionate about Cyber-Sécurity
View GitHub Profile
@Unam3dd
Unam3dd / strlen_slow.s
Created May 30, 2023 16:33
Assembly strlen slow
.intel_syntax noprefix
.global __vs_strlen_slow
.section .text
__vs_strlen_slow:
endbr64
test rdi, rdi
jz .L_ret_zero
@Unam3dd
Unam3dd / ft_atoi_and_incrementation_trol.c
Created October 27, 2022 10:06
Trol Incrementation and ft_atoi
#include <stdio.h>
int ft_atoi(char *str)
{
long long to_dec = 0;
int neg = 1;
while (!(*str ^ ' ') || (*str >= '\t' && *str <= '\r'))
str = (char *)-~(unsigned long long)str; // Wtff dude
while ((!(*str ^ '+') || !(*str ^ '-')))
@Unam3dd
Unam3dd / bitwise-cheatsheet.txt
Created June 22, 2022 11:01
bitwise operators tricks
atoi example
https://fr.wikipedia.org/wiki/Table_de_v%C3%A9rit%C3%A9
Bitwise tricks
All these tricks are also used in cryptography and obfuscation methods.
AND
Take bits in bytes
@Unam3dd
Unam3dd / rot13.c
Last active October 22, 2021 12:46
Simple ROT13 Cipher
#include <stdio.h>
#define IS_ALPHA(c) ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
char *rot13_cipher(char *dst, char *src)
{
char *tmp = dst;
while (*src) {