Skip to content

Instantly share code, notes, and snippets.

View jay's full-sized avatar
🇺🇸

Jay Satiro jay

🇺🇸
  • New Rochelle, New York, United States
View GitHub Profile
@jay
jay / test-RtlGetNtVersionNumbers.c
Last active March 22, 2024 22:06
test of GetVersionExW, RtlGetVersion and RtlGetNtVersionNumbers on Windows 11.
/*
test of GetVersionExW, RtlGetVersion and RtlGetNtVersionNumbers on Windows 11.
can be built with cygwin/mingw/mingw-w64 gcc or microsoft cl.
https://cygwin.com/pipermail/cygwin/2024-March/255728.html
---
without manifest:
@jay
jay / Test-DLL-atexit-handler
Last active March 12, 2024 13:23
Test whether or not a DLL's atexit handler is called on FreeLibrary
@jay
jay / getaddrinfo.c
Last active February 19, 2024 20:42
Use getaddrinfo to retrieve addresses the same way libcurl does.
/* Use getaddrinfo to retrieve addresses the same way libcurl does.
Usage: getaddrinfo [-u] [-4|-6] [--] <host> [service|port]
curl bug report:
'Cannot resolve named proxy host when configured with async DNS'
https://github.com/curl/curl/issues/12955
* Copyright (C) 2024 Jay Satiro <raysatiro@yahoo.com>
https://curl.se/docs/copyright.html
@jay
jay / hooktest2.cpp
Last active November 24, 2023 21:43
Monitor *raw* mouse buttons and keypresses in Windows
/* hooktest2
Monitor *raw* mouse buttons, keypresses, everything but MOUSEMOVE via low level
mouse and keyboard hooks. I wrote this to help identify some bugs in Chrome and
software running on Dell laptops.
The program will exit when the caps lock key is pressed. You can change that in
the LowLevelKeyboardProc function.
g++ -Wall -o hooktest2 hooktest2.cpp && hooktest2
@jay
jay / curl ubuntu (update installed release).txt
Last active October 23, 2023 18:14
Notes for building and installing curl and OpenSSL in Ubuntu 16 x64 LTS
###############################################################################
#
# This is for when we have to update the installed version of curl, nghttp2 or
# openssl in Ubuntu 16 LTS. This is not a single script.
#
# https://gist.github.com/jay/d88d74b6807544387a6c
#
###############################################################################
#
@jay
jay / ListEasyHandles.c
Last active August 29, 2023 07:14
Use libcurl to add some easy handles to a multi handle, then list them.
/* Use libcurl to add some easy handles to a multi handle, then list them.
Usage: ListEasyHandles
curl-library mailing list thread:
'How to list easy handles from a multi handle'
https://curl.haxx.se/mail/lib-2016-06/0000.html
* Copyright (C) 2016 Jay Satiro <raysatiro@yahoo.com>
https://curl.se/docs/copyright.html
@jay
jay / ParseStream.c
Last active August 24, 2023 09:53
Parse a stream received by libcurl into sections.
/* Parse a stream received by libcurl into sections.
Usage: ParseStream
This program is the same as libcurl example getinmemory.c except that it also
parses the received data into sections.
A data section refers to attributes and data and is received in this format:
[[<4 bytes: attribute size><attributes><8 bytes: data size><data>]...]
@jay
jay / FixPEChecksum.cpp
Last active June 17, 2023 06:10
FixPEChecksum fixes the PE checksum in 32-bit and 64-bit PE files.
/* FixPEChecksum fixes the PE checksum in 32-bit and 64-bit PE files.
Usage: FixPEChecksum [--no-csv-header] [--dryrun] [--] <file> [[file]...]
cl /W4 FixPEChecksum.cpp
Copyright (C) 2018 Jay Satiro <raysatiro@yahoo.com>
All rights reserved. License GPLv3+: GNU GPL version 3 or later
<http://www.gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
@jay
jay / enablehttp2.pl
Last active December 24, 2022 20:36
Enable HTTP2 in libcurl's Visual Studio 2010+ project files.
#!/usr/bin/env perl
=begin comment
README
This script enables HTTP2 in libcurl's Visual Studio 2010+ project files.
You'll need to modify these in-script variables for the script to work:
$curldir
$nghttp2dir
@jay
jay / checkout-curl-release.pl
Last active December 15, 2022 04:18
fetch and checkout a curl release from the canonical repo
#!/usr/bin/env perl
=begin comment
README
./checkout-curl-release.pl <"latest" | tag | version>
This script fetches and checks out the release tag marked as "latest" (or
a user-specified release tag or version) from the canonical curl repo on
github, and then modifies the curl/libcurl version includes to use the version