-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathbuf.ahk
202 lines (202 loc) · 43.5 KB
/
buf.ahk
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
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
; Byte functions.
; buffers are char*, that is one byte per 'element'.
;
buf_byte_find(hay, ned, haylen, nedlen, init:=false){
; Finds the first occurance of ned in hay.
; Params:
; hay, buffer to search in.
; ned, buffer to find in hay.
; haylen, length of the buffer hay
; nedlen, length of the buffer ned
; init, internal use, omit.
;
; Returns
; -1, ned is not in hay.
; p, the position of the start of ned in hay. Index is zero based.
; Source:
; byteFind.c
; Url:
; ...
local k, i, raw, p
static flProtect:=0x40, flAllocationType:=0x1000 ; PAGE_EXECUTE_READWRITE ; MEM_COMMIT
static raw32:=strsplit("4290271061,1459617791,216826707,740586635,673477691,539251851,606362763,3296924278,1600019212,1989002077,666668288,0,673467531,687980931,50234353,35554319,1819672576,251920003,41860,83788544,15369487,3380936704,3054486644,114219,210305024,3957885220,649366799,0,956417667,1752572988,4281484344,2315218573,267220471,942804150,3832873291,843888143,38483969,3054492277,939668044,3497329483,2011818121,2315255807,666668534,0,251788931,34693,264865024,4294925700,464916479,440057905,1340673909,2432696319,251796536,4294919556,29393919,4034249017,3087844483,4294967295,1566531163,7769539,2215627141,4294967078,3190535695,1,2300841097,2299653096,666668534,0,956417667,3363185724,4281484344,2315218573,267220471,942804150,3832873291,843888143,38483969,3901348469,4294894057,7769599,3766743177,1703153411,2197815297,2215576056,508,251852931,172932,733351680,2382186125,1955148348,210316324,2313062692,822355012,3958081984,649366809,0,2197930115,3347251650,604256513,4283336207,440074239,3054496373,1312293194,266433793,939674294,3631546958,55227919,1963150904,612139983,2249131012,805,72005135,1963216440,1320554427,310533,1245184000,2309846277,2332566596,686498828,709146127,776222723,2200466691,1815807173,527631396,704951823,1965950008,1152782102,1144521002,192217390,709146127,776222722,2345497602,2299012164,1815684108,2232353828,4294967136,69495947,772584975,254413880,4294922117,608996351,1286999852,1329135118,1032130558,2348810239,254551116,4279127222,268390200,4294912901,4257540607,3062759423,0,2215627141,4294966710,3190535695,1,2300841097,2299915240,666668534,0,956417667,2249139260,4294966868,4281484344,2315218573,266958327,942804150,3765764427,2011818121,2315255805,666668534,0,2302391823,2311074269,4220068876,2422608363,2197930115,70844866,293998372,956301310,267220250,939608758,3832873293,38450703,1963085112,1253445595,55392259,4270051957,3766882052,251658241,939806134,3228894282,88782351,1963281720,311223,669712384,978105871,1028405251,2200401155,4265149639,3054444662,1278753292,376766525,978105871,1028405249,252409089,37375158,37571640,4265201268,4285957391,3488219135,2432696316,2302391823,32408541,210354225,3959130404,29393679,956416643,2249139204,4294966640,3983874616,21673487,1963019576,1253445604,38615042,3054492533,1295516490,2211607811,2249131262,346,72005135,1963216184,1253445568,88946693,79673205,3942645760,1286999847,1278739258,661979965,956614531,253785079,943328438,1962949964,1286999830,1278738746,192217405,978105871,1028405250,969831426,1988431863,268435455,4017334,255462456,4294928517,4230015487,2422669311,2369500687,3716808262,2300841097,822355012,3959130560,29393679,956416643,2249139204,4294966460,3983874616,21673487,1963019576,1253445604,38615042,3054492533,1295516490,2211607811,67380348,10323471,3054436352,1295516746,264140036,939871670,3044345162,1215,608471296,604801800,2422615019,977581583,1027880963,2200532227,2084242631,544408612,973387279,4015160,3054442101,939604548,1963015492,1152782091,1144521274,3430154813,136594571,992218249,251929724,4294926469,1287000063,204996669,1384451898,268435455,4281683126,4281486392,4282615055,1206517759,3221225467,4,4294861289,310783,736690176,3221225469,4,79673835,3909091328,4294967015,2425393296",",")
static raw64:=strsplit("1465210433,4290270038,1174405119,276218169,1566531163,1724079681,8658703,0,29393729,1103636805,251853187,147332,1097889280,251918723,46212,4186128640,4270132996,1157627904,3295985797,448139076,112961,3224436736,258347755,17439,29393736,1992833349,3515434364,18626628,22121797,2302995061,1018564555,2050506777,1155364097,3054490505,943724852,3497329266,39423297,423409167,58341440,1844036213,1107296255,251787651,39045,3229959424,4284122127,3054501887,252786706,290692,3246606336,3955241217,2149519124,0,29459272,268390712,4294914948,29393919,1975531841,4294949099,1583087615,1581342047,3229959619,4279665679,256180223,3108051638,1,350994481,8658703,0,29393736,1992833349,3515434444,18626628,22121797,2302995061,884346827,1916289049,1155364097,3054490505,943724860,3497329274,4294888425,3364439295,313921348,251912323,93060,33063680,35030031,4169334784,3716419330,1157627906,1107122573,838758797,3917693376,1712974593,8658703,0,1208074371,1090634115,2249179193,4294967125,1964062788,2041974763,2050506753,266433793,1073904054,1963096632,2041974743,2050506755,1103983875,251984771,237702,2041974528,2050506756,263812356,3137698486,4,91830336,2833992052,8658703,0,1141078925,959755791,976500804,2072854389,3745072132,55542543,4253614080,884346692,876102697,1971654442,2214592511,256116163,1142502582,253375544,4294927237,2382072319,256115323,1144599734,1949971512,3677962675,4283073807,2303000575,1018564571,1010319386,965021465,2315255807,1018564595,1010319386,696586009,1157627903,3054488457,943725116,2232359228,4294967064,4294812649,2035711,264275269,4294809476,3054454015,28918042,822083584,1713236928,8658703,0,29393736,1170749765,251744653,4294853766,3515434495,18626628,2303059573,3054453450,943722812,3631546746,4294792169,2035711,283885617,1208074371,1090634115,2249179193,4294966801,1964062788,1907757035,1916289025,266433793,1073904054,1963096632,2041974743,2050506755,1103983875,251984259,147078,2041974528,2050506756,263812356,1074100918,1963292984,79380911,3942645760,2035512,56331585,422884879,439629888,2369860981,960562267,2301589209,1018564574,1010319409,1092842802,1107673987,422884879,439629890,2302743669,1535984091,884346626,876101657,1153266714,960617353,1434783705,3925868543,4294966428,32080705,350994481,4202255,1208074371,1090634115,2249179193,4294966613,1964062788,1907757035,1916289025,266433793,1073904054,1963096632,2041974743,2050506755,1103983875,251984259,109190,2041974528,2050506756,263812356,1074100918,1963292984,79380911,3942645760,1535983933,1018564355,1010319385,1094546714,1141136269,2198850361,323,3054493321,943731004,2155164220,96699201,1018564418,1010319897,1837436698,1107296255,2369903497,3054436955,943724852,3044284980,265894213,4294923141,3414771199,884346690,876102170,1099239193,3925868543,4294966220,4269378881,2202124337,283836905,1208074371,1090634115,2249179193,4294966405,1964062788,1907757035,1916289025,266433793,1073902006,1963094584,1907757015,1916289027,2211280131,2249131263,201,74626575,74528832,3054484085,943719793,2960459122,310081,1223360512,8658703,0,56331585,422884879,439629888,2369863797,4214817883,8815375,3733520384,825013775,841758784,4285957391,2202140671,255985091,1108948150,253375544,4294927237,3683205631,39554369,422884879,439629888,960803444,1233457119,1107296255,256048009,1109013686,253310008,4294915973,3414771199,884346690,876102170,629477145,3925868543,4294965984,3655974961,1107296250,3857308553,3154116606,4,4294843881,3925576191,4294966493,3957033281,79380905,3942645760,310177,3337158656,1107296252,1211,4273137920,2425421823,2425393296,2425393296,2425393296",",")
static bin:=buf_byte_find("","","","",true)
if init {
if bin
return bin ; for byteCount.ahk
bin:=DllCall("Kernel32.dll\VirtualAlloc", "Uptr",0, "Ptr", (raw:=A_PtrSize==4?raw32:raw64).length()*4, "Uint", flAllocationType, "Uint", flProtect, "Ptr")
for k, i in raw
NumPut(i,bin+(k-1)*4,"Int")
raw32:="",raw64:=""
return bin
}
return (p:=DllCall(bin, "ptr", hay, "ptr", ned, "uint", haylen, "uint", nedlen, "cdecl uint")) == 0xFFFFFFFF ? -1 : p
}
buf_byte_write(hay, ned, wrt, haylen, nedlen, wrtlen, count:=-1, offset:=0, init:=false){
; Finds position p of ned in hay, and writes wrt into hay at p+offset.
; Params:
; hay, buffer to search in.
; ned, buffer to find in hay.
; wrt, buffer to write in hay at ned's position + offset.
; haylen, length of the buffer hay
; nedlen, length of the buffer ned
; wrtlen, length of the buffer wrt
; count, maximum number of writes to do, specify -1 to write at all matches, default.
; offset, specify a offset from where ned is found to where wrt is written. Eg, hay:="abc", ned:="b", wrt:="d", offset:=-2 --> "dbc". After write, the search continues wrtlen steps forward from the match, not from the write.
; init, internal use, omit.
;
; Return
; n, the number of writes made.
; Source:
; bytewrite.c
; Url:
; ...
; Note:
; Requires that byteFind is defined above this function.
local k, i, raw
static flProtect:=0x40, flAllocationType:=0x1000 ; PAGE_EXECUTE_READWRITE ; MEM_COMMIT
static raw32:=[1398167381,2334977155,994845820,2337547388,2337809476,2336236636,257696884,3229991570,146838543,3649376194,956301312,256910460,53127,608471808,608487252,24,2314207488,2300322884,666668534,0,1344554123,136608905,2300845193,2332828740,2302944324,4278461508,2204116052,1903493112,2088302213,472140939,956372109,2338484951,2337547340,2303206508,700514754,612139973,1819541588,337923209,649366928,0,252904589,1395894,956416643,2283021396,3967102988,337923211,3405893417,405030019,612120833,608996176,3264679704,1411677241,146839311,956986818,257434700,4294930309,608472063,751076120,1566531163,7769539,4043424137,3924527481,649366928,0,3035349385,825017475,1600019392,2425406301]
static raw64:=[1447122753,1413567809,1398167381,955024200,616336196,168,2955183243,1224736768,2303251593,3481879755,2686758027,2332033024,12068020,960823296,3264352249,2484060293,264374464,52357,3443082240,12814095,2369912832,2337029636,12592308,826605568,2223590637,36900,608471296,2035500,1105824065,2303522953,3649652962,2211905345,1802829816,2071524997,740576395,956372109,1163686615,2336817029,9446540,2370109440,3263760140,778463860,8658703,0,28708676,2201093261,2202534338,960561601,1150830801,1963132040,3364439271,1104095556,1208075651,4248421121,1103271695,2534407993,1975650496,2889434122,45092,1149334784,2202593417,1583036612,1547787615,1581342017,2311282497,2045837761,266660746,17439,3955329345,3955241396,2425393369,2425393296]
static bin:=buf_byte_write("","","","","","","","",true)
static pbyteFind:=buf_byte_find("","","","",true)
if init {
bin:=DllCall("Kernel32.dll\VirtualAlloc", "Uptr",0, "Ptr", (raw:=A_PtrSize==4?raw32:raw64).length()*4, "Uint", flAllocationType, "Uint", flProtect, "Ptr")
for k, i in raw
NumPut(i,bin+(k-1)*4,"Int")
raw32:="",raw64:=""
return bin
}
return DllCall(bin, "ptr", hay, "ptr", ned, "ptr", wrt, "uint", haylen, "uint", nedlen, "uint", wrtlen, "uint", count, "uint", offset, "ptr", pbyteFind, "cdecl uint")
}
buf_byte_count(hay, ned, haylen, nedlen, overlap:=false, init:=false){
; Counts the number of occurances of ned in hay.
; Params:
; hay, buffer to search in.
; ned, buffer to find in hay.
; haylen, length of the buffer hay
; nedlen, length of the buffer ned
; overlap, specify false to not count overlapping occurances, specify true to count overlaps. Eg, aaa has two occurances of aa if overlap is true. Default is false.
; init, internal use, omit.
;
; Returns
; 0, ned is not in hay.
; n, the number of occurances of ned in hay.
; Source:
; byteCount.c
local k, i, raw
static flProtect:=0x40, flAllocationType:=0x1000 ; PAGE_EXECUTE_READWRITE ; MEM_COMMIT
static raw32:=strsplit("28858197,1442840576,753697619,1344568451,610044673,608996172,609520456,611617600,3276083012,270812297,3409559601,3246613623,2212047105,1752433403,17991183,4219666432,2575568643,2197815296,2232354043,1104,1047841157,822523407,2296066559,3943441476,29590279,678877497,608482831,436484620,3054497653,2365659716,1178075499,2911112961,2298478592,2010724843,649367007,0,3296983177,1600019244,3062743901,0,4000631173,822523407,2296066559,3943441476,29590279,3631467321,608482831,436484108,3054497653,2365659716,1178075499,2693009153,2298478596,2313022443,666668534,0,2926889349,822523407,2296066559,3943441476,29590279,2557925689,608482831,436484108,3054497653,2365659716,1178075499,2298770433,266464235,35275958,1963083320,29852658,270818307,1989005035,666668288,0,440710671,38156290,4282746127,3347316735,610009857,4279953680,3062759423,0,251788163,214917,264865024,4294914436,265783807,3414767286,3884179447,265238799,4186175815,361172755,2298478598,2311074253,2315203057,953299414,2484026892,29852610,3745107969,3711561589,1149891209,3465088036,3918126985,48858127,3364421632,1754134569,608471536,82690324,2365670797,4247388009,405030025,2198134977,1149832957,2249134116,220,472151177,3236892518,1550716774,258350116,258403823,1150018799,258346020,3607223136,896470886,0,258403633,258399073,1711332208,2211147535,3347251653,1947166224,1815867471,258349092,258395867,258396527,258395496,258397536,258407023,258397289,258407521,258394110,258406767,258392830,258396271,258392431,258407521,258393193,258398206,2876424958,3362721638,203703433,270812299,3648196454,4262422024,1863280321,1880057560,258408400,22399088,1779394243,2114938584,1645176535,1846503115,1812948695,4262422218,2114938561,612106695,608451340,3900968724,2415919105,2520205,70971529,24874266,264279055,1140965558,4181265444,203713675,29722127,4035510272,18498618,264279055,3347693750,4160874633,2298641293,608471493,267991308,107142,988842240,251796036,3054485652,2311555520,2381840872,3314090875,203703433,2249193785,383,1144713353,2484011802,3233157056,3901343625,2072901633,2311424260,957097028,1552289785,2298478593,440679152,3230928644,2311108111,32016839,91983352,1149879689,4181265444,20547087,4035510272,85607482,264279055,3347693750,4160874633,2298903437,608471493,267991308,71302,988842240,252058180,3054485652,2311555520,2381840872,3314091899,203703433,2249193785,243,1144713353,2484012826,3233157056,3901343625,2072901633,2311424264,957097028,3498446841,2298478592,440679152,3230928648,2311108111,32016839,159092216,1149879689,4181265444,11372047,4035510272,152716346,264279055,3347693750,4160874633,2299165581,608471493,267991308,35462,988842240,252320324,3054485652,2311555520,2381840872,3314092923,203703433,1802959161,1144713353,2484013850,3233157056,3901343625,2072901633,2311424268,957097028,2303489785,440679152,3230928652,2311108111,32016839,226201080,1149879689,4181265444,4035521910,219825210,264279055,3347693750,4160874633,2299427725,957097028,2299557625,441202929,3264483086,30586383,2332828756,2198611012,1583033540,2428722527,3766737033,3850702595,251658240,3716759222,337921223,0,1284096049,4220062756,3229815019,29524737,203703355,11436815,440008704,3054496885,1312293194,266564865,939674294,3665101390,55227919,1963150904,83723217,61900303,3054436352,1312293962,264205572,939870902,3061122382,1215,608471296,608996120,2418797324,2520205,977581583,1044658179,2200335619,4248372423,3054444406,70793732,253130046,20595894,20857912,3054439285,939670084,1946304068,608472015,608995608,268253452,4294926725,612142079,608469776,4160815380,1441397249,2214592511,1543700935,904466468,2432696315,337921163,4294642153,649367039,0,251787395,71556,49840896,254719503,135812,4249062656,1277451401,337921223,0,1284107145,1821051940,1149848612,3224442916,1988957931,666668288,0,2197930115,1144717762,2759003172,4034206264,21673487,1963019832,1253445607,38680578,3054493301,1312293706,2211804419,68691068,46564879,3054436352,1312293962,264336644,3204795062,4,1963281976,608471475,608996124,254339852,54150326,54412344,3347261557,612121348,253719320,943326390,376782340,977581583,1044658177,252409089,37373110,37635128,1150012788,1284054052,2084113444,2232358948,4294967140,405044363,1041020431,255462456,4294923141,1287000063,1278803502,2232417834,4294967108,776779279,709638399,897912831,2348810239,2198873212,18097220,4194433025,4294912489,7769599,2369697295,3979476803,203705481,337921161,4220108849,1988958955,666668288,0,2197930115,1144717762,2198801444,208,3967097400,21673487,1963019832,1253445603,38680578,3054492277,1312293706,2211542275,68428924,28870159,3054436352,1312293962,264074500,939871926,3027567946,405030025,1215,608471808,254208788,54152374,54414392,3347261045,1942436100,213258015,1040988218,3054442101,939604556,1963015756,1286999819,1278739002,3480486462,405030027,337935417,4284908815,2089549823,3054441508,205012492,1434783546,2348810239,2198873212,4160815557,1273625089,2432696319,2520205,2232418181,291,203703495,0,65657649,2315255802,666668534,0,3689539721,2382364664,3481927235,203703495,0,1552542089,1149848612,3224441892,3229814507,29524737,2198861881,4294966451,4000647738,22722063,1963023928,1521881061,39729154,3054492789,1580729178,2211673347,68428924,11175439,3054436352,1580729434,264205572,3171244726,4,1963286072,608471473,610044696,254339916,53101750,53363768,3313707125,611072772,253719316,942277814,376778244,709146127,776222721,252409089,36324534,36586552,1150012788,1552488484,1815694372,2232357924,4294967138,337931403,773633551,254417976,4294922629,610044927,611093324,1555435340,1547239198,2232418090,4294967098,270818443,203703427,30933249,4281264602,79691775,3909091328,4294966437,1213,2309745408,4172933627,79691775,3909091328,4294966932,1215,4253870336,2425421823,2425393296,2425393296,16843009,16843009,16843009,16843009",",")
static raw64:=strSplit("1447122753,1413567809,1398167381,955024200,611592463,2083065616,3124830244,1,2686762115,16777216,3510964037,960872497,1097627585,1157742723,2202126377,2215576313,188,16156175,2202075136,1886651385,83460929,61310223,2235891712,255882432,3224443574,3955831109,2149519120,0,29459265,1992833349,3414770982,421279810,2369908341,3054436721,2303275324,2050506995,1233391361,1157627908,960878985,265975752,270824488,612116495,3296938016,1600019256,1096565085,1096696157,258392927,17439,1958774085,448139226,826654769,2416634825,29459265,1992833349,3414771142,421279810,2369908341,3054436721,2303275324,2050506995,159649537,1157627908,3639335305,4202255,1958774085,448139162,826654769,2416634825,29459265,1942042949,3414771078,421280322,2369908341,3054436721,943731004,2215575930,1004,3958475073,2149519323,0,33129281,45581583,2235891712,1283723200,1241513983,256166281,2303007414,3656862146,1103792456,1158668675,256229689,2202126407,2265912312,1480,826654769,2035657,944036657,3281260314,29459265,29524808,960878593,1172927953,2303053881,4236513233,1157627902,2369898121,2303000408,3458811087,1156601485,3938569001,29524740,3854685577,251364100,13010447,2302935040,1712071772,1725689615,608464399,4010763788,4010764013,210586852,1611621945,1725641152,3501839,1711276032,1723883791,12611599,1863270758,29590289,281117513,258398777,258396276,258394735,258395867,258396527,258395496,258397536,258407023,258397289,258407521,258400254,258398974,258396527,258395241,258397281,258398974,2960644606,3547271014,1726611777,148534031,3674083174,3278835558,3413118822,1880057429,258408400,258399082,258396798,258394978,258396782,258394732,258392574,3489776254,2215638329,4294966799,1154648388,252779576,3054486164,1104150994,1090605709,2249183289,4294966771,287062596,264410127,3489780406,38964545,265304385,4294826630,473580799,3264483089,30586383,1384989136,3493413123,4257318415,977600511,2484015388,3535146946,2369900545,960562258,2827358160,1157627901,252779578,3054486164,1104150994,1090867853,2249183289,4294966671,287062596,264410127,3489780406,106073409,265304385,4294801030,473580799,3264483089,30586383,1384989136,3493413127,4250764815,977600511,2484015388,3535146946,2369900545,960563282,1149636560,1157627901,252779578,3054486164,1104150994,1091129997,2249183289,4294966571,287062596,264410127,3489780406,173182273,265304385,4294775430,473580799,3264483089,30586383,1384989136,3493413131,4244211215,977600511,2484015388,3535146946,2369900545,960564306,3766882256,1157627900,252779578,3054486164,1104150994,1091392141,2249183289,4294966471,287062596,1103270927,252625539,3489780406,265304389,4294749830,1188180479,252779576,3489776276,4294745833,3364439295,2199565839,2232353760,288,826654769,3565766107,258349035,17439,29590337,29459272,264452421,4294733443,1964587263,2041974763,2050506753,266433793,1073902006,1963094584,1907757015,1916289027,1103983875,251984259,255622,1907756800,1916289028,263812356,1074098614,1963291192,310959,1005256704,8658703,0,1141079693,959755791,976500804,2123182965,4181278980,4253625718,884346692,876102697,2199942442,256116166,1144075446,1966224440,2382268690,256115326,1144599734,1949971512,1106741695,2232416569,4294967124,1157742723,21811969,4283361761,258408447,17439,40996161,826062351,41564224,4221928719,3229876223,3506521345,4294670313,2035711,40996161,826062351,41564224,4226123023,3229876223,3506521345,4294686697,2035711,1157742723,3924414721,268435451,17439,251787395,75652,49840896,34702351,2369847296,2370174321,3224501857,1104884037,1140976003,434886025,8658703,0,29590337,29459272,264452421,4294651523,1964587263,2041974763,2050506753,266433793,1073904054,1963096632,2041974743,2050506755,2211280131,2249131262,716,75150863,75053120,256162421,3204807350,4,91830340,2833993076,8658703,0,57642308,1018564422,1010320937,1145271594,1090809741,2198861113,629,1190037829,826062351,842807366,4285695247,3347316735,3054453765,943995196,2232367676,4294967136,1156548932,1174564749,691844623,708589638,4265193076,4282811663,4153016319,1018564420,1010320442,897912633,1157627903,256173961,1144667318,255409208,4294910853,3481879807,1018564420,1010320442,293932857,2214592511,21299648,3909175507,4294904809,2035711,32080705,826654769,3565766107,2422608875,29590337,29459272,264452421,4294581891,1964587263,1907757035,1916289025,266433793,1073902006,1963094584,1907757015,1916289027,1103983875,251984259,116102,1907756800,1916289028,263812356,1074098614,1963291192,310959,1005256704,1141079693,959755791,976500804,2123185013,3476636676,22709007,4253614080,884346692,876102697,2206299434,256116166,1144075446,254948408,4294930309,2382268927,256115326,1144599734,1949971512,4047061431,4283860239,2303000575,1018564558,1010319410,1166348081,2214592511,21299648,3774958803,4294918121,2149519359,0,264865093,71557,1170223360,1357500977,1107296250,838756749,3677439424,32080705,3956574533,3280158993,3246606337,3275310337,4180247311,423297023,3054496629,943718777,3782541690,41006607,41039936,3054491509,943719281,3446997874,251985283,47238,1907756800,1916289028,263877892,3188029878,4,91895872,2850766196,4202255,1141079693,959755791,976500804,2123183989,1945057540,4253630840,884346694,876103209,2206364970,256116166,1144075446,254948408,4294930565,2382268927,256115326,1144599734,1949971512,267729339,4294924421,267291135,1077034166,254884920,4294920325,3465102591,842839567,826030144,4281828623,3229876223,3540075777,3923837260,4294967089,3471441545,3221225470,4,4294735593,3959327231,4018750644,4294818281,311039,2783641600,3922364741,4294965520,1215,4255181056,79626239,3909091328,4294966933,2425393296,16843009,16843009,16843009,16843009", ",")
static bin:=buf_byte_count("","","","","",true)
if init {
bin:=DllCall("Kernel32.dll\VirtualAlloc", "Uptr",0, "Ptr", (raw:=A_PtrSize==4?raw32:raw64).length()*4, "Uint", flAllocationType, "Uint", flProtect, "Ptr")
for k, i in raw
NumPut(i,bin+(k-1)*4,"Int")
raw32:="",raw64:=""
return bin
}
return DllCall(bin, "ptr", hay, "ptr", ned, "uint", haylen, "uint", nedlen, "uint", overlap, "cdecl uint")
}
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
; Short functions.
; buffers are short*, that is two bytes per 'element'.
;
buf_short_find(hay, ned, haylen, nedlen, init:=false){
; Finds the first occurance of ned in hay.
; Params:
; hay, buffer to search in.
; ned, buffer to find in hay.
; haylen, length of the area in hay to search in.
; nedlen, length of the area in ned to search in.
; init, internal use, omit.
;
; Returns
; -1, ned is not in hay.
; p, the position of the start of ned in hay. Index is zero based.
; Source:
; shortFind.c
; Url:
; ...
local k, i, raw, p
static flProtect:=0x40, flAllocationType:=0x1000 ; PAGE_EXECUTE_READWRITE ; MEM_COMMIT
static raw32:=strsplit("4290271061,1459617791,552371027,1076133003,1009024059,874796171,941907083,3296924278,1600019232,1989002077,666668288,0,1009011851,687980931,50299897,36602895,1584791552,251920259,37764,83854080,13403407,3380936704,3071263860,114219,132841472,956417667,1717991161,4268911673,2315208333,604277239,3071273589,963015172,3765764675,1917105935,1127835138,265647364,74597559,105068902,76270197,4286376228,4286840831,2239460609,1870925769,268435455,3224443831,1964652902,4284541201,2422669311,1109145958,4283728911,3229876223,1975597313,549749743,4294967224,1600019455,2422653789,2215627141,4294967094,3190535951,1,3330476011,1996044545,1815701208,1183710834,2314701311,3933545476,1912911631,37960038,3071271029,1711436356,1963213625,4286114261,4169793535,2201204495,2215576544,384,251787395,145284,49840896,51282959,1200422912,1065127421,608471546,990153988,2300853385,2366121028,1149829703,3623947300,270812297,2298759053,18097220,608471512,3955241240,29393678,956482179,1317408705,1728053247,3983880763,40548111,40581478,3071271797,962987114,3648324715,107656975,107690342,2089013109,251921444,241798,1790381824,1798923784,263877896,3339348919,68953156,1711276032,1963616825,608471464,310556,1015742464,254536484,107627703,1799633254,2200663302,1815807173,577963044,1778693903,1795438950,3071219829,1711434308,40584249,3071216757,1711565380,74138681,1150011764,1015618596,611092772,611093276,611072284,1250234116,2348810239,2332566636,3071222844,962986093,2232367660,4294967093,270826635,203713675,1715451663,254426169,4294910085,611093503,612141848,1840713492,741959168,176492346,3925868543,4294966702,2215627141,4294966694,3190535951,1,3330477035,267991297,4294853766,1815701247,1183710834,1979156991,1018630121,2067359346,2005143298,2315255805,2430069751,2520205,2089402417,384516132,649366928,0,2197930115,3241738946,4261643791,963051519,267220274,1711434423,1963092793,1790382051,1798923780,265909508,1711700663,1963359033,612139983,2249131072,603,142259983,142293350,3071261301,962988666,2960460411,1213,2301946624,666668534,0,1786558223,2084136454,729089643,956614019,1983915116,1018629922,1010394730,253261163,40533175,1803303270,252474626,74087607,1803303270,969503748,255861868,4294926213,4239976959,1989017599,666668288,0,4265559181,2315218829,17048644,606898648,136594569,384548913,649366928,0,2197930115,3241738946,4248012303,963051519,267220274,1711438519,1963096889,2058817507,2067359236,265909508,1711700663,1963359033,607945679,2860912388,251658241,1711831735,1963490105,2058817467,2067359242,3216078090,4,203703433,3945016459,1152847657,962987642,1963359044,80184105,578023225,2047129359,2063874406,3071219829,1711438404,41632825,3071216757,1711569476,75187257,1150012276,747179044,607926564,4284384527,1821114367,2089486372,3071214628,962986093,2232367660,4294967112,4294693353,7769599,4232014989,2315143053,76358660,611092779,608471300,38112524,270812297,1149884417,3224441892,1988958443,666668288,0,2197930115,3241738946,4232283663,996605951,267220274,1711438519,1963096889,2058817507,2067359236,265909508,1711700663,1963359033,607945679,3011907332,251658240,1711831991,1963489849,2058817467,2067359242,3216078090,4,136594569,69495947,2422615275,2051323663,1144612358,712312443,990168963,577971260,2047129359,2063874406,3071219829,1711438404,41632825,3071216757,1711569476,75187257,1150012020,1820919844,1010369572,1501892388,2348810239,2332828796,251929708,963002295,2232363580,4294967108,337931403,270826635,7190287,975976806,4281238799,3354001407,3187671034,4,4294833897,608487423,1052,4239386880,79691775,3942645760,311209,2867396608,2432696318",",")
static raw64:=strsplit("1447122753,1413567809,1398167381,4294967224,3241756159,1583025526,1547787615,1581342017,1103322945,1157742723,2202126377,2215576313,621,2202103414,2215576569,192,83460929,18253071,2235891712,1153922240,1092269839,441,3955241216,2035471,29393736,1992833349,3515434365,473515110,1368212801,1156150529,3071265673,963008828,3698655866,265521476,1717122231,1963225657,1502429647,884412162,1916364377,3921769734,4294967154,33129281,11699471,2235891712,1602490304,268435455,996545207,3229880081,1207959556,822264195,252963776,17439,46236488,4266735974,4281893903,3229876223,3224977665,4290308725,1543503871,1096638302,1096630620,3277799774,8658703,0,264275269,4294905220,3071231231,28918042,822083584,1712712640,8658703,0,29393736,1992833349,3515434429,473515110,1368212801,1156150529,3071265673,963008820,3698655858,265521476,1717124279,1963227705,4274055631,778502143,8658703,0,1153993028,2199041807,2215576544,384,251787395,142468,49840896,50234383,2369847296,2370174553,2202139993,21823977,1220555209,2303515393,747457246,613239818,3674295578,778443499,8658703,0,1208074371,1090699651,2249179193,4294967078,288965734,3071273589,962986617,3765764730,75085583,75118950,3071268469,962987641,3430221434,251985539,246918,2058817280,2033804808,1153004808,175748879,1215,960783872,1316227706,258385643,17439,57642308,1018629958,960915049,1182100028,74419524,267729217,225155,4001973504,1018629958,960915057,2232382012,4294967152,1141229443,2034022159,1010386022,1569001338,1157627903,2370105225,256246383,1718172855,1782331718,4265192052,4282549519,256049151,1712995511,423377218,4281500943,255983615,1713650871,253312057,4294910853,2109149183,960652800,2232355132,4294967060,4294800873,3229959679,4251747343,256180223,3108051639,1,485212209,8658703,0,29393736,1170749765,251744653,4294841734,3515434495,473515110,1172665665,256035465,1716599991,1963096633,4247316951,2422669311,283885617,1208074371,1090699651,2249179193,4294966754,288965734,3071273589,962986609,3765764722,75085583,75118950,3071268469,962987633,3430221426,83460929,39880207,3071213568,962988145,3094677618,175224591,175257958,3141643893,4,2422618347,56331585,1497151247,1513896294,2369861237,960562267,2301654745,1018630110,1010394737,1092908402,1107673987,1496626959,876167782,1091859802,2369903497,3071214171,963008820,3161741876,1104906564,2232408377,4294967124,4294734313,1502430719,1304441343,2370558345,283843388,1208074371,1090699651,2249179193,4294966562,288965734,3071273589,962986609,3765764722,74561295,74594662,3071268469,962987633,3430221426,83460929,29984271,3071213568,962988146,3094677617,175224591,175257958,3141643893,4,2369864939,3071214427,963008820,1148541492,73108801,264976708,90499,1155434752,1899280143,876168294,2038763378,1107296255,1107673987,1496626959,876167782,1703219034,1107296255,2369903497,3071214171,963008820,2926860852,265894213,4294921093,884412415,876176954,1032130361,3925868543,4294966170,4202255,4284058945,4268854593,21545009,4052304347,439127368,153390415,258348779,17439,1208074371,1090699651,2249179193,4294966326,288965734,3071273589,962986617,3765764730,75085583,75118950,3071268469,962987641,3430221434,251985539,52358,2042040064,2050582024,263812360,1711962551,1963620921,79249839,3942645760,2149519182,0,56200517,1018629954,960652889,1198873148,72977733,267598145,34691,3750315008,884412228,960783993,2232384052,4294967152,96568129,1018629954,960652873,2232371772,4294967132,1171884357,1107450253,1497151247,1010385510,1151956058,2232405561,4294967104,1018629954,960652834,2232361276,4294967088,8238863,423377254,4280452367,2481586175,838860794,4203538880,2302803967,4274973147,79429631,3909091328,4294966779,3924789572,4294966466,3956902213,79249838,3942645760,311206,2884173824,1107296252,1211,4271565056,2425421823,2425393296,2425393296",",")
static bin:=buf_short_find("","","","",true)
if init {
if bin
return bin ; for shortCount.ahk
bin:=DllCall("Kernel32.dll\VirtualAlloc", "Uptr",0, "Ptr", (raw:=A_PtrSize==4?raw32:raw64).length()*4, "Uint", flAllocationType, "Uint", flProtect, "Ptr")
for k, i in raw
NumPut(i,bin+(k-1)*4,"Int")
raw32:="",raw64:=""
return bin
}
return (p:=DllCall(bin, "ptr", hay, "ptr", ned, "uint", haylen, "uint", nedlen, "cdecl uint")) == 0xFFFFFFFF ? -1 : p
}
buf_short_write(hay, ned, wrt, haylen, nedlen, wrtlen, count:=-1, offset:=0, init:=false){
; Finds position p of ned in hay, and writes wrt into hay at p+offset.
; Params:
; hay, buffer to search in.
; ned, buffer to find in hay.
; wrt, buffer to write in hay at ned's position + offset.
; haylen, length of the buffer hay
; nedlen, length of the buffer ned
; wrtlen, length of the buffer wrt
; count, maximum number of writes to do, specify -1 to write at all matches, default.
; offset, specify a offset from where ned is found to where wrt is written. Eg, hay:="abc", ned:="b", wrt:="d", offset:=-2 --> "dbc". After write, the search continues wrtlen steps forward from the match, not from the write.
; init, internal use, omit.
;
; Return
; n, the number of writes made.
; Source:
; shortWrite.c
; Note:
; Requires that shortFind is defined above this function.
local k, i, raw
static flProtect:=0x40, flAllocationType:=0x1000 ; PAGE_EXECUTE_READWRITE ; MEM_COMMIT
static raw32:=[1398167381,2334977155,994845820,2337547388,2337809484,2336236636,257696884,3380986514,146838543,3582267330,956301312,256910460,52103,608471808,608487252,24,2314207488,2300322884,666668534,0,1344554123,136608905,2300845193,2332828740,2302944324,4278461508,2204116052,1903493112,2088302213,472140939,956372109,2338484951,2303992916,1959953857,611093294,608961352,1346900,1277459593,3062748457,0,1165801231,806653184,956416131,1015637697,2347595091,692855932,608469967,2084110616,479023140,608996171,3264679704,1411677241,146839311,956986818,257434700,4294930309,608472063,751076120,1566531163,7769539,4043424137,3924527481,649366928,0,825017475,1600019392,2425406301,2425393296]
static raw64:=[1447122753,1413567809,1398167381,955024200,616336196,168,2955183243,1224736768,2303251593,3481879755,2686758027,2332033024,12068020,960823296,3264352249,2484060293,264374464,56453,3443082240,13862671,2369912832,2337029636,12592308,826605568,2223590637,36900,608471296,2035500,1105824065,2303522953,3649652962,2211905345,1903493112,2282747525,132,740576395,956372109,1163817687,2336817029,9446540,2370109440,3263760140,258373236,17439,28774212,2201093261,2202534338,960561857,1721256145,1124370756,692381301,3313713615,3364439041,2370370873,2534359836,4281942466,146839311,1141798338,2955193401,251658240,4294933381,3901310207,952402760,1566531163,1564564545,1598119489,2149519299,0,4043424137,4286417167,3656122367,4202255,3955329345,3955241381,2425393359,2425393296]
static bin:=buf_short_write("","","","","","","","",true)
static pshortFind:=buf_short_find("","","","",true)
if init {
bin:=DllCall("Kernel32.dll\VirtualAlloc", "Uptr",0, "Ptr", (raw:=A_PtrSize==4?raw32:raw64).length()*4, "Uint", flAllocationType, "Uint", flProtect, "Ptr")
for k, i in raw
NumPut(i,bin+(k-1)*4,"Int")
raw32:="",raw64:=""
return bin
}
return DllCall(bin, "ptr", hay, "ptr", ned, "ptr", wrt, "uint", haylen, "uint", nedlen, "uint", wrtlen, "uint", count, "uint", offset, "ptr", pshortFind, "cdecl uint")
}
buf_short_count(hay, ned, haylen, nedlen, overlap:=false, init:=false){
; Counts the number of occurances of ned in hay.
; Params:
; hay, buffer to search in.
; ned, buffer to find in hay.
; haylen, length of the area in hay to search in.
; nedlen, length of the area in ned to search in.
; overlap, specify false to not count overlapping occurances, specify true to count overlaps. Eg, aaa has two occurances of aa if overlap is true. Default is false.
; init, internal use, omit.
;
; Returns
; 0, ned is not in hay.
; n, the number of occurances of ned in hay.
; Source:
; shortCount.c
; Note:
; Compiled with gcc -O2
local k, i, raw
static flProtect:=0x40, flAllocationType:=0x1000 ; PAGE_EXECUTE_READWRITE ; MEM_COMMIT
static raw32:=strSplit("28858197,1442840576,753697619,1344568451,610044673,608996172,609520456,3276083008,824444041,2009807296,29459309,4219722025,258831362,64646,66814720,11437071,4219666432,629477124,2231369729,2336715977,826549316,951521243,1149878321,132843556,956416899,1714124505,2371501113,4034206516,251741069,36859063,69485705,1143227531,40384870,33981455,1552613376,3644392484,1150014839,3296921636,1600019244,2422653789,4067740037,1143227531,3071269681,2311074104,3942917188,29590279,628345657,1513896294,1964717197,608472048,1958154052,1804403250,1882809857,2240024322,2298478593,1925921259,608472027,751076100,1566531163,7769539,2725562757,1143227531,3071269681,2311074104,3943179332,29590279,2255935801,1513896294,1964717197,21204464,845985551,608471298,608471812,1748592196,1099173634,2332033025,3942917212,33260499,3380950645,4283728911,1150025727,479020068,817303370,2422652977,963037489,3247705906,16958083,1976777160,751076335,1566531163,649366979,0,3766737033,1166348035,2332033025,826549316,612142061,610044228,817303372,19137675,608471488,3955241220,649366805,0,2197930115,3359179458,17203983,996540416,267220274,1711430327,1963089721,1521946595,1597597188,265909508,1711692471,1963351865,612139983,2249131084,1195,140162831,140458342,3071261301,962988634,2960460383,136594569,1211,608995584,608471820,254405452,106581175,1598830950,2200532230,3627615427,3071222390,963009036,410345228,1514977039,1278830082,208994911,1514977039,1278830084,3413378143,136594571,203705483,1277451321,4283860239,3313762303,604242689,69489667,4294921705,649367039,0,69485699,605815553,4294855657,7769599,846509839,1882809860,2961510148,2214592510,17310788,3911457795,4294966908,2520205,846509839,1882809860,3951365892,2214592509,17310788,3911457795,4294966711,2520205,69495947,3689539721,2432696317,2520205,251787395,92036,49840896,1143227531,254850831,161668,608471808,461147460,65766394,69485767,0,136600713,2298638221,17572988,608471544,608471824,2313683268,2366907460,1149830215,1141053476,1149846564,76225572,2311061796,824190020,2198793152,3263365568,264780034,4294815875,842622719,2089545077,3071231012,962986586,3748987487,73053967,73349478,3071268213,962987610,3413444191,136608899,1116081924,251658243,1711823543,1963482937,610044854,311108,3071213568,962988635,2742356570,606356617,673467529,203709579,1143227531,3071224811,1711700556,108547129,3347262325,612121348,253915912,1719274679,1970801721,1287065368,962986618,1963096140,1287065356,962987130,1946449996,608472009,608996132,610044200,612120844,1149570824,2348810239,2333090940,252453980,963002295,2232359484,4294967087,337935499,1715451663,254426169,4294909573,610044927,612141852,464981784,974928230,4278813967,1149501439,50398244,1409491972,4276690980,2432696318,2520205,1143227531,4263214221,3951291697,611092737,612141316,610044180,817303304,1143227531,2089547777,1149846564,76221476,2311061796,823141444,2300046272,666668534,0,2197930115,3359179458,4264723215,996605951,267220274,1711430327,1963089721,1521946595,1597597188,265909508,1711692471,1963351865,612139983,2249131016,485,140162831,140458342,3071261301,962988634,2960460383,405030025,1211,611093248,608995588,608471836,254405384,106581175,1598830950,2200532230,3275293891,3071222387,963009036,410345228,1514977039,1278830082,208994911,1514977039,1278830084,3413378143,405030027,472140939,69495945,136600633,4283335951,1821114367,1552616484,3071218724,962986093,2232359468,4294967096,69485699,604242689,270816259,4294913513,649367039,0,1143227531,4229659789,2298669955,3339199580,271428,2365587456,2089353839,1552620580,4160832548,270812297,1143227531,203713673,1149888513,76223524,2311061796,823665732,2198793152,3263365568,264780034,4294656131,842753791,3071274357,962986618,3816096379,75151119,75184486,3071269237,962987642,3480553083,136608899,3431337732,251658240,1711831735,1963490105,2075594682,608487178,1056,2050582016,2309518602,3206554692,4,203713675,3071224811,1711700548,108741689,3347262325,612121348,253915912,1719272631,1970996281,1152847640,962986618,1963096900,1152847628,962987130,1946450756,608472009,611092768,612141324,611093280,611072288,1216679688,2348810239,2333090924,253502588,1711304119,255470649,4294914693,612142079,611093268,1068961548,708589926,4280124687,1149501439,50398244,1409491972,317265956,3154116607,4,4294684649,310271,2112421888,3355443198,69215300,3942645760,311192,652804096,2432696317", ",")
static raw64:=strsplit("1447122753,1413567809,1398167381,418153288,2149891203,16777216,113217,256180224,3224490309,2009151813,3229827431,3358147841,49906497,10912783,2249129984,224,66683713,2202098548,2232354041,272,1958774085,448204603,826654769,2416634825,29459265,1992833349,3414770983,473514598,1106081113,251752845,1232157879,963048329,2215576186,440,1171884357,3648505913,415531848,1566531163,1564564545,1598119489,3229959619,3071273588,1170223386,166447409,29459265,1992833349,3414771159,473514598,1106081113,251752845,1232157879,963048329,2215576186,392,3956902213,2035671,1958774085,448204715,826654769,2416634825,29459265,1942042949,3414771095,473514598,1106081113,251752845,1718697143,251820601,93060,4052304128,258398955,17439,33129281,2235906677,1636044736,1157627903,1091221263,1291796621,37831821,2422652977,1147589169,2484013369,3246606530,1238368514,3967141945,4294916073,2149519359,0,264800580,3766688439,562368259,1140850689,826658953,1015892187,3955241216,2035476,29590337,46236488,264452421,4294901635,423192319,3071273589,962986609,3765764722,74561295,74594662,3071268469,962987633,3430221426,83460929,73696783,3071213568,962988145,3094677618,175290127,175192422,79605365,3942645760,2149519166,0,1141075597,1765586703,1010386022,2369221994,960562286,1093760745,256306313,1717646519,1647589702,3330482805,3071230981,1147564348,1970420793,2381220115,256115310,1718170807,1781807428,4119444084,266942785,4294922117,29393919,1221787973,1240070401,2432696319,40996161,1899804431,75118950,4264985871,3229876223,3506521345,4294838249,2035711,40996161,1899804431,75118950,4268131599,3229876223,3506521345,4294850537,2035711,1157742723,1776931073,268435454,17439,251787395,87940,49840896,37651471,2369847296,2369912441,2369912689,2302999913,3677439440,1220542792,21561089,76105974,747457572,613239866,1237332274,2370627977,3942657404,3280158993,3246606337,3275310338,4255810319,963051519,1156216089,41006863,1916355686,1155429634,74561295,1916355686,1154643204,108115727,1916355686,1103525126,251984259,205958,3071230976,1147537522,1963487545,3071231152,79497841,1711276032,175257924,2302975861,2299012188,3943441476,1569539143,3071230467,1114003716,1968833593,1972192327,3459859716,45318927,2303000576,3071230707,1114003716,257557561,165765,1569539072,3071230469,1114003716,257557561,160645,4119413760,39685444,79105858,960652889,2842974724,610044740,608471816,3912843532,4281042191,256311295,1715090615,959723846,4279993615,256245759,1711306167,959723844,4278945039,256245759,1713648823,825506116,4277896463,3229876223,3540075777,604767048,4294898921,2149519359,0,4285631809,1171294532,2370624305,3224436772,1223788873,3946196109,2149519128,0,29590337,46236488,264452421,4294733699,423323391,3071273589,962986617,3765764730,75085583,75118950,3071268469,962987641,3430221434,83460929,31360527,3071213568,962988153,3094677626,175748879,175782246,79605365,3942645760,58625347,884412228,960783993,1131772468,1141145229,2198851385,386,1191020865,1765586703,1010386534,2038763370,2214592511,256116166,1718695095,1916025156,4284908815,4270456831,1141014157,2034022159,1010386022,1101952122,2232414521,4294967116,708622095,691812710,4282287375,3229876223,3540075777,3923837260,4294967096,4285631809,4269378881,1305839941,3224497409,1222324549,2303325697,613240057,881675327,344540210,1713040164,8658703,0,29590337,46236488,264452421,4294668163,423323391,3071273589,962986617,3765764730,75085583,75118950,3071268469,962987641,3430221434,83460929,15238671,3071213568,962988153,3094677626,2042040132,311050,1147535360,1946843705,262531914,17439,1141075853,1765586703,1010386022,2370008426,960758895,2189627341,1090519040,256307081,1719211191,2048145734,4285695247,3347316735,3071230981,1147566396,259669049,4294926213,2381285887,256115311,1718172855,1782331716,960605812,1166348281,1124073471,574404367,1010385510,897912609,1107296255,1715386127,254884921,4294911877,29393919,605815620,3924361548,4294967072,610044740,608471816,4241484044,4270456831,4294881001,3958344191,1552630961,1149962276,2302938148,4253018613,79560703,3909091328,4294966268,1214,4270188800,79691775,3942645760,310661,1525219328,2432696317,2425393296,2425393296",",")
static bin:=buf_short_count("","","","","",true)
if init {
bin:=DllCall("Kernel32.dll\VirtualAlloc", "Uptr",0, "Ptr", (raw:=A_PtrSize==4?raw32:raw64).length()*4, "Uint", flAllocationType, "Uint", flProtect, "Ptr")
for k, i in raw
NumPut(i,bin+(k-1)*4,"Int")
raw32:="",raw64:=""
return bin
}
return DllCall(bin, "ptr", hay, "ptr", ned, "uint", haylen, "uint", nedlen, "int", overlap, "cdecl uint")
}