Skip to content

Instantly share code, notes, and snippets.

@Learath2
Learath2 / strtoi.c
Created January 20, 2017 00:22
strtoi
int strtoi(const char *nptr, char **endptr, int base)
{
long n = strtol(nptr, endptr, base);
if(n > INT_MAX){
errno = ERANGE;
return INT_MAX;
}
else if(n < INT_MIN){
errno = ERANGE;
@Learath2
Learath2 / agc.h
Created February 9, 2020 17:37
Abstract GV
#include <game/server/gamecontext.h>
/*
Interface: IGameController
Abstract base class for gamecontrollers
*/
class IGameController
{
class CGameContext *m_pGameContext;
import java.awt.Color;
import ghidra.app.script.GhidraScript;
import ghidra.app.tablechooser.*;
import ghidra.program.model.address.Address;
public class Demo extends GhidraScript {
class ResultRow implements AddressableRowObject {
private Address address;
func HookOpaqueTypeToFromMap(from reflect.Value, to reflect.Value) (v interface{}, err error) {
v = from.Interface()
anonMapType := reflect.TypeOf(map[string]interface{}{})
// Passthrough if we are not mapping to/from map[string]interface{}
if (to.Type() != anonMapType && from.Type() != anonMapType) || to.Type() == from.Type() {
return
}
otherVal, otherType := from, from.Type()
@Learath2
Learath2 / CV.tex
Created August 19, 2025 16:44
CV template
%! TeX program = lualatex
\documentclass{article}
\newlength{\myheadlen}
\setlength{\myheadlen}{4.2cm}
\newlength{\myfootlen}
\setlength{\myfootlen}{1cm}