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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="Stylesheet" type="text/css" href="default.css" />
<meta http-equiv="Content-Type" content=
"text/html; charset=utf-8" />
<title>Classes</title>
</head>
<body>
<h1>Classes</h1>
<p>The script language <a href="http://www.lua.org/about.html">LUA</a> built into VMProtect is object-oriented: it is very similar to JavaScript in its syntax, ideology and implementation.
The script language includes standard classes providing basic functionality and specialized classes giving access to application protection functionality.
</p>
<h3>Class hierarchy</h3>
<ul>
<li><a href="#Core">Core</a><ul>
<li><a href="#Watermarks">Watermarks</a><ul>
<li><a href="#Watermark">Watermark</a></li>
</ul></li>
<li><a href="#Licenses">Licenses</a><ul>
<li><a href="#License">License</a></li>
</ul></li>
<li><a href="#Files">Files</a><ul>
<li><a href="#File">File</a></li>
</ul></li>
<li><a href="#Folders">Folders</a><ul>
<li><a href="#Folder">Folder</a></li>
</ul></li>
<li><a href="#PEFile">PEFile</a><ul>
<li><a href="#PEFormat">PEFormat</a><ul>
</ul></li>
<li><a href="#PEArchitecture">PEArchitecture</a><ul>
<li><a href="#PESegments">PESegments</a><ul>
<li><a href="#PESegment">PESegment</a></li>
</ul></li>
<li><a href="#PESections">PESections</a><ul>
<li><a href="#PESection">PESection</a></li>
</ul></li>
<li><a href="#PEDirectories">PEDirectories</a><ul>
<li><a href="#PEDirectory">PEDirectory</a></li>
</ul></li>
<li><a href="#PEImports">PEImports</a><ul>
<li><a href="#PEImport">PEImport</a></li>
</ul></li>
<li><a href="#PEExports">PEExports</a><ul>
<li><a href="#PEExport">PEExport</a></li>
</ul></li>
<li><a href="#PEResources">PEResources</a><ul>
<li><a href="#PEResource">PEResource</a></li>
</ul></li>
<li><a href="#PEFixups">PEFixups</a><ul>
<li><a href="#PEFixup">PEFixup</a></li>
</ul></li>
</ul></li>
</ul></li>
<li><a href="#MacFile">MacFile</a><ul>
<li><a href="#MacFormat">MacFormat</a><ul>
</ul></li>
<li><a href="#MacArchitecture">MacArchitecture</a><ul>
<li><a href="#MacSegments">MacSegments</a><ul>
<li><a href="#MacSegment">MacSegment</a></li>
</ul></li>
<li><a href="#MacSections">MacSections</a><ul>
<li><a href="#MacSection">MacSection</a></li>
</ul></li>
<li><a href="#MacCommands">MacCommands</a><ul>
<li><a href="#MacCommand">MacCommand</a></li>
</ul></li>
<li><a href="#MacSymbols">MacSymbols</a><ul>
<li><a href="#MacSymbol">MacSymbol</a></li>
</ul></li>
<li><a href="#MacImports">MacImports</a><ul>
<li><a href="#MacImport">MacImport</a></li>
</ul></li>
<li><a href="#MacExports">MacExports</a><ul>
<li><a href="#MacExport">MacExport</a></li>
</ul></li>
<li><a href="#MacFixups">MacFixups</a><ul>
<li><a href="#MacFixup">MacFixup</a></li>
</ul></li>
</ul></li>
</ul></li>
<li><a href="#MapFunctions">MapFunctions</a><ul>
<li><a href="#MapFunction">MapFunction</a><ul>
<li><a href="#References">References</a><ul>
<li><a href="#Reference">Reference</a></li>
</ul></li>
</ul></li>
</ul></li>
<li><a href="#IntelFunctions">IntelFunctions</a><ul>
<li><a href="#IntelFunction">IntelFunction</a><ul>
<li><a href="#IntelSegment">IntelSegment</a><ul>
<li><a href="#IntelRegistr">IntelRegistr</a></li>
<li><a href="#IntelCommandType">IntelCommandType</a></li>
<li><a href="#IntelFlag">IntelFlag</a></li>
<li><a href="#IntelCommand">IntelCommand</a><ul>
<li><a href="#OperandType">OperandType</a><ul>
<li><a href="#IntelOperand">IntelOperand</a></li>
</ul></li>
</ul></li>
</ul></li>
<li><a href="#CommandLinks">CommandLinks</a><ul>
<li><a href="#LinkType">LinkType</a><ul>
<li><a href="#CommandLink">CommandLink</a></li>
</ul></li>
</ul></li>
</ul></li>
</ul></li>
</ul></li>
<li><a href="#FFILibrary">FFILibrary</a><ul>
<li><a href="#FFIFunction">FFIFunction</a></li>
</ul></li>
</ul>
<h3>Core</h3>
<p id="ProjectOption">Project options:</p>
<pre class="code">
enum ProjectOption {
None,
Pack,
ImportProtection,
MemoryProtection,
ResourceProtection,
CheckDebugger,
CheckKernelDebugger,
CheckVirtualMachine,
StripFixups,
StripDebugInfo,
DebugMode
}
</pre>
<p id="Core">A class to work with the VMProtect core:</p>
<pre class="code" id="Core">
class Core {
public:
string projectFileName(); // returns the name of the project
void saveProject(); // saves the project
string inputFileName(); // returns the name of the source file for the current project
string outputFileName(); // returns the name of the output file for the current project
void setOutputFileName(string name); // sets the name of the output file for the current project
string watermarkName(); // returns the name of the watermark of the current project
void setWatermarkName(string name); // sets the name of the watermark for the current project
int options(); // returns <a href="#ProjectOption">options</a> of the current project
void setOptions(int options); // sets options of the current project
string vmSectionName(); // returns VM segment name for the current project
void setVMSectionName(); // sets VM segment name for the current project
<a href="#Licenses">Licenses</a> licenses(); // returns the list of licenses for the current project
<a href="#Files">Files</a> files(); // returns the list of files for the current project
<a href="#Watermarks">Watermarks</a> watermarks(); // returns the list of watermarks
<a href="#PEFile">PEFile</a>/<a href="#MacFile">MacFile</a> inputFile(); // returns source file
<a href="#PEFile">PEFile</a>/<a href="#MacFile">MacFile</a> outputFile(); // returns output file
<a href="#PEArchitecture">PEArchitecture</a>/<a href="#MacArchitecture">MacArchitecture</a> inputArchitecture(); // returns source architecture
<a href="#PEArchitecture">PEArchitecture</a>/<a href="#MacArchitecture">MacArchitecture</a> outputArchitecture(); // returns output architecture
};
</pre>
<h3>Watermarks</h3>
<p id="Watermarks">A class to work with the list of <a href="watermarks.htm">watermarks</a>:</p>
<pre class="code">
class Watermarks {
public:
<a href="#Watermark">Watermark</a> item(int index); // returns a watermark with the given index
int count(); // returns a number of watermarks in the list
<a href="#Watermark">Watermark</a> itemByName(string name); // returns a watermark with the given name
<a href="#Watermark">Watermark</a> add(string name, string value); // adds a watermark with the given name and value
}
</pre>
<p id="Watermark">A class to work with a watermark:</p>
<pre class="code">
class Watermark {
public:
string name(); // returns the name of the watermark
string value(); // returns the value of the watermarks
bool blocked(); // returns the "Blocked" property
void setBlocked(bool value); // sets the "Blocked" property
}
</pre>
<h3>Licenses</h3>
<p id="Licenses">A class to work with the list of <a href="manager/licenses.htm">licenses</a>:</p>
<pre class="code">
class Licenses {
public:
int keyLength(); // returns the length of the key
string publicExp(); // returns the public exponent
string privateExp(); // returns the private exponent
string modulus(); // returns modulus
<a href="#License">License</a> item(int index); // returns a license with the given index
int count(); // returns the number of licenses in the list
}
</pre>
<p id="License">A class to work with a license:</p>
<pre class="code">
class License {
public:
string date(string format = "%c"); // returns the date of the license
string customerName(); // returns the name of the license owner
string customerEmail(); // returns an e-mail of the license owner
string orderRef(); // returns the order id the license was purchased
string comments(); // returns comments to the license
string serialNumber(); // returns the serial number of the license
bool blocked(); // returns the "Blocked" property
void setBlocked(bool value); // sets the "Blocked" property
}
</pre>
<h3>Files</h3>
<p id="Files">A class to work with the list of <a href="project_files.htm">files</a>:</p>
<pre class="code">
class Files {
public:
<a href="#File">File</a> item(int index); // returns a file with the given index
int count(); // returns the number of files in the list
}
</pre>
<p id="File">A class to work with a <a href="project_files.htm">file</a>:</p>
<pre class="code">
class File {
public:
string name(); // returns the name of the file
string fileName(); // returns the filename
int options(); // returns options
void setName(string name); // sets the name of the file
void setFileName(string name); // sets the filename of the file
void setOptions(); // sets options
}
</pre>
<h3>Folders</h3>
<p id="Folders">A class to work with custom folders:</p>
<pre class="code">
class Folders {
public:
int count(); // returns the number of folders in the list
<a href="#Folder">Folder</a> item(int index); // returns a folder with the given index
<a href="#Folder">Folder</a> add(string name); // adds a new folder
void clear(); // clears the list
};
</pre>
<p id="Folder">A class to work with a custom folder:</p>
<pre class="code" id="Folder">
class Folder {
public:
int count(); // returns the number of subfolders
<a href="#Folder">Folder</a> item(int index); // returns a subfolder with the given index
<a href="#Folder">Folder</a> add(string name); // adds a new subfolder
string name(); // returns the name of the folder
void clear(); // clears the list of subfolders
void destroy(); // destroys the folder an all child subfolders
};
</pre>
<h3>PE files</h3>
<p id="PEFormat">Constants to work with the PE format:</p>
<pre class="code">
enum PEFormat {
// Directory Entries
IMAGE_DIRECTORY_ENTRY_EXPORT,
IMAGE_DIRECTORY_ENTRY_IMPORT,
IMAGE_DIRECTORY_ENTRY_RESOURCE,
IMAGE_DIRECTORY_ENTRY_EXCEPTION,
IMAGE_DIRECTORY_ENTRY_SECURITY,
IMAGE_DIRECTORY_ENTRY_BASERELOC,
IMAGE_DIRECTORY_ENTRY_DEBUG,
IMAGE_DIRECTORY_ENTRY_ARCHITECTURE,
IMAGE_DIRECTORY_ENTRY_TLS,
IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG,
IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT,
IMAGE_DIRECTORY_ENTRY_IAT,
IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT,
IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR,
// Section characteristics
IMAGE_SCN_CNT_CODE,
IMAGE_SCN_CNT_INITIALIZED_DATA,
IMAGE_SCN_CNT_UNINITIALIZED_DATA,
IMAGE_SCN_MEM_DISCARDABLE,
IMAGE_SCN_MEM_NOT_CACHED,
IMAGE_SCN_MEM_NOT_PAGED,
IMAGE_SCN_MEM_SHARED,
IMAGE_SCN_MEM_EXECUTE,
IMAGE_SCN_MEM_READ,
IMAGE_SCN_MEM_WRITE,
// Resource types
RT_CURSOR,
RT_BITMAP,
RT_ICON,
RT_MENU,
RT_DIALOG,
RT_STRING,
RT_FONTDIR,
RT_FONT,
RT_ACCELERATOR,
RT_RCDATA,
RT_MESSAGETABLE,
RT_GROUP_CURSOR,
RT_GROUP_ICON,
RT_VERSION,
RT_DLGINCLUDE,
RT_PLUGPLAY,
RT_VXD,
RT_ANICURSOR,
RT_ANIICON,
RT_HTML,
RT_MANIFEST,
RT_DLGINIT,
RT_TOOLBAR
};
</pre>
<p id="PEFile">A class to work with a PE file:</p>
<pre class="code">
class PEFile {
public:
string name(); // returns the filename
string format(); // returns the "PE" format name
uint64 size(); // returns the size of the file
int count(); // returns the number of architectures in the list
<a href="#PEArchitecture">PEArchitecture</a> item(int index); // returns an architecture with the given index
uint64 seek(uint64 offset); // sets a file position
uint64 tell(); // returns a file position
int write(string buffer); // records a buffer to the file
};
</pre>
<p id="PEArchitecture">A class to work with the PE architecture:</p>
<pre class="code">
class PEArchitecture {
public:
string name(); // returns the name of the architecture
<a href="#PEFile">PEFile</a> file(); // returns the parent file
uint64 entryPoint(); // returns the starting address
uint64 imageBase(); // returns the base offset
<a href="#OperandSize">OperandSize</a> cpuAddressSize(); // returns bit count of the architecture
uint64 size(); // returns the size of the architecture
<a href="#PESegments">PESegments</a> segments(); // returns the list of segments
<a href="#PESections">PESections</a> sections(); // returns the list of sections
<a href="#PEDirectories">PEDirectories</a> directories(); // returns the list of directories
<a href="#PEImports">PEImports</a> imports(); // returns the list of imported libraries
<a href="#PEExports">PEExports</a> exports(); // returns the list of exported functions
<a href="#PEResources">PEResources</a> resources(); // returns the list of resources
<a href="#PEFixups">PEFixups</a> fixups(); // returns the list of relocations (fixups);
<a href="#MapFunctions">MapFunctions</a> mapFunctions(); // returns the list of functions available for protection
<a href="#IntelFunctions">IntelFunctions</a> functions(); // returns the list of protected functions
bool addressSeek(uint64 address); // sets a file position
uint64 seek(uint64 offset); // sets a file position
uint64 tell(); // returns a file position
int write(string buffer); // writes a buffer to a file
};
</pre>
<p id="PESegments">A class to work with the list of segments for the PE architecture:</p>
<pre class="code">
class PESegments {
public:
<a href="#PESegment">PESegment</a> item(int index); // returns a segment with the given index
int count(); // returns the number of segments in the list
<a href="#PESegment">PESegment</a> itemByAddress(uint64 address); // returns the segment at the given address
};
</pre>
<p id="PESegment">A class to work with a PE architecture segment:</p>
<pre class="code">
class PESegment {
public:
uint64 address(); // returns the address of the segment
string name(); // returns the name of the segment
uint64 size(); // returns the size of the segment
int physicalOffset(); // returns the file position (offset) of the segment
int physicalSize(); // returns the file size of the segment
int flags(); // returns flags of the segment
bool excludedFromPacking(); // returns the "Excluded from packing" property
void setName(string name); // sets the name of the segment
};
</pre>
<p id="PESections">A class to work with the list of PE architecture sections:</p>
<pre class="code">
class PESections {
public:
<a href="#PESection">PESection</a> item(int index); // returns a section with the given index
int count(); // returns the number of sections in the list
<a href="#PESection">PESection</a> itemByAddress(uint64 address); // returns a section at the given address
};
</pre>
<p id="PESection">A class to work with a PE architecture section:</p>
<pre class="code">
class PESection {
public:
uint64 address(); // returns the address of the section
string name(); // returns the name of the section
uint64 size(); // returns the size of the section
int offset(); // returns the file positions of the section
<a href="#PESegment">PESegment</a> segment(); // returns the parent segment
};
</pre>
<p id="PEDirectories">A class to work with PE architecture directories:</p>
<pre class="code">
class PEDirectories {
public:
<a href="#PEDirectory">PEDirectory</a> item(int index); // returns a directory with the given index
int count(); // returns the number of directories in the list
<a href="#PEDirectory">PEDirectory</a> itemByType(int type); // returns a directory of the given type
};
</pre>
<p id="PEDirectory">A class to work with a PE architecture directory:</p>
<pre class="code">
class PEDirectory {
public:
uint64 address(); // returns the address of the directory
string name(); // returns the name of the directory
uint64 size(); // returns the size of the directory
int type(); // returns the type of the directory
void setAddress(uint64 address); // sets the address of the directory
void setSize(int size); // sets the size of the directory
void clear(); // clears the address and the size of the directory
};
</pre>
<p id="PEImports">A class to work with the list of imported libraries for the PE architecture:</p>
<pre class="code">
class PEImports {
public:
<a href="#PEImport">PEImport</a> item(int index); // returns a library with the given index
int count(); // returns the number of libraries in the list
<a href="#PEImport">PEImport</a> itemByName(string name); // returns a library with the given name
};
</pre>
<p id="PEImport">A class to work with an imported library for the PE architecture :</p>
<pre class="code">
class PEImport {
public:
string name(); // returns the name of the library
<a href="#PEImportFunction">PEImportFunction</a> item(int index); // returns an imported function with the given index
int count(); // returns the number of imported functions
void setName(string name); // sets the name of the library
};
</pre>
<p id="PEImportFunction">A class to work with a PE architecture imported function:</p>
<pre class="code">
class PEImportFunction {
public:
uint64 address(); // returns a memory address where the imported function address is stored
string name(); // returns the name of the imported function
};
</pre>
<p id="PEExports">A class to work with the list of exported functions for the PE architecture :</p>
<pre class="code">
class PEExports {
public:
string name(); // returns the name of the library
void setName(string name); // sets the name of the library
<a href="#PEExport">PEExport</a> item(int index); // returns an exported function with the given index
int count(); // returns the number of exported functions in the list
void clear(); // clears the list
<a href="#PEExport">PEExport</a> itemByAddress(uint64 address); // returns an exported function at the given address
<a href="#PEExport">PEExport</a> itemByName(string name); // returns an exported function with the given name
};
</pre>
<p id="PEExport">A class to wotk with a PE architecture exported function:</p>
<pre class="code">
class PEExport {
public:
uint64 address(); // returns the address of the exported function
string name(); // returns the name of the exported function
void setName(string name); // sets the name of the exported function
int ordinal(); // returns the ordinal of the exported function
string forwardedName(); // returns the name of the function the exported function forwards to
void destroy(); // destroys the exported function
};
</pre>
<p id="PEResources">A class to work with the list of PE architecture resources:</p>
<pre class="code">
class PEResources {
public:
<a href="#PEResource">PEResource</a> item(int index); // returns a resources with the given index
int count(); // returns the number of resources in the list
void clear(); // clears the list
<a href="#PEResource">PEResource</a> itemByType(int type); // returns a resource of the given type
<a href="#PEResource">PEResource</a> itemByName(string name); // returns a resource with the given name
};
</pre>
<p id="PEResource">A class to work with a PE architecture resource:</p>
<pre class="code">
class PEResource {
public:
<a href="#PEResource">PEResource</a> item(int index); // returns a resource with the given index
int count(); // returns the number of resources in the list
void clear(); // clears the list
uint64 address(); // returns the address of the resource
int size(); // returns the size of the resource
string name(); // returns the name of the resource
int type(); // returns the type of the resource
bool isDirectory(); // returns the "Directory" property
void destroy(); // destroys the resource
<a href="#PEResource">PEResource</a> itemByName(string name); // returns a resource with the given name
bool excludedFromPacking(); // returns the "Excluded from packing" property
};
</pre>
<p id="PEFixups">A class to work with the list of PE architecture fixups (relocations):</p>
<pre class="code">
class PEFixups {
public:
<a href="#PEFixup">PEFixup</a> item(int index); // returns an element with the given index
int count(); // returns the number of elements in the list
<a href="#PEFixup">PEFixup</a> itemByAddress(uint64 address); // returns an element at the given address
};
</pre>
<p id="PEFixup">A class to work with a PE architecture fixup (relocation):</p>
<pre class="code">
class PEFixup {
public:
uint64 address(); // returns the address of the element
};
</pre>
<h3>Mach-O files</h3>
<p id="MacFormat">Constants to work with the Mach-O format:</p>
<pre class="code">
enum MacFormat {
// Load Command Types
LC_SEGMENT,
LC_SYMTAB,
LC_SYMSEG,
LC_THREAD,
LC_UNIXTHREAD,
LC_LOADFVMLIB,
LC_IDFVMLIB,
LC_IDENT,
LC_FVMFILE,
LC_PREPAGE,
LC_DYSYMTAB,
LC_LOAD_DYLIB,
LC_ID_DYLIB,
LC_LOAD_DYLINKER,
LC_PREBOUND_DYLIB,
LC_ROUTINES,
LC_SUB_FRAMEWORK,
LC_SUB_UMBRELLA,
LC_SUB_CLIENT,
LC_SUB_LIBRARY,
LC_TWOLEVEL_HINTS,
LC_PREBIND_CKSUM,
LC_LOAD_WEAK_DYLIB,
LC_SEGMENT_64,
LC_ROUTINES_64,
LC_UUID,
LC_RPATH,
LC_CODE_SIGNATURE,
LC_SEGMENT_SPLIT_INFO,
LC_REEXPORT_DYLIB,
LC_LAZY_LOAD_DYLIB,
LC_ENCRYPTION_INFO,
LC_DYLD_INFO,
LC_DYLD_INFO_ONLY,
LC_LOAD_UPWARD_DYLIB,
LC_VERSION_MIN_MACOSX,
// Section Types
SECTION_TYPE,
SECTION_ATTRIBUTES,
S_REGULAR,
S_ZEROFILL,
S_CSTRING_LITERALS,
S_4BYTE_LITERALS,
S_8BYTE_LITERALS,
S_LITERAL_POINTERS,
S_NON_LAZY_SYMBOL_POINTERS,
S_LAZY_SYMBOL_POINTERS,
S_SYMBOL_STUBS,
S_MOD_INIT_FUNC_POINTERS,
S_MOD_TERM_FUNC_POINTERS,
S_COALESCED,
S_GB_ZEROFILL,
S_INTERPOSING,
S_16BYTE_LITERALS,
S_DTRACE_DOF,
S_LAZY_DYLIB_SYMBOL_POINTERS,
SECTION_ATTRIBUTES_USR,
S_ATTR_PURE_INSTRUCTIONS,
S_ATTR_NO_TOC,
S_ATTR_STRIP_STATIC_SYMS,
S_ATTR_NO_DEAD_STRIP,
S_ATTR_LIVE_SUPPORT,
S_ATTR_SELF_MODIFYING_CODE,
S_ATTR_DEBUG,
SECTION_ATTRIBUTES_SYS,
S_ATTR_SOME_INSTRUCTIONS,
S_ATTR_EXT_RELOC,
S_ATTR_LOC_RELOC
};
</pre>
<p id="MacFile">A class to work with a Mach-O file:</p>
<pre class="code">
class MacFile {
public:
string name(); // returns the name of the file
string format(); // returns the name of the "Mach-O" format
uint64 size(); // returns the size of the file
int count(); // returns the number of architectures in the list
<a href="#MacArchitecture">MacArchitecture</a> item(int index); // returns an architecture with the given index
uint64 seek(uint64 offset); // sets the file position
uint64 tell(); // returns the file position
int write(string buffer); // writes a buffer to the file
};
</pre>
<p id="MacArchitecture">A class to work with the Mach-O architecture:</p>
<pre class="code">
class MacArchitecture {
public:
string name(); // returns the name of the architecture
<a href="#MacFile">MacFile</a> file(); // returns the parent file
uint64 entryPoint(); // returns the starting address
<a href="#OperandSize">OperandSize</a> cpuAddressSize(); // returns bit count of the architecture
uint64 size(); // returns the size of the architecture
<a href="#MacSegments">MacSegments</a> segments(); // returns the list of segments
<a href="#MacSections">MacSections</a> sections(); // returns the list of sections
<a href="#MacCommands">MacCommands</a> commands(); // returns the list of load commands
<a href="#MacSymbols">MacSymbols</a> symbols(); // returns the list of symbols
<a href="#MacImports">MacImports</a> imports(); // returns the list of imported libraries
<a href="#MacExports">MacExports</a> exports(); // returns the list of exported functions
<a href="#MacFixups">MacFixups</a> fixups(); // returns the list of fixups (relocations)
<a href="#MapFunctions">MapFunctions</a> mapFunctions(); // returns the list of functions available for protection
<a href="#IntelFunctions">IntelFunctions</a> functions(); // returns the list of protected functions
bool addressSeek(uint64 address); // sets the file position
uint64 seek(uint64 offset); // sets the file position
uint64 tell(); // returns the file position
int write(string buffer); // writes a buffer to the file
};
</pre>
<p id="MacSegments">A class to work with the list of Mach-O architecture segments:</p>
<pre class="code">
class MacSegments {
public:
<a href="#MacSegment">MacSegment</a> item(int index); // returns a segment with the given index
int count(); // returns the number of segments in the list
<a href="#MacSegment">MacSegment</a> itemByAddress(); // returns a segment at the given address
};
</pre>
<p id="MacSegment">A class to work with a Mach-O architecture segment:</p>
<pre class="code" id="MacSegment">
class MacSegment {
public:
uint64 address(); // returns the address of the segment
string name(); // returns the name of the segment
uint64 size(); // returns the size of the segment
int physicalOffset(); // returns the file position of the segment
int physicalSize(); // returns the file size of the segment
int flags(); // returns flags of the segment
bool excludedFromPacking(); // returns the "Excluded from packing" property
};
</pre>
<p id="MacSections">A class to work with the list of Mach-O architecture sections:</p>
<pre class="code">
class MacSections {
public:
<a href="#MacSection">MacSection</a> item(int index); // returns a section with the given index
int count(); // returns the number of sections in the list
<a href="#MacSection">MacSection</a> itemByAddress(uint64 address); // returns a section at the given address
};
</pre>
<p id="MacSection">A class to work with a Mach-O architecture section:</p>
<pre class="code">
class MacSection {
public:
uint64 address(); // returns the address of the section
string name(); // returns the name of the section
uint64 size(); // returns the size of the section
int offset(); // returns the file position of the section
<a href="#MacSegment">MacSegment</a> segment(); // returns the parent segment
};
</pre>
<p id="MacCommands">A class to work with the list of Mach-O architecture load commands:</p>
<pre class="code">
class MacCommands {
public:
<a href="#MacCommand">MacCommand</a> item(int index); // returns a command with the given index
int count(); // returns the number of command in the list
<a href="#MacCommand">MacCommand</a> itemByType(int type); // returns a command of the given type
};
</pre>
<p id="MacCommand">A class to work with a Mach-O architecture load command:</p>
<pre class="code">
class MacCommand {
public:
uint64 address(); // returns the address of the command
int type(); // returns the type of the command
string name(); // returns the name of the command
int size(); // returns the size of the command
};
</pre>
<p id="MacSymbols">A class to work with the list of Mach-O architecture symbols:</p>
<pre class="code">
class MacSymbols {
public:
<a href="#MacSymbol">MacSymbol</a> item(int index); // returns a symbol with the given index
int count(); // returns the number of symbols in the list
};
</pre>
<p id="MacSymbol">A class to work with a Mach-O architecture symbol:</p>
<pre class="code">
class MacSymbol {
public:
uint64 value(); // returns the value of the symbol
string name(); // returns the name of the symbol
};
</pre>
<p id="MacImports">A class to work with the list of imported libraries for the Mach-O architecture:</p>
<pre class="code">
class MacImports {
public:
<a href="#MacImport">MacImport</a> item(int index); // returns an imported library with the given index
int count(); // returns the number of imported libraries in the list
<a href="#MacImport">MacImport</a> itemByName(string name); // returns an imported library with the given name
};
</pre>
<p id="MacImport">A class to work with a Mach-O architecture imported library:</p>
<pre class="code">
class MacImport {
public:
string name(); // returns the name of the imported library
<a href="#MacImportFunction">MacImportFunction</a> item(int index); // returns an imported function with the given index
int count(); // returns the number of imported functions in the list
void setName(string name); // sets the name of the imported library
};
</pre>
<p id="MacImportFunction">A class to work with a Mach-O architecture imported function:</p>
<pre class="code">
class MacImportFunction {
public:
uint64 address(); // returns the memory address where the address of the imported function is stored
string name(); // returns the name of the imported function
};
</pre>
<p id="MacExports">A class to work with the list of exported functions for the Mach-O architecture:</p>
<pre class="code">
class MacExports {
public:
string name(); // returns the name of the library
<a href="#MacExport">MacExport</a> item(); // returns an exported function with the given index
int count(); // returns the number of exported functions in the list
void clear(); // clears the list
<a href="#MacExport">MacExport</a> itemByAddress(uint64 address); // returns an exported function at the given address
<a href="#MacExport">MacExport</a> itemByName(string name); // returns an exported function with the given name
};
</pre>
<p id="MacExport">A class to work with a Mach-O architecture exported function:</p>
<pre class="code">
class MacExport {
public:
uint64 address(); // returns the address of the exported function
string name(); // returns the name of the exported function
string forwardedName(); // returns the name of the function the exported function is forwarded to
void destroy(); // destroys the exported function
};
</pre>
<p id="MacFixups">A class to work with the list of fixups (relocations) for the Mach-O architecture:</p>
<pre class="code">
class MacFixups {
public:
<a href="#MacFixup">MacFixup</a> item(int index); // returns an element with the given index
int count(); // returns the number of elements in the list
<a href="#MacFixup">MacFixup</a> itemByAddress(uint64 address); // returns an element at the given address
};
</pre>
<p id="MacFixup">A class to work with a Mach-O architecture fixup:</p>
<pre class="code">
class MacFixup {
public:
uint64 address(); // returns the address of the element
};
</pre>
<h3>Functions</h3>
<p id="MapFunctions">A class to work with the list of functions:</p>
<pre class="code">
class MapFunctions {
public:
<a href="#MapFunction">MapFunction</a> item(int index); // returns a function with the given index
int count(); // returns the number of functions in the list
<a href="#MapFunction">MapFunction</a> itemByAddress(uint64 address); // returns a function at the given address
<a href="#MapFunction">MapFunction</a> itemByName(string name); // returns a function with the given name
};
</pre>
<p id="ObjectType">Types of functions:</p>
<pre class="code">
enum ObjectType {
Unknown,
Code,
Data,
Export,
Marker,
APIMarker,
Import,
String
};
</pre>
<p id="MapFunction">A class to work with a function:</p>
<pre class="code">
class MapFunction {
public:
uint64 address(); // returns the address of the function
string name(); // returns the name of the function
<a href="#ObjectType">ObjectType</a> type(); // returns the type of the function
<a href="#References">References</a> references(); // returns the list of references
};
</pre>
<p id="References">A class to work with the list of references:</p>
<pre class="code">
class References {
public:
<a href="#Reference">Reference</a> item(int index); // returns a reference with the given index
int count(); // returns the number of references in the list
};
</pre>
<p id="Reference">A class to work with a reference:</p>
<pre class="code">
class Reference {
public:
uint64 address(); // returns the address of the command
uint64 operandAddress(); // returns the address of the references
};
</pre>
<h3>Intel functions</h3>
<p id="IntelFunctions">A class to work with the list of Intel functions:</p>
<pre class="code">
class IntelFunctions {
public:
<a href="#IntelFunction">IntelFunction</a> item(int index); // returns a function with the given index
int count(); // returns the number of functions in the list
void clear(); // clears the list
<a href="#IntelFunction">IntelFunction</a> itemByAddress(uint64 address); // returns a function at the given address
<a href="#IntelFunction">IntelFunction</a> itemByName(string name); // returns a function with the given name
<a href="#IntelFunction">IntelFunction</a> addByAddress(uint64 address, <a href="#CompilationType">CompilationType</a> type = ctVirtualization);
// Adds a new function with the given address and compilation type
};
</pre>
<p id="CompilationType">Compilation types:</p>
<pre class="code">
enum CompilationType {
None,
Virtualization,
Mutation,
Ultra
};
</pre>
<p id="IntelFunction">A class to work with an Intel function:</p>
<pre class="code">
class IntelFunction {
public:
uint64 address(); // returns the address of the function
string name(); // returns the name of the function
<a href="#ObjectType">ObjectType</a> type(); // returns the type of the function
<a href="#IntelCommand">IntelCommand</a> item(int index); // returns a command with the given index
int count(); // returns the number of commands in the list
<a href="#CompilationType">CompilationType</a> compilationType(); // returns the compilation type
void setCompilationType(<a href="#CompilationType">CompilationType</a> value); // sets the compilation type
<a href="#CommandLinks">CommandLinks</a> links(); // returns the list of links
<a href="#IntelCommand">IntelCommand</a> itemByAddress(uint64 address); // returns a command at the given address
void destroy(); // destroys the function
<a href="#Folder">Folder</a> folder(); // returns the custom folder
void setFolder(<a href="#Folder">Folder</a> folder); // sets the custom folder
};
</pre>
<p id="IntelCommandType">Types of Intel commands:</p>
<pre class="code">
enum IntelCommandType {
Unknown, Push, Pop, Mov, Add, Xor, Test, Lea, Ud0, Ret, Ssh, Crc, Call, Jmp,
Fstsw, Fsqrt, Fchs, Fstcw, Fldcw, Fild, Fist, Fistp, Fld, Fstp, Fst, Fadd,
Fsub, Fsubr, Fisub, Fisubr, Fdiv, Fcomp, Fmul, Repe, Repne, Rep, DB, DW, DD, DQ,
Movs, Cmps, Scas, Movzx, Movsx, Inc, Dec, Les, Lds, Lfs, Lgs, Lss, Xadd, Bswap,
Jxx, And, Sub, Stos, Lods, Nop, Xchg, Pushf, Popf, Sahf, Lahf, Shl, Shr, Sal,
Sar, Rcl, Rcr, Rol, Ror, Shld, Shrd, Loope, Loopne, Loop, Jcxz, In, Ins, Out,
Outs, Wait, Cbw, Cwde, Cdqe, Cwd, Cdq, Cqo, Clc, Stc, Cli, Sti, Cld, Std, Not,
Neg, Div, Imul, Idiv, Mul, Or, Adc, Cmp, Sbb, Pusha, Popa, Clflush, Pause,
Bound, Arpl, Daa, Das, Aaa, Aam, Aad, Aas, Enter, Leave, Int, Into, Iret, Set,
Cmov, Addpd, Addps, Addsd, Addss, Andpd, Andps, Andnpd, Andnps, Cmppd, Cmpps,
Cmpsd, Cmpss, Comisd, Comiss, Cvtdq2ps, Cvtpd2dq, Cvtdq2pd, Cvtpd2pi, Cvtps2pi,
Cvtpd2ps, Cvtps2pd, Cvtpi2pd, Cvtpi2ps, Cvtps2dq, Cvtsd2si, Cvtss2si, Cvtsd2ss,
Cvtss2sd, Cvttpd2pi, Cvttps2pi, Cvttpd2dq, Cvttps2dq, Cvttsd2si, Cvttss2si,
Divpd, Divps, Divsd, Divss, Maxpd, Maxps, Maxsd, Maxss, Minpd, Minps, Minsd,
Minss, Mulpd, Mulps, Mulsd, Mulss, Orpd, Orps, Movd, Movq, Movntq, Movapd, Movaps,
Movdqa, Movdqu, Movdq2q, Movq2dq, Movhlps, Movhpd, Movhps, Movlhps, Movlpd,
Movlps, Movmskpd, Movmskps, Movnti, Movntpd, Movntps, Movsd, Movss, Movupd,
Movups, Pmovmskb, Psadbw, Pshufw, Pshufd, Pshuflw, Pshufhw, Psubb, Psubw, Psubd,
Psubq, Psubsb, Psubsw, Psubusb, Psubusw, Paddb, Paddw, Paddd, Paddq, Paddsb,
Paddsw, Paddusb, Paddusw, Pavgb, Pavgw, Pinsrw, Pextrw, Pmaxsw, Pmaxub, Pminsw,
Pminub, Pmulhuw, Pmulhw, Pmullw, Pmuludq, Psllw, Pslld, Psllq, Pslldq, Psraw,
Psrad, Psrlw, Psrld, Psrlq, Psrldq, Punpcklbw, Punpcklwd, Punpckldq, Punpcklqdq,
Punpckhqdq, Packusdw, Pcmpgtb, Pcmpgtw, Pcmpgtd, Pcmpeqb, Pcmpeqw, Pcmpeqd,
Emms, Packsswb, Packuswb, Punpckhbw, Punpckhwd, Punpckhdq, Packssdw, Pand,
Pandn, Por, Pxor, Pmaddwd, Rcpps, Rcpss, Rsqrtss, Movsxd, Shufps, Shufpd, Sqrtpd,
Sqrtps, Sqrtsd, Sqrtss, Subpd, Subps, Subsd, Subss, Ucomisd, Ucomiss, Unpckhpd,
Unpckhps, Unpcklpd, Unpcklps, Xorpd, Xorps, Bt, Bts, Btr, Btc, Xlat, Cpuid,
Rsm, Bsf, Bsr, Cmpxchg, Cmpxchg8b, Hlt, Cmc, Lgdt, Sgdt, Lidt, Sidt, Smsw, Lmsw,
Invlpg, Lar, Lsl, Clts, Invd, Wbinvd, Ud2, Wrmsr, Rdtsc, Rdmsr, Rdpmc, Fcom,
Fdivr, Fiadd, Fimul, Ficom, Ficomp, Fidiv, Fidivr, Faddp, Fmulp, Fsubp, Fsubrp,
Fdivp, Fdivrp, Fbld, Fbstp, Ffree, Frstor, Fsave, Fucom, Fucomp, Fldenv, Fstenvm,
Fxch, Fabs, Fxam, Fld1, Fldl2t, Fldl2e, Fldpi, Fldlg2, Fldln2, Fldz, Fyl2x,
Fptan, Fpatan, Fxtract, Fprem1, Fdecstp, Fincstp, Fprem, Fyl2xp1, Fsincos, Frndint,
Fscale, Fsin, Fcos, Ftst, Fstenv, F2xm1, Fnop, Finit, Fclex, Fcompp, Sysenter,
Sysexit, Sldt, Str, Lldt, Ltr, Verr, Verw, Sfence, Lfence, Mfence, Prefetchnta,
Prefetcht0, Prefetcht1, Prefetcht2, Prefetch, Prefetchw, Fxrstor, Fxsave, Ldmxcsr,
Stmxcsr, Fcmovb, Fcmove, Fcmovbe, Fcmovu, Fcmovnb, Fcmovne, Fcmovnbe, Fcmovnu,
Fucomi, Fcomi, Fucomip, Fcomip, Fucompp, Vmcall, Vmlaunch, Vmresume, Vmxoff,
Monitor, Mwait, Xgetbv, Xsetbv, Vmrun, Vmmcall, Vmload, Vmsave, Stgi, Clgi,
Skinit, Invlpga, Swapgs, Rdtscp, Syscall, Sysret, Femms, Getsec, Pshufb, Phaddw,
Phaddd, Phaddsw, Pmaddubsw, Phsubw, Phsubd, Phsubsw, Psignb, Psignw, Psignd,
Pmulhrsw, Pabsb, Pabsw, Pabsd, Movbe, Palignr, Rsqrtps, Vmread, Vmwrite, Svldt,
Rsldt, Svts, Rsts, Xsave, Xrstor, Vmptrld, Vmptrst, Maskmovq, Fnstenv, Fnstcw,
Fstp1, Fneni, Fndisi, Fnclex, Fninit, Fsetpm, Fisttp, Fnsave, Fnstsw, Fxch4,
Fcomp5, Ffreep, Fxch7, Fstp8, Fstp9, Haddpd, Hsubpd, Addsubpd, Addsubps, Movntdq,
Fcom2, Fcomp3, Haddps, Hsubps, Movddup, Movsldup, Cvtsi2sd, Cvtsi2ss, Movntsd,
Movntss, Lddqu, Movshdup, Popcnt, Tzcnt, Lzcnt, Pblendvb, Pblendps, Pblendpd,
Ptest, Movsxbw, Movsxbd, Movsxbq, Movsxwd, Movsxwq, Movsxdq, Muldq, Pcmpeqq,
Movntdqa, Xsaveopt, Maskmovdqu, Ud1, Pcmpgtq, Movzxbw, Movzxbd, Movzxbq, Movzxwd,
Movzxwq, Movzxdq
};
</pre>
<p id="IntelSegment">Intel segments:</p>
<pre class="code">
enum IntelSegment {
None,
es,
cs,
ss,
ds,
fs,
gs
};
</pre>
<p id="IntelFlag">Intel flags:</p>
<pre class="code">
enum IntelFlag {
C,
P,
A,
Z,
S,
T,
I,
D,
O
};
</pre>
<p id="IntelRegistr">Intel registers:</p>
<pre class="code">
enum IntelRegistr {
eax,
ecx,
edx,
ebx,
esp,
ebp,
esi,
edi,
r8,
r9,
r10,
r11,
r12,
r13,
r14,
r15
};
</pre>
<p id="IntelCommand">A class to work with an Intel command:</p>
<pre class="code">
class IntelCommand {
public:
uint64 address(); // returns the address of the command
<a href="#IntelCommandType">IntelCommandType</a> type(); // returns the type of the command
string text(); // returns the text representation
int size(); // returns the size of the command
int dump(int index); // returns data of the command with the given index
<a href="#CommandLink">CommandLink</a> link(); // returns the command link
int flags(); // returns command flags
<a href="#IntelSegment">IntelSegment</a> baseSegment(); // returns the base segment
<a href="#IntelCommandType">IntelCommandType</a> preffix(); // returns the type of the prefix command
<a href="#IntelOperand">IntelOperand</a> operand(int index); // returns an operand with the given index
};
</pre>
<p id="OperandType">Operand types:</p>
<pre class="code">
enum OperandType {
None,
Value,
Registr,
Memory,
SegmentRegistr,
ControlRegistr,
DebugRegistr,
FPURegistr,
HiPartRegistr,
BaseRegistr,
MMXRegistr,
XMMRegistr
};
</pre>
<p id="OperandSize">Operand sizes:</p>
<pre class="code">
enum OperandSize {
Byte,
Word,
DWord,
QWord,
TByte,
OWord,
FWord
};
</pre>
<p id="IntelOperand">A class to work with an operand of the Intel command:</p>
<pre class="code">
class IntelOperand {
public:
int type(); // returns the type of the operand
<a href="#OperandSize">OperandSize</a> size(); // returns the size of the operand
int registr(); // returns the register
int baseRegistr(); // returns the base register
int scale(); // returns the scale
uint64 value(); // returns the value
};
</pre>
<p id="CommandLinks">A class to work with the list of command links:</p>
<pre class="code" id="CommandLinks">
class CommandLinks {
public:
<a href="#CommandLink">CommandLink</a> item(int index); // returns a link with the given index
int count(); // returns the number of links in the list
};
</pre>
<p id="LinkType">Link types:</p>
<pre class="code">
enum LinkType {
None,
SEHBlock,
FinallyBlock,
DualSEHBlock,
FilterSEHBlock,
Jmp,
JmpWithFlag,
JmpWithFlagNSFS,
JmpWithFlagNSNA,
JmpWithFlagNSNS,
Call,
Case,
Switch,
Native,
Offset,
GateOffset,
ExtSEHBlock,
MemSEHBlock,
ExtSEHHandler,
VBMemSEHBlock
};
</pre>
<p id="CommandLink">A class to work with a command link:</p>
<pre class="code">
class CommandLink {
public:
uint64 toAddress(); // returns the address the link refers
<a href="#LinkType">LinkType</a> type(); // returns the type of the link
<a href="#IntelCommand">IntelCommand</a> from(); // returns the parent command
};
</pre>
<p id="FFILibrary">A class to work with a library:</p>
<pre class="code">
enum ParamType {
"void",
"byte",
"char",
"short",
"ushort",
"int",
"uint",
"long",
"ulong",
"size_t",
"float",
"double",
"string",
"pointer"
};
enum CallType {
"default",
"cdecl",
"stdcall"
};
class FFILibrary {
public:
string name(); // returns the name
uint64 address(); // returns the address in the memory
void close();
FFIFunction getFunction(string name, ParamType ret, ParamType param1, ...); // returns a function
FFIFunction getFunction(string name, table (ParamType ret, CallType abi, ParamType, ...)); // returns a function
};
</pre>
<p id="FFIFunction">A class to work with a foreign function:</p>
<pre class="code">
class FFIFunction {
string name(); // returns the name
uint64 address(); // returns the address in the memory
};
</pre>
<br />
<br />
<br />
<br />
<hr noshade="noshade" size="1" />
<div align="center">
© 2006-2015 Copyright VMProtect Software
</div>
</body>
</html>
|