{{ message }}

Instantly share code, notes, and snippets.

# Alekseyyy/ctf.2020.decompetition.baby-go.go

Last active Feb 17, 2022
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
 // baby-go reconstruction // by Aleksey // - https://alekseyyy.github.io // - @EpsilonCalculus / @EntropyThot package main import ( "fmt" "os" "strconv" ) func main() { // Good luck! if (len(os.Args) > 1) { input, err := strconv.Atoi(os.Args) if err == nil { if (input % 3 == 0 && input % 5 == 0) { fmt.Println("Green") } else if (input % 3 == 0) { fmt.Println("Yellow") } else if (input % 5 == 0) { fmt.Println("Blue") } else { fmt.Println(input) } } } }
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
 // fabulous reconstruction // by Aleksey // - https://alekseyyy.github.io // - @EpsilonCalculus / @EntropyThot // I stole some of my code from here... // ... (like how brett keane stole that poem about his mum): // https://www.thepolyglotdeveloper.com/2016/12/fibonacci-sequence-printed-golang/ package main import ( "fmt" "os" "strconv" ) func fib(k int) int { if k <= 1 { return k } return fib(k - 1) + fib(k - 2) } func main() { if (len(os.Args ) > 1) { input, err := strconv.Atoi(os.Args) if err == nil { fmt.Println(fib(input + 1)) } else { fmt.Println("1") } } }
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
 # "Quick and dirty" tool to compare similarity between two executables. # By Aleksey, https://alekseyyy.github.io # - @EpsilonCalculus on Twitter/Keybase # - @EntropyThot on decompetition.io # "Inspired" by Malware Data Science (2018, ch. 5) import sys J = lambda X, Y: float(len(X.intersection(Y))) / float(len(X.union(Y))) d_J = lambda X, Y: 1 - J(X, Y) if __name__ == "__main__": if len(sys.argv) < 2: print("please enter two disassembly strings as arguments") sys.exit() bin1 = sys.argv bin2 = sys.argv print("J(X, Y) =", J(bin1, bin2)) print("dJ(X, Y) =", J(bin1, bin2))
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
 /* * prime reconstruction * by Aleksey (mostly with help from Ghidra's recompiler :P) * - https://alekseyyy.github.io * - @EpsilonCalculus / @EntropyThot */ #include #include int is_prime(long n) { // TODO... int prime, local_c; if ((int) n < 2) prime = 0; else { if ((n == 2) || (n == 3)) prime = 1; else { if (((n & 1) == 0) || ((int)n % 3 == 0)) prime = 0; else { local_c = 5; while (local_c * local_c < (int)n) { if (((int)n % local_c == 0) || ((int)n % (local_c + 2) == 0)) return 0; local_c = local_c + 6; } prime = 1; } } } return prime; } int main(int argc, char** argv) { // IS PRIME? int x, y; if (argc != 2) { fprintf(stderr, "USAGE: %s \n", *argv); exit(1); } x = atoi((char*) argv); y = is_prime((long)x); printf("is_prime(%d) = %d\n", x, y); return 0; }