Skip to content

Instantly share code, notes, and snippets.

@robert-wallis
robert-wallis / capture.cpp
Created March 1, 2013 08:43
Capture the raw screen pixels in OSX. Then saves to a file for debugging.
void captureScreen()
{
CGImageRef image_ref = CGDisplayCreateImage(CGMainDisplayID());
CGDataProviderRef provider = CGImageGetDataProvider(image_ref);
CFDataRef dataref = CGDataProviderCopyData(provider);
size_t width, height;
width = CGImageGetWidth(image_ref);
height = CGImageGetHeight(image_ref);
size_t bpp = CGImageGetBitsPerPixel(image_ref) / 8;
uint8 *pixels = malloc(width * height * bpp);
@retvil
retvil / [IOC] Free Steam (Add Beta)
Last active December 20, 2021 19:09
[IOC] Free Steam (Add Beta)
(function()
{
if( location.href.match( /^https:\/\/store\.steampowered\.com\/account\/?$/ ) === null )
{
alert( 'Please run this on Steam\'s account page details: https://store.steampowered.com/account/' );
return;
}
var freePackages =
[
@albertzsigovits
albertzsigovits / ida.txt
Created January 31, 2019 10:30
IDA Pro Tips and Tricks
# IDA Pro Keyboard shortcuts and tips:
######################################
Ctrl+E - Return to entry point
Alt+M - Set bookmark
Ctrl+M - List bookmarks
Space - Toggle full screen/workflow view
Esc - Backup to parent function
Ctrl+X - Find All X-References
Ctrl+R - Change reference information e.g deltas etc.
@superzazu
superzazu / sdl2_sinewave.c
Created May 29, 2019 07:24
Playing a sine wave with the SDL2
#include <stdio.h>
#include <SDL.h>
int main(void) {
SDL_Init(SDL_INIT_AUDIO);
// the representation of our audio device in SDL:
SDL_AudioDeviceID audio_device;
// opening an audio device: