배너 로고 아이디를 확인해 주세요. (크롬에서 대문 우클릭하고 검사 누르시면 나옵니다.)
아이디는 임의로 수정해도 좋지만 다른 태그에서 이 이름(아이디)이 식별자로 쓰인다는 점에 주의하세요.
- | // Hack an unexported (private) member of a struct. | |
| // ptrToTargetStruct - a ptr to that struct. | |
| // member - name of an unexported field. | |
| func Hack(ptrToTargetStruct interface{}, member string) *TYPE_MEMBER { | |
| return *(**TYPE_MEMBER)(unsafe.Pointer(reflect.Indirect(reflect.ValueOf(ptrToTargetStruct)).FieldByName(member).UnsafeAddr())) | |
| } | |
| // | |
| // type TARGET struct { | |
| // privateMemer *TYPE_MEMBER | |
| // } |
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "log" | |
| "net/http" | |
| ) | |
| type _ReqRes struct { |
| MessageBoxW( | |
| NULL, | |
| (LPCWSTR)L"Resource not available\nDo you want to try again?", | |
| (LPCWSTR)L"Account Details 1", | |
| MB_ICONWARNING | MB_CANCELTRYCONTINUE | MB_DEFBUTTON2 | |
| ); |
| package main | |
| //#include "dllmain.h" | |
| import "C" |
| package main | |
| import "syscall" | |
| func main() { | |
| // equivalent to (HANDLE)GetModuleHandle(NULL); in C | |
| handle, _, _ := syscall.Syscall( | |
| syscall.NewLazyDLL("kernel32.dll").NewProc("GetModuleHandleW").Addr(), | |
| 1, 0, 0, 0, |
| package lpcwstr | |
| // #include <windows.h> | |
| // #include <wchar.h> | |
| // #include <WinNT.h> | |
| import "C" | |
| import ( | |
| "unicode/utf16" | |
| "unsafe" |
| package main | |
| import ( | |
| "errors" | |
| "log" | |
| "unsafe" | |
| ) | |
| func foo1() (err error) { | |
| defer func() { |
| package main | |
| import ( | |
| "log" | |
| "syscall" | |
| "unsafe" | |
| "github.com/nanitefactory/gominhook" // In order to use this package you need to have MinHook.x64.dll in your system. | |
| ) |
| func imageToColors(img image.Image) []color.Color { | |
| rect := img.Bounds() | |
| width := rect.Dx() | |
| height := rect.Dy() | |
| xFrom := rect.Min.X | |
| xTo := rect.Max.X | |
| yFrom := rect.Max.Y - 1 | |
| yTo := rect.Min.Y - 1 | |
| ret := make([]color.Color, width*height) |