Skip to content

Commit 6b0bf24

Browse files
committed
Allows running on Windows server (DEP=all)
1 parent b660b43 commit 6b0bf24

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

BinMod.ahk

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
;@Ahk2Exe-SetVersion 2023.06.05 ; Edition: (y.m.d)
2+
;@Ahk2Exe-SetVersion 2025.03.09 ; Edition: (y.m.d)
33
;@Ahk2Exe-SetCopyright TAC109
44
;@Ahk2Exe-SetProductName BinMod
55
;@Ahk2Exe-SetDescription Binary file editor - see Ahk2Exe's PostExec directive
@@ -278,7 +278,7 @@ io(Type:="Close", Data:="")
278278
; https://www.autohotkey.com/boards/viewtopic.php?f=76&t=13155#p67713
279279

280280
InBuf(hayP, hayS, neeP, neeS, sOff:=0) ; Search buffer; returns offset
281-
{ Static Buf ;Includes InBuf by wOxxOm www.autohotkey.com/forum/topic25925.html
281+
{ Static Buf,s ;Includes wOxxOm's InBuf www.autohotkey.com/forum/topic25925.html
282282
If (!VarSetCapacity(Buf)) ; Mcode
283283
{ h := "530CEC83E5895583145D8BFC57560000BE840F00FB8B104D8B6D7E0041D929C12918"
284284
. "45C701087D8B607E4BACC0310C758B744B32744B41744C754B10744B203F75AEF293AD934E2C"
@@ -308,9 +308,10 @@ InBuf(hayP, hayS, neeP, neeS, sOff:=0) ; Search buffer; returns offset
308308
. "48407A8B305A02E9C1484A8BEFC32905E3C1D889ABC301D831078B484A8BEE75C9FF3F300974"
309309
. "03E183F775C9FFC7FF488BEF01483C7A8B10B9EB0148245A04C3C1480000003C30040F24D888"
310310
. "FFAA0704027C3A5E5F5D58EB75C97E00F8835B595AC301"
311-
VarSetCapacity(Buf, StrLen(h)//2+6)
311+
VarSetCapacity(Buf, s:=StrLen(h)//2+6)
312312
Loop % (StrLen(h)+12)//14
313313
NumPut("0x" SubStr(h,(A_Index-1)*14+1,14), Buf, (A_Index-1)*7, "Int64")
314+
DllCall("VirtualProtect","Ptr",&Buf, "Ptr",s, "UInt",0x40, "UInt*",s)
314315
}
315316
Return DllCall(&Buf, "Ptr",hayP,"Ptr",neeP,"Ptr",hayS,"Ptr",neeS,"Ptr",sOff)
316317
}

0 commit comments

Comments
 (0)