PDA

Просмотр полной версии : проблемы [php decompiler ai]


ReanimatoR
25.12.2009, 12:58
В общем есть декомпилер ai.obj серверные файлы от ла2.
его functions.php
http://pastebin.com/m6236673e
на всякий остальные файлы от декомпилера:
import.php
<?php

$load = 'c4';

$events = array();
$f = file('./data/events_'.$load.'.txt');
foreach($f as $line) {
$c = explode('|', trim($line));
$events[$c[0]][$c[1]] = $c[2];
}

$vars = array();
$f = file('./data/vars_'.$load.'.txt');
foreach($f as $line) {
$c = explode('|', trim($line));
$vars[$c[0]][$c[1]] = $c[2];
}

$functions = array();
$f = file('./data/functions_'.$load.'.txt');
foreach($f as $line) {
$c = explode('|', trim($line));
$functions[$c[0]] = explode(',', $c[1]);
}

$handlers = array();
$f = file('./data/handlers_'.$load.'.txt');
foreach($f as $line) {
$c = explode('|', trim($line));
$handlers[$c[1]] = $c[2];
}

$f = file('./data/item_pch.txt');
foreach($f as $line) {
$c = explode('=', trim($line));
$params['item'][trim($c[1])] = str_replace(']', '', str_replace('[', '', trim($c[0])));
}

?>

decompiler.php
<?php
include("function.php");
$orig = "ai.obj";
$oh = fopen($orig, 'r');
if (!$oh) {
print "can't open AI.obj.\n";
die;
}

if (!$hmmpf = (ord(fread($oh, 2)) == 255)) {
fseek($oh, 0);
}
print "this will take some time :P\n";

$line = 0;
$path = './decompiled/';
$fh = fopen($path.'ai.nasc', 'w');
@fputs($fh, copyright()."\r\n");
$gh = fopen($path.'npc_definitions.txt', 'w');
while(!feof($oh)) {
$row = trim(fgets($oh));
if ($hmmpf) {
$tmp = $row;
$row = '';
for ($i = 0; $i < strlen($tmp); $i += 2)
$row .= $tmp[$i];
}

$row = str_replace(' ', ' ', $row);

if(strlen($row)!=0){
$ai[$line] = $row;
if($row == 'class_end'){
if(count($ai) == 2){
$data = explode(' ', trim($ai[0]));
print('Processing: '.$data[2]);
@fputs($gh, "class ".$data[2]." : ".$data[4]."\r\n{\r\n}\r\n\r\n");
print(" [ Completed ]\r\n");
$line = 0;
}
else
{
process_class($ai); $line = 0;
}
unset($ai); unset($data); unset($incompatibility);
} else $line++;
}

}
fclose($fh);
fclose($gh);
fclose($oh);
?>

В общем декомпилица весь ai.obj там на 150мегов кода, все нпц и т.д., кроме одного, на этом он виснет...

вот на этом пидорге:
http://pastebin.com/m13287af

кто сможет декомпильнуть его?:)

ReanimatoR
26.12.2009, 01:24
Одни флудеры на ачате остались=)
жаль=)
тему клоз, вряд ли кто-то сечет.

m0Hze
26.12.2009, 02:04
Я бы помог,если бы понял что нужно 8)
А то тут копаться задолбаешся в кучке некрасивого кода (