Skip to content

Instantly share code, notes, and snippets.

View DJm00n's full-sized avatar

Dimitriy Ryazantcev DJm00n

View GitHub Profile
@DJm00n
DJm00n / OpenSSL-1_1_0-stable-VS2015.md
Created January 9, 2018 12:46 — forked from terrillmoore/OpenSSL-1_1_0-stable-VS2015.md
Building OpenSSL 1.1.0 with Microsoft VS 2015

Building OpenSSL 1.1.0 with Microsoft VS 2015

MCCI needs OpenSSL for a Windows project (that will be cross-platform). A casual search didn't turn up either a good source for cross-platform libraries, which meant we have to build them ourselves. A deeper search found a detailed guide here, and yet the details don't match what I found when I checked out the code; and the post doesn't talk about doing it directly from GitHub (which I wanted to do).

Here's the procedure for building OpenSSL on 64-bit Windows 10, with Visual Studio 2015.

  1. If you don't have it, please install git bash from git-scm.com.
  2. Start a git bash window.

    In the following, I'll use lines beginning with {dir} $ to designate input to a bash Window. We'll also have to use a cmd.exe Window for much of the build, and those lines will be marked {dir}>, just as on Windows..

#include <iphlpapi.h>
struct iflist {
wchar_t name[50];
struct sockaddr_in sin;
int ifidx;
};
void getiflist(struct iflist *list, int *listLen)
{
@DJm00n
DJm00n / utf8.cpp
Last active November 19, 2019 11:58
#include <iostream>
#include <Windows.h>
int main()
{
SetConsoleCP(CP_UTF8);
SetConsoleOutputCP(CP_UTF8);
std::cout << "GetConsoleCP()=" << GetConsoleCP() << ", GetConsoleOutputCP()=" << GetConsoleOutputCP() << std::endl;
std::cout << "GetACP()=" << GetACP() << std::endl;
MIIBqjCBsAYJKoZIhvcNAQUNMIGiMEMGCSqGSIb3DQEFDDA2BCCM6a4iNcV1ZkQaJJc4n7wSULd469F2
jWYCwQxLwV4BQgICJxAwDgYKKoYkAgEBAQEBAgUAMFsGCyqGJAIBAQEBAQEDMEwECJF27pUuqlxyBECp
1utF8TxwgoDElnsjH16t9ljrpMA3KR042WvwJcpOF/jpcg3GFbQ6KJdfC8Heo2Q4tWTqLBef0BI+bbj6
xXkEBIH01WwfhTQoZMqNpVDtZxUC8pu0vlnbFn/6DNVVyZGFLbQ1yX4QJjrPyEkDYcBHnoTBUvFcXXJG
3S7S8vtSmJ85c7Jtyk8B0AMhB+F8bmhxV/9pLPuBohTlq6r7lbj6HBmSccmWwVPQEPPvf8MS90F47E3r
dXeF1piuxllB4TEUl7j/ALWXGxhcBrfUyqee6Fq2v2/COc8U4JWZm3DZhQ/+MPp0buePLL+l+7rXDgHj
AHARhCyoLIQEg0UUbMKv4In5MyYefucxAWHsPnlp7Lhc7RlgSmADTiVk48MLU9qRQylp3/JRJG7rL5My
HnhsVRUvvWyvUw==
@DJm00n
DJm00n / gipHidGamepadDescriptor.txt
Last active May 8, 2021 02:16
xusb.sys HID Report Descriptors
//--------------------------------------------------------------------------------
// Report descriptor data in hex (length 262 bytes)
//--------------------------------------------------------------------------------
// 05010905 A101A100 09300931 150027FF FF000095 02751081 02C0A100 09330934
// 150027FF FF000095 02751081 02C00501 09321500 26FF0395 01750A81 02150025
// 00750695 01810305 01093515 0026FF03 9501750A 81021500 25007506 95018103
// 05091901 290A950A 75018102 15002500 75069501 81030501 09391501 25083500
@DJm00n
DJm00n / DualSense_WASAPI_Vibration.cpp
Created April 13, 2022 10:56 — forked from Ohjurot/DualSense_WASAPI_Vibration.cpp
Minimal demo to get the DualSense controller vibrating using the haptic feedback (Audio device channel 3 and 4)
#include <Windows.h>
#include <avrt.h>
#include <string>
#include <sstream>
#include <initguid.h>
#include <Mmdeviceapi.h>
#include <audioclient.h>
@DJm00n
DJm00n / code.cpp
Created May 29, 2022 18:10
GetDefaultLayout() from input.dll
/* WARNING: Could not reconcile some variable overlaps */
void GetDefaultLayout(LPCWSTR param_1,wchar_t *param_2,uint *param_3)
{
LSTATUS LVar1;
uint uVar2;
ulonglong uVar3;
undefined **ppuVar4;
@DJm00n
DJm00n / Devices.Abstraction.winmd
Last active October 3, 2022 15:02
Xbox Accesiories App
namespace Devices.Abstraction {
// {2C424946-00A9-47BB-BEB9-D7DCA5C7B7D1}
[Windows.Foundation.Metadata.Guid(742541638u, 169, 18363, 190, 185, 215, 220, 165, 199, 183, 209)]
public interface IHidControllerStatics
// {5B6949A8-F5E4-4264-8735-55CD757A8E44}
[Windows.Foundation.Metadata.Guid(1533626792u, 62948, 16996, 135, 53, 85, 205, 117, 122, 142, 68)]
public interface IHidController : IGameController
SHGetKnownFolderPath
FOLDERID_SavedGames
{4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4}
@DJm00n
DJm00n / gist:34fba6e2b2f57e706e780214eb490281
Created November 12, 2022 07:34
CTransBmp::CreateMask(CDC* pDC)
void CTransBmp::CreateMask(CDC* pDC)
{
m_hbmMask = new CBitmap;
// Nuke any existing mask
if (m_hbmMask) m_hbmMask->DeleteObject();
// Create memory DCs to work with
CDC* hdcMask = new CDC;
CDC* hdcImage = new CDC;