Source: p297901
Function:
Code: Select all
bufferTo2BHex(byRef buffer, sizeBytes)
{
loop % sizeBytes
{
if((A_Index&1)>0)
{
s .= Format("{:04X} ", NumGet(&buffer + 0, A_Index - 1, "UShort"))
}
}
return rtrim(s, A_space)
}
Code: Select all
#SingleInstance Ignore
SetBatchLines, -1
SetKeyDelay, 0
SetWorkingDir %A_ScriptDir%
#Include <classMemory> ; On Lib folder
;Extras function
bufferTo2BHex(byRef buffer, sizeBytes)
{
loop % sizeBytes
{
if((A_Index&1)>0)
{
s .= Format("{:04X} ", NumGet(&buffer + 0, A_Index - 1, "UShort"))
}
}
return rtrim(s, A_space)
}
;App
Run, % "OldVidPlayer.exe", , , VidPlayerPID
WinWait, % "ahk_pid" VidPlayerPID,, 2 ; Wait 2 seconds
if(ErrorLevel > 0)
{
ExitApp
}
Sleep 1000
return
ScreenCaptureToHex:
_w := 480
_h := 320
_bytes := (_w*_h)*2
mem := new _ClassMemory("ahk_pid " VidPlayerPID, "", hProcessCopy)
Hotkey IfWinActive, % "ahk_pid " VidPlayerPID
Hotkey, F12, StartSnapshot
_screen := mem.readRaw(mem.BaseAddress + 0x000A3BD4, myBuffer, _bytes, 0xDC, 0x48, 0x2C, 0)
_hx := bufferTo2BHex(myBuffer, _bytes)
FileDelete, _result.txt
FileAppend, % _hx , _result.txt
return
8000 0400 8400 0010 8010 0410 C618 C6F8 A65E 4100 6100 8100 A100 C100 E100 200 2200 4200 6200 8200 A200 C200 E200 300 2300 4300 6300 8300 A300 C300 E300 (...)