Skip to content

Instantly share code, notes, and snippets.

@errzey
errzey / sym.sh
Last active August 30, 2017 18:15
stupid shell script that tries to find a specific symbol in libs.
#!/usr/bin/env bash
# runs through your ld paths and looks for a symbol
# passed as the first argument
#
# example:
#
# $ ./lz.findsymbol.sh xcb_big_requests_id
# /usr/lib/x86_64-linux-gnu/libcairo.a
# /usr/lib/x86_64-linux-gnu/libxcb.a
@errzey
errzey / example_usage.c
Last active February 2, 2022 10:22
trx-1 / trx-2 api in one header
/*
Output is something like:
ellzey@bluedream ~/Code/libtrx/src ./example
line1:
line2: ALM EBRCS
line3: TGRP psDr
line4: A2D
line5: ALCO Northwest S
line6: RadioID: 2DF98B
@errzey
errzey / ssbug.md
Last active October 24, 2020 07:30

Lets take a look at the vulnerable code:

if (s->servername_done == 0) {
    switch (servname_type) {
        case TLSEXT_NAMETYPE_host_name:
            if (s->session->tlsext_hostname == NULL) {
                if (len > TLSEXT_MAXLEN_host_name ||
                    ((s->session->tlsext_hostname = OPENSSL_malloc(len + 1)) == NULL)) {
 *al = TLS1_AD_UNRECOGNIZED_NAME;
@errzey
errzey / simple_elf_crawler.c
Created September 19, 2016 03:39
ELF section / symbol crawler in 20 lines of code using liblz_elf
#include <liblz.h>
#include <liblz/lzapi.h>
#include <liblz/lz_elf.h>
static int __print_symbol(lz_elf_symbol * symbol, void * args) {
printf(" Symbol name: %s\n", lz_elf_symbol_get_name(symbol));
return 0;
}
static int __print_section(lz_elf_section * section, void * arg) {
printf("Section name : %s\nSections count: %zu\n", lz_elf_section_get_name(section), lz_elf_section_get_nsyms(section));
@errzey
errzey / EBRCS_p25_phaseII.py
Created August 10, 2016 18:33
East Bay Regional Communications System TG UID generator. (Moto P25 PhaseII)
#!/usr/bin/env python
if __name__ == '__main__':
stuff = {
'Paramedics Plus' : [(3030000, 3030999)],
'Alameda Co SO Consoles' : [(3011000, 3011999)],
'Alameda Co FD Consoles' : [(3013000, 3013999)],
'Alameda Co FD' : [(3035000, 3035999)],
'Alameda PD Console' : [(3088100, 3088199)],

Keybase proof

I hereby claim:

  • I am ellzey on github.
  • I am strcpy (https://keybase.io/strcpy) on keybase.
  • I have a public key whose fingerprint is D0D6 688E 39FC E3B9 D575 8531 E8DF 9CA0 8131 CBFF

To claim this, I am signing this object:

@errzey
errzey / sidebar-brew.md
Created October 27, 2015 23:07
fixing brew for sidebar patch

The sidebar patch is no longer included in the brew recipe, which sucks.

You can grab the newest patches here: http://www.lunar-linux.org/mutt-sidebar/

Here is how to edit brew to apply the patch without errors:

  • brew edit mutt
  • add option "with-sidebar-patch", "Apply sidebar patch
  • add:
@errzey
errzey / AREADME.md
Last active August 29, 2015 14:20
Using the libevhtp thrift module

Using the libevhtp thrift module

Just copy all this stuff to a directory (compile thrift with the libevhtp module of course first)

mkdir build; cd build; cmake .. ; make
./evhtp_thrift_server &
# if you have SO_REUSEPORT support, you can run multiple times.
./test1_client
@errzey
errzey / gist:472ac7c6c6f3ca09ca94
Created April 12, 2015 17:34
psuedocode for kernelcorn
struct query {
struct event * r_pipe_ev;
int r_pipe; /* response pipe */
int q_pipe; /* query pipe */
int response[256];
};
static void
read_response(int sock, short events, void * arg) {
struct query * q = (struct query *)arg;
evhtpexp app = express();
express_cb_s foocb = onGet(app, "/foo",
func void(evreq r, void * a) {
reply(r, "FOOO");
});
express_cb_s barcb = onGet(app, "/bar",
func void(evreq r, void * a) {
reply(r, "BARRR");