Skip to content

Instantly share code, notes, and snippets.

View vxcute's full-sized avatar
💻
programming

astro vxcute

💻
programming
  • Alexandria, Egypt
View GitHub Profile
@Barakat
Barakat / IDTClient.c
Last active June 4, 2021 14:49
Windows x86 Interrupt Descriptor Table (IDT) hooking driver
//
// Windows x86 Interrupt Descriptor Table (IDT) hook test
//
// Barakat Soror (https://twitter.com/barakatsoror)
//
#include <Windows.h>
int main(void)
{
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include "x.h"
#include "datatypes.h"
// windbg use: !analyze -show 109
// As of 2/25/2019
0 : A generic data region
1 : Modification of a function or .pdata
2 : A processor IDT
3 : A processor GDT
4 : Type 1 process list corruption
5 : Type 2 process list corruption
6 : Debug routine modification
7 : Critical MSR modification
@LIJI32
LIJI32 / gameboy.py
Last active July 3, 2022 20:36
Game Boy loader script for IDA
import idaapi
from idc import *
logo = "CE ED 66 66 CC 0D 00 0B 03 73 00 83 00 0C 00 0D 00 08 11 1F 88 89 00 0E DC CC 6E E6 DD DD D9 99 BB BB 67 63 6E 0E EC CC DD DC 99 9F BB B9 33 3E".replace(" ", "").decode("hex")
registers = {
0xFF00: "rJOYP",
0xFF01: "rSB",
0xFF02: "rSC",
0xFF04: "rDIV",
/** By_Sean_Eron_Anderson [email protected] */
#include <stdbool.h>
#include <stdint.h>
#include <endian.h>
#define CHAR_BIT 8
void Compute_the_sign_of_an_integer() {
/*Compute the sign of an integer*/
@mjs3339
mjs3339 / GetProcessorInfo.cs
Created July 6, 2018 21:30
C# Get CPU Information using WMI
private static Dictionary<string, string> GetProcessorInfo()
{
ManagementObjectCollection moc;
var Processor = new Dictionary<string, string>();
try
{
moc = new ManagementObjectSearcher("select * from Win32_Processor").Get();
}
catch
@namazso
namazso / pdb_parser_lite.cpp
Created April 18, 2018 17:49
A lightweight PDB parser that retrieves type and symbol CodeView streams.
/* MIT License
*
* Copyright (c) namazso 2018
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@helinwang
helinwang / string.md
Last active March 7, 2024 01:23
How to call go from c with string (char *) as the parameter without making a copy

Here is the gist for showing how to send string from c to go without a copy, for sending an float32 array from c to go without copy, please see here

Below is the documentation for converting between a c string and a go string:

// From https://golang.org/cmd/cgo/
// A few special functions convert between Go and C types by making copies of the data. 
// Go string to C string
// The C string is allocated in the C heap using malloc.
// It is the caller's responsibility to arrange for it to be
// freed, such as by calling C.free (be sure to include stdlib.h