-
Notifications
You must be signed in to change notification settings - Fork 3
/
libtcc
4706 lines (4590 loc) · 562 KB
/
libtcc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
libtcc for AutoHotkey by oif2003
tested on AutoHotkey v2 a100 64bit only
23 Nov 2018
This script uses Tiny C Compiler's libtcc.dll to compile imbedded C code
See examples for usage
*/
#SingleInstance Force
;autoload last cFunc.dll. if c code has changed, it will recompile the dll and replace the current one
cFunc := useTCC() ;cFunc is a string that holds the full path to cFunc.dll (includes trailing "\")
;-------------------------------------------------------------------------------------------------------------
;Examples:
;-------------------------------------------------------------------------------------------------------------
;You can break up the c code into parts, they will be put back together in the order they appear|
;-----------------------------------------------------------------------------------------------
/*_C func
#define DLL __attribute__ ((dllexport)) //need to export each function that will be called from AutoHotkey
#include <math.h> //include files that ships with TCC are supported
*/
msgbox(csqrt(10))
csqrt(a) => DllCall(cFunc "csqrt", "Double", a, "Double")
/*_C func
double sqrt(double x);
int csqrt(double a) DLL //must include "DLL" for each exported function
{ //it is equivalent to " __attribute__ ((dllexport))"
return sqrt(a); //see #define in header
}
*/ ;end of block comment signals end of C function block
;-------------------------------------------------------------------------------------------------------------
;string example|
;--------------
msgbox(hello())
hello() => DllCall(cFunc "hello", "AStr")
/*_C function start <==== typing just "/*_C func" will do
char * hello(void) DLL
{
return "Hello world!";
}
*/ ;end of block comment signals end of C function block
;-------------------------------------------------------------------------------------------------------------
;array example|
;-------------
VarSetCapacity(a, 5*4) ;setup buffer capacity (4 is size of Int)
arr(&a) ;send function the pointer to the buffer
arrayStr := "["
loop 5 { ;read each element of array
arrayStr .= NumGet(a, (A_Index-1)*4, "Int") . (A_Index != 5 ? "," : "]")
} msgbox(arrayStr)
arr(arrPtr) => DllCall(cFunc "arr", "Ptr", arrPtr)
/*_C func
int arr(int a[]) DLL
{
for(int i = 0; i < 5; i++){
a[i] = (i + 1) * 10;
}
return 0;
}
*/
;-------------------------------------------------------------------------------------------------------------
;you can combine function blocks if you want, they all get combined anyway!|
;--------------------------------------------------------------------------
msgbox(mul(add(1,3),5))
add(a, b) => DllCall(cFunc "add", "Int", a, "Int", b)
mul(a, b) => DllCall(cFunc "mul", "Int", a, "Int", b)
/*_C func
int add(int a, int b) DLL
{
return a + b;
}
int mul(int a, int b) DLL
{
return a * b;
}
*/
;------------------------------------------------- FunC ends here :( ---------------------------------------------------
;========================================================================================================================
;unpack Tiny C Compiler's libtcc.dll and needed files
;compile c code to dll, load it, and then cleanup afterwards
useTCC(directory := "") {
if !directory {
directory := A_ScriptDir "\AHK_cFunc_Temp"
}
cFuncdllName := "cFunc.dll"
,cFuncdllPath := directory "\" cFuncdllName
;read c code
,script := fileRead(A_ScriptFullPath)
,startLabel := "/*_C" " func"
,endLabel := "*/"
,lastp := 1
;loop read each section of c code and combine them to cStr
while pos := InStr(script, startLabel, true, lastp) {
cStart := InStr(script, "`n", , pos + StrLen(startLabel))
,cEnd := InStr(script, endLabel, , cStart + 1)
,cStr .= SubStr(script, cStart, cEnd - cStart) "`n"
,lastp := cEnd + 1
}
;calculate SHA256 of c code to see if we need to recompile cFunc.dll
cHash := storageManager.hashString(cStr, "SHA256")
lastDll := fetchLastDll() ;fetch last cFunc.dll and hash of its c code
if lastDll.cHash == cHash {
DirCreate(directory)
,storageManager.unpackFile(lastDll.data, cFuncdllPath, dataMode := true)
} else {
;load full locker object
locker := storageManager.initialize(AutoSave := true) ;save locker content on script exit
;unpack everything in tcc64 folder to "directory" folder
;todo load and free library these dll: decompressor, crypto, ... etc
hcrypt32 := DllCall("LoadLibrary", "Str", "Crypt32.dll", "Ptr")
,hcabinet := DllCall("LoadLibrary", "Str", "Cabinet.dll", "Ptr")
,storageManager.unpackFolder("\locker\file\tcc64", directory)
,DllCall("FreeLibrary", "Ptr", hcabinet)
,DllCall("FreeLibrary", "Ptr", hcrypt32)
;LIBTCC calls to generate DLL
,htcclib := DllCall("LoadLibrary", "Str", directory "\libtcc.dll", "Ptr")
,Context := DllCall("libtcc\tcc_new", "Ptr")
;set path to our include/lib folders
;~ StrPutVar(directory "\lib", libraryPath)
;~ StrPutVar(directory "\include", includePath)
;~ StrPutVar(directory "\include", sysincludePath)
;~ StrPutVar(directory, tcclibPath)
;~ DllCall("libtcc\tcc_add_library_path", "Ptr", Context, "Str", libraryPath, "Int")
;~ DllCall("libtcc\tcc_add_include_path", "Ptr", Context, "Str", includePath, "Int")
;~ DllCall("libtcc\tcc_add_sysinclude_path", "Ptr", Context, "Str", sysincludePath, "Int")
;~ DllCall("libtcc\tcc_set_lib_path", "Ptr", Context, "Str", tcclibPath)
;StrPutVar("", options)
;DllCall("libtcc\tcc_set_options", "Ptr", Context, "Str", options)
;TCC_OUTPUT_MEMORY := 1 ; output will be run in memory (default)
;TCC_OUTPUT_EXE := 2 ; executable file
,TCC_OUTPUT_DLL := 3 ; dynamic library
;TCC_OUTPUT_OBJ := 4 ; object file
;TCC_OUTPUT_PREPROCESS := 5 ; only preprocess (used internally)
,DllCall("libtcc\tcc_set_output_type", "Ptr", Context, "UInt", TCC_OUTPUT_DLL, "Int")
StrPutVar(cStr, _cStr)
,DllCall("libtcc\tcc_compile_string", "Ptr", Context, "Str", _cStr, "Int")
;filedelete(cFuncdllPath) ;remove old copy
StrPutVar(directory "\" cFuncdllName, filename)
,DllCall("libtcc\tcc_output_file", "Ptr", Context, "Str", filename, "Int")
;pack cFunc.dll and store hash of current c code as its description
,storageManager.packFile(cFuncdllPath)
,locker.file[cFuncdllName].description := cHash
;clean up
,DllCall("libtcc\tcc_delete", "Ptr", Context)
,DllCall("FreeLibrary", "Ptr", htcclib)
}
cFuncHandle := DllCall("LoadLibrary", "Str", cFuncdllPath, "Ptr")
onExit("cleanUp")
return cFuncdllPath "\" ;add trailing "\" so we can append function names after it (for DllCall)
;StrPutVar ehlper function straight from the v2 docs
StrPutVar(string, ByRef var, encoding := "cp0") {
VarSetCapacity(var, StrPut(string, encoding) * ((encoding="utf-16"||encoding="cp1200") ? 2 : 1) )
return StrPut(string, &var, encoding)
}
;delete temporary files we extracted/created
cleanUp() {
DllCall("FreeLibrary", "Ptr", cFuncHandle)
,DirDelete(directory, Recurse := true)
}
fetchLastDll() {
script := fileRead(A_ScriptFullPath)
,dllStart := InStr(script, "cFunc.dll", true, -1)
,dllEnd := InStr(script, "`n", , InStr(script, ",", , InStr(script, "description", true, dllStart)))
,cFuncDllStr := SubStr(script, dllStart, dllEnd - dllStart + 1)
,dataStart := InStr(cFuncDllStr, '"data": "') + 10
,dataEnd := InStr(cFuncDllStr, '"', , dataStart) - 1
,data := SubStr(cFuncDllStr, dataStart, dataEnd - dataStart + 1)
,SHAstart := InStr(cFuncDllStr, '"description": "') + 16
,SHAend := InStr(cFuncDllStr, '"', , SHAstart) - 1
,SHA := SubStr(cFuncDllStr, SHAstart, SHAend - SHAstart + 1)
return {Data:data, cHash:SHA}
}
}
;=============================================================================================================
;storageManager.packFolder()
;storageManager.unpackFolder()
;storageManager.delete("locker\file\") ;deletes all attached files
;storageManager.packFile(FileSelect(), "locker\file\someotherfolder\subfolder\")
;storageManager.unpackFile("locker\file\test1\dir.h", A_ScriptDir "\testfolder\new")
;storageManager.delete("locker\file\test1")
class storageManager {
static tempDir := A_ScriptDir ;todo: change all A_ScriptDir to storageManager.tempDir
,label := "/* storageManager" " " "attachements" ;label used for attachments
,script
,locker
initialize(AutoSave := true) {
storageManager.locker := this.load()
if AutoSave {
OnExit(()=>this.save())
}
return storageManager.locker
}
save() { ;dumps the current locker object as json string and saves it
this.script := SubStr(this.script, 1, InStr(this.script, this.label) - 1)
this.script := this.script this.label "`n" this.json.auto(this.locker)
FileOpen(A_ScriptFullPath, "w").Write(this.script)
}
load() { ;loads the json string at the end of this file into the locker object
this.script := FileRead(A_ScriptFullPath)
,jstr := SubStr(this.script, InStr(this.script, this.label, true, -1) + StrLen(this.label) + 1)
return this.json.auto(jstr)
}
delete(storagePath) { ;deletes a single file or folder
path := this.parseStoragePath(storagePath) ;parse storagePath
fileName := path.fileName
path.folder.Delete(fileName)
}
parseStoragePath(path) { ;helper function for parsing "\" separated storage paths
path := Trim(path, "\")
,parts := StrSplit(path, "\")
,fileName := parts.Pop()
,parts.RemoveAt(1) ;first chunck is "locker"
,op := this.locker ;first point to this.locker (which inturn points to global var locker)
for _, v in parts { ;points to each folder inside locker until we exhaust the provided path
op := op[v]
}
return {folder:op, fileName:fileName} ;returns fileObject and fileName
}
unpackFolder(storagePath := "locker\file", targetPath := "", options := "R") { ; R-recursive
if !targetPath {
targetPath := DirSelect("*" A_ScriptDir, 1 + 2, "Select destination folder")
}
path := this.parseStoragePath(storagePath) ;parse storagePath
for k, v in path.folder[path.fileName] {
if v.HasKey("attribute") { ;indicating we have a file not a folder
this.unpackFile(storagePath "\" k, targetPath "\")
} else if InStr(options, "R") {
DirCreate(targetPath "\" k)
this.unpackFolder(storagePath "\" k, targetPath "\" k, options) ;recursive call
}
}
}
packFolder(folder := "", dest := "locker\file\", options := "R") { ; R-recursive
;prompt user for folder and destination folder if folder param is null
if !folder {
folder := DirSelect("*" A_ScriptDir)
userFolder := InputBox("Enter folder name for storage")
dest := userFolder ? (dest . Trim(userFolder, "\") . "\") : dest
}
folderLen := StrLen(folder)
;loop through file/folder (recursively if "R" flag is present in options parameter)
Loop Files folder "\*" , options = "R" ? "R" : "F" {
;contruct storagePath string from dest and A_LoopFileFullPath
storagePath := dest . SubStr(A_LoopFileFullPath, folderLen + 2, InStr(A_LoopFileFullPath, "\", , -1) - folderLen - 1)
this.packFile(A_LoopFileFullPath, storagePath)
}
}
unpackFile(storagePath, targetPath := "", dataMode := false) { ;in dataMode storagePath == raw data
if dataMode { ;and targetPath must include file name
cryptString := storagePath
} else {
;parse storagePath
path := this.parseStoragePath(storagePath)
,fileName := path.fileName
,cryptString := path.folder[fileName].data ;base64 data string to be decrypted and decompressed
}
;parse targetPath
if !targetPath {
filePath := A_ScriptDir "\" fileName ;default to A_ScriptDir
} else if InStr(FileExist(targetPath), "D") { ;
filePath := RTrim(targetPath, "\") "\" fileName ;if targetPath is a directory
} else {
filePath := targetPath
}
;write empty file if file in storage is also empty (data == "`r`n")
if !Trim(cryptString, "`r`n") {
FileDelete(filePath)
FileAppend("", filePath)
return
}
;https://docs.microsoft.com/en-us/windows/desktop/api/compressapi/nf-compressapi-createcompressor
;COMPRESS_ALGORITHM_MSZIP := 2 ;MSZIP compression algorithm
;COMPRESS_ALGORITHM_XPRESS := 3 ;XPRESS compression algorithm
;COMPRESS_ALGORITHM_XPRESS_HUFF := 4 ;XPRESS compression algorithm with Huffman encoding
COMPRESS_ALGORITHM_LZMS := 5 ;LZMS compression algorithm
;first call to get buffer size
DllCall("crypt32\CryptStringToBinary"
,"str", cryptString ;pszString
,"uint", 0 ;cchString
,"uint", 1 ;dwFlags
,"ptr", 0 ;pbBinary
,"uint*", s ;pcbBinary
,"ptr", 0 ;pdwSkip
,"ptr", 0 ;pdwFlags
)
;set buffer size based on previous call (*2 for UTF)
,VarSetCapacity(buffer, s*2)
,DllCall("crypt32\CryptStringToBinary"
,"str", cryptString ;pszString
,"uint", 0 ;cchString
,"uint", 1 ;dwFlags
,"ptr", &buffer ;pbBinary
,"uint*", s ;pcbBinary
,"ptr", 0 ;pdwSkip
,"ptr", 0 ;pdwFlags
)
;Create Decompressor Handle
,DllCall("Cabinet.dll\CreateDecompressor"
,"UInt", COMPRESS_ALGORITHM_LZMS ;Algorithm
,"Ptr", 0 ;AllocationRoutines,
,"Ptr*", dHandle ;CompressorHandle
)
,size := s
;first call to get buffer size (s)
,DllCall("Cabinet.dll\Decompress"
,"Ptr", dHandle ;DecompressorHandle,
,"Ptr", &buffer ;CompressedData,
,"UInt", size ;CompressedDataSize,
,"Ptr", &dBuffer ;UncompressedBuffer,
,"UInt", 0 ;UncompressedBufferSize,
,"UInt*", s ;UncompressedDataSize
)
;set buffer size based on previous call
,_s := VarSetCapacity(dBuffer, s)
,DllCall("Cabinet.dll\Decompress"
,"Ptr", dHandle ;DecompressorHandle,
,"Ptr", &buffer ;CompressedData,
,"UInt", size ;CompressedDataSize,
,"Ptr", &dBuffer ;UncompressedBuffer,
,"UInt", _s ;UncompressedBufferSize,
,"UInt*", s ;UncompressedDataSize
)
,DllCall("Cabinet.dll\CloseDecompressor", "Ptr", dHandle)
,FileDelete(filePath)
,FileOpen(filePath, "w").RawWrite(dbuffer,s)
}
packFile(file, dest := "locker\file\") { ; packs and compresses a file, it is then stored as plaintext
size := FileGetSize(file)
sha256 := this.hashFile(file, "SHA256")
dlltext := FileRead(file, "RAW")
_size := size
;https://docs.microsoft.com/en-us/windows/desktop/api/compressapi/nf-compressapi-createcompressor
;COMPRESS_ALGORITHM_MSZIP := 2 ;MSZIP compression algorithm
;COMPRESS_ALGORITHM_XPRESS := 3 ;XPRESS compression algorithm
;COMPRESS_ALGORITHM_XPRESS_HUFF := 4 ;XPRESS compression algorithm with Huffman encoding
COMPRESS_ALGORITHM_LZMS := 5 ;LZMS compression algorithm
DllCall("Cabinet.dll\CreateCompressor"
,"UInt", COMPRESS_ALGORITHM_LZMS ;Algorithm,
,"Ptr", 0 ;AllocationRoutines,
,"Ptr*", cHandle ;CompressorHandle
)
;https://docs.microsoft.com/en-us/windows/desktop/api/compressapi/nf-compressapi-compress
;first call to get buffer size (s)
DllCall("Cabinet.dll\Compress"
,"Ptr", cHandle ;CompressorHandle,
,"Ptr", &dlltext ;UncompressedData,
,"UInt", size ;UncompressedDataSize,
,"Ptr", &cBuffer ;CompressedBuffer,
,"UInt", 0 ;CompressedBufferSize,
,"UInt*", s ;CompressedDataSize
)
;set buffer size based on previous call
_s := VarSetCapacity(cBuffer, s)
DllCall("Cabinet.dll\Compress"
,"Ptr", cHandle ;CompressorHandle,
,"Ptr", &dlltext ;UncompressedData,
,"UInt", size ;UncompressedDataSize,
,"Ptr", &cBuffer ;CompressedBuffer,
,"UInt", _s ;CompressedBufferSize,
,"UInt*", s ;CompressedDataSize
)
DllCall("Cabinet.dll\CloseCompressor", "Ptr", cHandle)
size := s
;https://docs.microsoft.com/en-us/windows/desktop/api/wincrypt/nf-wincrypt-cryptbinarytostringw
;first call to find size (s) needed for our crypt string
DllCall("crypt32\CryptBinaryToString"
,"Ptr", &cBuffer ;pbBinary ptr to array of bytes
,"uint", size ;cbBinary length of array
,"uint", 1 ;dwFlags flags: 1 = 64 bit without headers
,"ptr", 0 ;pszString when this is 0, pccString returns needed size
,"uint*", s ;pccString
)
VarSetCapacity(cryptString, s := s * 2) ;*2 for unicode
;second call to get the actual string
DllCall("crypt32\CryptBinaryToString"
,"Ptr", &cBuffer ;pbBinary ptr to array of bytes
,"uint", size ;cbBinary length of array
,"uint", 1 ;dwFlags flags: 1 = 64 bit without headers
,"str", cryptString ;pszString now this is ptr to buffer of string
,"uint*", s ;pccString size of buffer as previously determined
)
;combine every other line (basically format with 3 instead of 1 coloumn to save space)
;we could do more but I'd rather not have line wrap
strArr := StrSplit(cryptString, "`r`n")
for k, v in strArr {
data .= v (!Mod(k, 3) ? "`n" : "") ;set to three columns
}
data := "`n" data
size := StrLen(data) + strArr.Length() // 2
SplitPath(file, fileName)
destobj := str2obj(dest) ;destobj is an array. [1]:points to object base. [2]:points to file write location
; writing file data
destobj[2][fileName] := { originalSize: _size ;uncompressed file size
, packededSize: size ;estimation of packed size (1 char = 1 byte)
, added: formattime(A_Now) ;when file was added
, description: description ;Used for certain files, ie: storing hash
, SHA256: sha256 ; of compiled dll's c code
, data: data ;compressed binary as base 64 string
, directory: dest ;pseudo directory where the file is stored
, attribute: "F" } ;reserved for future use
merge(destobj[1], this.locker) ;merging destobj[1] into this.locker (locker in global scope)
;helper function for generating object structure from string so we can merge it with json structure
str2obj(ostr) {
ostr := Trim(ostr, "\")
parts := StrSplit(ostr, "\")
_po := po := %parts[1]% := {} ;po points to the first level of the object
loop parts.Count() - 1 { ;_po points to the last (where we will put the file object)
_po := _po[parts[A_Index+1]] := {}
}
return [po, _po]
}
;helper function which allows us to merge objects. x is merged into y
merge(x, y) { ;by reference, x, y are objects
for s, t in x {
found := false
for u, v in y {
if s == u {
if isObject(t) && isObject(v) { ;this rule may need to be updated
merge(t, v) ;to better handle files of same name
} else { ;being added
if isObject(x[s]) {
y[u] := x[s].Clone()
} else if !isObject(y[u]) {
y[u] := x[s]
}
}
found := true
}
}
if !found {
y[s] := isObject(t) ? t.Clone() : t
}
}
}
}
;-------------------------------------------------------------------------------------------------------------------
;hashFile(FullFilePath, Algorithm) - valid Algorithms: MD2, MD4, MD5, SHA1, SHA256, SHA384, SHA512
;-------------------------------------------------------------------------------------------------------------------
hashFile(file := "", algo := "") { ;using CertUtil
static cPid := 0
,lastError := "" ;stores last error message: strStdOut
,Supported_Hash := Object("MD2",_,"MD4",_,"MD5",_,"SHA1",_,"SHA256",_,"SHA384",_,"SHA512",_)
;return last error message
if !file {
return lastError
}
;check to see if requested algorithm is supported
algo := StrUpper(algo)
if !Supported_Hash.HasKey(algo) {
return
}
;create and hide command window if we don't already have one
if !cPid {
_A_DetectHiddenWindows := A_DetectHiddenWindows
,A_DetectHiddenWindows := true
,Run(A_ComSpec " /k ",, "Hide", cPid)
,WinWait("ahk_pid" cPid, , 10)
,DllCall("AttachConsole","uint", cPid)
,A_DetectHiddenWindows := _A_DetectHiddenWindows
;clean up on exiting script
OnExit(()=>cleanUp(cPid))
}
;run command and get output
objShell := ComObjCreate("WScript.Shell")
objExec := objShell.Exec('certutil -hashfile "' file '" ' algo)
while !objExec.StdOut.AtEndOfStream {
strStdOut := objExec.StdOut.ReadAll()
}
;parse output
start := InStr(strStdOut, file ":") + StrLen(file) + 1
end := InStr(strStdOut, "CertUtil: -hashfile command completed successfully.", , -1) - 1
if start < end {
return StrUpper(SubStr(strStdOut, start + 2, end - start - 2))
} else {
lastError := strStdOut
return
}
;cleanUp function called on script exit (OnExit)
cleanUp(_cPid) {
_A_DetectHiddenWindows := A_DetectHiddenWindows
A_DetectHiddenWindows := true
DllCall("FreeConsole", "UInt")
WinKill("ahk_pid" _cPid)
A_DetectHiddenWindows := _A_DetectHiddenWindows
}
}
;-------------------------------------------------------------------------------------------------------------------
;hashString(String, Algorithm) - valid Algorithms: MD2, MD4, MD5, SHA1, SHA256, SHA384, SHA512
;-------------------------------------------------------------------------------------------------------------------
hashString(string, algo) {
;These are the supported formats, maybe someone else can get the rest to work?
static Supported_Hash := Object("MD2",_,"MD4",_,"MD5",_,"SHA1",_,"SHA256",_,"SHA384",_,"SHA512",_)
;check to see if requested algorithm is supported
algo := StrUpper(algo)
if !Supported_Hash.HasKey(algo) {
return
}
;continue if algorithm is supported
hModule := DllCall("LoadLibrary", "Str", "Bcrypt.dll", "Ptr")
,size := StrPutVar(string, str) - 1 ;put string in str variable as UTF-8 for later use
;See link for explaination of steps taken below:
;https://docs.microsoft.com/en-us/windows/desktop/SecCNG/creating-a-hash-with-cng
;-------------------------------------------------------------------------------------------------
;https://docs.microsoft.com/en-us/windows/desktop/api/Bcrypt/nf-bcrypt-bcryptopenalgorithmprovider
,DllCall("Bcrypt.dll\BCryptOpenAlgorithmProvider"
,"Ptr*", phandle
,"Str", algo
,"Str",
,"UInt", 0
,"UInt" ;returned error code see winnt.h
)
;https://docs.microsoft.com/en-us/windows/desktop/api/Bcrypt/nf-bcrypt-bcryptgetproperty
,DllCall("Bcrypt.dll\BCryptGetProperty"
,"Ptr", phandle
,"Str", "ObjectLength" ;getting length of object
,"UInt*", pbOutput
,"UInt", 4
,"UInt*", pcbResult
,"UInt", 0
,"UInt" ;returned error code see winnt.h
)
;https://docs.microsoft.com/en-us/windows/desktop/api/Bcrypt/nf-bcrypt-bcryptcreatehash
,cbHashObject := pbOutput
,VarSetCapacity(pbHashObject, cbHashObject, 0)
,DllCall("Bcrypt.dll\BCryptCreateHash"
,"Ptr", phandle
,"Ptr*", phHash
,"Ptr", &pbHashObject
,"UInt", cbHashObject
,"Ptr", 0
,"UInt", 0
,"UInt", 0
,"UInt" ;returned error code see winnt.h
)
;https://docs.microsoft.com/en-us/windows/desktop/api/Bcrypt/nf-bcrypt-bcrypthashdata
,DllCall("Bcrypt.dll\BCryptHashData"
,"Ptr", phHash
,"Ptr", &str ;&pbInput
,"UInt", size ;cbInput
,"UInt", 0
,"UInt" ;returned error code see winnt.h
)
;https://docs.microsoft.com/en-us/windows/desktop/api/Bcrypt/nf-bcrypt-bcryptgetproperty
,DllCall("Bcrypt.dll\BCryptGetProperty"
,"Ptr", phandle
,"Str", "HashDigestLength" ;getting length of hash
,"UInt*", pbOutput
,"UInt", 4
,"UInt*", pcbResult
,"UInt", 0
,"UInt" ;returned error code see winnt.h
)
hashsize := pbOutput
;https://docs.microsoft.com/en-us/windows/desktop/api/Bcrypt/nf-bcrypt-bcryptfinishhash
,cbOutput := hashsize
,VarSetCapacity(pbOutput, cbOutput, 0)
,DllCall("Bcrypt.dll\BCryptFinishHash"
,"Ptr", phHash
,"Ptr", &pbOutput
,"UInt", cbOutput
,"UInt", 0
,"UInt" ;returned error code see winnt.h
)
;read each byte and append its 2 digit hex value to hashstr
loop hashsize {
hashstr .= format("{:02x}", NumGet(&pbOutput, A_Index - 1 , "UChar"))
}
;clean up
DllCall("Bcrypt.dll\BCryptDestroyHash", "Ptr", phHash, "UInt")
,DllCall("Bcrypt.dll\BCryptCloseAlgorithmProvider", "Ptr", phandle, "UInt", 0, "UInt")
,DllCall("FreeLibrary", "Ptr", hModule)
return StrUpper(hashstr)
;-------------------------------------------------------------------------------------------------
;helper function
StrPutVar(string, ByRef var) { ;from AHK v2 doc
VarSetCapacity(var, StrPut(string, "Utf-8"))
return StrPut(string, &var, "Utf-8")
}
}
;=============================================================================================================
;todo: implement proper escape sequences at least for AutoHotkey (perhaps during token/detoken phases?)
;json-like class. for internal use only. does not properly support json
class json {
;auto input parser json string <=> ahk object
auto(input) {
if IsObject(input) {
return this.obj2str(input)
} else {
return this.str2obj(input)
}
}
;------------------------------------------------------------------------------------------
;convert object to json string
obj2str(obj, firstRun := true) {
static output := ""
,level := 0
,noTab := false
if firstRun {
output := ""
}
if isObject(obj) {
if obj.Count() {
if isArray(obj) { ;if this is an array (based on A_Index == key)
output .= (noTab ? "" : tabs(level)) "[`n"
level++
noTab := false
for k, v in obj {
this.obj2str(v, false)
output .= (k != obj.Count() ? "," : "") "`n"
}
output .= tabs(--level) "]"
} else { ;otherwise output as object
output .= (noTab ? "" : tabs(level)) "{`n"
level++
noTab := false
for k, v in obj {
output .= tabs(level) '"' k '": '
noTab := true
this.obj2str(v, false)
noTab := false
output .= (A_Index != obj.Count() ? "," : "") "`n"
}
output .= tabs(--level) "}"
}
} else {
output .= "[]"
}
} else {
if obj == "" {
obj := "null"
} else if !(obj is "Number") || !isNumber(obj) { ;don't put quotes around numbers
obj := '"' obj '"'
}
output .= (noTab ? "" : tabs(level)) obj
}
return output
isNumber(x) { ;quickly and dirty check. Other ideas: use is Type first then do this
return NumGet(&x, "UInt") == x
|| NumGet(&x, "Int") == x || NumGet(&x, "Int64") == x
|| NumGet(&x, "Double") == x || NumGet(&x, "Float") == x
|| NumGet(&x, "Ptr") == x || NumGet(&x, "UPtr") == x
|| NumGet(&x, "Short") == x || NumGet(&x, "UShort") == x
|| NumGet(&x, "Char") == x || NumGet(&x, "UChar") == x
}
isArray(arr) { ;another quick and dirty check: A_Index == Current Key ?
if !IsObject(arr) {
return false
} else {
for k, v in arr {
if k != A_Index {
return false
}
}
return true
}
}
tabs(n) { ;create tab string
loop n {
tab .= "`t"
}
return tab
}
}
;------------------------------------------------------------------------------------------
;covert json string to ahk function string then feed it thru the function parser
str2obj(jstr) {
funcStr := this.jstr2func(jstr)
,o := this.funcParser(strreplace(funcstr, '"'))
return o
}
;recursively evaluate the function string
funcParser(funcStr) {
paren := InStr(funcStr, "(")
if paren {
innerStr := SubStr(funcStr, paren + 1, -1)
,parenCount := 0
,argStart := 1
,args := []
loop parse innerStr {
if A_LoopField == "(" {
parenCount++
} else if A_LoopField == ")" {
parenCount--
}
if !parenCount && A_LoopField == "," {
args.push(SubStr(innerStr, argStart, A_Index - argStart))
,argStart := A_Index + 1
} else if A_Index == StrLen(innerStr) {
args.push(SubStr(innerStr, argStart, A_Index - argStart + 1))
}
}
for k, v in args {
args[k] := this.funcParser(v)
}
return func(SubStr(funcStr, 1, paren - 1)).Call(args*)
} else {
this.restoreString(funcStr, this.dictionary) ;replace string tokens with their originals
if funcStr is "Number" {
return funcStr + 0
} else {
if funcStr == "null" {
return
} else if funcStr == "true" {
return true
} else if funcStr == "false" {
return false
} else if SubStr(funcStr, 1, 1) == '"' && SubStr(funcStr, -1, 1) == '"' {
funcStr := SubStr(funcStr, 2, -1) ;remove quotation marks on strings
return funcStr
} else {
return "Unhandled exception, check " A_ScriptName ", " A_ThisFunc ", " A_LineNumber
}
}
}
}
;convert json string to function string in ahk. namely, array() and object()
jstr2func(jstr, firstRun := true) {
static tokenBase := 0x1abf - 1
,commaToken := Chr(tokenBase + 1)
,colonToken := Chr(tokenBase + 2)
if firstRun {
this.dictionary := this.tokenizeString(jstr)
,jstr := StrReplace(jstr, "`n") ;remove newline, tab, and space
,jstr := StrReplace(jstr, "`r")
,jstr := StrReplace(jstr, "`t")
,jstr := StrReplace(jstr, " ")
}
if !InStr(jstr, "[") && !InStr(jstr, "{") {
return jstr
} else {
inner := findInnerMost(jstr)
,innerStr := SubStr(jstr, inner[1], inner[2] - inner[1] + 1)
,jstr := SubStr(jstr, 1, inner[1] - 1) str2func(innerStr) SubStr(jstr, inner[2] + 1)
,jstr := this.jstr2func(jstr, firstRun := false)
return jstr
}
str2func(str) { ;convert string to function
brace := InStr(str, "{")
,brack := InStr(str, "[")
if brack {
funcStr := 'Array('
,funcStrArr := StrSplit(SubStr(str, 2, -1), commaToken)
for k, v in funcStrArr {
funcStr .= str2func(v) (k != funcStrArr.Length() ? "," : "")
}
funcStr .= ")"
} else if brace {
funcStr := 'Object(' StrReplace(SubStr(str, 2), "}", ")")
,funcStr := StrReplace(funcStr, ':', ',')
} else {
return str
}
return funcStr
}
findInnerMost(str) { ;find innermost object/array
braceCount := brackCount := maxCount := maxStart := maxEnd := 0
loop parse str {
if A_LoopField == "{" {
braceCount++
} else if A_LoopField == "}" {
braceCount--
} else if A_LoopField == "[" {
brackCount++
} else if A_LoopField == "]" {
brackCount--
}
if braceCount + brackCount > maxCount { ;Find max cumulative count of [ and {
maxCount := braceCount + brackCount
,maxStart := A_Index ;Update max [ / { location
,closing := SubStr(str, A_Index, 1) == "[" ? "]" : "}"
,maxEnd := InStr(str, closing, , A_Index) ;update where it ends
}
}
return [maxStart, maxEnd]
}
}
;------------------------------------------------------------------------------------------
;helper methods
restoreString(ByRef str, dictionary) {
static tokenBase := 0x1abf - 1
,strToken := Chr(tokenBase + 3)
,escapedQuote := Chr(tokenBase + 4)
for k, v in dictionary {
str := StrReplace(str, strToken k strToken, v, , 1)
}
str := StrReplace(str, escapedQuote, '"')
}
tokenizeString(ByRef str) {
static tokenBase := 0x1abf - 1
,strToken := Chr(tokenBase + 3)
,scapedQuote := Chr(tokenBase + 4)
quoteCount := quoteStart := 0
,dictionary := []
,str := StrReplace(str, '``"', escapedQuote)
loop parse str {
if A_LoopField == '"' {
quoteCount++
if Mod(quoteCount, 2) {
quoteStart := A_Index
} else {
quoteEnd := A_Index
,dictionary.push(SubStr(str, quoteStart, quoteEnd - quoteStart + 1))
}
}
}
for k, v in dictionary {
str := StrReplace(str, v, strToken k strToken, , 1)
}
return dictionary
}
}
}
;===========================================================================================
/* storageManager attachements
{
"file": {
"cFunc.dll": {
"added": "9:05 PM Friday, November 23, 2018",
"attribute": "F",
"data": "
ClHlwBgAuwUACAAAAAAAAAAIAAAAAAAAYgIAAJEp0wKkGpcSjn5tNFAM0w06uqn+F6Se4jDp0qWq1fpaw43gHkUbU6OCytEe5NHvdWtMMjjBj7PdI8Wt4vgEMT3OU8jX/yZfHahKXHSErQAgAQACigWmLVk4lk0VMaDdW+RatnWs8Vpn2gKXNaX1gazpLaRD
X13UtQFcnaFhM1URcnIVGVkYxtKYW53RmDUAIHC10fQSt7gzBYFQW9kWkva8XBUErwVssVqYWr/ACrCUzTeVQtycxcZG5kInN2Y31/Z9ABk7s5mCYHUg2EMIGZvc2x3IGxtbGRL+egAH5ZL/7+QSIq4355wNwFLD5SWBrl3xrdqEKwiLYbj6W7wBJyaBWJmB
FCUybR7ebABVR/DrA5cDOQCjaRGiWsHsakr8XtJuel4PSBR+fbBSFHStDQsiOAAJomkRSQA8GAl47GoIX7c4AoAHg6sPC8JySLccbBofCvAH+YsW+YsSsS4QTYkXhDZxbTyYFjQiXdocqIABggIBgoDh5IyUVgq+xWFhdYMenciEX5SIJOz3kGQGjPIAUeT3
MI9RtIiEUZWIBFFk/WB2hbAHIpUnIlUBkQbaCQx2V4YC5wLs+fZ9ToOAt8LowshcwCw3HtbvLgu4hqLDK6NzWbORQHCO6wGoKpgPKRQruBb4KhC4TKF86AANBesUyS6AALiA8xD4/lffgsC39BpVAhWCgcCCiAsAPDhowJCsKoLS3pAoNDS4lJG9tYFMPRFV
/DQQtzo5kDIxELo3N7ewMZC2MLmzNzk4kLk0NKrKzxSAG9KcQAvgoPvhYAGOAYAyANzq/9/qE1QAAwCQWk0=
",
"description": "B70F8032CC0F6DB2598F28F4BBED48297527944856DF9722DB8F791D81151D24",
"directory": "locker\file\",
"originalSize": 2048,
"packededSize": 865,
"SHA256": "6E544719449E092A9A5BD786E95A5111D80384CB763EFBCA7D68D66AB2B91E7A
"
},
"tcc64": {
"include": {
"_mingw.h": {
"added": "3:36 PM Friday, November 23, 2018",
"attribute": "F",
"data": "
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
bV8gKiAKKi8=",
"description": null,
"directory": "locker\file\tcc64\include\",
"originalSize": 3865,
"packededSize": 2348,
"SHA256": "AB4BE7D34E7FA0E722F0948E0C90AD4D95B8A1EC649C2F186DFA387B57BE7833
"
},
"assert.h": {
"added": "3:36 PM Friday, November 23, 2018",
"attribute": "F",
"data": "
ClHlwBgAegWfBQAAAAAAAJ8FAAAAAAAA8AIAANAAa3VKK67rBRif9WjE20lrRgrZ/HH6HsiJl5tsQ+QBMMB0JaoBVX0yM3YusIKu4W3MwowL7vqZswx+mgsCfZh2J+fn1Uh44B+sDk8cFVAAAMaH+3qu2sSBsJSNcJjqgMBoFP5cjNVg2Rj0lTiYK+i685e1
VDVFTElGX1/dE8vXNYJSRJR0hUGZa7Sa4uOroMCnkBAUFCyv3mJ/eQmH3fPsOablbSMXFoGwVNoubmC91N5OirVhpi/N793qWKx3NxqfWKxdt+Td9KVSPV9yYWhjdyB0c25vY5q570IPtybuaw9EZEhE22y57y7DkR7cW1dvJzNzFpaiiQg3lIqBm7ucEr2Y
EYbhOuvEInRyb2JhIihvcmPV84U2VwcHEtZ2FiYH1zm5D2RHQ9IwBdlTSJmrw25M44GsXVZbmaop7K5f3BO1FovCHq+nsrYwNxCrr3RjbnVmIDk5QxbYFeEwl6oKg65FWuvRdGHXkwYiVs2BuMmV0VkxqryAUGEVDT1NJX1VUFdmZQiIFafzuq+vOqimJGyf
wo6TVBVVkZTlJZQkRUUVxKVUWG+WNjq3NBS6qgzk6kkKierJ6evqyLqyHrax6uvK8ooHAqJace6IsHIg+qqcIKekJqkiKgvIoQ5LhaqLrXI2cykwKWRpb3YoKCApbm/WYsvk4PCKvlAyIw5C7B/CuAqPqoSKiJw2ZQpVGJlbGSaWxmYB0fO6lrlKCm4su3Zh
80FzwWr84qmayOrYxtwssMwtzUKqlr6QvqgqsKmpoK8vELMyMjeztBGFl8/cXBomYtWUdgciVdSUFMQ0NJVEhMHDuL3RgciVmZXJgey4ldmlnV3U8qqoMDm5sArrzQmTVnYWtjZmVZW1pdG51cm13J1VXG0gNDZ3mJjZGwidXNiFLDTnUiWFtb0RgYylsYnV
QYGUodGBuFlBZWNhbHBWV7W4VWRlbtUzVx2B0KGdpcnlwb2Ngby5VUBhaCBlbGlmIHNpaFQgKiAKKiov
",
"description": null,
"directory": "locker\file\tcc64\include\",
"originalSize": 1439,
"packededSize": 1056,
"SHA256": "3AB7EDEC5E55840C35BE252BAD52236955C3B4F9143810CDB1F09C34510EB8C4
"
},
"conio.h": {
"added": "3:36 PM Friday, November 23, 2018",
"attribute": "F",
"data": "
ClHlwBgAMAV6KwAAAAAAAHorAAAAAAAAdAcAAAEAAFxZFlf0Ou3XkIC7+PLFYt6/qOtSEw60BR1XiNUYk1q1V8OWWOkyfPn9VcyO0sXIMX8PCJJCM7MRglbGIzr1LoC0ZDAa7+RdWGHvG2mhuhwhRAOfT3TuzjdTP9wXE9GyOGZE68zNGwoimTbshizKdqZC
oDA/Xvws96pe+7tcTfWOVr8xoqZimIhNWy1umkpddCwRSSF2rgPVJ7NtHuF68mDai+zAHOulNCPjZKqS/xTc4gAAQNYt6y3Nfb2lWYzJSxpc2NdY2dxGW/Ko9ZmCpe3fboXkiFjaDNXMR5bJfGNZzLdMDOtiF8wWiKbf6U9c61Er9cvg8qguYtcxq9DSbL2Z
uVnBMISdH9XLekVQ+oSez1VBRVKL2TeWte2Cthd4bI6ODLrj5rLy00rLKTlFniRqTVDuDjlGdywR+viAbMUyosy09WAUDJvjEO3lolYlIFlKRYJY44nXrFVKg/DwgGTP8YHEnF3Wwu5C5sVuKTIZMTIMlo8R6QSOjhcB5TCuj+1wWgyUuVosMeGl2koWciaK
3Fxbsk+9iRDj/+bn4yye5vLJ+UxN7IgbDnJrsl+dre/O22mSnwlu/XrePgOSZv7xuUF+xr4h82eM2n7/P4P+2dmAVkjBUuhv9WArGyGOM33K4iiP4x0nOG96ddPDTY7mtM3wl0Z5Gu80zM9Mn1F+xvtMtGwCl9GeTVamS5sKzWW8yzgH6eZmRfLkqu/Kqu46
aVtOHVcll2GjOGA6HE6d+SVL19XcVlaXX5ClJvHyQswyujS5O1VUseU4aEKbx/PYyujCLLmibC7bYEXdJeyiLCxxTknWzS73ZpaxE29kF0FRZndNFlZFMQXiUkb21lYlSxOzmvgiMwNSASuzNHYxSyQvu44yjQykAhcGMlemlzZnNRMW7n5WJpVd4t0Dm/uw