This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.intel_syntax noprefix | |
.global __vs_strlen_slow | |
.section .text | |
__vs_strlen_slow: | |
endbr64 | |
test rdi, rdi | |
jz .L_ret_zero |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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 ^ '-'))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) { |
NewerOlder