Skip to content

Instantly share code, notes, and snippets.

View AXDOOMER's full-sized avatar
🖱️
Hacking

Alexandre-Xavier Labonté-Lamoureux AXDOOMER

🖱️
Hacking
View GitHub Profile
void sub_GAME_7F053A10(ALSoundState *state, coord3d *pos)
{
if (getPlayerCount() == 1)
{
PropRecord *p = g_CurrentPlayer->prop;
float ang = atan2f(pos->z - p->pos.z, pos->x - p->pos.x);
float theta = ang - DegToRad(g_CurrentPlayer->vv_theta) + 3.14159265f;
//if (theta < 0)
// theta += 6.2831853f;
@AXDOOMER
AXDOOMER / polymorphism-boxes.rs
Created July 22, 2021 02:14
Polymorphism with function calls in Rust
struct Chat;
struct Chien;
trait Bruiteur {
fn bruit(&self) -> &str;
}
impl Bruiteur for Chat {
fn bruit(&self) -> &str {
"Nyan"
// Shellcode executor
// Expects hex as a command line parameter
//
// Compile with: gcc -fno-stack-protector -z execstack main.c
#include <string.h>
#include <stddef.h>
#include <stdlib.h>
int main(int argc, char* argv[])
@AXDOOMER
AXDOOMER / ioctl.c
Created July 11, 2020 17:49
ioctl, opens CD drive
// https://manpages.courier-mta.org/htmlman2/ioctl.2.html
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <linux/cdrom.h>
#include <sys/ioctl.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
@AXDOOMER
AXDOOMER / linux_handling_interrupts_with_signals.c
Last active January 22, 2024 22:30
Handling interrupts with signals on Linux
#include <stdio.h>
#include <stdlib.h> // exit
#include <string.h> // memset
#include <unistd.h> // sleep
#include <signal.h>
// Enum for when the program is 32 bits
// Source: https://sites.uclouvain.be/SystInfo/usr/include/sys/ucontext.h.html
enum
{