Skip to content

Commit

Permalink
Also fix integer underflow. *You saw nothing*
Browse files Browse the repository at this point in the history
  • Loading branch information
G33kDude committed Aug 5, 2021
1 parent 3b09096 commit b618dd7
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
48 changes: 24 additions & 24 deletions Dist/cJson.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ class cJson
_LoadLib() {
static CodeBase64 := ""
. "TLUCAAwAVUiJ5UiDAOxwSIlNEEiJAFUYTIlFIEyJAE0oSItFEEiLAQAIRThIiwBIORDCD4S0ALjHRfwBAWrrR0iDfRgAAHQti0X8SJhIAI0VNRoA"
. "AEQPFLYEAWAYAWCNSAIASItVGEiJCmYAQQ++0GaJEOsCDwA2IIsAjVABgQEIiRCDRfwBBT8Q9RkAAAE+hMB1EqUDek0gAT9JicgASInB6AYfAACF"
. "AEQPFLYEAWAYAWCNSAIASItVGEiJCmYAQQ++0GaJEOsCDwA2IIsAjVABgQEIiRCDRfwBBT8Q9RkAAAE+hMB1EqUDek0gAT9JicgASInB6CYfAACF"
. "A3EZEGDHACIADl0CuAGn6S4GAADGSEX7AANTUDADB0ASIABodVsADAHHRQr0Amg1hBAYi0X0AYBIweAFSAHQSJiJRdCAC4ABUBCACxiDwAEADQCF"
. "lMCIAEX7g0X0AYB90PsAdBMBGWMBFAUtFHyyA1Ysgg8IQbjCWwExBkG4e4ADEGBERImPX8dF8IJgDhYFAhmETfCJTciDfdDwAH5eGYwsDyyZCxIg"
. "jwsPtoA68AGEgMAPhNgBAACBIOXGOjABQ42BATUrZ0ABpsjAD415Hx1FEhxUEszp9kNQCRPp4sAEyiWqOMIlsMKr7Myr7MKbtJYX8avswKvDD1bA"
. "D1PIqxEzUhyeRSxMGOvaG9QSJgZG0xI6vnkBDwAPtkAYPAF1HyeDEMAsahCCG6BRfALDwi9DBQYPhZRAQsUFADlFKHVpx0XoZQwu6AImLhYfLg8u"
. "jwsPtoA68AGEgMAPhNgBAACBIOXGOjABQ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E9g31A+AB5vrgAAABI"
. "AIPEMF3DkFVIAInlSIPsIEiJAYBTiVUYTIlFIAWDMByPMGbHACIAGOkIBIAeiy3p9AMBggkQD7cAZoP4KCJ1ZoMhGZIhXABbDk4cOZADLwo5fAo5"
. "XKFKOVwA6R2QHAmKHAYIvxyIC2IA6aoCbY8clsMEhBwMvxyIC2aoAOk3kBwjihwKvxxBiAtuAOnEAY8csBvDBIQcDb8ciAtyAOnqUZAcPYocCV8O"
. "Xw7GBbB0AOneQWxMDspjAhFEDh9+DYcBfn58N/8P8A/TBXXQBUMND7cawCCSIEEFAJqJwejSjGAS6zSDCR6PCcAAhcAGEvGJSINFEMAEASMYhcAP"
. "hfz7/6r/uRIirxKQoJAgoJAvBwDlkQClpJFmgaONBQQd9aALiUXwx0UC/MGX6zIPt0UQiIPgD6Gxi0XwQLEAD7YAZg++0IsURfxjr+ghBGbB6CIE"
. "IQiDRfygn/wDIH7Ix0X4wHgA6wo/YxUl4KxImEQPELdERejPFkSJwg16qbtlqaUY"
static Code := false if ((A_PtrSize * 8) != 64) {
Throw Exception("_LoadLib does not support " (A_PtrSize * 8) " bit AHK, please run using 64 bit AHK")
} ; MCL standalone loader https://github.com/G33kDude/MCLib.ahk
; Copyright (c) 2021 G33kDude, CloakerSmoker (CC-BY-4.0)
; https://creativecommons.org/licenses/by/4.0/ if (!Code) {
if !DllCall("Crypt32\CryptStringToBinary", "Str", CodeBase64, "UInt", 0, "UInt", 1, "UPtr", 0, "UInt*", CompressedSize, "Ptr", 0, "Ptr", 0, "UInt")
throw Exception("Failed to parse MCLib b64 to binary") CompressedSize := VarSetCapacity(DecompressionBuffer, CompressedSize, 0) if !DllCall("Crypt32\CryptStringToBinary", "Str", CodeBase64, "UInt", 0, "UInt", 1, "Ptr", &DecompressionBuffer, "UInt*", CompressedSize, "Ptr", 0, "Ptr", 0, "UInt")
throw Exception("Failed to convert MCLib b64 to binary") if !(pCode := DllCall("GlobalAlloc", "UInt", 0, "Ptr", 9776, "Ptr"))
throw Exception("Failed to reserve MCLib memory") if (DllCall("ntdll\RtlDecompressBuffer", "UShort", 0x102, "Ptr", pCode, "UInt", 9776, "Ptr", &DecompressionBuffer, "UInt", CompressedSize, "UInt*", DecompressedSize, "UInt"))
throw Exception("Error calling RtlDecompressBuffer",, Format("0x{:08x}", r)) if !DllCall("VirtualProtect", "Ptr", pCode, "Ptr", 9776, "UInt", 0x40, "UInt*", OldProtect, "UInt")
throw Exception("Failed to convert MCLib b64 to binary") if !(pCode := DllCall("GlobalAlloc", "UInt", 0, "Ptr", 9808, "Ptr"))
throw Exception("Failed to reserve MCLib memory") if (DllCall("ntdll\RtlDecompressBuffer", "UShort", 0x102, "Ptr", pCode, "UInt", 9808, "Ptr", &DecompressionBuffer, "UInt", CompressedSize, "UInt*", DecompressedSize, "UInt"))
throw Exception("Error calling RtlDecompressBuffer",, Format("0x{:08x}", r)) if !DllCall("VirtualProtect", "Ptr", pCode, "Ptr", 9808, "UInt", 0x40, "UInt*", OldProtect, "UInt")
Throw Exception("Failed to mark MCLib memory as executable") Exports := {} for ExportName, ExportOffset in {"BIGINTS_AS_FLOATS": 0, "dumps": 16, "fnGetObj": 1840, "loads": 1856, "objFalse": 6752, "objNull": 6768, "objTrue": 6784} {
Exports[ExportName] := pCode + ExportOffset
} Code := Exports } return Code
Expand Down
2 changes: 1 addition & 1 deletion Src/loads.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void comobjset(IDispatch *pObj, BSTR key, VARIANT *value)
{
value->pdispVal->lpVtbl->Release(value->pdispVal);
}
else if (value->vt == VT_I4 && value->llVal > 2147483647) // Fix integer overflow
else if (value->vt == VT_I4 && (value->llVal > 2147483647 || value->llVal < -2147483648)) // Fix integer overflow
{
Field *field;
if (obj_get_field_str((Object *)pObj, key, &field))
Expand Down

0 comments on commit b618dd7

Please sign in to comment.