1 (изменено: Malcev, 2017-04-15 07:41:47)

Тема: AHK: Base64 заархивированный ZLib

Имеется Base64 заархивированный ZLib.
Не получается у меня разархивировать его без временных файлов.
А вроде как можно:
Сайт: http://www.zlib.net/
Сайт рус.:http://zlib.net.ru/
Атохотки враппер: https://github.com/shajul/Autohotkey/tr … plets/zlib
Современная dll для 64 бит систем: https://sourceforge.net/projects/libpng … ;download=   
Кто-нибудь сталкивался с этим?

Пока написал вариант с использованием offzip:
http://aluigi.altervista.org/mytoolz/offzip.zip
Перед распаковкой мне нужно сделать смещение на 32 байта, я его сделал, но мне кажется кривой способ.
Может есть правильнее варианты?

var =
( Join
AQAAAAAAAAB8YAAAAAAAAENvbXByZXNzZWRUaXRsZQB4nO0da3Nat1I/hen3
mIcBJzMqHceP1lMnzhiamE8ZjLHDLQEKOLH74+/tPqSj9wHjJBxuGQ+Esw9p
Je2u9qwe+d9/pfhFPIjPYiRK4osYiJmYi6GYiLH4WfwkqmJPVODfEmDGog/w
G8COxR1h/xAdcSpeAFWTaH4RLSHFIdBMxDVwfBSX8GsiFgG8A6UsoM4BYd47
9bZEDeqsiJfwOYBPDSjKAY0Ub6hkfv4o2oBf0DNKNyeKd1BDTzwC9hSoZuIr
PM1AihbQzcQ9cGDJaSoJpS7oaQFYXU8fngfUHy1xC9gR1MYlLaNGiWZZv4zg
rwXtYxl8uBQnUNacoGfEzZQ+FOnGIC3WeAt/+RLm06J8E6BdRCUMMbaMF9Cf
i4iUGo7Q5SNWztESbO+c5B0SfibOadwmVMMc9O99Un+R36b2n0+oPwZQ+oLq
uQV4vLyfVLsNfQdKmZKMuu0xHGKW1ehLdQw1f6ax0TLEZKopmabiCkbpDL5P
oJQ2wA7IkrDmEIf0Xfh9Jt4CDCENoG8qaheDtG1xBCN/An9vYYwuqbV7QP8S
+BqiDrzMGdJJGN0ZSPsVWvSJ2jRT7da2rPGXALkDGmw5Po+pzGXcfs+Gveb3
6yHpHesRPg+U9rWBBsfE6N0h1dYjLD7fKh3fA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LV+oy9Z/oIjcPeG
hlI2vinsVXZfC7dP570Yp2+4TtHo8Q5vb/Epy0pDvl3fLWj2tW/2GKvfpraQ
phx4Dhfqzt/l6Fxv3mfZ298LfbuMeS6Ju+y371Om1Ad9qKkDH5yHwhOzIYUk
i+opL2ziRh8qHevAuvEW+57K1xjvp/vIyMzP6daVvYipHERU77ObtE/VW02Y
/c87h3qruHyLKycx2GNHWaTaUjfj+1BNx1rmvpe7GISkZWe8aaV7CzND8Lxw
3p3sLeWJYv8jwD8ihQdc
)

Bytes := Base64Dec(BIN, var)
FileDelete, temp
oFile := FileOpen("temp", "rw")
oFile.RawWrite(BIN, Bytes)
oFile.Pos := 32
oFileContent := oFile.Read()
oFile.Pos := 0
oFile.Write(oFileContent)
oFile.Close()
RunWait, offzip.exe temp temp1,,Hide
FileRead, temp, temp1
FileDelete, temp
FileDelete, temp1
msgbox % temp
ExitApp


Base64dec(ByRef OutData, ByRef InData)
{
   DllCall("Crypt32.dll\CryptStringToBinary", Ptr, &InData, UInt, StrLen(InData), UInt,1, UInt,0, UIntP, Bytes, UIntP, 0, UIntP, 0, "CDECL Int")
   VarSetCapacity(OutData, Bytes)
   DllCall("Crypt32.dll\CryptStringToBinary",  Ptr, &InData, UInt, StrLen(InData), UInt,1, Str, OutData, UIntP, Bytes, UIntP, 0, UIntP, 0, "CDECL Int")
   Return Bytes
}