Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ori = file_get_contents("./ori.org");
- $new = "";
- $ori = chunk_split(bin2hex($ori), 2, " ");
- $expl_file = explode(" ", $ori);
- foreach($expl_file as $value) {
- $val = chr(hexdec($value));
- if (!preg_match("/[^0-9a-zA-Z ]/", $val)) {
- $new .= chr(hexdec($value));
- }
- }
- //echo $new; exit();
- // # let the party start.... search for ecu infos
- $found = false;
- $found_type = "";
- $edc15_boschhw = "";
- $edc15_swnr = "";
- $edc15_swvs = "";
- $edc15_vwnr = "";
- // BOSCH EDC15 ?
- preg_match_all("/0281(.*?) /", $new, $search0281);
- if (isset($search0281[1][0]) and strlen($search0281[1][0])==6) {
- // IT'S EDC15
- $found = true; $found_type = "Bosch EDC";
- $edc15_error = false;
- $edc15_boschhw = "0281".$search0281[1][0];
- // GET SOFTWARE NR
- preg_match_all("/1037(.*?) /", $new, $search1037);
- if (isset($search1037[1][0])) {
- $edc15_swnr = substr($search1037[1][0], 0, 6);
- if (is_numeric($edc15_swnr)) {
- $edc15_swnr = "1037".$edc15_swnr;
- }
- }
- // GET VW NUMBER
- if ($found) {
- preg_match_all("/03(.*?) /", $new, $searchVWNR);
- foreach($searchVWNR[1] as $val) {
- if (strlen($val)==9 and !is_numeric(substr($val, -2))) {
- $edc15_vwnr = "03".$val;
- }
- }
- }
- }
- if ($found) {
- echo "ECU-Type: <strong>".$found_type."</strong><br />";
- echo "Bosch-Number: ".$edc15_boschhw."<br />";
- echo "Software-Number: ".$edc15_swnr."<br />";
- echo "VW Part Number: ".$edc15_vwnr."<br />";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement