Awesome, thanks for the replies.
Got it with the reply leef_me sent. I put the Hex into the ahk file, write to the windows users temp folder, read it, use it, then delete it. ( actually it wont delete, but ill figure that out later lol )
Simple as pie =D
In case anyone needs it.
It uses
BinReadWrite.ahk
Code:
Image_TopNav_Separator =
( Join
47 49 46 38 39 61 02 00 0B 00 A2 00 00 56 A0 D1 57 9F CF 55 A2 D6 07 62 97 0B 61 94 57 A1 D0 0A 61 97 00
00 00 21 F9 04 00 00 00 00 00 2C 00 00 00 00 02 00 0B 00 00 03 09 48 30 42 61 05 CA 48 67 02 00 3B
)
StringReplace Image_TopNav_Separator, Image_TopNav_Separator, %A_Space%, , All
File := A_Temp . "\tmp.gif"
FileHandle := OpenFileForWrite(file)
Size := Hex2Bin(Data, Image_TopNav_Separator)
WriteInFile(FileHandle, Data, Size)
CloseFile(fh)
; Image searching goes here
; Delete it here, if we can figure it out... ( these dont work =( )
; FileDelete, %A_Temp%\tmp.gif
; FileDelete, %File%
;
Here is the Hex2Bin function if you need it (i found it hard to find the right one)
Code:
/*
// Convert a string of hexa digit pairs to raw bytes stored in a variable.
// Convert either byteNb bytes or, if null, the whole content of the variable.
//
// Return the number of converted bytes, or -1 if error (memory allocation)
*/
Hex2Bin(ByRef @bin, _hex, _byteNb=0)
{
local dataSize, granted, dataAddress, x
; Get size of data
x := StrLen(_hex)
dataSize := Ceil(x / 2)
if (x = 0 or dataSize * 2 != x)
{
; Invalid string, empty or odd number of digits
ErrorLevel = Param
Return -1
}
If (_byteNb < 1 or _byteNb > dataSize)
{
_byteNb := dataSize
}
; Make enough room
granted := VarSetCapacity(@bin, _byteNb, 0)
if (granted < _byteNb)
{
; Cannot allocate enough memory
ErrorLevel = Mem=%granted%
Return -1
}
dataAddress := &@bin
Loop Parse, _hex
{
if (A_Index & 1) ; Odd
{
x = %A_LoopField% ; Odd digit
}
else
{
; Concatenate previous x and even digit, converted to hex
x := "0x" . x . A_LoopField
; Store integer in memory
DllCall("RtlFillMemory", "UInt", dataAddress, "UInt", 1, "UChar", x)
dataAddress++
}
}
Return _byteNb
}