Skip to content

Instantly share code, notes, and snippets.

View StefanoBelli's full-sized avatar

ste StefanoBelli

  • Rome, Italy
View GitHub Profile
SHELL=/bin/sh
AS=as
LD=ld
OBJS=obj.o obj1.o
OUT=executable
all:$(OBJS)
@for OBJ in $(OBJS); do echo -e "\tLD $$OBJ"; done
@$(LD) $(OBJS) -o $(OUT) && echo -e '\tOUT $(OUT)'
@StefanoBelli
StefanoBelli / nvapiinterface.cpp
Last active April 26, 2021 07:03
nvapi interface
#include <cstring>
#include <Windows.h>
#include <string>
#include <iostream>
#include <memory>
#include <vector>
#define MAKE_VERSION(stype, ver) static_cast<std::uint32_t>( sizeof(stype) | ((ver) << 16) )
@StefanoBelli
StefanoBelli / exhausted.cpp
Created September 17, 2018 02:56
twitch stream
//I don't like intel syntax..
//lemme see
#include <cstdint>
//i like stdcall...
//shit I am wasted
// I like using stdcall, so we used that calling convention
// (we don't have to worry about cleaning the stack and we just push arguments on the stack
// Returns: base ^ exp
std::uint32_t __stdcall pow_unsigned(std::uint32_t base, std::uint32_t exp) {
#ifndef PRINT_H
#define PRINT_H
#include <iostream>
#include <utility>
template<typename Ty>
void print(Ty&& p) { std::cout << std::forward<Ty>(p); }
template <typename First, typename ...Many>
#ifndef STATX_DEFINED_H
#define STATX_DEFINED_H
#include <unistd.h>
#include <linux/stat.h>
#include <sys/syscall.h>
#define statx(dirfd, pathname, flags, mask, buf) \
syscall(SYS_statx, dirfd, pathname, flags, mask, buf)
#!/bin/bash
# guess prefix based on an installed program
#
# give a program on your own
# ./guess-prefix.sh gcc
#
# or let the program consider "make"
# ./guess-prefix.sh
#
@StefanoBelli
StefanoBelli / print_loading_text.c
Last active July 3, 2018 12:00
Wasting time...
#include <stdio.h>
#include <ctype.h>
#define LOAD_INDICATOR(x_ch_ind) \
x_ch_ind = (x_ch_ind == '\\') ? '|' : \
(x_ch_ind == '|') ? '/' : \
(x_ch_ind == '/') ? '-' : \
(x_ch_ind == '-') ? '\\' : '-'
void print_loading_text(char* str, size_t len) {
@StefanoBelli
StefanoBelli / mmap_shellcode.c
Last active December 25, 2021 16:35
Run shellcode using mmap()
//gcc -m32 mmap_shellcode.c
//spawn a /bin/sh shell
#include <stdio.h>
#include <string.h>
#include <sys/mman.h>
unsigned char bytes[] = \
"\x31\xc0\x50\x68\x6e\x2f\x73\x68\x68\x2f\x2f\x62\x69\x89\xe3\x50\x89\xe2\x53\x89\xe1\xb0\x0b\xcd\x80";
int main() {
language: android
android:
components:
- tools
- platform-tools
- build-tools-28.0.3
- android-24
- sys-img-armeabi-v7a-android-24
licenses:
- 'android-sdk-license-.+'
00001101-0000-1000-8000-00805F9B34FB