Skip to content

Instantly share code, notes, and snippets.

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()
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;
@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;
@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 / text.txt
Created February 3, 2016 10:19
Spook1
Volume in drive D has no label.
Volume Serial Number is DAB7-C31C
Directory of D:\
03.02.2016 12:18 0 kek.log
03.02.2016 12:15 <DIR> program files
1 File(s) 0 bytes
Directory of D:\program files
@Learath2
Learath2 / test.nim
Created July 2, 2015 18:50
Nim test
let
num = 600851475143'i64
res = num / 3'i64
echo($res)
@Learath2
Learath2 / test.nim
Created July 2, 2015 18:49
nim i64
let
num = 600851475143
res = num / 3
echo($res)
@Learath2
Learath2 / lpf.nim
Created July 2, 2015 17:47
confused
discard """ proc createPrimeList(n: Natural): seq[int] =
result = @[2]
for i in 3..n:
for x in result:
if i mod x == 0:
break
else:
result.add(i)
"""
@Learath2
Learath2 / equ.nim
Created June 28, 2015 17:40
Calculator
from strutils import replace,find,parseInt
echo("Input an operation:")
var line = readLine(stdin)
line = replace(line, " ", "");
let
opindex = find(line, {'+','-','*','/'})
op = line[opindex]
@Learath2
Learath2 / srvlist.json
Created March 11, 2015 22:59
ServerList
[
{
"version": "Test",
"servername": "Test Server",
"mapname": "map",
"gametype": "Type",
"flags": 0,
"players": 3,
"maxplayers": 16,
"clients": 3,