Skip to content

Instantly share code, notes, and snippets.

View 911992's full-sized avatar

A⁻¹ 911992

View GitHub Profile
@911992
911992 / struct_padding.c
Created June 30, 2020 15:50
C Struct Padding Example
#include <stdio.h>
/*Author: https://github.com/911992*/
typedef struct s{
int b;
char f;
char _data[9];
};
#include <stdio.h>
/*learn C, the confusing approach*/
/*teacher: (⌐■_■)*/
/*student: (╯°□°)╯︵ ┻━┻*/
int main(void) ??<
char _vls<:012:>=\
<%0x43,040,105,0x73,0x20,0103,\
79,0x4f,76,-0%>;
printf("%s??/n", &(0x00??(_vls??)));
#include <stdio.h>
int main(void) {
int _jp_tsu = 'ッ';
printf("Tsu: %x\n",_jp_tsu);
return 0;
}
//out: Tsu: e38383
/*
* Copyright (c) 2020, https://github.com/911992 All rights reserved.
* License BSD 3-Clause (https://opensource.org/licenses/BSD-3-Clause)
*/
/*
sample_code_java0
File: Charset_Test.java
Created on: May 28, 2020 7:19:32 PM
@author https://github.com/911992
@911992
911992 / for_loop_asm.c
Created March 15, 2020 13:37
Using one loop(for ,e.g. 1 X 16) instead of two(for-for, e.g. 4X4) for performance stuffs
/**
#compile:
gcc -S -fverbose-asm -g -O0 <<FILE>>.c -O <<FILE>>.s
#asm
as -alhnd <<FILE>>.s > <<FILE>>.lst
#related course
https://www.youtube.com/watch?v=ulJm7_aTiQM
*/
/*using one loop instead of two (nested loop)*/
@911992
911992 / c_trigraphs_example.c
Created March 5, 2020 20:26
C trigraphs, and some little tip for obfuscating
%:include <stdio.h>
main(void) ??<
char _vls<:4:>=<%1,3,5,7%>;
printf("val:%d ??/n", 1??(_vls??) );
??>
/*
Above code equals to following code.
Prints 3.
*/