Skip to content

Instantly share code, notes, and snippets.

View kyle-go's full-sized avatar
🌴
On vacation

Kyle kyle-go

🌴
On vacation
View GitHub Profile
@kyle-go
kyle-go / compile-java.md
Last active August 29, 2018 03:03
How compile java to jar?

Main.java内容为:

package com.company;

public class Main {
    public static void main(String[] args) {
        System.out.println("Hello Java!");
    }
}
@kyle-go
kyle-go / main.cpp
Last active January 9, 2019 01:37
Check Windows is x64 or not
//
// ref:https://stackoverflow.com/questions/7011071/detect-32-bit-or-64-bit-of-windows
//
#include <windows.h>
#include <shlwapi.h>
#pragma comment(lib, "shlwapi.lib")
bool is_x64_system() {
if (sizeof(void*) == 8) {
// test.cpp : 定义控制台应用程序的入口点。
//
#include "stdafx.h"
#include <Windows.h>
#include <string>
#include <iostream>
@kyle-go
kyle-go / Crack.cpp
Last active April 19, 2019 06:10
内网通破解
/*
by https://www.52pojie.cn/thread-930853-1-1.html
*/
#include "windows.h"
#include "stdio.h"
#include <string>
#include <openssl/aes.h>
#pragma comment(lib, "libcrypto.lib")
@kyle-go
kyle-go / compress.cc
Last active June 17, 2019 01:44
Compress and Decompress with Windows API. BUT Decompress BUG on windows xp.
#include <windows.h>
#include <ctime>
#include <string>
/*
使用Windows api实现数据压缩与解压缩
重点说下RtlDecompressBuffer这个api,经过反复测试发现有2个问题
1. 某些情况下虽然给的解压缓冲区很小,但此API并不会返回STATUS_BAD_COMPRESSION_BUFFER,而是返回了STATUS_SUCCESS。
只是某些情况下会这样,并非100%复现,规律暂时没有找到,但我找到了一些可以复现的情况。
@kyle-go
kyle-go / main
Created December 6, 2019 06:53
netstat -ano -p tcp 枚举TCP链接
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <windows.h>
#include <Iphlpapi.h>
#include <tlhelp32.h>
#pragma comment(lib, "Iphlpapi.lib")
#pragma comment(lib, "WS2_32.lib")
int main()
@kyle-go
kyle-go / vm.py
Last active March 16, 2022 20:50
vmware poweron, poweroff, create_snapshot, delete_snapshot, revert_snapshot
# coding=utf-8
import sys
import atexit
from pyVmomi import vim, vmodl
from pyVim.connect import SmartConnectNoSSL, Disconnect
from pyVim.task import WaitForTask
def poweron(content, name):
@kyle-go
kyle-go / dllmain.cpp
Created March 9, 2020 06:26
Patch by version.dll
#include <windows.h>
#pragma comment (linker, "/export:GetFileVersionInfoA=c:\\windows\\system32\\version.GetFileVersionInfoA,@1")
#pragma comment (linker, "/export:GetFileVersionInfoByHandle=c:\\windows\\system32\\version.GetFileVersionInfoByHandle,@2")
#pragma comment (linker, "/export:GetFileVersionInfoExW=c:\\windows\\system32\\version.GetFileVersionInfoExW,@3")
#pragma comment (linker, "/export:GetFileVersionInfoSizeA=c:\\windows\\system32\\version.GetFileVersionInfoSizeA,@4")
#pragma comment (linker, "/export:GetFileVersionInfoSizeExW=c:\\windows\\system32\\version.GetFileVersionInfoSizeExW,@5")
#pragma comment (linker, "/export:GetFileVersionInfoSizeW=c:\\windows\\system32\\version.GetFileVersionInfoSizeW,@6")
#pragma comment (linker, "/export:GetFileVersionInfoW=c:\\windows\\system32\\version.GetFileVersionInfoW,@7")
#pragma comment (linker, "/export:VerFindFileA=c:\\windows\\system32\\version.VerFindFileA,@8")
@kyle-go
kyle-go / Element-Plus-BUG.vue
Created April 13, 2021 13:30
疑似element-plus的bug
<!--报错信息:-->
<!--runtime-core.esm-bundler.js?5c40:540 TypeError: Cannot read property 'style' of null-->
<!--at patchStyle (runtime-dom.esm-bundler.js?830f:104)-->
<!--at patchProp (runtime-dom.esm-bundler.js?830f:363)-->
<!--at patchProps (runtime-core.esm-bundler.js?5c40:4104)-->
<!--at patchElement (runtime-core.esm-bundler.js?5c40:4051)-->
<!--at processElement (runtime-core.esm-bundler.js?5c40:3871)-->
<!--at patch (runtime-core.esm-bundler.js?5c40:3788)-->
<!--at patchKeyedChildren (runtime-core.esm-bundler.js?5c40:4506)-->
<!--at patchChildren (runtime-core.esm-bundler.js?5c40:4449)-->
@kyle-go
kyle-go / url.js
Created September 8, 2022 07:44
URL param encode
// rfc3986
// https://datatracker.ietf.org/doc/html/rfc3986#section-1.1
const queryParams = { param1: '@*/+~!@#$&*()=:/,;?+\'~!*()', param2: 'value2-_.!~*\'()' }
const queryString = new URLSearchParams(queryParams).toString()
console.log(queryString)