Skip to content

Instantly share code, notes, and snippets.

🐋
Thanks for the fish!

Fedor Indutny indutny

🐋
Thanks for the fish!
Block or report user

Report or block indutny

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View baumgarte-2.32.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@indutny
indutny / 00-totp.js
Last active Feb 28, 2020
TOTP collisions
View 00-totp.js
const { authenticator, hotp } = require('otplib');
const SECRET = authenticator.generateSecret();
const map = new Map();
const TOTAL = 100000;
const MAX_DIFFERENT = 1000000;
const STEP = 30;
const OFFSET = (Date.now() / 1000 / STEP) | 0;
View twitter-contest.js
!function() {
// Don't forget to scroll all the way down to load all replies!
const elems = document.body.querySelectorAll(
'div.original-permalink-page ' +
'li.ThreadedConversation:not(.ThreadedConversation--selfThread),' +
'li.ThreadedConversation--loneTweet');
for (const elem of elems) {
elem.style.border = '2px solid green';
View quiz.js
'use strict';
// Quiz:
//
// Implement `solution` function using only calls to API methods below and no
// other JS primitives (even math).
//
// Correct implementation will print "Success!" once executed
//
@indutny
indutny / crypto-browserify.svg
Last active Jul 4, 2017
crypto-browserify CommonJS dependency graph.
View crypto-browserify.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@indutny
indutny / info.md
Last active Nov 22, 2016
"Xcode - lldb" version correspondence
View info.md

Thank you for participation, we've managed to find these versions together:

  • xcode 8.2 - 360.1.68
  • xcode 8.1 - 360.1.65
  • xcode 8 - 360.1.50
  • xcode 7.3.1 - 350.0.21
  • xcode 7.3.0 - 350.0.21
  • xcode 7.2 - 340.4.119
  • xcode 7.1 - 340.4.110
  • xcode 7.0 - 340.4.70
@indutny
indutny / 0-HOWTO.md
Last active Nov 4, 2015
FLUSH+RELOAD in node.js
View 0-HOWTO.md

How to run this

  1. Take any binary that has OpenSSL functions listed in collect.js
  2. Open lldb /path/to/binary
  3. Do disas -n function-name for each function in collect.js
  4. Choose some offset near the end of the function
  5. Subtract 0x1000000000 to get file offset
  6. Put the number in collect.js
  7. Run node collect.js /path/to/binary | node filter.js > log
  8. Let it run for some time to collect enough information
@indutny
indutny / example.js
Created Oct 11, 2015
json-pipeline usage example
View example.js
// Just for viewing graphviz output
var fs = require('fs');
var Pipeline = require('json-pipeline');
var Reducer = require('json-pipeline-reducer');
var Scheduler = require('json-pipeline-scheduler');
//
// Create empty graph with CFG convenience
// methods.
View ciphers.d
#!/usr/sbin/dtrace -C -s
#pragma D option quiet
#pragma D option strsize=4096
#define PTR__SIZE sizeof(uint64_t)
struct SSL {
uint32_t version;
uint8_t pad[0x12c];
View iojs-c++-streams.md

stream_base: introduce StreamBase

StreamBase is a brand new way to write C++ streams. The class itself is for separting StreamWrap (with the methods like .writeAsciiString, .writeBuffer, .writev, etc) from the HandleWrap class, making possible writing abstract C++ streams that are not bound to any uv socket.

Important part of the abstraction is following methods (which mimics libuv's stream API):

You can’t perform that action at this time.