Skip to content

Instantly share code, notes, and snippets.

[Theory]
[InlineData(typeof(string))]
[InlineData(typeof(byte))]
[InlineData(typeof(sbyte))]
[InlineData(typeof(short))]
[InlineData(typeof(ushort))]
[InlineData(typeof(int))]
[InlineData(typeof(uint))]
[InlineData(typeof(long))]
[InlineData(typeof(ulong))]
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 4.1.12-gentoo Kernel Configuration
#
#
# Gentoo Linux
#
CONFIG_GENTOO_LINUX=y
CONFIG_GENTOO_LINUX_UDEV=y
USE [master]
GO
/****** Object: StoredProcedure [dbo].[db_restore] Script Date: 2015-12-11 10:27:00 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
@Novakov
Novakov / usart.c
Created January 26, 2016 14:25
EFM32
USART_InitAsync_TypeDef init = USART_INITASYNC_DEFAULT;
init.enable = usartDisable;
CMU_ClockEnable(cmuClock_USART1, true);
GPIO_PinModeSet(gpioPortD, 0, gpioModePushPull, 1);
GPIO_PinModeSet(gpioPortD, 1, gpioModeInput, 0);
USART_InitAsync(USART, &init);
USART->ROUTE = USART_ROUTE_LOCATION_LOC1 | USART_ROUTE_RXPEN | USART_ROUTE_TXPEN;
package test;
import java.io.IOException;
import org.kohsuke.github.GHCommitState;
import org.kohsuke.github.GHRepository;
import org.kohsuke.github.GitHub;
public class Program {
@Novakov
Novakov / EnvInjectionHelper.fs
Last active March 11, 2016 21:17
[Blog] Ustawianie zmiennych srodowiskowych - implementacja
open System
let rec loop () =
let c = char (Console.Read())
let response = match c with
| 'E' -> "echo"
| 'S' ->
let varName = Console.ReadLine()
let varValue = Console.ReadLine()
@Novakov
Novakov / DllImports.fs
Last active March 14, 2016 21:22
[Blog] Wstrzykiwanie biblioteki DLL do procesu
[<DllImport("kernel32.dll", SetLastError = true)>]
extern bool WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, IntPtr lpBuffer, int nSize, int * lpNumberOfBytesWritten);
[<DllImport("kernel32.dll", SetLastError = true)>]
extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress, IntPtr dwSize, AllocationType flAllocationType, MemoryProtection flProtect);
[<DllImport("kernel32.dll")>]
extern IntPtr CreateRemoteThread(IntPtr hProcess, IntPtr lpThreadAttributes, UInt32 dwStackSize, IntPtr lpStartAddress, IntPtr lpParameter, UInt32 dwCreationFlags, IntPtr * lpThreadId);
[<DllImport("kernel32.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)>]
@Novakov
Novakov / findFunction.fs
Created March 20, 2016 20:29
[Blog]O szukaniu funkcji w procesie
let findFunction (processHandle: IntPtr) (library: string) (name: string) =
let library = ToolHelp.createSnapshot(ToolHelp.SnapshotFlags.Module ||| ToolHelp.SnapshotFlags.Module32) (GetProcessId(processHandle))
|> ToolHelp.modules
|> Seq.find (fun m -> m.ModuleName.Equals(library, StringComparison.InvariantCultureIgnoreCase))
let peFile = PeFile(library.ModulePath)
let func = peFile.ExportedFunctions |> Seq.find (fun f -> f.Name.Equals(name))
library.BaseAddress + (nativeint func.Address)
@Novakov
Novakov / Pather\paket.references
Last active March 23, 2016 20:53
[Blog] Paket i Fake
System.Collections.Immutable
CommandLineParser
PeNet
Antlr4.Runtime
@Novakov
Novakov / add_injections.xml
Last active March 31, 2016 07:02
[Blog] Pakowanie aplikacji z ILRepack
<Target Name="_AddInjections">
<ItemGroup>
<Injections Include="Injection.x86">
<Arch>x86</Arch>
</Injections>
<Injections Include="Injection.x64">
<Arch>x64</Arch>
</Injections>
</ItemGroup>
<ItemGroup>