Skip to content

Instantly share code, notes, and snippets.

View arthuredelstein's full-sized avatar

Arthur Edelstein arthuredelstein

View GitHub Profile
@arthuredelstein
arthuredelstein / tb-manual-screenshot-scripts.js
Created January 7, 2018 21:46
Handy scripts for making screenshots in tor browser. To use, paste in browser console. Then entergrabImage("image-dir", "imagestem", false);
let locales = ["ar", "de", /*"en-US",*/ "es-ES", "fa", "fr", "ja", "it",
"ko", "nl", "pl", "pt-BR", /*"ru",*/ "tr", "vi", "zh-CN"];
let listenOnce = (element, event, useCapture) => {
return new Promise(function (resolve, reject) {
let onEvent = function (ev) {
element.removeEventListener(event, onEvent, useCapture);
resolve(ev);
};
element.addEventListener(event, onEvent, useCapture);
@arthuredelstein
arthuredelstein / exits-failing-dns
Last active November 17, 2017 21:31 — forked from nusenu/exits-failing-dns
tor exits failing DNS (>80%) as per 2017-11-12
+------------------------------------------+--------------------+----------------------------------------------------------------------------+
| fingerprint | nickname | contact | contacted
+------------------------------------------+--------------------+----------------------------------------------------------------------------+
| DAB96CEA61CC039A803217035293FAB32645FDDA | kree | 0x02225522 Frenn vun der Enn (FVDE) <info AT enn DOT lu> | y
| B84F248233FEA90CAD439F292556A3139F6E1B82 | tollana | 0x02225522 Frenn vun der Enn (FVDE) <info AT enn DOT lu> | y
| 9BDEC15EAE422563716AFE0025B9E66C9D4CCEBD | freki | 0x02225522 Frenn vun der Enn (FVDE) <info AT enn DOT lu> | y
| B0279A521375F3CB2AE210BDBFC645FDD2E1973A | chulak | 0x02225522 Frenn vun der Enn (FVDE) <info AT enn DOT lu> | y
| 5D1
@arthuredelstein
arthuredelstein / 18101_windows_2.cpp
Created November 12, 2017 08:55
Intercepting the Open button
#include <windows.h>
#include <shobjidl.h>
#include <stdio.h>
void test_ifiledialog()
{
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED |
COINIT_DISABLE_OLE1DDE);
if (SUCCEEDED(hr))
{
#include <windows.h>
#include <shobjidl.h>
#include <Commdlg.h>
#include <stdio.h>
//
// Global Variables and declarations.
//
dom/base/DOMIntersectionObserver.cpp:425:44 8 signed integer overflow: 60000 * 60000 cannot be represented in type 'int'
gfx/cairo/cairo/src/cairo-fixed-private.h:327:8 12 signed integer overflow: 2147483618 - -2147483648 cannot be represented in type 'int'
gfx/cairo/cairo/src/cairo-fixed-private.h:329:7 12 signed integer overflow: 0 - -2147483648 cannot be represented in type 'int'
gfx/cairo/cairo/src/cairo-slope-private.h:49:22 24 signed integer overflow: 1603327488 - -1041034579 cannot be represented in type 'int'
gfx/cairo/cairo/src/cairo-slope-private.h:50:22 18 signed integer overflow: -2080005830 - 89450914 cannot be represented in type 'int'
gfx/cairo/cairo/src/cairo-spline.c:131:11 6 signed integer overflow: -1949475940 - 1890767425 cannot be represented in type 'int'
gfx/cairo/cairo/src/cairo-spline.c:132:11 6 signed integer overflow: -2146398472 - 2115431338 cannot be represented in type 'int'
gfx/cairo/cairo/src/cairo-spline.c:134:11 6 signed integer overflow: -1866
1:45.18 "../../../build/unix/gold/ld" --hash-style=both --eh-frame-hdr -m elf_x86_64 -shared -o libreplace_malloc.so /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crti.o /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/crtbeginS.o -L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9 -L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu -L/lib/x86_64-linux-gnu -L/lib/../lib64 -L/usr/lib/x86_64-linux-gnu -L/usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../.. -L/usr/lib/llvm-4.0/bin/../lib -L/lib -L/usr/lib -z defs -h libreplace_malloc.so /home/arthur/tor-browser/obj-x86_64-pc-linux-gnu/memory/replace/replace/tmpHF2Ywh.list -lpthread -lubsan -ldl -z noexecstack -z text --build-id -rpath-link /home/arthur/tor-browser/obj-x86_64-pc-linux-gnu/dist/bin -rpath-link /usr/local/lib -lstdc++ -lm -lgcc_s -lpthread -lc -lgcc_s /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/crtendS.o /usr/bin/../lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/crtn.o
1:45.18 /usr/bin/ld.gold.real: error: read-only segment
js/src/jit/MoveResolver.h:179:7 37159 load of value 3452816845, which is not a valid value for type 'Type'
obj-firefox/dist/include/mozilla/ipc/ProtocolUtils.h:616:39 23273 load of value 4142548140, which is not a valid value for type 'Mode'
dom/workers/Workers.h:169:23 16329 load of value 4294967295, which is not a valid value for type 'JSGCParamKey'
dom/workers/Workers.h:115:18 16326 load of value 4294967295, which is not a valid value for type 'JSGCParamKey'
js/xpconnect/src/XPCJSContext.cpp:425:56 11707 signed integer overflow: 2147483647 * 1000000 cannot be represented in type 'int'
gfx/thebes/gfxContext.h:474:10 11096 load of value 229, which is not a valid value for type 'bool'
gfx/layers/apz/util/InputAPZContext.cpp:58:30 9199 load of value 4142693320, which is not a valid value for type 'nsEventStatus'
gfx/skia/skia/src/core/SkArenaAlloc.cpp:74:39 8424 left shift of negative value -321365071
toolkit/components/telemetry/Telemetry.cpp:1991:24 7910 signed in
@arthuredelstein
arthuredelstein / dieharderFirefox.md
Created July 13, 2017 18:41
Building DieHarder allocator on Debian

Here's what worked for me.

Building dieharder:

git clone --recursive https://github.com/emeryberger/DieHard
cd DieHard/src
make linux-gcc-x86-64 TARGET=libdieharder

Then I needed to add the following to my Firefox .mozconfig:

I built the latest mozilla-central, https://github.com/mozilla/gecko-dev/commit/ef3cede9a5
using a .mozconfig with
`
ac_add_options --disable-jemalloc
ac_add_options --disable-replace-malloc
`
and then ran the firefox at obj.../dist/bin with
`
LD_PRELOAD=/home/arthur/DieHard/src/libdieharder.so ./firefox
`
@arthuredelstein
arthuredelstein / gist:4322a447ea87deb9882eb9478559832e
Created November 30, 2016 01:29
ff esr45/dieharder segfault traces
Program received signal SIGSEGV, Segmentation fault.
0x00007f685f0bf189 in NewStringDeflated<(js::AllowGC)1> (
cx=0x7f6892667c00,
s=0x7f687b179d80 u"b.navigator.mimeTypes[g.FLASH_MIME] is undefined", n=48)
at /home/arthur/tor-browser/js/src/vm/String.cpp:1036
1036 news.get()[i] = Latin1Char(s[i]);
(gdb) bt
#0 0x00007f685f0bf189 in NewStringDeflated<(js::AllowGC)1> (
cx=0x7f6892667c00,
s=0x7f687b179d80 u"b.navigator.mimeTypes[g.FLASH_MIME] is undefined", n=48)