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) { |
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> | |
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
.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
.intel_syntax noprefix | |
.global __vs_strlen_sse2 | |
.section .text | |
__vs_strlen_sse2: | |
endbr64 | |
test rdi, rdi | |
jz .L_null | |
pxor xmm0, xmm0 |
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 | |
.file "__strlen_sse42" | |
.section .text, "ax" | |
.globl __vs_strlen_sse42 | |
__vs_strlen_sse42: | |
endbr64 | |
xor rax, rax |
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_avx2 | |
.section .text | |
__vs_strlen_avx2: | |
endbr64 | |
test rdi, rdi | |
jz .L_null | |
cmp byte ptr [rdi], 0 |
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_memmove_erms_aligned | |
.section .text | |
__vs_memmove_erms_aligned: | |
endbr64 | |
mov rax, rdi | |
test rdi, rdi |
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_memmove_erms | |
.section .text | |
__vs_memmove_erms: | |
endbr64 | |
mov rax, rdi | |
test rdi, rdi | |
jz .L_ret |
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 "vs_std.h" | |
#include "_vs_std.h" | |
#include <cpuid.h> | |
///////////////////////////// | |
// | |
// INCLUDES | |
// | |
///////////////////////////// |
OlderNewer