Skip to content

Instantly share code, notes, and snippets.

View Fonger's full-sized avatar

Fonger Fonger

  • Taipei, Taiwan
  • 08:20 (UTC +08:00)
View GitHub Profile
Sub Main()
Dim i As Integer
Dim result As Integer
result = 1
For i = 1 To 5
result = result * i
Next
<?php
$browsers = array('firefox','chrome','safari','opera','msie');
$browser = new stdClass();
preg_match('#('.implode('|',$browsers).')(/| )([^ ]+)#i',$_SERVER['HTTP_USER_AGENT'],$match);
$browser->version = round((int)$match[3]);
$match = strtolower($match[1]);
foreach($browsers as $val)
{
@Fonger
Fonger / gist:ecc1f67062093fcacfa1
Last active October 5, 2019 13:15
CloudFlare JS Anti-DDoS Challenge
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
<meta name="robots" content="noindex, nofollow" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<title>Just a moment...</title>
<style type="text/css">
@Fonger
Fonger / gist:d2e7f8d67292c2d9585e
Created April 4, 2015 07:38
NimoHS.cpp (Deprecated HackShield CRCBypass DLL)
// =========================================================
// Name: NimoHS v1.0 Bypass AhnLab HackShield 5.2.8.893
// Date: November 1, 2009
// Author: nimo1993
// =========================================================
#include "stdafx.h"
#include "conio.h"
@Fonger
Fonger / gist:affa6e8d896382f39f6a
Created April 4, 2015 22:54
NimoMSHSCRC.cpp v1.1 HackShield CRC Bypass
// =========================================================
// Name: NimoMSHSCRC v1.1 Bypass AhnLab HackShield 5.3.5.1024
// Date: April, 14, 2010
// Author: nimo1993, thanks to the founder of MS CRC address.
// =========================================================
#include "stdafx.h"
//#include "conio.h"
DWORD MSCRCStart = 0x00401000, MSCRCEnd = 0x00BFE000;
var defaultEncoding = 1; // 1: Tranditional Chinese, 2: Simplified Chinese
var translateDelay = 0;
var cookieDomain = "http://your-site";
var msgToTraditionalChinese = "繁體";
var msgToSimplifiedChinese = "简体";
var translateButtonId = "translateLink";
var currentEncoding = defaultEncoding;
var targetEncodingCookie = "targetEncoding" + cookieDomain.replace(/\./g,"");
var targetEncoding = ( getCookie(targetEncodingCookie) == null ? defaultEncoding : getCookie(targetEncodingCookie) );
@Fonger
Fonger / strlcat_strlcpy.c
Created November 22, 2015 17:42
strlcat and strlcpy for linux
#ifndef HAVE_STRLCAT
/*
* '_cups_strlcat()' - Safely concatenate two strings.
*/
size_t /* O - Length of string */
strlcat(char *dst, /* O - Destination string */
const char *src, /* I - Source string */
size_t size) /* I - Size of destination string buffer */
{
@Fonger
Fonger / HideModule.cpp
Last active January 5, 2023 04:15
Hide DLL ( 32bit and 64bit support)
#include "stdafx.h"
#include "HideModule.h"
std::vector<UNLINKED_MODULE> UnlinkedModules;
void RelinkModuleToPEB(HMODULE hModule)
{
std::vector<UNLINKED_MODULE>::iterator it = std::find_if(UnlinkedModules.begin(), UnlinkedModules.end(), FindModuleHandle(hModule));
if (it == UnlinkedModules.end())
@Fonger
Fonger / VMProtectSDK64.inc
Last active January 3, 2018 12:26
VMProtect 64 bit masm header file for MASM for x64(ml64.exe) on Visual Studio
; protection
VMProtectBegin PROTO :DWORD
VMProtectBeginVirtualization PROTO :DWORD
VMProtectBeginMutation PROTO :DWORD
VMProtectBeginUltra PROTO :DWORD
VMProtectBeginVirtualizationLockByKey PROTO :DWORD
VMProtectBeginUltraLockByKey PROTO :DWORD
VMProtectEnd PROTO
; utils

Stylebot Patterns

stylebot.me has been down for a while, so I create this gist to help those who need document on pattern settings.

Basic (default)

By default, Stylebot uses simple text strings to match styles to websites. Examples:

  • docs.google.com : Matches any URL with docs.google.com in it.
  • docs.google.com, spreadsheets.google.com : Matches any URL with docs.google.com or spreadsheets.google.com in it.

Advanced

Stylebot supports wildcards **, * and ,