(draft; work in progress)
See also:
- Compilers
- Program analysis:
- Dynamic analysis - instrumentation, translation, sanitizers
(draft; work in progress)
See also:
| /* @(#) converts datasploit text dumps to CSV, consumable by other tools | |
| * @(#) copyright 2018 Stefan Edwards, released under ISC license | |
| */ | |
| #include <stdio.h> | |
| #include <string.h> | |
| #include <stdint.h> | |
| #include <regex.h> | |
| int etlfile(FILE *, regex_t *, regex_t *); |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "bufio" | |
| "strings" | |
| ) | |
| func main() { |
| # change to whatever location to where homebrew is installed | |
| if [ -z "$HOMEBREW_HOME" ]; then | |
| export HOMEBREW_HOME=$HOME/homebrew | |
| echo "HOMEBREW_HOME=$HOME/homebrew" >> ~/.profile | |
| fi | |
| # install homebrew for single user | |
| if [ ! -d "$HOMEBREW_HOME" ]; then | |
| mkdir -p $HOMEBREW_HOME && curl -L https://github.com/Homebrew/homebrew/tarball/master | tar xz --strip 1 -C $HOMEBREW_HOME | |
| fi |
| import sys | |
| defaults = { | |
| 'PR': {'H': 'High (H)', 'L': 'Low (L)', 'N': 'None (N)'}, | |
| 'A': {'H': 'High (H)', 'L': 'Low (L)', 'N': 'None (N)'}, | |
| 'C': {'H': 'High (H)', 'L': 'Low (L)', 'N': 'None (N)'}, | |
| 'I': {'H': 'High (H)', 'L': 'Low (L)', 'N': 'None (N)'}, | |
| 'AC': {'H': 'High (H)', 'L': 'Low (L)'}, | |
| 'S': {'C': 'Changed (C)', 'U': 'Unchanged (U)'}, | |
| 'UI': {'R': 'Required (R)', 'N': 'None (N)'}, |
| #include <stdio.h> | |
| int | |
| main(void) { | |
| int i = 0, j = 5; | |
| printf("%d, %d, %d\n", i, -~i, ~-i); // 0, 1, -1 | |
| printf("%d, %d, %d\n", j, -~j, ~-j); // 5, 6, 4 | |
| return 0; |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <stdint.h> | |
| uint64_t | |
| fnv(char *key, uint32_t len) | |
| { | |
| uint64_t hash = 14695981039346656037; | |
| uint32_t idx = 0; | |
| for(; idx < len; idx++) |
| $ time ./run_hydra.ss hydra_s1.ss | |
| 55 | |
| 6765 | |
| 832040 | |
| 2178309 | |
| real 0m0.830s | |
| user 0m0.655s | |
| sys 0m0.046s |
| (define (hydra@load src-file) | |
| "an implementation of the primitive procedure load" | |
| (with f (open src-file :read) | |
| (with-exception-handler | |
| (fn (x) (display (format "An error occured while loading ~S: ~a\n" src-file x)) (close f)) | |
| (fn () | |
| (letrec ((loop (fn (expr) | |
| (if (eq? expr #e) | |
| #v | |
| (begin |
| procedure TClipper.IntersectEdges(e1,e2: PEdge; | |
| const pt: TIntPoint; protects: TIntersectProtects = []); | |
| procedure DoEdge1; | |
| begin | |
| AddOutPt(e1, e2, pt); | |
| SwapSides(e1, e2); | |
| SwapPolyIndexes(e1, e2); | |
| end; | |
| //---------------------------------------------------------------------- |