Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- ini_set('memory_limit', '900M');
- ini_set('display_errors', '1');
- $files = explode("\n", `dir /b /s *.xmap`);
- $token = "\x00\x00\x00\x00";
- foreach ($files as $file)
- {
- if (!is_file($file)) continue;
- $handle = fopen($file, "r");
- if ($handle !== false)
- {
- // skip header
- fread($handle, 0x60);
- // read line
- while ($line = fread($handle, 0x70))
- {
- // end of section?
- if (substr($line, 0x20, 4) != $token) break;
- // parse
- $x = array_pop(unpack("f", strrev(substr($line, 0x30, 4))));
- $y = array_pop(unpack("f", strrev(substr($line, 0x34, 4))));
- $z = array_pop(unpack("f", strrev(substr($line, 0x38, 4))));
- $h = "0x" . strtoupper( bin2hex(substr($line, 0x24, 4)) );
- // print
- printf("%.4f, %.4f, %.4f, %s\r\n", $x, $y, $z, $h);
- }
- fclose($handle);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment