Skip to content

Instantly share code, notes, and snippets.

View wqweto's full-sized avatar

Vladimir Vissoultchev wqweto

View GitHub Profile
@wqweto
wqweto / mdSha3.bas
Last active July 9, 2024 11:02
[VB6/VBA] SHA-3 pure VB implementation
'--- mdSha3.bas
Option Explicit
DefObj A-Z
#Const HasPtrSafe = (VBA7 <> 0)
#Const LargeAddressAware = (Win64 = 0 And VBA7 = 0 And VBA6 = 0 And VBA5 = 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)
@wqweto
wqweto / SimpleAES.cs
Last active October 27, 2022 03:35
Simple PBKDF2 based AES-256 encryption
public class SimpleAES
{
private const int SALT_SIZE = 8;
private const int KEY_SIZE = 256;
public static string Encrypt(string text, string passphrase)
{
byte[] result = null;
if (Encrypt(Encoding.UTF8.GetBytes(text), passphrase, ref result))
{
'--- mdSerialNumber.bas
Option Explicit
DefObj A-Z
#Const HasPtrSafe = (VBA7 <> 0) Or (TWINBASIC <> 0)
'=========================================================================
' API
'=========================================================================
@wqweto
wqweto / mdStreamSupport.bas
Last active November 18, 2022 08:58
[VB6/VBA] IStream wrapper module
'--- mdStreamSupport.bas
Option Explicit
DefObj A-Z
#Const HasPtrSafe = (VBA7 <> 0) Or (TWINBASIC <> 0)
'=========================================================================
' API
'=========================================================================
@wqweto
wqweto / usp_adm_CreateLinkView.sql
Last active January 14, 2022 07:58
Working with external data in SQL Server
IF OBJECT_ID('usp_adm_CreateLinkView') IS NOT NULL DROP PROC usp_adm_CreateLinkView
GO
CREATE PROC usp_adm_CreateLinkView (
@ConnStrOrFile VARCHAR(1000)
, @TableName sysname = NULL
, @ViewName sysname = NULL
, @Flags INT = NULL -- 1 - CSV header, 2 - CSV unicode
) AS
SET NOCOUNT ON
@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
Created October 13, 2021 16:54
ECDSA server certificate signed by a ECDSA self-signed CA
using System;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
@wqweto
wqweto / FM20.IDL
Last active April 4, 2023 18:24
Typelib resource ID 3 from MSVBVM60.DLL
// Generated .IDL file (by the OLE/COM Object Viewer)
//
// typelib filename: FM20.DLL
[
uuid(0D452EE1-E08F-101A-852E-02608C4D0BB4),
version(2.0),
helpstring("Microsoft Forms 2.0 Object Library"),
helpfile("fm20.hlp"),
helpcontext(00000000),
@wqweto
wqweto / Form1.frm
Created January 27, 2021 09:59
Large string array
Option Explicit
Private Sub Form_Load()
Const STR_NAMES1 As String = "|Thousand|Million|Billion|Trillion|Quadrillion|Quintillion|Sextillion|Septillion|Octillion|Nonillion|Decillion|Undecillion|Duodecillion|Tredecillion|Quattuordecillion|Quindecillion|Sexdecillion|Septendecillion|Octodecillion|Novemdecillion|Vigintillion|Unvigintillion|Duovigintillion|Trevigintillion|Quattuorvigintillion|Quinvigintillion|Sexvigintillion|Septenvigintillion|Octovigintillion|Novemvigintillion|Trigintillion|Untrigintillion|Duotrigintillion|Tretrigintillion|Quattuortrigintillion|Quintrigintillion|Sextrigintillion|Septtrigintillion|Octotrigintillion|Novemtrigintillion|Quadragintillion|Unquadragintillion|Duoquadragintillion|Trequadragintillion|Quattuorquadragintillion|Quinquadragintillion|Sexquadragintillion|Septquadragintillion|Octoquadragintillion|Novemquadragintillion|Quinquagintillion|Unquinquagintillion|Duoquinquagintillion|Trequinquagintillion|Quattuorquinquagintillion" & _
"|Quinquinquagint
@wqweto
wqweto / dump.txt
Created October 31, 2020 10:20
Firefox 82.0.2 handshake traffic
TlsHandshake.Input
0000 - 16 03 01 02 00 01 00 01 FC 03 03 34 10 C3 43 D6 ........ь..4.ГCЦ
0010 - 88 64 7F 28 A7 97 CB 88 4D E5 08 D5 A3 BF 5D 37 €d(§—Л€Mе.ХЈї]7
0020 - FD DF 57 F5 3E AB BE D7 4E 28 D0 20 8E 9E 61 A4 эЯWх>«ѕЧN(Р Ћћa¤
0030 - 7A 02 66 E5 0D B4 4B 16 9E EB D0 D8 AD 50 0F 6C z.fе.ґK.ћлРШ­P.l
0040 - A3 A0 7F D6 CB 09 B4 72 49 97 BF 8F 00 24 13 01 Ј ЦЛ.ґrI—їЏ.$..
0050 - 13 03 13 02 C0 2B C0 2F CC A9 CC A8 C0 2C C0 30 ....А+А/М©МЁА,А0
0060 - C0 0A C0 09 C0 13 C0 14 00 9C 00 9D 00 2F 00 35 А.А.А.А..њ.ќ./.5
0070 - 00 0A 01 00 01 8F 00 17 00 00 FF 01 00 01 00 00 .....Џ....я.....
0080 - 0A 00 0E 00 0C 00 1D 00 17 00 18 00 19 01 00 01 ................