Open miou-gh opened 4 years ago
The following snippet produces a discrepancy between PHP and PeachPie. It appears that the IL generated by PeachPie does not seek and write the bytes at the appropriate location. Instead, it appears to do nothing at all.
PHP: 0x45 0x49 0x46 0x75 0xBB 0x73 0xED PeachPie: 0x45 0x49 0x46 0x00 0x00 0x00 0x00
$filename = "output.txt"; $fh = fopen($filename, 'wb'); fwrite($fh, "EIF", 3); fwrite($fh, "\x0\x0\x0\x0"); fflush($fh); $rid = crc32(file_get_contents($filename)) | 0x01010101; fseek($fh, 3, SEEK_SET); fwrite($fh, pack('n', ($rid >> 16) & 0xFFFF) . pack('n', $rid & 0xFFFF), 4);
thanks for the issue. It seems for now, PeachPie needs an additional fflush at the end, since it won't close the file handle automatically
fflush($fh);
The following snippet produces a discrepancy between PHP and PeachPie. It appears that the IL generated by PeachPie does not seek and write the bytes at the appropriate location. Instead, it appears to do nothing at all.
PHP: 0x45 0x49 0x46 0x75 0xBB 0x73 0xED PeachPie: 0x45 0x49 0x46 0x00 0x00 0x00 0x00