-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathffdec.php
More file actions
47 lines (37 loc) · 1.5 KB
/
ffdec.php
File metadata and controls
47 lines (37 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
// Verifica se o Java está instalado
$java_check = shell_exec("java -version 2>&1");
if (!$java_check) {
die("Erro: Java não está instalado ou não está no PATH.");
}
$ffdec_path = __DIR__ . "/../ffdec/ffdec.jar";
if (!file_exists($ffdec_path)) die("Erro: ffdec.jar não encontrado em $ffdec_path");
function ffdec($command) {
global $ffdec_path;
$output = shell_exec("java -jar \"$ffdec_path\" $command 2>&1");
echo "<pre>Saída do shell_exec:\n$output</pre>";
}
function exportImage($output_dir, $swf_dest_path) {
ffdec("-export image \"$output_dir\" \"$swf_dest_path\"");
}
function exportScript($output_dir, $swf_dest_path) {
ffdec("-export script \"$output_dir\" \"$swf_dest_path\"");
}
function exportBinaryData($output_dir, $swf_dest_path) {
ffdec("-export binaryData \"$output_dir\" \"$swf_dest_path\"");
}
function importImages($swf_original, $swf_modified, $src_path) {
ffdec("-importImages \"$swf_original\" \"$swf_modified\" \"$src_path\"");
}
function importScript($swf_original, $swf_modified, $src_path) {
ffdec("-importScript \"$swf_original\" \"$swf_modified\" \"$src_path\"");
}
function replace($swf_original, $swf_modified, $character_id, $src_file) {
ffdec("-replace \"$swf_original\" \"$swf_modified\" \"$character_id\" \"$src_file\"");
}
function swf2xml($swf_original, $output_xml) {
ffdec("-swf2xml \"$swf_original\" \"$output_xml\"");
}
function xml2swf($xml_modified, $output_swf) {
ffdec("-xml2swf \"$xml_modified\" \"$output_swf\"");
}