Skip to content

Instantly share code, notes, and snippets.

View eahydra's full-sized avatar

Joseph eahydra

View GitHub Profile
@eahydra
eahydra / port.go
Created February 3, 2015 08:48
port forward
package main
import (
"flag"
"fmt"
"io"
"net"
)
func main() {
#include <windows.h>
#include <winioctl.h>
#include <ntddscsi.h>
#include <vector>
#include <cstdint>
bool check_is_ssd(char disk_letter)
{
std::string disk_path = "\\\\.\\";
disk_path += (char)toupper(disk_letter);
package main
import (
"encoding/binary"
"errors"
"fmt"
"io"
"net"
)
package main
import (
"fmt"
)
func SelectSort(data []int) {
if len(data) <= 1 {
return
}
package main
import (
"fmt"
)
func BubbleSort(data []int) {
n := len(data)
if n <= 1 {
return
package main
import (
"fmt"
)
func InsertSort(data []int) {
if len(data) <= 1 {
return
}
@eahydra
eahydra / inject.c
Last active January 25, 2020 02:41
VOID LoadImageNotifyRoutine(PUNICODE_STRING FullImageName, HANDLE ProcessId, PIMAGE_INFO ImageInfo)
{
PPROCESS_TABLE pProcess;
BOOLEAN ShouldInsertApc = FALSE;
BOOLEAN ForceDllInjection = TRUE;
NTSTATUS Status = STATUS_SUCCESS;
//锁进程链表
ProcessLock();
package main
import (
"fmt"
"io"
"io/ioutil"
"math/rand"
"os"
"strings"
)
package list
import "fmt"
type Element struct {
next, prev *Element
list *List
Value interface{}
}
package main
import "math/rand"
import "fmt"
func quicksort(data []interface{}, pred func(l interface{}, r interface{}) bool) {
if len(data) <= 1 {
return
}
i := rand.Int() % len(data)