Skip to content

Instantly share code, notes, and snippets.

View wqweto's full-sized avatar

Vladimir Vissoultchev wqweto

View GitHub Profile
@wqweto
wqweto / cPrintersCombo.cls
Last active April 25, 2024 15:10
Based on [Retrieving icons of current user printers](https://stackoverflow.com/a/1183185/40691)
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cPrintersCombo"
Attribute VB_GlobalNameSpace = False
@wqweto
wqweto / mdAesCtr.bas
Last active March 29, 2024 19:02
[VB6/VBA] Simple AES 256-bit password protected encryption
'--- mdAesCtr.bas
Option Explicit
DefObj A-Z
#Const HasPtrSafe = (VBA7 <> 0) Or (TWINBASIC <> 0)
'=========================================================================
' API
'=========================================================================
@wqweto
wqweto / mdTea.bas
Created March 17, 2024 10:58
[VB6/VBA] Wheeler & Needham’s Tiny Encryption Algorithm
'--- mdTea.bas -- Wheeler & Needham’s Tiny Encryption Algorithm
Option Explicit
DefObj A-Z
#Const HasPtrSafe = (VBA7 <> 0)
#Const HasOperators = (TWINBASIC <> 0)
#If HasPtrSafe Then
Private Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As LongPtr)
#Else
@wqweto
wqweto / README.md
Last active March 13, 2024 14:08
Signing Web Service

How to use

You can use it from command line with curl like this

c:> curl -sSL -F file=@project1.exe http://localhost:4500/sign -o project1_signed.exe --fail || echo failed
@wqweto
wqweto / mdJson.bas
Last active January 13, 2024 18:43
JSON parsing/dumping functions with JSON path support for VB6 and VBA
'=========================================================================
'
' https://github.com/Unicontsoft/UcsFiscalPrinters/blob/master/src/UcsFP20/Shared/mdJson.bas
' JSON parsing and dumping functions with JSON path support
'
'=========================================================================
Option Explicit
DefObj A-Z
Private Const MODULE_NAME As String = "mdJson"
@wqweto
wqweto / mdAES.bas
Last active January 11, 2024 14:22
Pure VB6 impl of AES in CBC, CTR, GCM and CCM modes
'--- mdAES.bas
Option Explicit
DefObj A-Z
#Const HasPtrSafe = (VBA7 <> 0)
#Const HasOperators = (TWINBASIC <> 0)
#If HasPtrSafe Then
Private Declare PtrSafe Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As LongPtr)
Private Declare PtrSafe Function ArrPtr Lib "vbe7" Alias "VarPtr" (Ptr() As Any) As LongPtr
@wqweto
wqweto / check_vat.php
Last active December 14, 2023 11:00
Check company VAT number using SOAP service at http://ec.europa.eu and return JSON encoded result
<?php
header('Content-type: application/json; charset=utf8');
$vatno = str_replace(array(' ', '.', '-', ',', '"'), '', $_GET['vatno']);
echo serviceCheckVat($vatno, &$name, &$address, &$error);
/*
include "connect.php";
mysql_query("SET NAMES utf8");
$vatno = mysql_real_escape_string($_GET['vatno']);
@wqweto
wqweto / mdAesCbc.bas
Last active August 3, 2023 20:20
[VB6/VBA] openssl compatible AES-256 in CBC mode and PBKDF2 w/ SHA-512 for WinXP using legacy CryptoAPI
'--- mdAesCbc.bas
Option Explicit
DefObj A-Z
#Const HasPtrSafe = (VBA7 <> 0) Or (TWINBASIC <> 0)
'=========================================================================
' API
'=========================================================================
@wqweto
wqweto / program.cs
Last active August 1, 2023 08:31
Minimal .Net Web Server with Regex Routing in 177 LOC of C#
//
// Poor Man's Web Server with Regex Routing in 177 LOC of C#
//
// This is a simple standalone http server that handles routing with regular expressions
// matching. For each request the router passes capture groups to handlers as a data dictionary.
//
// Router implementation constructs a single composite regex to match request path, based on
// https://nikic.github.io/2014/02/18/Fast-request-routing-using-regular-expressions.html
//
// One can use `WebServer` and `Router` classes alone, just has to register all custom
@wqweto
wqweto / mdJson.bas
Last active July 4, 2023 12:28
JSON parsing and dumping functions in VB6
see https://gist.github.com/wqweto/e92dce63a68cd3ff9ca91b053b9510c9