Skip to content

Instantly share code, notes, and snippets.

@oblivia-simplex
oblivia-simplex / claude-docker-conversation.txt
Created April 14, 2023 17:29
Claude setting up a networking lab for me
LUCCA: I want to set up a small networking lab containing a handful of hosts running different OSes, where it's possible to move from any host on the network to any other, but where the connectivity graph isn't necessarily fully connected. could you please write me a docker compose file that implements this? 8 hosts would be sufficient.
WINTERMUTE: Here is a Docker Compose file that will deploy 8 Docker containers representing hosts on a small network with a topology that is not fully connected:
version: '3'
services:
host1:
image: ubuntu
networks:
- net1
@oblivia-simplex
oblivia-simplex / g3po-demo-before.c
Created April 14, 2023 17:27
Demonstration of G-3PO on Memory Copying Function from Canon Printer Firmware with GPT-4 and Claude
/* DISPLAY WARNING: Type casts are NOT being printed */
void * FUN_4520a9bc(uint *param_1,uint *param_2,size_t param_3)
{
undefined8 *puVar1;
undefined8 *puVar2;
uint *puVar3;
byte *pbVar4;
@oblivia-simplex
oblivia-simplex / g3po-demo-claude-after.c
Created April 14, 2023 16:32
Demonstration of G-3PO Annotating Decompiled Code with Anthropic's Claude v1.2: After
/* /--------------------------------------------------------------------------------\
|AI generated comment, take with a grain of salt: |
| |
| Here is my analysis of the code: |
| $param_1 -> src |
| $param_2 -> dst |
| $param_3 -> length |
| FUN_4520a9bc :: memcpy |
| This function appears to implement a memcpy function which copies length |
@oblivia-simplex
oblivia-simplex / g3po-demo-after.c
Created April 14, 2023 16:05
Demonstration of G-3PO Annotating a Binary Function: After
/* /--------------------------------------------------------------------------------\
|AI generated comment, take with a grain of salt: |
| |
| The function FUN_4520a9bc appears to be a custom implementation of the |
|memmove function, which copies a block of memory from one location to another, |
|handling overlapping regions correctly. |
| Let's start by renaming the variables and the function itself: |
| ``` |
| $param_1 -> $src |
@oblivia-simplex
oblivia-simplex / g3po-demo-before.c
Created April 14, 2023 15:57
Demonstration of G-3PO Annotating a Decompiled Binary: Before
/* DISPLAY WARNING: Type casts are NOT being printed */
void * FUN_4520a9bc(uint *param_1,uint *param_2,size_t param_3)
{
undefined8 *puVar1;
undefined8 *puVar2;
uint *puVar3;
byte *pbVar4;
@oblivia-simplex
oblivia-simplex / keybase.md
Created September 27, 2017 14:27
verification for keybase

Keybase proof

I hereby claim:

  • I am oblivia-simplex on github.
  • I am oblivia (https://keybase.io/oblivia) on keybase.
  • I have a public key whose fingerprint is 4355 B493 420C 9E65 A671 3C77 DCA4 8036 3F3D 0241

To claim this, I am signing this object:

/**
* Calls an array of arbitrary machine instructions as a subroutine,
* and returns a serialized representation of the register state at
* the end of the array's execution.
* No security features at all have been implemented. Intended
* application: AIM-GP (automatic induction of machine code through
* genetic programming), or something like that.
**/
unsigned char * code_call (unsigned char *code){
(defmacro call-code (code types-and-args)
"Pokes machine code into memory and calls it as a function.
Types-and-args should be an unquoted list of the form
:cffi-type-keyword argument :cffi-type-keyword argument [etc]
:cffi-type-keyword
where the final type keyword specifies the return type."
`(let ((ptr (cffi:foreign-alloc :unsigned-char
:initial-contents ,code)))
(unwind-protect
(cffi:foreign-funcall-pointer ptr () ,@types-and-args)
@oblivia-simplex
oblivia-simplex / disassemble-sequence.lisp
Created February 18, 2016 17:13
A couple of functions for disassembling arbitrary byte sequences in SBCL common lisp.
;;; A couple of functions for disassembling arbitrary byte sequences in SBCL common lisp.
(defun sapify (seq)
"Take a sequence of byte-sized integers and return the corresponding a system-area-pointer."
(sb-sys:vector-sap
(make-array (length seq)
:element-type '(unsigned-byte 8)
:initial-contents (coerce seq 'list))))
(defun disas-seq (seq len)
#include <stdio.h>
#include <string.h>
int f(void){
int i;
char arr1[64];
char arr2[64];
memset(arr1, 'X', 63);
memset(arr2, 'Y', 63);
arr1[63] = arr2[63] = '\0';