Skip to content
⌘ NSIS Forum Archive

Win32 ReadFile buffer question

3 posts

zeeh3#

Win32 ReadFile buffer question

Hi, I am using this script to read a piece of a binary file into a buffer for later decompression:

FileOpen $R2 "${COMP_PATH}\${COMP_FILE}" r
FileSeek $R2 ${OFFSET} SET
System::Alloc 512
System::Call 'Kernel32::ReadFile(i R2, i sr4, i 512, *i 0 r5, i 0)'

But the decompression call needs an extra 8 bytes (0) in the end of the buffer ($4)

How can I do this? Thanks a lot.