Skip to content

Instantly share code, notes, and snippets.

View 0xWDG's full-sized avatar
💻
Hacking my way around

Wesley de Groot 0xWDG

💻
Hacking my way around
View GitHub Profile
@0xWDG
0xWDG / PHP_Singleton.php
Created February 15, 2018 11:39
PHP_Singleton
<?php
// Singleton to connect db.
class ConnectDb {
  // Hold the class instance.
  private static $instance = null;
  private $conn;
  
  private $host = 'localhost';
  private $user = 'db user-name';
  private $pass = 'db password';
@0xWDG
0xWDG / 1. information.md
Last active May 20, 2018 22:18
Webkit bug

When a <table> is outside of <form> tag the <form> tag will be closed without any <input> fields.

which lead to an undeliverable form

If the <table> is within the <post> tag there is no problem.

@0xWDG
0xWDG / index.html
Created August 21, 2018 14:31
WIP Finder
<div class="container">
<div class="finder-window">
<div class="finder-header">
<div class="finder-window-controls">
<div class="finder-window-controls__close"></div>
<div class="finder-window-controls__minimize"></div>
<div class="finder-window-controls__maximize"></div>
</div>
</div>
<div class="finder-sidebar">
<!DOCTYPE html>
<html lang="en" >
<head>
<meta charset="UTF-8">
<title>TEST</title>
<style type="text/css">
html {
height: 100%;
}
* {
@0xWDG
0xWDG / DiCo.json
Last active November 2, 2018 13:49
DiCo.json
[{"ProfileName":"Wesley de Groot","ProfileImage":"https:\/\/scontent-ams3-1.xx.fbcdn.net\/v\/t1.0-9\/12540553_10200993236990571_1563581579900729933_n.jpg?_nc_cat=109&oh=1c6883e396a2111024c50f717ab3b6c1&oe=5C47D1EE","ProfileBio":"Hallo, ik ben Wesley \ud83d\ude03"},{"ProfileName":"Maike","ProfileImage":"https:\/\/scontent-ams3-1.xx.fbcdn.net\/v\/t1.0-9\/13529048_10153774785096365_8634972185709599875_n.jpg?_nc_cat=100&oh=426a8e849a1d37d0d3e847fbad41dd5b&oe=5C491061","ProfileBio":"Hallo, ik ben Maike :)"},{"ProfileName":"Mark","ProfileImage":"https:\/\/scontent-ams3-1.xx.fbcdn.net\/v\/t1.0-9\/22281683_10214013790916100_4143602397480062754_n.jpg?_nc_cat=108&oh=79ba66b75ce146233e813b2eeda9bc2b&oe=5C51AC9C","ProfileBio":"Hallo, ik........."},{"ProfileName":"Linda","ProfileImage":"https:\/\/proxy.duckduckgo.com\/iu\/?u=http%3A%2F%2Flindalimon.com%2Fwp-content%2Fthemes%2FEVA%2Fassets%2Fimg%2Flinda_logo_trans.png&f=1","ProfileBio":"Hallo, ik ben Linda!"},{"ProfileName":"God","ProfileImage":"https:\/\/proxy.duckduckgo.
@0xWDG
0xWDG / sendPush.txt
Created November 21, 2018 14:55 — forked from valfer/sendPush.txt
Sending Push Notification with HTTP2 (and PHP) see entire post at: http://coding.tabasoft.it/ios/sending-push-notification-with-http2-and-php/
<?php
/**
* @param $http2ch the curl connection
* @param $http2_server the Apple server url
* @param $apple_cert the path to the certificate
* @param $app_bundle_id the app bundle id
* @param $message the payload to send (JSON)
* @param $token the token of the device
* @return mixed the status code (see https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH101-SW18)
import Foundation
import UIKit
// Extend UIView
extension UIView {
/// Setup a struct for saving the gesture handlers
struct gestureHandler {
/// Gesture "Up"
static var up: (()->())? = nil
/// Gesture "Down"
@0xWDG
0xWDG / pdf_flatedecode.py
Created April 30, 2019 09:51 — forked from averagesecurityguy/pdf_flatedecode.py
Decompress FlateDecode Objects in PDF
#!/bin/bash
import re
import zlib
pdf = open("some_doc.pdf", "rb").read()
stream = re.compile(r'.*?FlateDecode.*?stream(.*?)endstream', re.S)
for s in stream.findall(pdf):
s = s.strip('\r\n')
try:
@0xWDG
0xWDG / Swizzle.md
Created April 1, 2020 12:55
Swizzle

Swizzle 1 works (somehow)

The login() function is in the extension The fakeLogin() function is in the main class

Swizzle 2 does not work as expected

The login() function is in the main class The fakeLogin() function is in the extension

Swizzle 3 does work as expected

The dynamic login() function is in the main class

@0xWDG
0xWDG / SecureLabel.swift
Created April 16, 2022 09:46 — forked from damian-rzeszot/SecureLabel.swift
_UITextLayoutCanvasView
import UIKit
lazy var hiddenView: UIView = {
let hiddenView: UIView
// iOS 14.1 -> _UITextFieldCanvasView
// iOS 15.0 -> _UITextLayoutCanvasView
if let klass = NSClassFromString("_UITextFieldCanvasView") as? UIView.Type {
hiddenView = klass.init()