Skip to content

Instantly share code, notes, and snippets.

View mattlawer's full-sized avatar

Mathieu Bolard mattlawer

View GitHub Profile
@mattlawer
mattlawer / fr-mac.properties
Last active September 5, 2021 15:23
USB Rubber Ducky - French Mac Keyboard Layout
// French mac layout
MODIFIERKEY_ALT_SHIFT = 0x06
KEY_NON_US_100 = 100
// 32
ASCII_20 = KEY_SPACE
// 33 !
ASCII_21 = KEY_8
// 34 "
@mattlawer
mattlawer / fr-mc.json
Created March 28, 2019 11:33
Bash Bunny - French Mac Keyboard (fr-mc)
{
"__comment": "All numbers here are in hex format and 0x is ignored.",
"__comment": " ",
"__comment": "This list is in ascending order of 3rd byte (HID Usage ID).",
"__comment": " See section 10 Keyboard/Keypad Page (0x07)",
"__comment": " of document USB HID Usage Tables Version 1.12.",
"__comment": " ",
"__comment": "Definition of these 3 bytes can be found",
"__comment": " in section B.1 Protocol 1 (Keyboard)",
"__comment": " of document Device Class Definition for HID Version 1.11",
@mattlawer
mattlawer / dark-pineapple.css
Last active May 11, 2019 08:18
A black and yellow theme for the WiFi Pineapple
.truncated {
text-overflow: ellipsis;
overflow: hidden;
}
.uppercase {
text-transform: uppercase;
}
.table-layout-fixed {
@mattlawer
mattlawer / DisableGDB.swift
Created December 25, 2016 17:13
Disable GDB with Swift 3
import Foundation
func disable_gdb() {
let PT_DENY_ATTACH: CInt = 31
let handle = dlopen("/usr/lib/libc.dylib", RTLD_NOW)
let sym = dlsym(handle, "ptrace")
typealias PtraceAlias = @convention(c) (CInt, pid_t, CInt, CInt) -> CInt
let ptrace = unsafeBitCast(sym, to: PtraceAlias.self)
_ = ptrace(PT_DENY_ATTACH, 0, 0, 0)
dlclose(handle)
@mattlawer
mattlawer / gist:3db21a1264afdca0314c7183143438bc
Created September 18, 2016 17:28
DirectoryMonitor - Swift 3
/*
Copyright (C) 2016 Apple Inc. All Rights Reserved.
See LICENSE.txt for this sample’s licensing information
Abstract:
`DirectoryMonitor` is used to monitor the contents of the provided directory by using a GCD dispatch source.
*/
import Foundation