Skip to content

Instantly share code, notes, and snippets.

View mcdulltii's full-sized avatar
🈳
Bored

Aaron mcdulltii

🈳
Bored
View GitHub Profile
#include<iostream>
#include<stdlib.h>
#include<stdio.h>
using namespace std;
#define BUF_LEN 16
#define N 1
typedef unsigned long(*pFdummy)(void);
// Return hashes
#include <stdio.h>
__global__ void staticReverse(int *d, int n)
{
__shared__ int s[64];
int t = threadIdx.x;
int tr = n-t-1;
s[t] = d[t];
__syncthreads();
d[t] = s[tr];
#!/bin/sh
cat > client.c <<EOF
#include <stdio.h>
#include <unistd.h>
int main()
{
printf("Hello, World!: from %ld\n", (long)getpid());
return 0;
}
EOF
#pragma once
// Reference: https://github.com/guided-hacking/anti-debugging
#include <windows.h>
#include <Winternl.h>
#include <iostream>
// [1]
// Detect remote debugger using inbuilt function
// Source: https://github.com/sol-prog/x86-64-minimal-JIT-compiler-Cpp
#include <iostream>
#include <string>
#include <vector>
#include <unistd.h>
#include <sys/mman.h>
// Add the message size
void append_message_size(std::vector<uint8_t> &machine_code, const std::string &variable);
// Source: https://github.com/sol-prog/x86-64-minimal-JIT-compiler-Cpp
#include <iostream>
#include <string>
#include <vector>
#include <stdexcept>
#include <cstring>
#include <unistd.h>
#include <sys/mman.h>
global call_64_from_64
global call_32_from_64
global call_32_from_32
section .text
call_64_from_64:
mov rsi, rdi
mov rax, 1
mov rdi, 1
@mcdulltii
mcdulltii / OpHacks.c
Created January 7, 2021 15:58
IEEE Hacks
// Pretend a float is an int
inline unsigned int AsInt(float f) {
return *(unsigned int*) &f;
}
// Pretend an int is a float
inline float AsFloat(unsigned int i) {
return *(float*) &i;
}
@mcdulltii
mcdulltii / CircuitBreaker.md
Last active August 9, 2021 08:17
CTFSGCTF 2021 RE Writeups

Circuit Breaker

Reflective loading of embedded executable. Embedded executable uses opaque predicates, virtualizations and antialias techniques to obfuscate the decoding of a stored string based on 2nd-order Runge-Kutta and time. Rewrite binary to use input/hex instead of time to decode string.

Description (public)

I have signed up for a shady beta test regarding a Singaporean made Meme Generator. All they gave was this binary, which generates the same meme every time?! Whenever I exit, the binary goes funky too. (Though it does print something different ever so often, perhaps I can control that?)
@mcdulltii
mcdulltii / generate.py
Last active June 6, 2021 09:24
Random Sequence Generation using Recursion
import numpy as np
import random, sys
sys.setrecursionlimit(10**6)
class linkedseq:
def __init__(self, M, K):
# N: Length of sequence to generate
# K: Constraint for index generation
N = len(M)