BackWPup – WordPress Backup Plugin - Version 2.0.0

Version Description

  • PHP Sessions, curl and PHP version 5.2.4 required!
  • Wordpress 3.2 required!
  • Using the system temp dir now
  • Updated AWS lib to 1.3.5
  • Updated RSC lib to 1.7.9
  • Updated MS Azure lib to 3.0.0
  • Added Google storage as destination
  • Reworked GUI (WordPress Dropboxes, working screen options, ....)
  • Complete new job working ot of Wordpress (less memory,automatic restart,...)
  • Added easyer job sheduling selection
Download this release

Release Info

Developer danielhuesken
Plugin Icon 128x128 BackWPup – WordPress Backup Plugin
Version 2.0.0
Comparing to
See all releases

Code changes from version 1.7.8 to 2.0.0

app/backwpup_dojob.php DELETED
@@ -1,1548 +0,0 @@
1
- <?php
2
- // don't load directly
3
- if ( !defined('ABSPATH') )
4
- die('-1');
5
-
6
- /**
7
- * BackWPup PHP class for WordPress
8
- *
9
- */
10
- class backwpup_dojob {
11
-
12
- private $jobid=0;
13
- public $filelist=array();
14
- private $tempfilelist=array();
15
- public $todo=array();
16
- private $allfilesize=0;
17
- public $backupfile='';
18
- public $backupfileformat='.zip';
19
- public $backupdir='';
20
- private $lastbackupdownloadurl='';
21
- public $logdir='';
22
- public $logfile='';
23
- private $tempdir='';
24
- public $cfg=array();
25
- public $job=array();
26
-
27
- public function __construct($jobid) {
28
- global $wpdb;
29
- @ini_get('safe_mode','Off'); //disable safe mode
30
- @ini_set('ignore_user_abort','Off'); //Set PHP ini setting
31
- ignore_user_abort(true); //user can't abort script (close windows or so.)
32
- @set_time_limit(300); //set script run time limit to 300= Webserver timout
33
- $this->jobid=$jobid; //set job id
34
- $this->cfg=get_option('backwpup'); //load config
35
- $jobs=get_option('backwpup_jobs'); //load jobdata
36
- //set Logs Dir
37
- $this->logdir=trailingslashit($this->cfg['dirlogs']);
38
- if (empty($this->logdir) or $this->logdir=='/') {
39
- $rand = substr( md5( md5( SECURE_AUTH_KEY ) ), -5 );
40
- $this->logdir=str_replace('\\','/',trailingslashit(WP_CONTENT_DIR)).'backwpup-'.$rand.'-logs/';
41
- }
42
- //Check log file dir
43
- if (!$this->_check_folders($this->logdir))
44
- return false;
45
- //check exists gzip functions
46
- if(!function_exists('gzopen'))
47
- $this->cfg['gzlogs']=false;
48
- //set Log file name
49
- $this->logfile='backwpup_log_'.date_i18n('Y-m-d_H-i-s').'.html';
50
- //create log file
51
- $fd=fopen($this->logdir.$this->logfile,'w');
52
- //Create log file header
53
- fwrite($fd,"<html>\n<head>\n");
54
- fwrite($fd,"<meta name=\"backwpup_version\" content=\"".BACKWPUP_VERSION."\" />\n");
55
- fwrite($fd,"<meta name=\"php_version\" content=\"".phpversion()."\" />\n");
56
- fwrite($fd,"<meta name=\"mysql_version\" content=\"".$wpdb->get_var("SELECT VERSION() AS version")."\" />\n");
57
- fwrite($fd,"<meta name=\"backwpup_logtime\" content=\"".current_time('timestamp')."\" />\n");
58
- fwrite($fd,str_pad("<meta name=\"backwpup_errors\" content=\"0\" />",100)."\n");
59
- fwrite($fd,str_pad("<meta name=\"backwpup_warnings\" content=\"0\" />",100)."\n");
60
- fwrite($fd,"<meta name=\"backwpup_jobid\" content=\"".$this->jobid."\" />\n");
61
- fwrite($fd,"<meta name=\"backwpup_jobname\" content=\"".$jobs[$this->jobid]['name']."\" />\n");
62
- fwrite($fd,"<meta name=\"backwpup_jobtype\" content=\"".$jobs[$this->jobid]['type']."\" />\n");
63
- fwrite($fd,str_pad("<meta name=\"backwpup_backupfilesize\" content=\"0\" />",100)."\n");
64
- fwrite($fd,str_pad("<meta name=\"backwpup_jobruntime\" content=\"0\" />",100)."\n");
65
- fwrite($fd,"<title>".sprintf(__('BackWPup Log for %1$s from %2$s at %3$s','backwpup'),$jobs[$this->jobid]['name'],date_i18n(get_option('date_format')),date_i18n(get_option('time_format')))."</title>\n</head>\n<body style=\"font-family:monospace;font-size:12px;white-space:nowrap;\">\n");
66
- fclose($fd);
67
- //set function for PHP user defineid error handling
68
- if (defined(WP_DEBUG) and WP_DEBUG)
69
- set_error_handler(array($this,'joberrorhandler'),E_ALL | E_STRICT);
70
- else
71
- set_error_handler(array($this,'joberrorhandler'),E_ALL & ~E_NOTICE);
72
- //find out if job already running and abort if
73
- if ($jobs[$this->jobid]['starttime']>0 and !empty($jobs[$this->jobid]['logfile'])) {
74
- if ($jobs[$this->jobid]['starttime']+301<current_time('timestamp')) { //Abort old jo if work longer as 10 min. because websever has 300 sec timeout
75
- trigger_error(__('Working Job will closed!!! And a new started!!!','backwpup'),E_USER_WARNING);
76
- //old logfile end
77
- $fd=fopen($jobs[$this->jobid]['logfile'],'a');
78
- fwrite($fd,"<span style=\"background-color:c3c3c3;\" title=\"[Line: ".__LINE__."|File: ".basename(__FILE__)."\">".date_i18n('Y-m-d H:i.s').":</span> <span style=\"background-color:red;\">".__('[ERROR]','backwpup')." ".__('Backup Aborted working to long!!!','backwpup')."</span><br />\n");
79
- fclose($fd);
80
- $logheader=backwpup_read_logheader($jobs[$this->jobid]['logfile']); //read waring count from log header
81
- $logheader['errors']++;
82
- //write new log header
83
- $fd=fopen($jobs[$this->jobid]['logfile'],'r+');
84
- while (!feof($fd)) {
85
- if (stripos(fgets($fd),"<meta name=\"backwpup_errors\"") !== false) {
86
- fseek($fd,$filepos);
87
- fwrite($fd,str_pad("<meta name=\"backwpup_errors\" content=\"".$logheader['errors']."\" />",100)."\n");
88
- break;
89
- }
90
- $filepos=ftell($fd);
91
- }
92
- fclose($fd);
93
- $this->job_end($jobs[$this->jobid]['logfile']);
94
- } else {
95
- trigger_error(sprintf(__('Job %1$s already running!!!','backwpup'),$jobs[$this->jobid]['name']),E_USER_ERROR);
96
- }
97
- }
98
- //Set job start settings
99
- $jobs[$this->jobid]['starttime']=current_time('timestamp'); //set start time for job
100
- $jobs[$this->jobid]['logfile']=$this->logdir.$this->logfile; //Set current logfile
101
- $jobs[$this->jobid]['lastbackupdownloadurl']='';
102
- $jobs[$this->jobid]['lastlogfile']=$this->logdir.$this->logfile;
103
- $jobs[$this->jobid]['cronnextrun']=backwpup_cron_next($jobs[$this->jobid]['cron']); //set next run
104
- if ($jobs[$this->jobid]['activated'])
105
- trigger_error(__('Next scheduled run is on:','backwpup').' '.date('D, j M Y H:i',$jobs[$this->jobid]['cronnextrun']).'; '.$jobs[$this->jobid]['cron'],E_USER_NOTICE);
106
- update_option('backwpup_jobs',$jobs); //Save job Settings
107
- $this->job=backwpup_check_job_vars($jobs[$this->jobid],$this->jobid);//Set and check job settings
108
- //set waht to do
109
- $this->todo=explode('+',$this->job['type']);
110
- //set Temp Dir
111
- $this->tempdir=trailingslashit($this->cfg['dirtemp']);
112
- if (empty($this->tempdir) or $this->tempdir=='/')
113
- $this->tempdir=backwpup_get_upload_dir();
114
- trigger_error(__('Temp folder is:','backwpup').$this->tempdir,E_USER_NOTICE);
115
- //only for jos that makes backups
116
- if (in_array('FILE',$this->todo) or in_array('DB',$this->todo) or in_array('WPEXP',$this->todo)) {
117
- //set Backup File format
118
- $this->backupfileformat=$this->job['fileformart'];
119
- //set Backup Dir
120
- $this->backupdir=$this->job['backupdir'];
121
- if (empty($this->backupdir))
122
- $this->backupdir=$this->tempdir;
123
- //check backup dir
124
- if ($this->backupdir!=backwpup_get_upload_dir()) {
125
- if (!$this->_check_folders($this->backupdir))
126
- return false;
127
- }
128
- //set Backup file Name
129
- $this->backupfile=$this->job['fileprefix'].date_i18n('Y-m-d_H-i-s').$this->backupfileformat;
130
- //celanup brocken backupfiles
131
- if ($dir = opendir($this->tempdir)) {
132
- while (($file = readdir($dir)) !== false) {
133
- if (is_readable($this->tempdir.$file) and is_file($this->tempdir.$file)) {
134
- if ($file!='.' and $file!='..' and ((!empty($this->job['fileprefix']) and false !== strpos($file,$this->job['fileprefix']) or $file==DB_NAME.'.sql' )or false !== strpos($file,preg_replace( '/[^a-z0-9_\-]/', '', strtolower(get_bloginfo('name')) ).'.wordpress.'))) {
135
- unlink($this->tempdir.$file);
136
- }
137
- }
138
- }
139
- closedir($dir);
140
- }
141
- }
142
- //check max script execution tme
143
- if (ini_get('safe_mode') or strtolower(ini_get('safe_mode'))=='on' or ini_get('safe_mode')=='1')
144
- trigger_error(sprintf(__('PHP Safe Mode is on!!! Max exec time is %1$d sec.','backwpup'),ini_get('max_execution_time')),E_USER_WARNING);
145
- // check function for memorylimit
146
- if (!function_exists('memory_get_usage')) {
147
- ini_set('memory_limit', apply_filters( 'admin_memory_limit', '256M' )); //Wordpress default
148
- trigger_error(sprintf(__('Memory limit set to %1$s ,because can not use PHP: memory_get_usage() function to dynamically increase the Memory!','backwpup'),ini_get('memory_limit')),E_USER_WARNING);
149
- }
150
- }
151
-
152
- //function for PHP error handling
153
- public function joberrorhandler() {
154
- $args = func_get_args(); // 0:errno, 1:errstr, 2:errfile, 3:errline
155
-
156
- //genrate timestamp
157
- if (!function_exists('memory_get_usage')) { // test if memory functions compiled in
158
- $timestamp="<span style=\"background-color:c3c3c3;\" title=\"[Line: ".$args[3]."|File: ".basename($args[2])."\">".date_i18n('Y-m-d H:i.s').":</span> ";
159
- } else {
160
- $timestamp="<span style=\"background-color:c3c3c3;\" title=\"[Line: ".$args[3]."|File: ".basename($args[2])."|Mem: ".backwpup_formatBytes(@memory_get_usage(true))."|Mem Max: ".backwpup_formatBytes(@memory_get_peak_usage(true))."|Mem Limit: ".ini_get('memory_limit')."]\">".date_i18n('Y-m-d H:i.s').":</span> ";
161
- }
162
-
163
- switch ($args[0]) {
164
- case E_NOTICE:
165
- case E_USER_NOTICE:
166
- $massage=$timestamp."<span>".$args[1]."</span>";
167
- break;
168
- case E_WARNING:
169
- case E_USER_WARNING:
170
- $logheader=backwpup_read_logheader($this->logdir.$this->logfile); //read waring count from log header
171
- $warnings=$logheader['warnings']+1;
172
- $massage=$timestamp."<span style=\"background-color:yellow;\">".__('[WARNING]','backwpup')." ".$args[1]."</span>";
173
- break;
174
- case E_ERROR:
175
- case E_USER_ERROR:
176
- $logheader=backwpup_read_logheader($this->logdir.$this->logfile); //read error count from log header
177
- $errors=$logheader['errors']+1;
178
- $massage=$timestamp."<span style=\"background-color:red;\">".__('[ERROR]','backwpup')." ".$args[1]."</span>";
179
- break;
180
- case E_DEPRECATED:
181
- case E_USER_DEPRECATED:
182
- $massage=$timestamp."<span>".__('[DEPRECATED]','backwpup')." ".$args[1]."</span>";
183
- break;
184
- case E_STRICT:
185
- $massage=$timestamp."<span>".__('[STRICT NOTICE]','backwpup')." ".$args[1]."</span>";
186
- break;
187
- case E_RECOVERABLE_ERROR:
188
- $massage=$timestamp."<span>".__('[RECOVERABLE ERROR]','backwpup')." ".$args[1]."</span>";
189
- break;
190
- default:
191
- $massage=$timestamp."<span>[".$args[0]."] ".$args[1]."</span>";
192
- break;
193
- }
194
-
195
- @set_time_limit(300);//set script run time limit new to 300sec.
196
-
197
- if (!empty($massage)) {
198
- //wirte log file
199
- $fd=fopen($this->logdir.$this->logfile,'a');
200
- fwrite($fd,$massage."<br />\n");
201
- fclose($fd);
202
-
203
- //output on run now
204
- if (!defined('DOING_CRON')) {
205
- echo $massage."<script type=\"text/javascript\">window.scrollBy(0, 15);</script><br />\n";
206
- @flush();
207
- @ob_flush();
208
- }
209
-
210
- //write new log header
211
- if (isset($errors) or isset($warnings)) {
212
- $fd=fopen($this->logdir.$this->logfile,'r+');
213
- while (!feof($fd)) {
214
- $line=fgets($fd);
215
- if (stripos($line,"<meta name=\"backwpup_errors\"") !== false and isset($errors)) {
216
- fseek($fd,$filepos);
217
- fwrite($fd,str_pad("<meta name=\"backwpup_errors\" content=\"".$errors."\" />",100)."\n");
218
- break;
219
- }
220
- if (stripos($line,"<meta name=\"backwpup_warnings\"") !== false and isset($warnings)) {
221
- fseek($fd,$filepos);
222
- fwrite($fd,str_pad("<meta name=\"backwpup_warnings\" content=\"".$warnings."\" />",100)."\n");
223
- break;
224
- }
225
- $filepos=ftell($fd);
226
- }
227
- fclose($fd);
228
- }
229
-
230
- if ($args[0]==E_ERROR or $args[0]==E_CORE_ERROR or $args[0]==E_COMPILE_ERROR) {//Die on fatal php errors.
231
- $this->send_log_mail();
232
- die();
233
- }
234
- //true for no more php error hadling.
235
- return true;
236
- } else {
237
- return false;
238
- }
239
- }
240
-
241
- private function _check_folders($folder) {
242
- if (!is_dir($folder)) { //create dir if not exists
243
- if (!mkdir($folder,0755,true)) {
244
- trigger_error(sprintf(__('Can not create Folder: %1$s','backwpup'),$folder),E_USER_ERROR);
245
- return false;
246
- }
247
- }
248
- if (!is_writeable($folder)) { //test if folder wirteable
249
- trigger_error(sprintf(__('Can not write to Folder: %1$s','backwpup'),$folder),E_USER_ERROR);
250
- return false;
251
- }
252
- //create .htaccess for apache and index.html for other
253
- if (strtolower(substr($_SERVER["SERVER_SOFTWARE"],0,6))=="apache") { //check if it a apache webserver
254
- if (!is_file($folder.'.htaccess')) {
255
- if($file = fopen($folder.'.htaccess', 'w')) {
256
- fwrite($file, "Order allow,deny\ndeny from all");
257
- fclose($file);
258
- }
259
- }
260
- } else {
261
- if (!is_file($folder.'index.html')) {
262
- if($file = fopen($folder.'index.html', 'w')) {
263
- fwrite($file,"\n");
264
- fclose($file);
265
- }
266
- }
267
- if (!is_file($folder.'index.php')) {
268
- if($file = fopen($folder.'index.php', 'w')) {
269
- fwrite($file,"\n");
270
- fclose($file);
271
- }
272
- }
273
- }
274
- return true;
275
- }
276
-
277
- private function need_free_memory($memneed) {
278
- //fail back if fuction not exist
279
- if (!function_exists('memory_get_usage'))
280
- return true;
281
-
282
- if (ini_get('safe_mode') or strtolower(ini_get('safe_mode'))=='on' or ini_get('safe_mode')=='1') {
283
- trigger_error(sprintf(__('PHP Safe Mode is on!!! Can not increase Memory Limit is %1$s','backwpup'),ini_get('memory_limit')),E_USER_WARNING);
284
- return false;
285
- }
286
-
287
- //calc mem to bytes
288
- if (strtoupper(substr(trim(ini_get('memory_limit')),-1))=='K')
289
- $memory=trim(substr(ini_get('memory_limit'),0,-1))*1024;
290
- elseif (strtoupper(substr(trim(ini_get('memory_limit')),-1))=='M')
291
- $memory=trim(substr(ini_get('memory_limit'),0,-1))*1024*1024;
292
- elseif (strtoupper(substr(trim(ini_get('memory_limit')),-1))=='G')
293
- $memory=trim(substr(ini_get('memory_limit'),0,-1))*1024*1024*1024;
294
- else
295
- $memory=trim(ini_get('memory_limit'));
296
-
297
- //use real memory at php version 5.2.0
298
- if (version_compare(phpversion(), '5.2.0', '<'))
299
- $memnow=memory_get_usage();
300
- else
301
- $memnow=memory_get_usage(true);
302
-
303
- //need memory
304
- $needmemory=$memnow+$memneed;
305
-
306
- // increase Memory
307
- if ($needmemory>$memory) {
308
- $newmemory=round($needmemory/1024/1024)+1;
309
- if ($oldmem=ini_set('memory_limit', $newmemory.'M'))
310
- trigger_error(sprintf(__('Memory increased from %1$s to %2$s','backwpup'),$oldmem,ini_get('memory_limit')),E_USER_NOTICE);
311
- else
312
- trigger_error(sprintf(__('Can not increase Memory Limit is %1$s','backwpup'),ini_get('memory_limit')),E_USER_WARNING);
313
- }
314
- return true;
315
- }
316
-
317
- private function maintenance_mode($enable = false) {
318
- if (!$this->job['maintenance'])
319
- return;
320
-
321
- if ( $enable ) {
322
- trigger_error(__('Set Blog to Maintenance Mode','backwpup'),E_USER_NOTICE);
323
- if ( class_exists('WPMaintenanceMode') ) { //Support for WP Maintenance Mode Plugin
324
- update_option('wp-maintenance-mode-msqld','1');
325
- } elseif ( class_exists('MaintenanceMode') ) { //Support for Maintenance Mode Plugin
326
- $mamo=get_option('plugin_maintenance-mode');
327
- $mamo['mamo_activate']='on_'.current_time('timestamp');
328
- $mamo['mamo_backtime_days']='0';
329
- $mamo['mamo_backtime_hours']='0';
330
- $mamo['mamo_backtime_mins']='5';
331
- update_option('plugin_maintenance-mode',$mamo);
332
- } else { //WP Support
333
- $fdmain=fopen(trailingslashit(ABSPATH).'.maintenance','w');
334
- fwrite($fdmain,'<?php $upgrading = ' . time() . '; ?>');
335
- fclose($fdmain);
336
- }
337
- } else {
338
- trigger_error(__('Set Blog to normal Mode','backwpup'),E_USER_NOTICE);
339
- if ( class_exists('WPMaintenanceMode') ) { //Support for WP Maintenance Mode Plugin
340
- update_option('wp-maintenance-mode-msqld','0');
341
- } elseif ( class_exists('MaintenanceMode') ) { //Support for Maintenance Mode Plugin
342
- $mamo=get_option('plugin_maintenance-mode');
343
- $mamo['mamo_activate']='off';
344
- update_option('plugin_maintenance-mode',$mamo);
345
- } else { //WP Support
346
- @unlink(trailingslashit(ABSPATH).'.maintenance');
347
- }
348
- }
349
- }
350
-
351
- public function check_db() {
352
- global $wpdb;
353
-
354
- trigger_error(__('Run Database check...','backwpup'),E_USER_NOTICE);
355
-
356
- $tables=$wpdb->get_col('SHOW TABLES FROM `'.DB_NAME.'`');
357
- //exclude tables from check
358
- foreach($tables as $tablekey => $tablevalue) {
359
- if (in_array($tablevalue,$this->job['dbexclude']))
360
- unset($tables[$tablekey]);
361
- }
362
-
363
- //check tables
364
- if (sizeof($tables)>0) {
365
- $this->maintenance_mode(true);
366
- foreach ($tables as $table) {
367
- $check=$wpdb->get_row('CHECK TABLE `'.$table.'` MEDIUM', ARRAY_A);
368
- if ($check['Msg_type']=='error')
369
- trigger_error(sprintf(__('Result of table check for %1$s is: %2$s','backwpup'), $table, $check['Msg_text']),E_USER_ERROR);
370
- elseif ($check['Msg_type']=='warning')
371
- trigger_error(sprintf(__('Result of table check for %1$s is: %2$s','backwpup'), $table, $check['Msg_text']),E_USER_WARNING);
372
- else
373
- trigger_error(sprintf(__('Result of table check for %1$s is: %2$s','backwpup'), $table, $check['Msg_text']),E_USER_NOTICE);
374
-
375
- if ($sqlerr=mysql_error($wpdb->dbh)) //aditional SQL error
376
- trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), $sqlerr, $sqlerr->last_query),E_USER_ERROR);
377
- //Try to Repair tabele
378
- if ($check['Msg_type']=='error' or $check['Msg_type']=='warning') {
379
- $repair=$wpdb->get_row('REPAIR TABLE `'.$table.'`', ARRAY_A);
380
- if ($repair['Msg_type']=='error')
381
- trigger_error(sprintf(__('Result of table repair for %1$s is: %2$s','backwpup'), $table, $repair['Msg_text']),E_USER_ERROR);
382
- elseif ($repair['Msg_type']=='warning')
383
- trigger_error(sprintf(__('Result of table repair for %1$s is: %2$s','backwpup'), $table, $repair['Msg_text']),E_USER_WARNING);
384
- else
385
- trigger_error(sprintf(__('Result of table repair for %1$s is: %2$s','backwpup'), $table, $repair['Msg_text']),E_USER_NOTICE);
386
-
387
- if ($sqlerr=mysql_error($wpdb->dbh)) //aditional SQL error
388
- trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), $sqlerr, $sqlerr->last_query),E_USER_ERROR);
389
- }
390
- }
391
- $wpdb->flush();
392
- $this->maintenance_mode(false);
393
- trigger_error(__('Database check done!','backwpup'),E_USER_NOTICE);
394
- } else {
395
- trigger_error(__('No Tables to check','backwpup'),E_USER_WARNING);
396
- }
397
- }
398
-
399
- private function dump_db_table($table,$status,$file) {
400
- $this->need_free_memory(1048576); //1MB free memory for dump
401
- // create dump
402
- fwrite($file, "\n");
403
- fwrite($file, "--\n");
404
- fwrite($file, "-- Table structure for table $table\n");
405
- fwrite($file, "--\n\n");
406
- fwrite($file, "DROP TABLE IF EXISTS `" . $table . "`;\n");
407
- fwrite($file, "/*!40101 SET @saved_cs_client = @@character_set_client */;\n");
408
- fwrite($file, "/*!40101 SET character_set_client = '".mysql_client_encoding()."' */;\n");
409
- //Dump the table structure
410
- $result=mysql_query("SHOW CREATE TABLE `".$table."`");
411
- if (!$result) {
412
- trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), mysql_error(), "SHOW CREATE TABLE `".$table."`"),E_USER_ERROR);
413
- return false;
414
- }
415
- $tablestruc=mysql_fetch_assoc($result);
416
- fwrite($file, $tablestruc['Create Table'].";\n");
417
- fwrite($file, "/*!40101 SET character_set_client = @saved_cs_client */;\n");
418
-
419
- //take data of table
420
- $result=mysql_query("SELECT * FROM `".$table."`");
421
- if (!$result) {
422
- trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), mysql_error(), "SELECT * FROM `".$table."`"),E_USER_ERROR);
423
- return false;
424
- }
425
-
426
- fwrite($file, "--\n");
427
- fwrite($file, "-- Dumping data for table $table\n");
428
- fwrite($file, "--\n\n");
429
- if ($status['Engine']=='MyISAM')
430
- fwrite($file, "/*!40000 ALTER TABLE `".$table."` DISABLE KEYS */;\n");
431
-
432
-
433
- while ($data = mysql_fetch_assoc($result)) {
434
- $keys = array();
435
- $values = array();
436
- foreach($data as $key => $value) {
437
- if (!$this->job['dbshortinsert'])
438
- $keys[] = "`".str_replace("�", "��", $key)."`"; // Add key to key list
439
- if($value === NULL) // Make Value NULL to string NULL
440
- $value = "NULL";
441
- elseif($value === "" or $value === false) // if empty or false Value make "" as Value
442
- $value = "''";
443
- elseif(!is_numeric($value)) //is value not numeric esc
444
- $value = "'".mysql_real_escape_string($value)."'";
445
- $values[] = $value;
446
- }
447
- // make data dump
448
- if ($this->job['dbshortinsert'])
449
- fwrite($file, "INSERT INTO `".$table."` VALUES ( ".implode(", ",$values)." );\n");
450
- else
451
- fwrite($file, "INSERT INTO `".$table."` ( ".implode(", ",$keys)." )\n\tVALUES ( ".implode(", ",$values)." );\n");
452
-
453
- }
454
- if ($status['Engine']=='MyISAM')
455
- fwrite($file, "/*!40000 ALTER TABLE ".$table." ENABLE KEYS */;\n");
456
- }
457
-
458
- public function dump_db() {
459
- global $wpdb;
460
- trigger_error(__('Run Database Dump to file...','backwpup'),E_USER_NOTICE);
461
- //Set maintenance
462
- $this->maintenance_mode(true);
463
-
464
- //Tables to backup
465
- $tables=$wpdb->get_col('SHOW TABLES FROM `'.DB_NAME.'`');
466
- if ($sqlerr=mysql_error($wpdb->dbh))
467
- trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), $sqlerr, "SHOW TABLES FROM `".DB_NAME."`"),E_USER_ERROR);
468
-
469
- foreach($tables as $tablekey => $tablevalue) {
470
- if (in_array($tablevalue,$this->job['dbexclude']))
471
- unset($tables[$tablekey]);
472
- }
473
- sort($tables);
474
-
475
- if (sizeof($tables)>0) {
476
- $result=$wpdb->get_results("SHOW TABLE STATUS FROM `".DB_NAME."`;", ARRAY_A); //get table status
477
- if ($sqlerr=mysql_error($wpdb->dbh))
478
- trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), $sqlerr, "SHOW TABLE STATUS FROM `".DB_NAME."`;"),E_USER_ERROR);
479
- foreach($result as $statusdata) {
480
- $status[$statusdata['Name']]=$statusdata;
481
- }
482
-
483
- if ($file = fopen($this->tempdir.DB_NAME.'.sql', 'w')) {
484
- fwrite($file, "-- ---------------------------------------------------------\n");
485
- fwrite($file, "-- Dump with BackWPup ver.: ".BACKWPUP_VERSION."\n");
486
- fwrite($file, "-- Plugin for WordPress by Daniel Huesken\n");
487
- fwrite($file, "-- http://danielhuesken.de/portfolio/backwpup/\n");
488
- fwrite($file, "-- Blog Name: ".get_option('blogname')."\n");
489
- if (defined('WP_SITEURL'))
490
- fwrite($file, "-- Blog URL: ".trailingslashit(WP_SITEURL)."\n");
491
- else
492
- fwrite($file, "-- Blog URL: ".trailingslashit(get_option('siteurl'))."\n");
493
- fwrite($file, "-- Blog ABSPATH: ".trailingslashit(ABSPATH)."\n");
494
- fwrite($file, "-- Table Prefix: ".$wpdb->prefix."\n");
495
- fwrite($file, "-- Database Name: ".DB_NAME."\n");
496
- fwrite($file, "-- Dump on: ".date_i18n('Y-m-d H:i.s')."\n");
497
- fwrite($file, "-- ---------------------------------------------------------\n\n");
498
- //for better import with mysql client
499
- fwrite($file, "/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n");
500
- fwrite($file, "/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n");
501
- fwrite($file, "/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n");
502
- fwrite($file, "/*!40101 SET NAMES '".mysql_client_encoding()."' */;\n");
503
- fwrite($file, "/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\n");
504
- fwrite($file, "/*!40103 SET TIME_ZONE='".mysql_result(mysql_query("SELECT @@time_zone"),0)."' */;\n");
505
- fwrite($file, "/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n");
506
- fwrite($file, "/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n");
507
- fwrite($file, "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n");
508
- fwrite($file, "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n\n");
509
- //make table dumps
510
- foreach($tables as $table) {
511
- trigger_error(__('Dump Database table: ','backwpup').' '.$table,E_USER_NOTICE);
512
- $this->need_free_memory(($status[$table]['Data_length']+$status[$table]['Index_length'])*1.3); //get more memory if needed
513
- $this->dump_db_table($table,$status[$table],$file);
514
- }
515
- //for better import with mysql client
516
- fwrite($file, "\n");
517
- fwrite($file, "/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;\n");
518
- fwrite($file, "/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n");
519
- fwrite($file, "/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\n");
520
- fwrite($file, "/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\n");
521
- fwrite($file, "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n");
522
- fwrite($file, "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n");
523
- fwrite($file, "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n");
524
- fwrite($file, "/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\n");
525
- fclose($file);
526
- trigger_error(__('Database Dump done!','backwpup'),E_USER_NOTICE);
527
- } else {
528
- trigger_error(__('Can not create Database Dump file','backwpup'),E_USER_ERROR);
529
- }
530
- } else {
531
- trigger_error(__('No Tables to Dump','backwpup'),E_USER_WARNING);
532
- }
533
-
534
- //add database file to backupfiles
535
- if (is_readable($this->tempdir.DB_NAME.'.sql')) {
536
- trigger_error(__('Add Database Dump to Backup:','backwpup').' '.DB_NAME.'.sql '.backwpup_formatBytes(filesize($this->tempdir.DB_NAME.'.sql')),E_USER_NOTICE);
537
- $this->allfilesize+=filesize($this->tempdir.DB_NAME.'.sql');
538
- $this->filelist[]=array(79001=>$this->tempdir.DB_NAME.'.sql',79003=>DB_NAME.'.sql');
539
- }
540
- //Back from maintenance
541
- $this->maintenance_mode(false);
542
- }
543
-
544
- public function export_wp() {
545
- $this->need_free_memory(1048576); //1MB free memory
546
- $nonce=wp_create_nonce('backwpup-xmlexport');
547
- update_option('backwpup_nonce',array('nonce'=>$nonce,'timestamp'=>time()));
548
- if (function_exists('curl_exec')) {
549
- trigger_error(__('Run Wordpress Export to XML file...','backwpup'),E_USER_NOTICE);
550
- $ch = curl_init();
551
- curl_setopt($ch, CURLOPT_URL, plugins_url('wp_xml_export.php',__FILE__).'?wpabs='.trailingslashit(ABSPATH).'&_nonce='.$nonce);
552
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
553
- curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
554
- curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
555
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
556
- $return=curl_exec($ch);
557
- if (!$return) {
558
- trigger_error(__('cURL:','backwpup').' '.curl_error($ch),E_USER_ERROR);
559
- } else {
560
- $fd=fopen($this->tempdir.preg_replace( '/[^a-z0-9_\-]/', '', strtolower(get_bloginfo('name')) ).'.wordpress.' . date( 'Y-m-d' ) . '.xml',"w+");
561
- fwrite($fd,$return);
562
- fclose($fd);
563
- }
564
- curl_close($ch);
565
- } elseif (ini_get('allow_url_fopen')==true or ini_get('allow_url_fopen')==1 or strtolower(ini_get('allow_url_fopen'))=="on") {
566
- trigger_error(__('Run Wordpress Export to XML file...','backwpup'),E_USER_NOTICE);
567
- if (copy(plugins_url('wp_xml_export.php',__FILE__).'?wpabs='.trailingslashit(ABSPATH).'&_nonce='.$nonce,$this->tempdir.preg_replace( '/[^a-z0-9_\-]/', '', strtolower(get_bloginfo('name')) ).'.wordpress.' . date( 'Y-m-d' ) . '.xml')) {
568
- trigger_error(__('Export to XML done!','backwpup'),E_USER_NOTICE);
569
- } else {
570
- trigger_error(__('Can not Export to XML!','backwpup'),E_USER_ERROR);
571
- }
572
- } else {
573
- trigger_error(__('Can not Export to XML! no cURL or allow_url_fopen Support!','backwpup'),E_USER_WARNING);
574
- }
575
- if (is_readable($this->tempdir.preg_replace( '/[^a-z0-9_\-]/', '', strtolower(get_bloginfo('name')) ).'.wordpress.' . date( 'Y-m-d' ) . '.xml')) {
576
- //add database file to backupfiles
577
- trigger_error(__('Add XML Export to Backup:','backwpup').' '.preg_replace( '/[^a-z0-9_\-]/', '', strtolower(get_bloginfo('name')) ).'.wordpress.' . date( 'Y-m-d' ) . '.xml '.backwpup_formatBytes(filesize($this->tempdir.preg_replace( '/[^a-z0-9_\-]/', '', strtolower(get_bloginfo('name')) ).'.wordpress.' . date( 'Y-m-d' ) . '.xml')),E_USER_NOTICE);
578
- $this->allfilesize+=filesize($this->tempdir.preg_replace( '/[^a-z0-9_\-]/', '', strtolower(get_bloginfo('name')) ).'.wordpress.' . date( 'Y-m-d' ) . '.xml');
579
- $this->filelist[]=array(79001=>$this->tempdir.preg_replace( '/[^a-z0-9_\-]/', '', strtolower(get_bloginfo('name')) ).'.wordpress.' . date( 'Y-m-d' ) . '.xml',79003=>preg_replace( '/[^a-z0-9_\-]/', '', strtolower(get_bloginfo('name')) ).'.wordpress.' . date( 'Y-m-d' ) . '.xml');
580
- }
581
- }
582
-
583
- public function optimize_db() {
584
- global $wpdb;
585
-
586
- trigger_error(__('Run Database optimize...','backwpup'),E_USER_NOTICE);
587
-
588
- $tables=$wpdb->get_col('SHOW TABLES FROM `'.DB_NAME.'`');
589
- //exclude tables from optimize
590
- foreach($tables as $tablekey => $tablevalue) {
591
- if (in_array($tablevalue,$this->job['dbexclude']))
592
- unset($tables[$tablekey]);
593
- }
594
-
595
- if (sizeof($tables)>0) {
596
- $this->maintenance_mode(true);
597
- foreach ($tables as $table) {
598
- $optimize=$wpdb->get_row('OPTIMIZE TABLE `'.$table.'`', ARRAY_A);
599
- if ($optimize['Msg_type']=='error')
600
- trigger_error(sprintf(__('Result of table optimize for %1$s is: %2$s','backwpup'), $table, $optimize['Msg_text']),E_USER_ERROR);
601
- elseif ($optimize['Msg_type']=='warning')
602
- trigger_error(sprintf(__('Result of table optimize for %1$s is: %2$s','backwpup'), $table, $optimize['Msg_text']),E_USER_WARNING);
603
- else
604
- trigger_error(sprintf(__('Result of table optimize for %1$s is: %2$s','backwpup'), $table, $optimize['Msg_text']),E_USER_NOTICE);
605
-
606
- if ($sqlerr=mysql_error($wpdb->dbh))
607
- trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), $sqlerr, $sqlerr->last_query),E_USER_ERROR);
608
- }
609
- $wpdb->flush();
610
- trigger_error(__('Database optimize done!','backwpup'),E_USER_NOTICE);
611
- $this->maintenance_mode(false);
612
- } else {
613
- trigger_error(__('No Tables to optimize','backwpup'),E_USER_WARNING);
614
- }
615
- }
616
-
617
- private function _file_list_folder( $folder = '', $levels = 100, $excludes=array(),$excludedirs=array()) {
618
- if( empty($folder) )
619
- return false;
620
- if( ! $levels )
621
- return false;
622
- if ( $dir = @opendir( $folder ) ) {
623
- while (($file = readdir( $dir ) ) !== false ) {
624
- if ( in_array($file, array('.', '..','.svn') ) )
625
- continue;
626
- foreach ($excludes as $exclusion) { //exclude dirs and files
627
- if (false !== stripos($folder.$file,$exclusion) and !empty($exclusion) and $exclusion!='/')
628
- continue 2;
629
- }
630
- if ( !is_readable($folder.$file) ) {
631
- trigger_error(__('File or Folder is not readable:','backwpup').' '.$folder.$file,E_USER_WARNING);
632
- } elseif ( is_link($folder.$file) ) {
633
- trigger_error(__('Link not followed:','backwpup').' '.$folder.$file,E_USER_WARNING);
634
- } elseif ( is_dir( $folder.$file )) {
635
- if (!in_array(trailingslashit($folder.$file),$excludedirs))
636
- $this->_file_list_folder( trailingslashit($folder.$file), $levels - 1, $excludes);
637
- } elseif ( is_file( $folder.$file ) or is_executable($folder.$file) ) { //add file to filelist
638
- $this->tempfilelist[]=$folder.$file;
639
- $this->allfilesize=$this->allfilesize+filesize($folder.$file);
640
- } else {
641
- trigger_error(__('Is not a file or directory:','backwpup').' '.$folder.$file,E_USER_WARNING);
642
- }
643
- }
644
- @closedir( $dir );
645
- }
646
- }
647
-
648
- public function file_list() {
649
-
650
- //Make filelist
651
- trigger_error(__('Make a list of files to Backup ....','backwpup'),E_USER_NOTICE);
652
-
653
- //Check free memory for file list
654
- $this->need_free_memory(2097152); //2MB free memory for filelist
655
- //empty filelist
656
- $this->tempfilelist=array();
657
-
658
- $backwpup_exclude=explode(',',trim($this->job['fileexclude']));
659
- //Exclude Temp Files
660
- $backwpup_exclude[]=$this->tempdir.DB_NAME.'.sql';
661
- $backwpup_exclude[]=$this->tempdir.'wordpress.' . date( 'Y-m-d' ) . '.xml';
662
- $backwpup_exclude=array_unique($backwpup_exclude);
663
-
664
- //File list for blog folders
665
- if ($this->job['backuproot'])
666
- $this->_file_list_folder(trailingslashit(str_replace('\\','/',ABSPATH)),100,$backwpup_exclude,array_merge($this->job['backuprootexcludedirs'],backwpup_get_exclude_wp_dirs(ABSPATH)));
667
- if ($this->job['backupcontent'])
668
- $this->_file_list_folder(trailingslashit(str_replace('\\','/',WP_CONTENT_DIR)),100,$backwpup_exclude,array_merge($this->job['backupcontentexcludedirs'],backwpup_get_exclude_wp_dirs(WP_CONTENT_DIR)));
669
- if ($this->job['backupplugins'])
670
- $this->_file_list_folder(trailingslashit(str_replace('\\','/',WP_PLUGIN_DIR)),100,$backwpup_exclude,array_merge($this->job['backuppluginsexcludedirs'],backwpup_get_exclude_wp_dirs(WP_PLUGIN_DIR)));
671
- if ($this->job['backupthemes'])
672
- $this->_file_list_folder(trailingslashit(str_replace('\\','/',trailingslashit(WP_CONTENT_DIR).'themes')),100,$backwpup_exclude,array_merge($this->job['backupthemesexcludedirs'],backwpup_get_exclude_wp_dirs(trailingslashit(WP_CONTENT_DIR).'themes')));
673
- if ($this->job['backupuploads'])
674
- $this->_file_list_folder(trailingslashit(backwpup_get_upload_dir()),100,$backwpup_exclude,array_merge($this->job['backupuploadsexcludedirs'],backwpup_get_exclude_wp_dirs(backwpup_get_upload_dir())));
675
-
676
- //include dirs
677
- if (!empty($this->job['dirinclude'])) {
678
- $dirinclude=explode(',',$this->job['dirinclude']);
679
- $dirinclude=array_unique($dirinclude);
680
- //Crate file list for includes
681
- foreach($dirinclude as $dirincludevalue) {
682
- if (is_dir($dirincludevalue))
683
- $this->_file_list_folder(trailingslashit($dirincludevalue),100,$backwpup_exclude);
684
- }
685
- }
686
-
687
- $this->tempfilelist=array_unique($this->tempfilelist); //all files only one time in list
688
- sort($this->tempfilelist);
689
- //Check abs path
690
- if (ABSPATH=='/' or ABSPATH=='')
691
- $removepath='';
692
- else
693
- $removepath=trailingslashit(ABSPATH);
694
- //make file list
695
- foreach ($this->tempfilelist as $files)
696
- $this->filelist[]=array(79001=>$files,79003=>str_replace($removepath,'',$files));
697
- $this->tempfilelist=array();
698
-
699
- if (!is_array($this->filelist[0])) {
700
- trigger_error(__('No files to Backup','backwpup'),E_USER_ERROR);
701
- } else {
702
- trigger_error(__('Files to Backup:','backwpup').' '.count($this->filelist),E_USER_NOTICE);
703
- trigger_error(__('Size of all Files:','backwpup').' '.backwpup_formatBytes($this->allfilesize),E_USER_NOTICE);
704
- }
705
-
706
- }
707
-
708
- public function zip_files() {
709
- if (class_exists('ZipArchive')) { //use php zip lib
710
- trigger_error(__('Create Backup Zip file...','backwpup'),E_USER_NOTICE);
711
- $zip = new ZipArchive;
712
- if ($res=$zip->open($this->backupdir.$this->backupfile,ZIPARCHIVE::CREATE) === TRUE) {
713
- foreach($this->filelist as $key => $files) {
714
- if (!is_file($files[79001])) //check file exists
715
- continue;
716
- if ($zip->addFile($files[79001], $files[79003])) {
717
- if ($this->cfg['logfilelist'])
718
- trigger_error(__('Add File to ZIP file:','backwpup').' '.$files[79001].' '.backwpup_formatBytes(filesize($files[79001])),E_USER_NOTICE);
719
- } else {
720
- trigger_error(__('Can not add File to ZIP file:','backwpup').' '.$files[79001],E_USER_ERROR);
721
- }
722
- }
723
- $zip->close();
724
- trigger_error(__('Backup Zip file create done!','backwpup'),E_USER_NOTICE);
725
- } else {
726
- trigger_error(__('Can not create Backup ZIP file:','backwpup').' '.$res,E_USER_ERROR);
727
- }
728
- } else { //use PclZip
729
- define( 'PCLZIP_TEMPORARY_DIR', $this->tempdir );
730
- if (!class_exists('PclZip'))
731
- require_once(dirname(__FILE__).'/libs/pclzip.lib.php');
732
-
733
- //Create Zip File
734
- if (is_array($this->filelist[0])) {
735
- $this->need_free_memory(10485760); //10MB free memory for zip
736
- trigger_error(__('Create Backup Zip (PclZip) file...','backwpup'),E_USER_NOTICE);
737
- if ($this->cfg['logfilelist']) {
738
- foreach($this->filelist as $key => $files) {
739
- trigger_error(__('Add File to ZIP file:','backwpup').' '.$files[79001].' '.backwpup_formatBytes(filesize($files[79001])),E_USER_NOTICE);
740
- }
741
- }
742
- $zipbackupfile = new PclZip($this->backupdir.$this->backupfile);
743
- if (0==$zipbackupfile -> create($this->filelist,PCLZIP_OPT_ADD_TEMP_FILE_ON)) {
744
- trigger_error(__('Zip file create:','backwpup').' '.$zipbackupfile->errorInfo(true),E_USER_ERROR);
745
- } else {
746
- trigger_error(__('Backup Zip file create done!','backwpup'),E_USER_NOTICE);
747
- }
748
- }
749
- }
750
- if ($filesize=filesize($this->backupdir.$this->backupfile))
751
- trigger_error(sprintf(__('Backup Archive File size is %1s','backwpup'),backwpup_formatBytes($filesize)),E_USER_NOTICE);
752
- }
753
-
754
- public function tar_pack_files() {
755
-
756
- if ($this->backupfileformat=='.tar.gz') {
757
- $tarbackup=gzopen($this->backupdir.$this->backupfile,'w9');
758
- } elseif ($this->backupfileformat=='.tar.bz2') {
759
- $tarbackup=bzopen($this->backupdir.$this->backupfile,'w');
760
- } else {
761
- $tarbackup=fopen($this->backupdir.$this->backupfile,'w');
762
- }
763
-
764
- if (!$tarbackup) {
765
- trigger_error(__('Can not create TAR Backup file','backwpup'),E_USER_ERROR);
766
- return;
767
- } else {
768
- trigger_error(__('Create Backup Archive file...','backwpup'),E_USER_NOTICE);
769
- }
770
-
771
- $this->need_free_memory(1048576); //1MB free memory for tar
772
-
773
- foreach($this->filelist as $key => $files) {
774
- if ($this->cfg['logfilelist'])
775
- trigger_error(__('Add File to Backup Archive:','backwpup').' '.$files[79001].' '.backwpup_formatBytes(filesize($files[79001])),E_USER_NOTICE);
776
-
777
- //check file exists
778
- if (!is_readable($files[79001]))
779
- continue;
780
-
781
- // Get file information
782
- $file_information = stat($files[79001]);
783
- //split filename larger than 100 chars
784
- if (strlen($files[79003])<=100) {
785
- $filename=$files[79003];
786
- $filenameprefix="";
787
- } else {
788
- $filenameofset=strlen($files[79003])-100;
789
- $dividor=strpos($files[79003],'/',$filenameofset);
790
- $filename=substr($files[79003],$dividor+1);
791
- $filenameprefix=substr($files[79003],0,$dividor);
792
- if (strlen($filename)>100)
793
- trigger_error(__('File Name to Long to save corectly in TAR Backup Archive:','backwpup').' '.$files[79003],E_USER_WARNING);
794
- if (strlen($filenameprefix)>155)
795
- trigger_error(__('File Path to Long to save corectly in TAR Backup Archive:','backwpup').' '.$files[79003],E_USER_WARNING);
796
- }
797
- //Set file user/group name if linux
798
- $fileowner="Unknown";
799
- $filegroup="Unknown";
800
- if (function_exists('posix_getpwuid')) {
801
- $info=posix_getpwuid($file_information['uid']);
802
- $fileowner=$info['name'];
803
- $info=posix_getgrgid($file_information['gid']);
804
- $filegroup=$info['name'];
805
- }
806
-
807
- // Generate the TAR header for this file
808
- $header = pack("a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155a12",
809
- $filename, //name of file 100
810
- sprintf("%07o", $file_information['mode']), //file mode 8
811
- sprintf("%07o", $file_information['uid']), //owner user ID 8
812
- sprintf("%07o", $file_information['gid']), //owner group ID 8
813
- sprintf("%011o", $file_information['size']), //length of file in bytes 12
814
- sprintf("%011o", $file_information['mtime']), //modify time of file 12
815
- " ", //checksum for header 8
816
- 0, //type of file 0 or null = File, 5=Dir
817
- "", //name of linked file 100
818
- "ustar", //USTAR indicator 6
819
- "00", //USTAR version 2
820
- $fileowner, //owner user name 32
821
- $filegroup, //owner group name 32
822
- "", //device major number 8
823
- "", //device minor number 8
824
- $filenameprefix, //prefix for file name 155
825
- ""); //fill block 512K
826
-
827
- // Computes the unsigned Checksum of a file's header
828
- $checksum = 0;
829
- for ($i = 0; $i < 512; $i++)
830
- $checksum += ord(substr($header, $i, 1));
831
- $checksum = pack("a8", sprintf("%07o", $checksum));
832
-
833
- $header = substr_replace($header, $checksum, 148, 8);
834
-
835
- if ($this->backupfileformat=='.tar.gz') {
836
- gzwrite($tarbackup, $header);
837
- } elseif ($this->backupfileformat=='.tar.bz2') {
838
- bzwrite($tarbackup, $header);
839
- } else {
840
- fwrite($tarbackup, $header);
841
- }
842
-
843
- // read/write files in 512K Blocks
844
- $fd=fopen($files[79001],'rb');
845
- while(!feof($fd)) {
846
- $filedata=fread($fd,512);
847
- if (strlen($filedata)>0) {
848
- if ($this->backupfileformat=='.tar.gz') {
849
- gzwrite($tarbackup,pack("a512", $filedata));
850
- } elseif ($this->backupfileformat=='.tar.bz2') {
851
- bzwrite($tarbackup,pack("a512", $filedata));
852
- } else {
853
- fwrite($tarbackup,pack("a512", $filedata));
854
- }
855
- }
856
- }
857
- fclose($fd);
858
- }
859
-
860
-
861
- if ($this->backupfileformat=='.tar.gz') {
862
- gzwrite($tarbackup, pack("a1024", "")); // Add 1024 bytes of NULLs to designate EOF
863
- gzclose($tarbackup);
864
- } elseif ($this->backupfileformat=='.tar.bz2') {
865
- bzwrite($tarbackup, pack("a1024", "")); // Add 1024 bytes of NULLs to designate EOF
866
- bzclose($tarbackup);
867
- } else {
868
- fwrite($tarbackup, pack("a1024", "")); // Add 1024 bytes of NULLs to designate EOF
869
- fclose($tarbackup);
870
- }
871
-
872
- trigger_error(__('Backup Archive file create done!','backwpup'),E_USER_NOTICE);
873
- if ($filesize=filesize($this->backupdir.$this->backupfile))
874
- trigger_error(sprintf(__('Backup Archive File size is %1s','backwpup'),backwpup_formatBytes($filesize)),E_USER_NOTICE);
875
- }
876
-
877
-
878
- public function destination_ftp() {
879
-
880
- $this->need_free_memory(filesize($this->backupdir.$this->backupfile)*1.5);
881
-
882
- $ftpport=21;
883
- $ftphost=$this->job['ftphost'];
884
- if (false !== strpos($this->job['ftphost'],':')) //look for port
885
- list($ftphost,$ftpport)=explode(':',$this->job['ftphost'],2);
886
-
887
- if ($this->job['ftpssl']) { //make SSL FTP connection
888
- if (function_exists('ftp_ssl_connect')) {
889
- $ftp_conn_id = ftp_ssl_connect($ftphost,$ftpport,10);
890
- if ($ftp_conn_id)
891
- trigger_error(__('Connected by SSL-FTP to Server:','backwpup').' '.$this->job['ftphost'],E_USER_NOTICE);
892
- else {
893
- trigger_error(__('Can not connect by SSL-FTP to Server:','backwpup').' '.$this->job['ftphost'],E_USER_ERROR);
894
- return false;
895
- }
896
- } else {
897
- trigger_error(__('PHP Function to connect with SSL-FTP to Server not exists!','backwpup'),E_USER_ERROR);
898
- return false;
899
- }
900
- } else { //make normal FTP conection if SSL not work
901
- $ftp_conn_id = ftp_connect($ftphost,$ftpport,10);
902
- if ($ftp_conn_id)
903
- trigger_error(__('Connected to FTP Server:','backwpup').' '.$this->job['ftphost'],E_USER_NOTICE);
904
- else {
905
- trigger_error(__('Can not connect to FTP Server:','backwpup').' '.$this->job['ftphost'],E_USER_ERROR);
906
- return false;
907
- }
908
- }
909
-
910
- //FTP Login
911
- $loginok=false;
912
- trigger_error(__('FTP Client command:','backwpup').' USER '.$this->job['ftpuser'],E_USER_NOTICE);
913
- if ($loginok=ftp_login($ftp_conn_id, $this->job['ftpuser'], base64_decode($this->job['ftppass']))) {
914
- trigger_error(__('FTP Server reply:','backwpup').' User '.$this->job['ftpuser'].' logged in.',E_USER_NOTICE);
915
- } else { //if PHP ftp login don't work use raw login
916
- $return=ftp_raw($ftp_conn_id,'USER '.$this->job['ftpuser']);
917
- trigger_error(__('FTP Server reply:','backwpup').' '.$return[0],E_USER_NOTICE);
918
- if (substr(trim($return[0]),0,3)<=400) {
919
- trigger_error(__('FTP Client command:','backwpup').' PASS *******',E_USER_NOTICE);
920
- $return=ftp_raw($ftp_conn_id,'PASS '.base64_decode($this->job['ftppass']));
921
- trigger_error(__('FTP Server reply:','backwpup').' '.$return[0],E_USER_NOTICE);
922
- if (substr(trim($return[0]),0,3)<=400)
923
- $loginok=true;
924
- }
925
- }
926
-
927
- if (!$loginok)
928
- return false;
929
-
930
- //PASV
931
- trigger_error(__('FTP Client command:','backwpup').' PASV',E_USER_NOTICE);
932
- if ($this->job['ftppasv']) {
933
- if (ftp_pasv($ftp_conn_id, true))
934
- trigger_error(__('FTP Server reply:','backwpup').' '.__('Entering Passive Mode','backwpup'),E_USER_NOTICE);
935
- else
936
- trigger_error(__('FTP Server reply:','backwpup').' '.__('Can not Entering Passive Mode','backwpup'),E_USER_WARNING);
937
- } else {
938
- if (ftp_pasv($ftp_conn_id, false))
939
- trigger_error(__('FTP Server reply:','backwpup').' '.__('Entering Normal Mode','backwpup'),E_USER_NOTICE);
940
- else
941
- trigger_error(__('FTP Server reply:','backwpup').' '.__('Can not Entering Normal Mode','backwpup'),E_USER_WARNING);
942
- }
943
- //SYSTYPE
944
- trigger_error(__('FTP Client command:','backwpup').' SYST',E_USER_NOTICE);
945
- $systype=ftp_systype($ftp_conn_id);
946
- if ($systype)
947
- trigger_error(__('FTP Server reply:','backwpup').' '.$systype,E_USER_NOTICE);
948
- else
949
- trigger_error(__('FTP Server reply:','backwpup').' '.__('Error getting SYSTYPE','backwpup'),E_USER_ERROR);
950
-
951
- //test ftp dir and create it f not exists
952
- $ftpdirs=explode("/", untrailingslashit($this->job['ftpdir']));
953
- foreach ($ftpdirs as $ftpdir) {
954
- if (empty($ftpdir))
955
- continue;
956
- if (!@ftp_chdir($ftp_conn_id, $ftpdir)) {
957
- trigger_error('"'.$ftpdir.'" '.__('FTP Folder on Server not exists!','backwpup'),E_USER_WARNING);
958
- if (@ftp_mkdir($ftp_conn_id, $ftpdir)) {
959
- trigger_error('"'.$ftpdir.'" '.__('FTP Folder created!','backwpup'),E_USER_NOTICE);
960
- ftp_chdir($ftp_conn_id, $ftpdir);
961
- } else {
962
- trigger_error('"'.$ftpdir.'" '.__('FTP Folder on Server can not created!','backwpup'),E_USER_ERROR);
963
- }
964
- }
965
- }
966
-
967
- if (ftp_put($ftp_conn_id, $this->job['ftpdir'].$this->backupfile, $this->backupdir.$this->backupfile, FTP_BINARY)) { //transfere file
968
- trigger_error(__('Backup File transferred to FTP Server:','backwpup').' '.$this->job['ftpdir'].$this->backupfile,E_USER_NOTICE);
969
- $this->lastbackupdownloadurl="ftp://".$this->job['ftpuser'].":".base64_decode($this->job['ftppass'])."@".$this->job['ftphost'].$this->job['ftpdir'].$this->backupfile;
970
- } else
971
- trigger_error(__('Can not transfer backup to FTP server.','backwpup'),E_USER_ERROR);
972
-
973
- if ($this->job['ftpmaxbackups']>0) { //Delete old backups
974
- $backupfilelist=array();
975
- if ($filelist=ftp_nlist($ftp_conn_id, $this->job['ftpdir'])) {
976
- foreach($filelist as $files) {
977
- if ($this->job['fileprefix'] == substr(basename($files),0,strlen($this->job['fileprefix'])) and $this->backupfileformat == substr(basename($files),-strlen($this->backupfileformat)))
978
- $backupfilelist[]=basename($files);
979
- }
980
- if (sizeof($backupfilelist)>0) {
981
- rsort($backupfilelist);
982
- $numdeltefiles=0;
983
- for ($i=$this->job['ftpmaxbackups'];$i<sizeof($backupfilelist);$i++) {
984
- if (ftp_delete($ftp_conn_id, $this->job['ftpdir'].$backupfilelist[$i])) //delte files on ftp
985
- $numdeltefiles++;
986
- else
987
- trigger_error(__('Can not delete file on FTP Server:','backwpup').' '.$this->job['ftpdir'].$backupfilelist[$i],E_USER_ERROR);
988
- }
989
- if ($numdeltefiles>0)
990
- trigger_error($numdeltefiles.' '.__('files deleted on FTP Server:','backwpup'),E_USER_NOTICE);
991
- }
992
- }
993
- }
994
- ftp_close($ftp_conn_id);
995
-
996
- }
997
-
998
- public function destination_mail() {
999
- trigger_error(__('Prepare Sending backup file with mail...','backwpup'),E_USER_NOTICE);
1000
- //Create PHP Mailer
1001
- require_once(ABSPATH.WPINC.'/class-phpmailer.php');
1002
- $phpmailer = new PHPMailer();
1003
- //Setting den methode
1004
- if ($this->cfg['mailmethod']=="SMTP") {
1005
- require_once(ABSPATH.WPINC.'/class-smtp.php');
1006
- $smtpport=25;
1007
- $smtphost=$this->cfg['mailhost'];
1008
- if (false !== strpos($this->cfg['mailhost'],':')) //look for port
1009
- list($smtphost,$smtpport)=explode(':',$this->cfg['mailhost'],2);
1010
- $phpmailer->Host=$smtphost;
1011
- $phpmailer->Port=$smtpport;
1012
- $phpmailer->SMTPSecure=$this->cfg['mailsecure'];
1013
- $phpmailer->Username=$this->cfg['mailuser'];
1014
- $phpmailer->Password=base64_decode($this->cfg['mailpass']);
1015
- if (!empty($this->cfg['mailuser']) and !empty($this->cfg['mailpass']))
1016
- $phpmailer->SMTPAuth=true;
1017
- $phpmailer->IsSMTP();
1018
- trigger_error(__('Send mail with SMTP','backwpup'),E_USER_NOTICE);
1019
- } elseif ($this->cfg['mailmethod']=="Sendmail") {
1020
- $phpmailer->Sendmail=$this->cfg['mailsendmail'];
1021
- $phpmailer->IsSendmail();
1022
- trigger_error(__('Send mail with Sendmail','backwpup'),E_USER_NOTICE);
1023
- } else {
1024
- $phpmailer->IsMail();
1025
- trigger_error(__('Send mail with PHP mail','backwpup'),E_USER_NOTICE);
1026
- }
1027
-
1028
-
1029
- trigger_error(__('Creating mail','backwpup'),E_USER_NOTICE);
1030
- $phpmailer->From = $this->cfg['mailsndemail'];
1031
- $phpmailer->FromName = $this->cfg['mailsndname'];
1032
- $phpmailer->AddAddress($this->job['mailaddress']);
1033
- $phpmailer->Subject = __('BackWPup File from','backwpup').' '.date_i18n('Y-m-d H:i',$this->job['starttime']).': '.$this->job['name'];
1034
- $phpmailer->IsHTML(false);
1035
- $phpmailer->Body = 'Backup File';
1036
-
1037
- //check file Size
1038
- if (!empty($this->job['mailefilesize'])) {
1039
- $maxfilezise=abs($this->job['mailefilesize']*1024*1024);
1040
- if (filesize($this->backupdir.$this->backupfile)>$maxfilezise) {
1041
- trigger_error(__('Backup Archive too big for sending by mail','backwpup'),E_USER_ERROR);
1042
- return false;
1043
- }
1044
- }
1045
-
1046
- trigger_error(__('Adding Attachment to mail','backwpup'),E_USER_NOTICE);
1047
- $this->need_free_memory(filesize($this->backupdir.$this->backupfile)*5);
1048
- $phpmailer->AddAttachment($this->backupdir.$this->backupfile);
1049
-
1050
- trigger_error(__('Send mail....','backwpup'),E_USER_NOTICE);
1051
- if (false == $phpmailer->Send()) {
1052
- trigger_error(__('Can not send mail:','backwpup').' '.$phpmailer->ErrorInfo,E_USER_ERROR);
1053
- } else {
1054
- trigger_error(__('Mail send!!!','backwpup'),E_USER_NOTICE);
1055
- }
1056
-
1057
- }
1058
-
1059
- public function destination_s3() {
1060
-
1061
- if (!class_exists('CFRuntime'))
1062
- require_once(dirname(__FILE__).'/libs/aws/sdk.class.php');
1063
-
1064
- $this->need_free_memory(26214400*1.1);
1065
-
1066
- try {
1067
- $s3 = new AmazonS3($this->job['awsAccessKey'], $this->job['awsSecretKey']);
1068
-
1069
- if ($s3->if_bucket_exists($this->job['awsBucket'])) {
1070
- trigger_error(__('Connected to S3 Bucket:','backwpup').' '.$this->job['awsBucket'],E_USER_NOTICE);
1071
-
1072
- //Transfer Backup to S3
1073
- if ($this->job['awsrrs']) //set reduced redundancy or not
1074
- $storage=AmazonS3::STORAGE_REDUCED;
1075
- else
1076
- $storage=AmazonS3::STORAGE_STANDARD;
1077
-
1078
- if ($s3->create_mpu_object($this->job['awsBucket'], $this->job['awsdir'].$this->backupfile, array('fileUpload' => $this->backupdir.$this->backupfile,'acl' => AmazonS3::ACL_PRIVATE,'storage' => $storage,'partSize'=>26214400))) {//transfere file to S3
1079
- trigger_error(__('Backup File transferred to S3://','backwpup').$this->job['awsBucket'].'/'.$this->job['awsdir'].$this->backupfile,E_USER_NOTICE);
1080
- $this->lastbackupdownloadurl='admin.php?page=BackWPup&subpage=backups&action=downloads3&file='.$this->job['awsdir'].$this->backupfile.'&jobid='.$this->jobid;
1081
- } else {
1082
- trigger_error(__('Can not transfer backup to S3.','backwpup'),E_USER_ERROR);
1083
- }
1084
-
1085
- if ($this->job['awsmaxbackups']>0) { //Delete old backups
1086
- $backupfilelist=array();
1087
- if (($contents = $s3->list_objects($this->job['awsBucket'],array('prefix'=>$this->job['awsdir']))) !== false) {
1088
- foreach ($contents->body->Contents as $object) {
1089
- $file=basename($object->Key);
1090
- if ($this->job['fileprefix'] == substr($file,0,strlen($this->job['fileprefix'])) and $this->backupfileformat == substr($file,-strlen($this->backupfileformat)))
1091
- $backupfilelist[]=$file;
1092
- }
1093
- }
1094
- if (sizeof($backupfilelist)>0) {
1095
- rsort($backupfilelist);
1096
- $numdeltefiles=0;
1097
- for ($i=$this->job['awsmaxbackups'];$i<sizeof($backupfilelist);$i++) {
1098
- if ($s3->delete_object($this->job['awsBucket'], $this->job['awsdir'].$backupfilelist[$i])) //delte files on S3
1099
- $numdeltefiles++;
1100
- else
1101
- trigger_error(__('Can not delete file on S3://','backwpup').$this->job['awsBucket'].'/'.$this->job['awsdir'].$backupfilelist[$i],E_USER_ERROR);
1102
- }
1103
- if ($numdeltefiles>0)
1104
- trigger_error($numdeltefiles.' '.__('files deleted on S3 Bucket!','backwpup'),E_USER_NOTICE);
1105
- }
1106
- }
1107
-
1108
-
1109
-
1110
- } else {
1111
- trigger_error(__('S3 Bucket not exists:','backwpup').' '.$this->job['awsBucket'],E_USER_ERROR);
1112
- }
1113
- } catch (Exception $e) {
1114
- trigger_error(__('Amazon S3 API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
1115
- return;
1116
- }
1117
- }
1118
-
1119
- public function destination_rsc() {
1120
-
1121
- if (!class_exists('CF_Authentication'))
1122
- require_once(dirname(__FILE__).'/libs/rackspace/cloudfiles.php');
1123
-
1124
- $auth = new CF_Authentication($this->job['rscUsername'], $this->job['rscAPIKey']);
1125
- $auth->ssl_use_cabundle();
1126
- try {
1127
- if ($auth->authenticate())
1128
- trigger_error(__('Connected to Rackspase ...','backwpup'),E_USER_NOTICE);
1129
- $conn = new CF_Connection($auth);
1130
- $conn->ssl_use_cabundle();
1131
- $is_container=false;
1132
- $containers=$conn->get_containers();
1133
- foreach ($containers as $container) {
1134
- if ($container->name == $this->job['rscContainer'] )
1135
- $is_container=true;
1136
- }
1137
- if (!$is_container) {
1138
- $public_container = $conn->create_container($this->job['rscContainer']);
1139
- $public_container->make_private();
1140
- if (empty($public_container))
1141
- $is_container=false;
1142
- }
1143
- } catch (Exception $e) {
1144
- trigger_error(__('Rackspase Cloud API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
1145
- return;
1146
- }
1147
-
1148
- if (!$is_container) {
1149
- trigger_error(__('Rackspase Cloud Container not exists:','backwpup').' '.$this->job['rscContainer'],E_USER_ERROR);
1150
- return;
1151
- }
1152
-
1153
- try {
1154
- //Transfer Backup to Rackspace Cloud
1155
- $backwpupcontainer = $conn->get_container($this->job['rscContainer']);
1156
- //if (!empty($this->job['rscdir'])) //make the foldder
1157
- // $backwpupcontainer->create_paths($this->job['rscdir']);
1158
- $backwpupbackup = $backwpupcontainer->create_object($this->job['rscdir'].$this->backupfile);
1159
-
1160
- if ($backwpupbackup->load_from_filename($this->backupdir.$this->backupfile)) {
1161
- trigger_error(__('Backup File transferred to RSC://','backwpup').$this->job['rscContainer'].'/'.$this->job['rscdir'].$this->backupfile,E_USER_NOTICE);
1162
- $this->lastbackupdownloadurl='admin.php?page=BackWPup&subpage=backups&action=downloadrsc&file='.$this->job['rscdir'].$this->backupfile.'&jobid='.$this->jobid;
1163
- } else {
1164
- trigger_error(__('Can not transfer backup to RSC.','backwpup'),E_USER_ERROR);
1165
- }
1166
-
1167
- if ($this->job['rscmaxbackups']>0) { //Delete old backups
1168
- $backupfilelist=array();
1169
- $contents = $backwpupcontainer->list_objects(0,NULL,NULL,$this->job['rscdir']);
1170
- if (is_array($contents)) {
1171
- foreach ($contents as $object) {
1172
- $file=basename($object);
1173
- if ($this->job['rscdir'].$file == $object) {//only in the folder and not in complete bucket
1174
- if ($this->job['fileprefix'] == substr($file,0,strlen($this->job['fileprefix'])) and $this->backupfileformat == substr($file,-strlen($this->backupfileformat)))
1175
- $backupfilelist[]=$file;
1176
- }
1177
- }
1178
- }
1179
- if (sizeof($backupfilelist)>0) {
1180
- rsort($backupfilelist);
1181
- $numdeltefiles=0;
1182
- for ($i=$this->job['rscmaxbackups'];$i<sizeof($backupfilelist);$i++) {
1183
- if ($backwpupcontainer->delete_object($this->job['rscdir'].$backupfilelist[$i])) //delte files on Cloud
1184
- $numdeltefiles++;
1185
- else
1186
- trigger_error(__('Can not delete file on RSC://','backwpup').$this->job['rscContainer'].$this->job['rscdir'].$backupfilelist[$i],E_USER_ERROR);
1187
- }
1188
- if ($numdeltefiles>0)
1189
- trigger_error($numdeltefiles.' '.__('files deleted on Racspase Cloud Container!','backwpup'),E_USER_NOTICE);
1190
- }
1191
- }
1192
- } catch (Exception $e) {
1193
- trigger_error(__('Rackspase Cloud API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
1194
- }
1195
- }
1196
-
1197
- public function destination_msazure() {
1198
-
1199
- if (!class_exists('Microsoft_WindowsAzure_Storage_Blob')) {
1200
- set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__).'/libs');
1201
- require_once 'Microsoft/WindowsAzure/Storage/Blob.php';
1202
- }
1203
-
1204
- $this->need_free_memory(4194304*1.5);
1205
-
1206
- try {
1207
- $storageClient = new Microsoft_WindowsAzure_Storage_Blob($this->job['msazureHost'],$this->job['msazureAccName'],$this->job['msazureKey']);
1208
-
1209
- if(!$storageClient->containerExists($this->job['msazureContainer'])) {
1210
- trigger_error(__('Microsoft Azure Container not exists:','backwpup').' '.$this->job['msazureContainer'],E_USER_ERROR);
1211
- return;
1212
- } else {
1213
- trigger_error(__('Connected to Microsoft Azure Container:','backwpup').' '.$this->job['msazureContainer'],E_USER_NOTICE);
1214
- }
1215
-
1216
- $result = $storageClient->putBlob($this->job['msazureContainer'], $this->job['msazuredir'].$this->backupfile, $this->backupdir.$this->backupfile);
1217
-
1218
- if ($result->Name==$this->job['msazuredir'].$this->backupfile) {
1219
- trigger_error(__('Backup File transferred to azure://','backwpup').$this->job['msazuredir'].$this->backupfile,E_USER_NOTICE);
1220
- $this->lastbackupdownloadurl='admin.php?page=BackWPup&subpage=backups&action=downloadmsazure&file='.$this->job['msazuredir'].$this->backupfile.'&jobid='.$this->jobid;
1221
- } else {
1222
- trigger_error(__('Can not transfer backup to Microsoft Azure.','backwpup'),E_USER_ERROR);
1223
- }
1224
-
1225
- if ($this->job['msazuremaxbackups']>0) { //Delete old backups
1226
- $backupfilelist=array();
1227
- $blobs = $storageClient->listBlobs($this->job['msazureContainer'],$this->job['msazuredir']);
1228
- if (is_array($blobs)) {
1229
- foreach ($blobs as $blob) {
1230
- $file=basename($blob->Name);
1231
- if ($this->job['fileprefix'] == substr($file,0,strlen($this->job['fileprefix'])) and $this->backupfileformat == substr($file,-strlen($this->backupfileformat)))
1232
- $backupfilelist[]=$file;
1233
- }
1234
- }
1235
- if (sizeof($backupfilelist)>0) {
1236
- rsort($backupfilelist);
1237
- $numdeltefiles=0;
1238
- for ($i=$this->job['msazuremaxbackups'];$i<sizeof($backupfilelist);$i++) {
1239
- $storageClient->deleteBlob($this->job['msazureContainer'],$this->job['msazuredir'].$backupfilelist[$i]); //delte files on Cloud
1240
- $numdeltefiles++;
1241
- }
1242
- if ($numdeltefiles>0)
1243
- trigger_error($numdeltefiles.' '.__('files deleted on Microsoft Azure Container!','backwpup'),E_USER_NOTICE);
1244
- }
1245
- }
1246
-
1247
- } catch (Exception $e) {
1248
- trigger_error(__('Microsoft Azure API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
1249
- }
1250
- }
1251
-
1252
- public function destination_dir() {
1253
- $this->lastbackupdownloadurl='admin.php?page=BackWPup&subpage=backups&action=download&file='.$this->backupdir.$this->backupfile;
1254
- //Delete old Backupfiles
1255
- $backupfilelist=array();
1256
- if (!empty($this->job['maxbackups'])) {
1257
- if ( $dir = @opendir($this->job['backupdir']) ) { //make file list
1258
- while (($file = readdir($dir)) !== false ) {
1259
- if ($this->job['fileprefix'] == substr($file,0,strlen($this->job['fileprefix'])) and $this->backupfileformat == substr($file,-strlen($this->backupfileformat)))
1260
- $backupfilelist[]=$file;
1261
- }
1262
- @closedir( $dir );
1263
- }
1264
- if (sizeof($backupfilelist)>0) {
1265
- rsort($backupfilelist);
1266
- $numdeltefiles=0;
1267
- for ($i=$this->job['maxbackups'];$i<sizeof($backupfilelist);$i++) {
1268
- unlink(trailingslashit($this->job['backupdir']).$backupfilelist[$i]);
1269
- $numdeltefiles++;
1270
- }
1271
- if ($numdeltefiles>0)
1272
- trigger_error($numdeltefiles.' '.__('old backup files deleted!!!','backwpup'),E_USER_NOTICE);
1273
- }
1274
- }
1275
- }
1276
-
1277
- public function destination_dropbox(){
1278
-
1279
- if (!class_exists('Dropbox'))
1280
- require_once (dirname(__FILE__).'/libs/dropbox/dropbox.php');
1281
-
1282
- try {
1283
- $dropbox = new Dropbox(BACKWPUP_DROPBOX_APP_KEY, BACKWPUP_DROPBOX_APP_SECRET);
1284
- // set the tokens
1285
- $dropbox->setOAuthTokens($this->job['dropetoken'],$this->job['dropesecret']);
1286
- $info=$dropbox->accountInfo();
1287
- if (!empty($info['uid'])) {
1288
- trigger_error(__('Authed to DropBox from ','backwpup').$info['display_name'],E_USER_NOTICE);
1289
- }
1290
- //Check Quota
1291
- $dropboxfreespase=$info['quota_info']['quota']-$info['quota_info']['shared']-$info['quota_info']['normal'];
1292
- if (filesize($this->backupdir.$this->backupfile)>$dropboxfreespase) {
1293
- trigger_error(__('No free space left on DropBox!!!','backwpup'),E_USER_ERROR);
1294
- return;
1295
- } else {
1296
- trigger_error(__('Free Space on DropBox: ','backwpup').backwpup_formatBytes($dropboxfreespase),E_USER_NOTICE);
1297
- }
1298
- // put the file
1299
- $response = $dropbox->upload($this->backupdir.$this->backupfile,$this->job['dropedir']);
1300
- if ($response['result']=="winner!") {
1301
- $this->lastbackupdownloadurl='admin.php?page=BackWPup&subpage=backups&action=downloaddropbox&file='.$this->job['dropedir'].$this->backupfile.'&jobid='.$this->jobid;
1302
- trigger_error(__('Backup File transferred to DropBox.','backwpup'),E_USER_NOTICE);
1303
- } else {
1304
- trigger_error(__('Can not transfere Backup file to DropBox:','backwpup').' '.$response['error'],E_USER_ERROR);
1305
- }
1306
-
1307
- if ($this->job['dropemaxbackups']>0) { //Delete old backups
1308
- $backupfilelist=array();
1309
- $metadata = $dropbox->metadata($this->job['dropedir']);
1310
- if (is_array($metadata)) {
1311
- foreach ($metadata['contents'] as $data) {
1312
- $file=basename($data['path']);
1313
- if ($data['is_dir']!=true and $this->job['fileprefix'] == substr($file,0,strlen($this->job['fileprefix'])) and $this->backupfileformat == substr($file,-strlen($this->backupfileformat)))
1314
- $backupfilelist[]=$file;
1315
- }
1316
- }
1317
- if (sizeof($backupfilelist)>0) {
1318
- rsort($backupfilelist);
1319
- $numdeltefiles=0;
1320
- for ($i=$this->job['dropemaxbackups'];$i<sizeof($backupfilelist);$i++) {
1321
- $dropbox->fileopsDelete($this->job['dropedir'].$backupfilelist[$i]); //delete files on Cloud
1322
- $numdeltefiles++;
1323
- }
1324
- if ($numdeltefiles>0)
1325
- trigger_error($numdeltefiles.' '.__('files deleted on DropBox Folder!','backwpup'),E_USER_NOTICE);
1326
- }
1327
- }
1328
- } catch (Exception $e) {
1329
- trigger_error(__('DropBox API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
1330
- }
1331
- }
1332
-
1333
- public function destination_sugarsync(){
1334
-
1335
- if (!class_exists('SugarSync'))
1336
- require_once (dirname(__FILE__).'/libs/sugarsync.php');
1337
-
1338
- $this->need_free_memory(filesize($this->backupdir.$this->backupfile)*1.5);
1339
-
1340
- try {
1341
- $sugarsync = new SugarSync($this->job['sugaruser'],base64_decode($this->job['sugarpass']),BACKWPUP_SUGARSYNC_ACCESSKEY, BACKWPUP_SUGARSYNC_PRIVATEACCESSKEY);
1342
- //Check Quota
1343
- $user=$sugarsync->user();
1344
- if (!empty($user->nickname)) {
1345
- trigger_error(__('Authed to SugarSync with Nick ','backwpup').$user->nickname,E_USER_NOTICE);
1346
- }
1347
- $sugarsyncfreespase=(float)$user->quota->limit-(float)$user->quota->usage;
1348
- if (filesize($this->backupdir.$this->backupfile)>$sugarsyncfreespase) {
1349
- trigger_error(__('No free space left on SugarSync!!!','backwpup'),E_USER_ERROR);
1350
- return;
1351
- } else {
1352
- trigger_error(__('Free Space on SugarSync: ','backwpup').backwpup_formatBytes($sugarsyncfreespase),E_USER_NOTICE);
1353
- }
1354
- //Create and change folder
1355
- $sugarsync->mkdir($this->job['sugardir'],$this->job['sugarroot']);
1356
- $sugarsync->chdir($this->job['sugardir'],$this->job['sugarroot']);
1357
- //Upload to Sugarsync
1358
- $reponse=$sugarsync->upload($this->backupdir.$this->backupfile);
1359
- if (is_object($reponse)) {
1360
- $this->lastbackupdownloadurl='admin.php?page=BackWPup&subpage=backups&action=downloadsugarsync&file='.(string)$reponse.'&jobid='.$this->jobid;
1361
- trigger_error(__('Backup File transferred to SugarSync.','backwpup'),E_USER_NOTICE);
1362
- } else {
1363
- trigger_error(__('Can not transfere Backup file to SugarSync:','backwpup'),E_USER_ERROR);
1364
- }
1365
-
1366
- if ($this->job['sugarmaxbackups']>0) { //Delete old backups
1367
- $backupfilelist=array();
1368
- $getfiles=$sugarsync->getcontents('file');
1369
- if (is_object($getfiles)) {
1370
- foreach ($getfiles->file as $getfile) {
1371
- if ($this->job['fileprefix'] == substr($getfile->displayName,0,strlen($this->job['fileprefix'])) and $this->backupfileformat == substr($getfile->displayName,-strlen($this->backupfileformat)))
1372
- $backupfilelist[]=$getfile->displayName;
1373
- $backupfileref[utf8_encode($getfile->displayName)]=$getfile->ref;
1374
- }
1375
- }
1376
- if (sizeof($backupfilelist)>0) {
1377
- rsort($backupfilelist);
1378
- $numdeltefiles=0;
1379
- for ($i=$this->job['sugarmaxbackups'];$i<sizeof($backupfilelist);$i++) {
1380
- $sugarsync->delete($backupfileref[utf8_encode($backupfilelist[$i])]); //delete files on Cloud
1381
- $numdeltefiles++;
1382
- }
1383
- if ($numdeltefiles>0)
1384
- trigger_error($numdeltefiles.' '.__('files deleted on Sugarsync Folder!','backwpup'),E_USER_NOTICE);
1385
- }
1386
- }
1387
- } catch (Exception $e) {
1388
- trigger_error(__('SugarSync API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
1389
- }
1390
- }
1391
-
1392
-
1393
- public function job_end($logfile ='') {
1394
- global $wpdb;
1395
- if (empty($logfile))
1396
- $logfile=$this->logdir.$this->logfile;
1397
-
1398
- if(!mysql_ping($wpdb->dbh)) {
1399
- trigger_error(__('Database connection is gone create a new one.','backwpup'),E_USER_NOTICE);
1400
- $wpdb->db_connect();
1401
- }
1402
-
1403
- if ($logfile==$this->logdir.$this->logfile) {
1404
- //delete old logs
1405
- if (!empty($this->cfg['maxlogs'])) {
1406
- if ( $dir = opendir($this->logdir) ) { //make file list
1407
- while (($file = readdir($dir)) !== false ) {
1408
- if ('backwpup_log_' == substr($file,0,strlen('backwpup_log_')) and (".html" == substr($file,-5) or ".html.gz" == substr($file,-8)))
1409
- $logfilelist[]=$file;
1410
- }
1411
- closedir( $dir );
1412
- }
1413
- if (sizeof($logfilelist)>0) {
1414
- rsort($logfilelist);
1415
- $numdeltefiles=0;
1416
- for ($i=$this->cfg['maxlogs'];$i<sizeof($logfilelist);$i++) {
1417
- unlink($this->logdir.$logfilelist[$i]);
1418
- $numdeltefiles++;
1419
- }
1420
- if ($numdeltefiles>0)
1421
- trigger_error($numdeltefiles.' '.__('old Log files deleted!!!','backwpup'),E_USER_NOTICE);
1422
- }
1423
- }
1424
- trigger_error(sprintf(__('Job done in %1s sec.','backwpup'),current_time('timestamp')-$this->job['starttime']),E_USER_NOTICE);
1425
- }
1426
- restore_error_handler();
1427
-
1428
- if (!($filesize=@filesize($this->backupdir.$this->backupfile))) //Set the filezie corectly
1429
- $filesize=0;
1430
-
1431
- //clean up
1432
- @unlink($this->tempdir.DB_NAME.'.sql');
1433
- @unlink($this->tempdir.preg_replace( '/[^a-z0-9_\-]/', '', strtolower(get_bloginfo('name')) ).'.wordpress.' . date( 'Y-m-d' ) . '.xml');
1434
-
1435
- if (empty($this->job['backupdir']) and is_file($this->backupdir.$this->backupfile)) //delete backup file in temp dir
1436
- unlink($this->backupdir.$this->backupfile);
1437
-
1438
- $jobs=get_option('backwpup_jobs');
1439
- $jobs[$this->jobid]['lastrun']=$jobs[$this->jobid]['starttime'];
1440
- $jobs[$this->jobid]['cronnextrun']=backwpup_cron_next($jobs[$this->jobid]['cron']); //set next run
1441
- $jobs[$this->jobid]['lastruntime']=current_time('timestamp')-$jobs[$this->jobid]['starttime'];
1442
- $jobs[$this->jobid]['logfile']='';
1443
- $jobs[$this->jobid]['lastlogfile']=$logfile;
1444
- $jobs[$this->jobid]['starttime']='';
1445
- if (!empty($this->lastbackupdownloadurl))
1446
- $jobs[$this->jobid]['lastbackupdownloadurl']=$this->lastbackupdownloadurl;
1447
- else
1448
- $jobs[$this->jobid]['lastbackupdownloadurl']='';
1449
- update_option('backwpup_jobs',$jobs); //Save Settings
1450
-
1451
- $this->job['lastrun']=$jobs[$this->jobid]['lastrun'];
1452
- $this->job['lastruntime']=$jobs[$this->jobid]['lastruntime'];
1453
-
1454
- //write heder info
1455
- $fd=fopen($logfile,'r+');
1456
- $found=0;
1457
- while (!feof($fd)) {
1458
- $line=fgets($fd);
1459
- if (stripos($line,"<meta name=\"backwpup_jobruntime\"") !== false) {
1460
- fseek($fd,$filepos);
1461
- fwrite($fd,str_pad("<meta name=\"backwpup_jobruntime\" content=\"".$this->job['lastruntime']."\" />",100)."\n");
1462
- $found++;
1463
- }
1464
- if (stripos($line,"<meta name=\"backwpup_backupfilesize\"") !== false) {
1465
- fseek($fd,$filepos);
1466
- fwrite($fd,str_pad("<meta name=\"backwpup_backupfilesize\" content=\"".$filesize."\" />",100)."\n");
1467
- $found++;
1468
- }
1469
- if ($found>=2)
1470
- break;
1471
- $filepos=ftell($fd);
1472
- }
1473
- fclose($fd);
1474
-
1475
- //logfile end
1476
- $fd=fopen($logfile,'a');
1477
- fwrite($fd,"</body>\n</html>\n");
1478
- fclose($fd);
1479
-
1480
- //gzip logfile
1481
- if ($this->cfg['gzlogs']) {
1482
- $fd=fopen($logfile,'r');
1483
- $zd=gzopen($logfile.'.gz','w9');
1484
- while (!feof($fd)) {
1485
- gzwrite($zd,fread($fd,4096));
1486
- }
1487
- gzclose($zd);
1488
- fclose($fd);
1489
- unlink($logfile);
1490
- $logfile=$logfile.'.gz';
1491
- $jobs=get_option('backwpup_jobs');
1492
- $jobs[$this->jobid]['lastlogfile']=$logfile;
1493
- update_option('backwpup_jobs',$jobs); //Save Settings
1494
- }
1495
-
1496
- $logdata=backwpup_read_logheader($logfile);
1497
-
1498
- //Send mail with log
1499
- $sendmail=false;
1500
- if ($logdata['errors']>0 and $this->job['mailerroronly'] and !empty($this->job['mailaddresslog']))
1501
- $sendmail=true;
1502
- if (!$this->job['mailerroronly'] and !empty($this->job['mailaddresslog']))
1503
- $sendmail=true;
1504
- if ($sendmail) {
1505
- //Create PHP Mailer
1506
- require_once(ABSPATH.WPINC.'/class-phpmailer.php');
1507
- $phpmailer = new PHPMailer();
1508
- //Setting den methode
1509
- if ($this->cfg['mailmethod']=="SMTP") {
1510
- require_once(ABSPATH.WPINC.'/class-smtp.php');
1511
- $smtpport=25;
1512
- $smtphost=$this->cfg['mailhost'];
1513
- if (false !== strpos($this->cfg['mailhost'],':')) //look for port
1514
- list($smtphost,$smtpport)=explode(':',$this->cfg['mailhost'],2);
1515
- $phpmailer->Host=$smtphost;
1516
- $phpmailer->Port=$smtpport;
1517
- $phpmailer->SMTPSecure=$this->cfg['mailsecure'];
1518
- $phpmailer->Username=$this->cfg['mailuser'];
1519
- $phpmailer->Password=base64_decode($this->cfg['mailpass']);
1520
- if (!empty($this->cfg['mailuser']) and !empty($this->cfg['mailpass']))
1521
- $phpmailer->SMTPAuth=true;
1522
- $phpmailer->IsSMTP();
1523
- } elseif ($this->cfg['mailmethod']=="Sendmail") {
1524
- $phpmailer->Sendmail=$this->cfg['mailsendmail'];
1525
- $phpmailer->IsSendmail();
1526
- } else {
1527
- $phpmailer->IsMail();
1528
- }
1529
-
1530
- $mailbody=__("Jobname:","backwpup")." ".$logdata['name']."\n";
1531
- $mailbody.=__("Jobtype:","backwpup")." ".$logdata['type']."\n";
1532
- if (!empty($logdata['errors']))
1533
- $mailbody.=__("Errors:","backwpup")." ".$logdata['errors']."\n";
1534
- if (!empty($logdata['warnings']))
1535
- $mailbody.=__("Warnings:","backwpup")." ".$logdata['warnings']."\n";
1536
-
1537
- $phpmailer->From = $this->cfg['mailsndemail'];
1538
- $phpmailer->FromName = $this->cfg['mailsndname'];
1539
- $phpmailer->AddAddress($this->job['mailaddresslog']);
1540
- $phpmailer->Subject = __('BackWPup Log from','backwpup').' '.date_i18n('Y-m-d H:i',$this->job['lastrun']).': '.$this->job['name'];
1541
- $phpmailer->IsHTML(false);
1542
- $phpmailer->Body = $mailbody;
1543
- $phpmailer->AddAttachment($logfile);
1544
- $phpmailer->Send();
1545
- }
1546
- }
1547
- }
1548
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/css/options.css DELETED
@@ -1,24 +0,0 @@
1
- .column-id {
2
- width:40px;text-align:center;
3
- }
4
- .column-runtime, .column-last, .column-next , .column-status , .column-type {
5
- width:135px;
6
- }
7
- .column-info {
8
- width:150px;
9
- }
10
- .column-size {
11
- width:75px;
12
- }
13
- input.large-text,
14
- textarea.large-text {
15
- width: 99%;
16
- }
17
- input.regular-text,
18
- #adduser .form-field input {
19
- width: 25em;
20
- }
21
-
22
- input.small-text {
23
- width: 50px;
24
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/js/options.js DELETED
@@ -1,152 +0,0 @@
1
- jQuery(document).ready( function($) {
2
-
3
- $('.jobtype-select').change(function() {
4
- if ( true == $('#jobtype-select-FILE').attr('checked') || true == $('#jobtype-select-DB').attr('checked') || true == $('#jobtype-select-WPEXP').attr('checked')) {
5
- $('#fileformart').show();
6
- $('#toftp').show();
7
- $('#toamazon').show();
8
- $('#tomsazure').show();
9
- $('#torsc').show();
10
- $('#todropbox').show();
11
- $('#tosugarsync').show();
12
- $('#todir').show();
13
- $('#tomail').show();
14
- } else {
15
- $('#fileformart').hide();
16
- $('#toftp').hide();
17
- $('#toamazon').hide();
18
- $('#tomsazure').hide();
19
- $('#torsc').hide();
20
- $('#todropbox').hide();
21
- $('#tosugarsync').hide();
22
- $('#todir').hide();
23
- $('#tomail').hide();
24
- }
25
- if ( true == $('#jobtype-select-DB').attr('checked') || true == $('#jobtype-select-CHECK').attr('checked') || true == $('#jobtype-select-OPTIMIZE').attr('checked')) {
26
- $('#databasejobs').show();
27
- } else {
28
- $('#databasejobs').hide();
29
- }
30
- if ( true == $('#jobtype-select-DB').attr('checked')) {
31
- $('#dbshortinsert').show();
32
- } else {
33
- $('#dbshortinsert').hide();
34
- }
35
-
36
- if ( true == $('#jobtype-select-FILE').attr('checked')) {
37
- $('#filebackup').show();
38
- } else {
39
- $('#filebackup').hide();
40
- }
41
- });
42
-
43
- $('#mailmethod').change(function() {
44
- if ( 'SMTP' == $('#mailmethod').val()) {
45
- $('#mailsmtp').show();
46
- $('#mailsendmail').hide();
47
- } else if ( 'Sendmail' == $('#mailmethod').val()) {
48
- $('#mailsmtp').hide();
49
- $('#mailsendmail').show();
50
- } else {
51
- $('#mailsmtp').hide();
52
- $('#mailsendmail').hide();
53
- }
54
- });
55
-
56
- function awsgetbucket() {
57
- var awsAccessKey = $('#awsAccessKey').val();
58
- var awsSecretKey = $('#awsSecretKey').val();
59
- var awsBucket = $('#awsBucketselected').val();
60
- var data = {
61
- action: 'backwpup_get_aws_buckets',
62
- awsAccessKey: awsAccessKey,
63
- awsSecretKey: awsSecretKey,
64
- awsselected: awsBucket
65
- };
66
- $.post(ajaxurl, data, function(response) {
67
- $('#awsBucket').remove();
68
- $('#awsBucketselected').after(response);
69
- });
70
- }
71
-
72
- $('#awsAccessKey').change(function() {awsgetbucket();});
73
- $('#awsSecretKey').change(function() {awsgetbucket();});
74
-
75
- function msazuregetcontainer() {
76
- var msazureHost = $('#msazureHost').val();
77
- var msazureAccName = $('#msazureAccName').val();
78
- var msazureKey = $('#msazureKey').val();
79
- var msazureContainer = $('#msazureContainerselected').val();
80
- var data = {
81
- action: 'backwpup_get_msazure_container',
82
- msazureHost: msazureHost,
83
- msazureAccName: msazureAccName,
84
- msazureKey: msazureKey,
85
- msazureselected: msazureContainer
86
- };
87
- $.post(ajaxurl, data, function(response) {
88
- $('#msazureContainer').remove();
89
- $('#msazureContainerselected').after(response);
90
- });
91
- }
92
-
93
- $('#msazureHost').change(function() {msazuregetcontainer();});
94
- $('#msazureAccName').change(function() {msazuregetcontainer();});
95
- $('#msazureKey').change(function() {msazuregetcontainer();});
96
-
97
- function rscgetcontainer() {
98
- var rscUsername = $('#rscUsername').val();
99
- var rscAPIKey = $('#rscAPIKey').val();
100
- var rscContainer = $('#rscContainerselected').val();
101
- var data = {
102
- action: 'backwpup_get_rsc_container',
103
- rscUsername: rscUsername,
104
- rscAPIKey: rscAPIKey,
105
- rscselected: rscContainer
106
- };
107
- $.post(ajaxurl, data, function(response) {
108
- $('#rscContainer').remove();
109
- $('#rscContainerselected').after(response);
110
- });
111
- }
112
-
113
- $('#rscUsername').change(function() {rscgetcontainer();});
114
- $('#rscAPIKey').change(function() {rscgetcontainer();});
115
-
116
- function sugarsyncgetroot() {
117
- var sugaruser = $('#sugaruser').val();
118
- var sugarpass = $('#sugarpass').val();
119
- var sugarrootselected = $('#sugarrootselected').val();
120
- var data = {
121
- action: 'backwpup_get_sugarsync_root',
122
- sugaruser: sugaruser,
123
- sugarpass: sugarpass,
124
- sugarrootselected: sugarrootselected
125
- };
126
- $.post(ajaxurl, data, function(response) {
127
- $('#sugarroot').remove();
128
- $('#sugarrootselected').after(response);
129
- });
130
- }
131
-
132
- $('#sugaruser').change(function() {sugarsyncgetroot();});
133
- $('#sugarpass').change(function() {sugarsyncgetroot();});
134
-
135
-
136
- if ( $('#title').val() == '' )
137
- $('#title').siblings('#title-prompt-text').css('visibility', '');
138
- $('#title-prompt-text').click(function(){
139
- $(this).css('visibility', 'hidden').siblings('#title').focus();
140
- });
141
- $('#title').blur(function(){
142
- if (this.value == '')
143
- $(this).siblings('#title-prompt-text').css('visibility', '');
144
- }).focus(function(){
145
- $(this).siblings('#title-prompt-text').css('visibility', 'hidden');
146
- }).keydown(function(e){
147
- $(this).siblings('#title-prompt-text').css('visibility', 'hidden');
148
- $(this).unbind(e);
149
- });
150
-
151
- });
152
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/libs/Microsoft/WindowsAzure/SessionHandler.php DELETED
@@ -1,230 +0,0 @@
1
- <?php
2
- /**
3
- * Copyright (c) 2009 - 2010, RealDolmen
4
- * All rights reserved.
5
- *
6
- * Redistribution and use in source and binary forms, with or without
7
- * modification, are permitted provided that the following conditions are met:
8
- * * Redistributions of source code must retain the above copyright
9
- * notice, this list of conditions and the following disclaimer.
10
- * * Redistributions in binary form must reproduce the above copyright
11
- * notice, this list of conditions and the following disclaimer in the
12
- * documentation and/or other materials provided with the distribution.
13
- * * Neither the name of RealDolmen nor the
14
- * names of its contributors may be used to endorse or promote products
15
- * derived from this software without specific prior written permission.
16
- *
17
- * THIS SOFTWARE IS PROVIDED BY RealDolmen ''AS IS'' AND ANY
18
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
- * DISCLAIMED. IN NO EVENT SHALL RealDolmen BE LIABLE FOR ANY
21
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
- *
28
- * @category Microsoft
29
- * @package Microsoft_WindowsAzure
30
- * @subpackage Session
31
- * @copyright Copyright (c) 2009 - 2010, RealDolmen (http://www.realdolmen.com)
32
- * @license http://phpazure.codeplex.com/license
33
- * @version $Id: Storage.php 21617 2009-06-12 10:46:31Z unknown $
34
- */
35
-
36
- /** Microsoft_WindowsAzure_Storage_Table */
37
- require_once 'Microsoft/WindowsAzure/Storage/Table.php';
38
-
39
- /**
40
- * @see Microsoft_WindowsAzure_Exception
41
- */
42
- require_once 'Microsoft/WindowsAzure/Exception.php';
43
-
44
- /**
45
- * @category Microsoft
46
- * @package Microsoft_WindowsAzure
47
- * @subpackage Session
48
- * @copyright Copyright (c) 2009 - 2010, RealDolmen (http://www.realdolmen.com)
49
- * @license http://phpazure.codeplex.com/license
50
- */
51
- class Microsoft_WindowsAzure_SessionHandler
52
- {
53
- /**
54
- * Table storage
55
- *
56
- * @var Microsoft_WindowsAzure_Storage_Table
57
- */
58
- protected $_tableStorage;
59
-
60
- /**
61
- * Session table name
62
- *
63
- * @var string
64
- */
65
- protected $_sessionTable;
66
-
67
- /**
68
- * Session table partition
69
- *
70
- * @var string
71
- */
72
- protected $_sessionTablePartition;
73
-
74
- /**
75
- * Creates a new Microsoft_WindowsAzure_SessionHandler instance
76
- *
77
- * @param Microsoft_WindowsAzure_Storage_Table $tableStorage Table storage
78
- * @param string $sessionTable Session table name
79
- * @param string $sessionTablePartition Session table partition
80
- */
81
- public function __construct(Microsoft_WindowsAzure_Storage_Table $tableStorage, $sessionTable = 'phpsessions', $sessionTablePartition = 'sessions')
82
- {
83
- // Set properties
84
- $this->_tableStorage = $tableStorage;
85
- $this->_sessionTable = $sessionTable;
86
- $this->_sessionTablePartition = $sessionTablePartition;
87
- }
88
-
89
- /**
90
- * Registers the current session handler as PHP's session handler
91
- *
92
- * @return boolean
93
- */
94
- public function register()
95
- {
96
- return session_set_save_handler(array($this, 'open'),
97
- array($this, 'close'),
98
- array($this, 'read'),
99
- array($this, 'write'),
100
- array($this, 'destroy'),
101
- array($this, 'gc')
102
- );
103
- }
104
-
105
- /**
106
- * Open the session store
107
- *
108
- * @return bool
109
- */
110
- public function open()
111
- {
112
- // Make sure table exists
113
- $tableExists = $this->_tableStorage->tableExists($this->_sessionTable);
114
- if (!$tableExists) {
115
- $this->_tableStorage->createTable($this->_sessionTable);
116
- }
117
-
118
- // Ok!
119
- return true;
120
- }
121
-
122
- /**
123
- * Close the session store
124
- *
125
- * @return bool
126
- */
127
- public function close()
128
- {
129
- return true;
130
- }
131
-
132
- /**
133
- * Read a specific session
134
- *
135
- * @param int $id Session Id
136
- * @return string
137
- */
138
- public function read($id)
139
- {
140
- try
141
- {
142
- $sessionRecord = $this->_tableStorage->retrieveEntityById(
143
- $this->_sessionTable,
144
- $this->_sessionTablePartition,
145
- $id
146
- );
147
- return base64_decode($sessionRecord->serializedData);
148
- }
149
- catch (Microsoft_WindowsAzure_Exception $ex)
150
- {
151
- return '';
152
- }
153
- }
154
-
155
- /**
156
- * Write a specific session
157
- *
158
- * @param int $id Session Id
159
- * @param string $serializedData Serialized PHP object
160
- */
161
- public function write($id, $serializedData)
162
- {
163
- $sessionRecord = new Microsoft_WindowsAzure_Storage_DynamicTableEntity($this->_sessionTablePartition, $id);
164
- $sessionRecord->sessionExpires = time();
165
- $sessionRecord->serializedData = base64_encode($serializedData);
166
-
167
- $sessionRecord->setAzurePropertyType('sessionExpires', 'Edm.Int32');
168
-
169
- try
170
- {
171
- $this->_tableStorage->updateEntity($this->_sessionTable, $sessionRecord);
172
- }
173
- catch (Microsoft_WindowsAzure_Exception $unknownRecord)
174
- {
175
- $this->_tableStorage->insertEntity($this->_sessionTable, $sessionRecord);
176
- }
177
- }
178
-
179
- /**
180
- * Destroy a specific session
181
- *
182
- * @param int $id Session Id
183
- * @return boolean
184
- */
185
- public function destroy($id)
186
- {
187
- try
188
- {
189
- $sessionRecord = $this->_tableStorage->retrieveEntityById(
190
- $this->_sessionTable,
191
- $this->_sessionTablePartition,
192
- $id
193
- );
194
- $this->_tableStorage->deleteEntity($this->_sessionTable, $sessionRecord);
195
-
196
- return true;
197
- }
198
- catch (Microsoft_WindowsAzure_Exception $ex)
199
- {
200
- return false;
201
- }
202
- }
203
-
204
- /**
205
- * Garbage collector
206
- *
207
- * @param int $lifeTime Session maximal lifetime
208
- * @see session.gc_divisor 100
209
- * @see session.gc_maxlifetime 1440
210
- * @see session.gc_probability 1
211
- * @usage Execution rate 1/100 (session.gc_probability/session.gc_divisor)
212
- * @return boolean
213
- */
214
- public function gc($lifeTime)
215
- {
216
- try
217
- {
218
- $result = $this->_tableStorage->retrieveEntities($this->_sessionTable, 'PartitionKey eq \'' . $this->_sessionTablePartition . '\' and sessionExpires lt ' . (time() - $lifeTime));
219
- foreach ($result as $sessionRecord)
220
- {
221
- $this->_tableStorage->deleteEntity($this->_sessionTable, $sessionRecord);
222
- }
223
- return true;
224
- }
225
- catch (Microsoft_WindowsAzure_exception $ex)
226
- {
227
- return false;
228
- }
229
- }
230
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/libs/dropbox/oauth.php DELETED
@@ -1,895 +0,0 @@
1
- <?php
2
- // vim: foldmethod=marker
3
-
4
- /* Generic exception class
5
- */
6
- class OAuthException extends Exception {
7
- // pass
8
- }
9
-
10
- class OAuthConsumer {
11
- public $key;
12
- public $secret;
13
-
14
- function __construct($key, $secret, $callback_url=NULL) {
15
- $this->key = $key;
16
- $this->secret = $secret;
17
- $this->callback_url = $callback_url;
18
- }
19
-
20
- function __toString() {
21
- return "OAuthConsumer[key=$this->key,secret=$this->secret]";
22
- }
23
- }
24
-
25
- class OAuthToken {
26
- // access tokens and request tokens
27
- public $key;
28
- public $secret;
29
-
30
- /**
31
- * key = the token
32
- * secret = the token secret
33
- */
34
- function __construct($key, $secret) {
35
- $this->key = $key;
36
- $this->secret = $secret;
37
- }
38
-
39
- /**
40
- * generates the basic string serialization of a token that a server
41
- * would respond to request_token and access_token calls with
42
- */
43
- function to_string() {
44
- return "oauth_token=" .
45
- OAuthUtil::urlencode_rfc3986($this->key) .
46
- "&oauth_token_secret=" .
47
- OAuthUtil::urlencode_rfc3986($this->secret);
48
- }
49
-
50
- function __toString() {
51
- return $this->to_string();
52
- }
53
- }
54
-
55
- /**
56
- * A class for implementing a Signature Method
57
- * See section 9 ("Signing Requests") in the spec
58
- */
59
- abstract class OAuthSignatureMethod {
60
- /**
61
- * Needs to return the name of the Signature Method (ie HMAC-SHA1)
62
- * @return string
63
- */
64
- abstract public function get_name();
65
-
66
- /**
67
- * Build up the signature
68
- * NOTE: The output of this function MUST NOT be urlencoded.
69
- * the encoding is handled in OAuthRequest when the final
70
- * request is serialized
71
- * @param OAuthRequest $request
72
- * @param OAuthConsumer $consumer
73
- * @param OAuthToken $token
74
- * @return string
75
- */
76
- abstract public function build_signature($request, $consumer, $token);
77
-
78
- /**
79
- * Verifies that a given signature is correct
80
- * @param OAuthRequest $request
81
- * @param OAuthConsumer $consumer
82
- * @param OAuthToken $token
83
- * @param string $signature
84
- * @return bool
85
- */
86
- public function check_signature($request, $consumer, $token, $signature) {
87
- $built = $this->build_signature($request, $consumer, $token);
88
-
89
- // Check for zero length, although unlikely here
90
- if (strlen($built) == 0 || strlen($signature) == 0) {
91
- return false;
92
- }
93
-
94
- if (strlen($built) != strlen($signature)) {
95
- return false;
96
- }
97
-
98
- // Avoid a timing leak with a (hopefully) time insensitive compare
99
- $result = 0;
100
- for ($i = 0; $i < strlen($signature); $i++) {
101
- $result |= ord($built{$i}) ^ ord($signature{$i});
102
- }
103
-
104
- return $result == 0;
105
- }
106
- }
107
-
108
- /**
109
- * The HMAC-SHA1 signature method uses the HMAC-SHA1 signature algorithm as defined in [RFC2104]
110
- * where the Signature Base String is the text and the key is the concatenated values (each first
111
- * encoded per Parameter Encoding) of the Consumer Secret and Token Secret, separated by an '&'
112
- * character (ASCII code 38) even if empty.
113
- * - Chapter 9.2 ("HMAC-SHA1")
114
- */
115
- class OAuthSignatureMethod_HMAC_SHA1 extends OAuthSignatureMethod {
116
- function get_name() {
117
- return "HMAC-SHA1";
118
- }
119
-
120
- public function build_signature($request, $consumer, $token) {
121
- $base_string = $request->get_signature_base_string();
122
- $request->base_string = $base_string;
123
-
124
- $key_parts = array(
125
- $consumer->secret,
126
- ($token) ? $token->secret : ""
127
- );
128
-
129
- $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
130
- $key = implode('&', $key_parts);
131
-
132
- return base64_encode(hash_hmac('sha1', $base_string, $key, true));
133
- }
134
- }
135
-
136
- /**
137
- * The PLAINTEXT method does not provide any security protection and SHOULD only be used
138
- * over a secure channel such as HTTPS. It does not use the Signature Base String.
139
- * - Chapter 9.4 ("PLAINTEXT")
140
- */
141
- class OAuthSignatureMethod_PLAINTEXT extends OAuthSignatureMethod {
142
- public function get_name() {
143
- return "PLAINTEXT";
144
- }
145
-
146
- /**
147
- * oauth_signature is set to the concatenated encoded values of the Consumer Secret and
148
- * Token Secret, separated by a '&' character (ASCII code 38), even if either secret is
149
- * empty. The result MUST be encoded again.
150
- * - Chapter 9.4.1 ("Generating Signatures")
151
- *
152
- * Please note that the second encoding MUST NOT happen in the SignatureMethod, as
153
- * OAuthRequest handles this!
154
- */
155
- public function build_signature($request, $consumer, $token) {
156
- $key_parts = array(
157
- $consumer->secret,
158
- ($token) ? $token->secret : ""
159
- );
160
-
161
- $key_parts = OAuthUtil::urlencode_rfc3986($key_parts);
162
- $key = implode('&', $key_parts);
163
- $request->base_string = $key;
164
-
165
- return $key;
166
- }
167
- }
168
-
169
- /**
170
- * The RSA-SHA1 signature method uses the RSASSA-PKCS1-v1_5 signature algorithm as defined in
171
- * [RFC3447] section 8.2 (more simply known as PKCS#1), using SHA-1 as the hash function for
172
- * EMSA-PKCS1-v1_5. It is assumed that the Consumer has provided its RSA public key in a
173
- * verified way to the Service Provider, in a manner which is beyond the scope of this
174
- * specification.
175
- * - Chapter 9.3 ("RSA-SHA1")
176
- */
177
- abstract class OAuthSignatureMethod_RSA_SHA1 extends OAuthSignatureMethod {
178
- public function get_name() {
179
- return "RSA-SHA1";
180
- }
181
-
182
- // Up to the SP to implement this lookup of keys. Possible ideas are:
183
- // (1) do a lookup in a table of trusted certs keyed off of consumer
184
- // (2) fetch via http using a url provided by the requester
185
- // (3) some sort of specific discovery code based on request
186
- //
187
- // Either way should return a string representation of the certificate
188
- protected abstract function fetch_public_cert(&$request);
189
-
190
- // Up to the SP to implement this lookup of keys. Possible ideas are:
191
- // (1) do a lookup in a table of trusted certs keyed off of consumer
192
- //
193
- // Either way should return a string representation of the certificate
194
- protected abstract function fetch_private_cert(&$request);
195
-
196
- public function build_signature($request, $consumer, $token) {
197
- $base_string = $request->get_signature_base_string();
198
- $request->base_string = $base_string;
199
-
200
- // Fetch the private key cert based on the request
201
- $cert = $this->fetch_private_cert($request);
202
-
203
- // Pull the private key ID from the certificate
204
- $privatekeyid = openssl_get_privatekey($cert);
205
-
206
- // Sign using the key
207
- $ok = openssl_sign($base_string, $signature, $privatekeyid);
208
-
209
- // Release the key resource
210
- openssl_free_key($privatekeyid);
211
-
212
- return base64_encode($signature);
213
- }
214
-
215
- public function check_signature($request, $consumer, $token, $signature) {
216
- $decoded_sig = base64_decode($signature);
217
-
218
- $base_string = $request->get_signature_base_string();
219
-
220
- // Fetch the public key cert based on the request
221
- $cert = $this->fetch_public_cert($request);
222
-
223
- // Pull the public key ID from the certificate
224
- $publickeyid = openssl_get_publickey($cert);
225
-
226
- // Check the computed signature against the one passed in the query
227
- $ok = openssl_verify($base_string, $decoded_sig, $publickeyid);
228
-
229
- // Release the key resource
230
- openssl_free_key($publickeyid);
231
-
232
- return $ok == 1;
233
- }
234
- }
235
-
236
- class OAuthRequest {
237
- protected $parameters;
238
- protected $http_method;
239
- protected $http_url;
240
- // for debug purposes
241
- public $base_string;
242
- public static $version = '1.0';
243
- public static $POST_INPUT = 'php://input';
244
-
245
- function __construct($http_method, $http_url, $parameters=NULL) {
246
- $parameters = ($parameters) ? $parameters : array();
247
- $parameters = array_merge( OAuthUtil::parse_parameters(parse_url($http_url, PHP_URL_QUERY)), $parameters);
248
- $this->parameters = $parameters;
249
- $this->http_method = $http_method;
250
- $this->http_url = $http_url;
251
- }
252
-
253
-
254
- /**
255
- * attempt to build up a request from what was passed to the server
256
- */
257
- public static function from_request($http_method=NULL, $http_url=NULL, $parameters=NULL) {
258
- $scheme = (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] != "on")
259
- ? 'http'
260
- : 'https';
261
- $http_url = ($http_url) ? $http_url : $scheme .
262
- '://' . $_SERVER['SERVER_NAME'] .
263
- ':' .
264
- $_SERVER['SERVER_PORT'] .
265
- $_SERVER['REQUEST_URI'];
266
- $http_method = ($http_method) ? $http_method : $_SERVER['REQUEST_METHOD'];
267
-
268
- // We weren't handed any parameters, so let's find the ones relevant to
269
- // this request.
270
- // If you run XML-RPC or similar you should use this to provide your own
271
- // parsed parameter-list
272
- if (!$parameters) {
273
- // Find request headers
274
- $request_headers = OAuthUtil::get_headers();
275
-
276
- // Parse the query-string to find GET parameters
277
- $parameters = OAuthUtil::parse_parameters($_SERVER['QUERY_STRING']);
278
-
279
- // It's a POST request of the proper content-type, so parse POST
280
- // parameters and add those overriding any duplicates from GET
281
- if ($http_method == "POST"
282
- && isset($request_headers['Content-Type'])
283
- && strstr($request_headers['Content-Type'],
284
- 'application/x-www-form-urlencoded')
285
- ) {
286
- $post_data = OAuthUtil::parse_parameters(
287
- file_get_contents(self::$POST_INPUT)
288
- );
289
- $parameters = array_merge($parameters, $post_data);
290
- }
291
-
292
- // We have a Authorization-header with OAuth data. Parse the header
293
- // and add those overriding any duplicates from GET or POST
294
- if (isset($request_headers['Authorization']) && substr($request_headers['Authorization'], 0, 6) == 'OAuth ') {
295
- $header_parameters = OAuthUtil::split_header(
296
- $request_headers['Authorization']
297
- );
298
- $parameters = array_merge($parameters, $header_parameters);
299
- }
300
-
301
- }
302
-
303
- return new OAuthRequest($http_method, $http_url, $parameters);
304
- }
305
-
306
- /**
307
- * pretty much a helper function to set up the request
308
- */
309
- public static function from_consumer_and_token($consumer, $token, $http_method, $http_url, $parameters=NULL) {
310
- $parameters = ($parameters) ? $parameters : array();
311
- $defaults = array("oauth_version" => OAuthRequest::$version,
312
- "oauth_nonce" => OAuthRequest::generate_nonce(),
313
- "oauth_timestamp" => OAuthRequest::generate_timestamp(),
314
- "oauth_consumer_key" => $consumer->key);
315
- if ($token)
316
- $defaults['oauth_token'] = $token->key;
317
-
318
- $parameters = array_merge($defaults, $parameters);
319
-
320
- return new OAuthRequest($http_method, $http_url, $parameters);
321
- }
322
-
323
- public function set_parameter($name, $value, $allow_duplicates = true) {
324
- if ($allow_duplicates && isset($this->parameters[$name])) {
325
- // We have already added parameter(s) with this name, so add to the list
326
- if (is_scalar($this->parameters[$name])) {
327
- // This is the first duplicate, so transform scalar (string)
328
- // into an array so we can add the duplicates
329
- $this->parameters[$name] = array($this->parameters[$name]);
330
- }
331
-
332
- $this->parameters[$name][] = $value;
333
- } else {
334
- $this->parameters[$name] = $value;
335
- }
336
- }
337
-
338
- public function get_parameter($name) {
339
- return isset($this->parameters[$name]) ? $this->parameters[$name] : null;
340
- }
341
-
342
- public function get_parameters() {
343
- return $this->parameters;
344
- }
345
-
346
- public function unset_parameter($name) {
347
- unset($this->parameters[$name]);
348
- }
349
-
350
- /**
351
- * The request parameters, sorted and concatenated into a normalized string.
352
- * @return string
353
- */
354
- public function get_signable_parameters() {
355
- // Grab all parameters
356
- $params = $this->parameters;
357
-
358
- // Remove oauth_signature if present
359
- // Ref: Spec: 9.1.1 ("The oauth_signature parameter MUST be excluded.")
360
- if (isset($params['oauth_signature'])) {
361
- unset($params['oauth_signature']);
362
- }
363
-
364
- return OAuthUtil::build_http_query($params);
365
- }
366
-
367
- /**
368
- * Returns the base string of this request
369
- *
370
- * The base string defined as the method, the url
371
- * and the parameters (normalized), each urlencoded
372
- * and the concated with &.
373
- */
374
- public function get_signature_base_string() {
375
- $parts = array(
376
- $this->get_normalized_http_method(),
377
- $this->get_normalized_http_url(),
378
- $this->get_signable_parameters()
379
- );
380
-
381
- $parts = OAuthUtil::urlencode_rfc3986($parts);
382
-
383
- return implode('&', $parts);
384
- }
385
-
386
- /**
387
- * just uppercases the http method
388
- */
389
- public function get_normalized_http_method() {
390
- return strtoupper($this->http_method);
391
- }
392
-
393
- /**
394
- * parses the url and rebuilds it to be
395
- * scheme://host/path
396
- */
397
- public function get_normalized_http_url() {
398
- $parts = parse_url($this->http_url);
399
-
400
- $scheme = (isset($parts['scheme'])) ? $parts['scheme'] : 'http';
401
- $port = (isset($parts['port'])) ? $parts['port'] : (($scheme == 'https') ? '443' : '80');
402
- $host = (isset($parts['host'])) ? strtolower($parts['host']) : '';
403
- $path = (isset($parts['path'])) ? $parts['path'] : '';
404
-
405
- if (($scheme == 'https' && $port != '443')
406
- || ($scheme == 'http' && $port != '80')) {
407
- $host = "$host:$port";
408
- }
409
- return "$scheme://$host$path";
410
- }
411
-
412
- /**
413
- * builds a url usable for a GET request
414
- */
415
- public function to_url() {
416
- $post_data = $this->to_postdata();
417
- $out = $this->get_normalized_http_url();
418
- if ($post_data) {
419
- $out .= '?'.$post_data;
420
- }
421
- return $out;
422
- }
423
-
424
- /**
425
- * builds the data one would send in a POST request
426
- */
427
- public function to_postdata() {
428
- return OAuthUtil::build_http_query($this->parameters);
429
- }
430
-
431
- /**
432
- * builds the Authorization: header
433
- */
434
- public function to_header($realm=null) {
435
- $first = true;
436
- if($realm) {
437
- $out = 'Authorization: OAuth realm="' . OAuthUtil::urlencode_rfc3986($realm) . '"';
438
- $first = false;
439
- } else
440
- $out = 'Authorization: OAuth';
441
-
442
- $total = array();
443
- foreach ($this->parameters as $k => $v) {
444
- if (substr($k, 0, 5) != "oauth") continue;
445
- if (is_array($v)) {
446
- throw new OAuthException('Arrays not supported in headers');
447
- }
448
- $out .= ($first) ? ' ' : ',';
449
- $out .= OAuthUtil::urlencode_rfc3986($k) .
450
- '="' .
451
- OAuthUtil::urlencode_rfc3986($v) .
452
- '"';
453
- $first = false;
454
- }
455
- return $out;
456
- }
457
-
458
- public function __toString() {
459
- return $this->to_url();
460
- }
461
-
462
-
463
- public function sign_request($signature_method, $consumer, $token) {
464
- $this->set_parameter(
465
- "oauth_signature_method",
466
- $signature_method->get_name(),
467
- false
468
- );
469
- $signature = $this->build_signature($signature_method, $consumer, $token);
470
- $this->set_parameter("oauth_signature", $signature, false);
471
- }
472
-
473
- public function build_signature($signature_method, $consumer, $token) {
474
- $signature = $signature_method->build_signature($this, $consumer, $token);
475
- return $signature;
476
- }
477
-
478
- /**
479
- * util function: current timestamp
480
- */
481
- private static function generate_timestamp() {
482
- return time();
483
- }
484
-
485
- /**
486
- * util function: current nonce
487
- */
488
- private static function generate_nonce() {
489
- $mt = microtime();
490
- $rand = mt_rand();
491
-
492
- return md5($mt . $rand); // md5s look nicer than numbers
493
- }
494
- }
495
-
496
- class OAuthServer {
497
- protected $timestamp_threshold = 300; // in seconds, five minutes
498
- protected $version = '1.0'; // hi blaine
499
- protected $signature_methods = array();
500
-
501
- protected $data_store;
502
-
503
- function __construct($data_store) {
504
- $this->data_store = $data_store;
505
- }
506
-
507
- public function add_signature_method($signature_method) {
508
- $this->signature_methods[$signature_method->get_name()] =
509
- $signature_method;
510
- }
511
-
512
- // high level functions
513
-
514
- /**
515
- * process a request_token request
516
- * returns the request token on success
517
- */
518
- public function fetch_request_token(&$request) {
519
- $this->get_version($request);
520
-
521
- $consumer = $this->get_consumer($request);
522
-
523
- // no token required for the initial token request
524
- $token = NULL;
525
-
526
- $this->check_signature($request, $consumer, $token);
527
-
528
- // Rev A change
529
- $callback = $request->get_parameter('oauth_callback');
530
- $new_token = $this->data_store->new_request_token($consumer, $callback);
531
-
532
- return $new_token;
533
- }
534
-
535
- /**
536
- * process an access_token request
537
- * returns the access token on success
538
- */
539
- public function fetch_access_token(&$request) {
540
- $this->get_version($request);
541
-
542
- $consumer = $this->get_consumer($request);
543
-
544
- // requires authorized request token
545
- $token = $this->get_token($request, $consumer, "request");
546
-
547
- $this->check_signature($request, $consumer, $token);
548
-
549
- // Rev A change
550
- $verifier = $request->get_parameter('oauth_verifier');
551
- $new_token = $this->data_store->new_access_token($token, $consumer, $verifier);
552
-
553
- return $new_token;
554
- }
555
-
556
- /**
557
- * verify an api call, checks all the parameters
558
- */
559
- public function verify_request(&$request) {
560
- $this->get_version($request);
561
- $consumer = $this->get_consumer($request);
562
- $token = $this->get_token($request, $consumer, "access");
563
- $this->check_signature($request, $consumer, $token);
564
- return array($consumer, $token);
565
- }
566
-
567
- // Internals from here
568
- /**
569
- * version 1
570
- */
571
- private function get_version(&$request) {
572
- $version = $request->get_parameter("oauth_version");
573
- if (!$version) {
574
- // Service Providers MUST assume the protocol version to be 1.0 if this parameter is not present.
575
- // Chapter 7.0 ("Accessing Protected Ressources")
576
- $version = '1.0';
577
- }
578
- if ($version !== $this->version) {
579
- throw new OAuthException("OAuth version '$version' not supported");
580
- }
581
- return $version;
582
- }
583
-
584
- /**
585
- * figure out the signature with some defaults
586
- */
587
- private function get_signature_method($request) {
588
- $signature_method = $request instanceof OAuthRequest
589
- ? $request->get_parameter("oauth_signature_method")
590
- : NULL;
591
-
592
- if (!$signature_method) {
593
- // According to chapter 7 ("Accessing Protected Ressources") the signature-method
594
- // parameter is required, and we can't just fallback to PLAINTEXT
595
- throw new OAuthException('No signature method parameter. This parameter is required');
596
- }
597
-
598
- if (!in_array($signature_method,
599
- array_keys($this->signature_methods))) {
600
- throw new OAuthException(
601
- "Signature method '$signature_method' not supported " .
602
- "try one of the following: " .
603
- implode(", ", array_keys($this->signature_methods))
604
- );
605
- }
606
- return $this->signature_methods[$signature_method];
607
- }
608
-
609
- /**
610
- * try to find the consumer for the provided request's consumer key
611
- */
612
- private function get_consumer($request) {
613
- $consumer_key = $request instanceof OAuthRequest
614
- ? $request->get_parameter("oauth_consumer_key")
615
- : NULL;
616
-
617
- if (!$consumer_key) {
618
- throw new OAuthException("Invalid consumer key");
619
- }
620
-
621
- $consumer = $this->data_store->lookup_consumer($consumer_key);
622
- if (!$consumer) {
623
- throw new OAuthException("Invalid consumer");
624
- }
625
-
626
- return $consumer;
627
- }
628
-
629
- /**
630
- * try to find the token for the provided request's token key
631
- */
632
- private function get_token($request, $consumer, $token_type="access") {
633
- $token_field = $request instanceof OAuthRequest
634
- ? $request->get_parameter('oauth_token')
635
- : NULL;
636
-
637
- $token = $this->data_store->lookup_token(
638
- $consumer, $token_type, $token_field
639
- );
640
- if (!$token) {
641
- throw new OAuthException("Invalid $token_type token: $token_field");
642
- }
643
- return $token;
644
- }
645
-
646
- /**
647
- * all-in-one function to check the signature on a request
648
- * should guess the signature method appropriately
649
- */
650
- private function check_signature($request, $consumer, $token) {
651
- // this should probably be in a different method
652
- $timestamp = $request instanceof OAuthRequest
653
- ? $request->get_parameter('oauth_timestamp')
654
- : NULL;
655
- $nonce = $request instanceof OAuthRequest
656
- ? $request->get_parameter('oauth_nonce')
657
- : NULL;
658
-
659
- $this->check_timestamp($timestamp);
660
- $this->check_nonce($consumer, $token, $nonce, $timestamp);
661
-
662
- $signature_method = $this->get_signature_method($request);
663
-
664
- $signature = $request->get_parameter('oauth_signature');
665
- $valid_sig = $signature_method->check_signature(
666
- $request,
667
- $consumer,
668
- $token,
669
- $signature
670
- );
671
-
672
- if (!$valid_sig) {
673
- throw new OAuthException("Invalid signature");
674
- }
675
- }
676
-
677
- /**
678
- * check that the timestamp is new enough
679
- */
680
- private function check_timestamp($timestamp) {
681
- if( ! $timestamp )
682
- throw new OAuthException(
683
- 'Missing timestamp parameter. The parameter is required'
684
- );
685
-
686
- // verify that timestamp is recentish
687
- $now = time();
688
- if (abs($now - $timestamp) > $this->timestamp_threshold) {
689
- throw new OAuthException(
690
- "Expired timestamp, yours $timestamp, ours $now"
691
- );
692
- }
693
- }
694
-
695
- /**
696
- * check that the nonce is not repeated
697
- */
698
- private function check_nonce($consumer, $token, $nonce, $timestamp) {
699
- if( ! $nonce )
700
- throw new OAuthException(
701
- 'Missing nonce parameter. The parameter is required'
702
- );
703
-
704
- // verify that the nonce is uniqueish
705
- $found = $this->data_store->lookup_nonce(
706
- $consumer,
707
- $token,
708
- $nonce,
709
- $timestamp
710
- );
711
- if ($found) {
712
- throw new OAuthException("Nonce already used: $nonce");
713
- }
714
- }
715
-
716
- }
717
-
718
- class OAuthDataStore {
719
- function lookup_consumer($consumer_key) {
720
- // implement me
721
- }
722
-
723
- function lookup_token($consumer, $token_type, $token) {
724
- // implement me
725
- }
726
-
727
- function lookup_nonce($consumer, $token, $nonce, $timestamp) {
728
- // implement me
729
- }
730
-
731
- function new_request_token($consumer, $callback = null) {
732
- // return a new token attached to this consumer
733
- }
734
-
735
- function new_access_token($token, $consumer, $verifier = null) {
736
- // return a new access token attached to this consumer
737
- // for the user associated with this token if the request token
738
- // is authorized
739
- // should also invalidate the request token
740
- }
741
-
742
- }
743
-
744
- class OAuthUtil {
745
- public static function urlencode_rfc3986($input) {
746
- if (is_array($input)) {
747
- return array_map(array('OAuthUtil', 'urlencode_rfc3986'), $input);
748
- } else if (is_scalar($input)) {
749
- return str_replace(
750
- '+',
751
- ' ',
752
- str_replace('%7E', '~', rawurlencode($input))
753
- );
754
- } else {
755
- return '';
756
- }
757
- }
758
-
759
-
760
- // This decode function isn't taking into consideration the above
761
- // modifications to the encoding process. However, this method doesn't
762
- // seem to be used anywhere so leaving it as is.
763
- public static function urldecode_rfc3986($string) {
764
- return urldecode($string);
765
- }
766
-
767
- // Utility function for turning the Authorization: header into
768
- // parameters, has to do some unescaping
769
- // Can filter out any non-oauth parameters if needed (default behaviour)
770
- // May 28th, 2010 - method updated to tjerk.meesters for a speed improvement.
771
- // see http://code.google.com/p/oauth/issues/detail?id=163
772
- public static function split_header($header, $only_allow_oauth_parameters = true) {
773
- $params = array();
774
- if (preg_match_all('/('.($only_allow_oauth_parameters ? 'oauth_' : '').'[a-z_-]*)=(:?"([^"]*)"|([^,]*))/', $header, $matches)) {
775
- foreach ($matches[1] as $i => $h) {
776
- $params[$h] = OAuthUtil::urldecode_rfc3986(empty($matches[3][$i]) ? $matches[4][$i] : $matches[3][$i]);
777
- }
778
- if (isset($params['realm'])) {
779
- unset($params['realm']);
780
- }
781
- }
782
- return $params;
783
- }
784
-
785
- // helper to try to sort out headers for people who aren't running apache
786
- public static function get_headers() {
787
- if (function_exists('apache_request_headers')) {
788
- // we need this to get the actual Authorization: header
789
- // because apache tends to tell us it doesn't exist
790
- $headers = apache_request_headers();
791
-
792
- // sanitize the output of apache_request_headers because
793
- // we always want the keys to be Cased-Like-This and arh()
794
- // returns the headers in the same case as they are in the
795
- // request
796
- $out = array();
797
- foreach ($headers AS $key => $value) {
798
- $key = str_replace(
799
- " ",
800
- "-",
801
- ucwords(strtolower(str_replace("-", " ", $key)))
802
- );
803
- $out[$key] = $value;
804
- }
805
- } else {
806
- // otherwise we don't have apache and are just going to have to hope
807
- // that $_SERVER actually contains what we need
808
- $out = array();
809
- if( isset($_SERVER['CONTENT_TYPE']) )
810
- $out['Content-Type'] = $_SERVER['CONTENT_TYPE'];
811
- if( isset($_ENV['CONTENT_TYPE']) )
812
- $out['Content-Type'] = $_ENV['CONTENT_TYPE'];
813
-
814
- foreach ($_SERVER as $key => $value) {
815
- if (substr($key, 0, 5) == "HTTP_") {
816
- // this is chaos, basically it is just there to capitalize the first
817
- // letter of every word that is not an initial HTTP and strip HTTP
818
- // code from przemek
819
- $key = str_replace(
820
- " ",
821
- "-",
822
- ucwords(strtolower(str_replace("_", " ", substr($key, 5))))
823
- );
824
- $out[$key] = $value;
825
- }
826
- }
827
- }
828
- return $out;
829
- }
830
-
831
- // This function takes a input like a=b&a=c&d=e and returns the parsed
832
- // parameters like this
833
- // array('a' => array('b','c'), 'd' => 'e')
834
- public static function parse_parameters( $input ) {
835
- if (!isset($input) || !$input) return array();
836
-
837
- $pairs = explode('&', $input);
838
-
839
- $parsed_parameters = array();
840
- foreach ($pairs as $pair) {
841
- $split = explode('=', $pair, 2);
842
- $parameter = OAuthUtil::urldecode_rfc3986($split[0]);
843
- $value = isset($split[1]) ? OAuthUtil::urldecode_rfc3986($split[1]) : '';
844
-
845
- if (isset($parsed_parameters[$parameter])) {
846
- // We have already recieved parameter(s) with this name, so add to the list
847
- // of parameters with this name
848
-
849
- if (is_scalar($parsed_parameters[$parameter])) {
850
- // This is the first duplicate, so transform scalar (string) into an array
851
- // so we can add the duplicates
852
- $parsed_parameters[$parameter] = array($parsed_parameters[$parameter]);
853
- }
854
-
855
- $parsed_parameters[$parameter][] = $value;
856
- } else {
857
- $parsed_parameters[$parameter] = $value;
858
- }
859
- }
860
- return $parsed_parameters;
861
- }
862
-
863
- public static function build_http_query($params) {
864
- if (!$params) return '';
865
-
866
- // Urlencode both keys and values
867
- $keys = OAuthUtil::urlencode_rfc3986(array_keys($params));
868
- $values = OAuthUtil::urlencode_rfc3986(array_values($params));
869
- $params = array_combine($keys, $values);
870
-
871
- // Parameters are sorted by name, using lexicographical byte value ordering.
872
- // Ref: Spec: 9.1.1 (1)
873
- uksort($params, 'strcmp');
874
-
875
- $pairs = array();
876
- foreach ($params as $parameter => $value) {
877
- if (is_array($value)) {
878
- // If two or more parameters share the same name, they are sorted by their value
879
- // Ref: Spec: 9.1.1 (1)
880
- // June 12th, 2010 - changed to sort because of issue 164 by hidetaka
881
- sort($value, SORT_STRING);
882
- foreach ($value as $duplicate_value) {
883
- $pairs[] = $parameter . '=' . $duplicate_value;
884
- }
885
- } else {
886
- $pairs[] = $parameter . '=' . $value;
887
- }
888
- }
889
- // For each parameter, the name is separated from the corresponding value by an '=' character (ASCII code 61)
890
- // Each name-value pair is separated by an '&' character (ASCII code 38)
891
- return implode('&', $pairs);
892
- }
893
- }
894
-
895
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/libs/rackspace/share/magic DELETED
@@ -1,15283 +0,0 @@
1
- # Magic data for file(1) command.
2
- # Format is described in magic(5).
3
- # Don't edit this file, edit /etc/magic or send your suggested inclusions to
4
- # this file as a wishlist bug against file (using the reportbug utility).
5
-
6
-
7
- #------------------------------------------------------------------------------
8
- # Localstuff: file(1) magic for locally observed files
9
- #
10
- # $File: Localstuff,v 1.4 2003/03/23 04:17:27 christos Exp $
11
- # Add any locally observed files here. Remember:
12
- # text if readable, executable if runnable binary, data if unreadable.
13
- #------------------------------------------------------------------------------
14
- # acorn: file(1) magic for files found on Acorn systems
15
- #
16
-
17
- # RISC OS Chunk File Format
18
- # From RISC OS Programmer's Reference Manual, Appendix D
19
- # We guess the file type from the type of the first chunk.
20
- 0 lelong 0xc3cbc6c5 RISC OS Chunk data
21
- >12 string OBJ_ \b, AOF object
22
- >12 string LIB_ \b, ALF library
23
-
24
- # RISC OS AIF, contains "SWI OS_Exit" at offset 16.
25
- 16 lelong 0xef000011 RISC OS AIF executable
26
-
27
- # RISC OS Draw files
28
- # From RISC OS Programmer's Reference Manual, Appendix E
29
- 0 string Draw RISC OS Draw file data
30
-
31
- # RISC OS new format font files
32
- # From RISC OS Programmer's Reference Manual, Appendix E
33
- 0 string FONT\0 RISC OS outline font data,
34
- >5 byte x version %d
35
- 0 string FONT\1 RISC OS 1bpp font data,
36
- >5 byte x version %d
37
- 0 string FONT\4 RISC OS 4bpp font data
38
- >5 byte x version %d
39
-
40
- # RISC OS Music files
41
- # From RISC OS Programmer's Reference Manual, Appendix E
42
- 0 string Maestro\r RISC OS music file
43
- >8 byte x version %d
44
-
45
- >8 byte x type %d
46
-
47
- # Digital Symphony data files
48
- # From: Bernard Jungen (bern8817@euphonynet.be)
49
- 0 string \x02\x01\x13\x13\x13\x01\x0d\x10 Digital Symphony sound sample (RISC OS),
50
- >8 byte x version %d,
51
- >9 pstring x named "%s",
52
- >(9.b+19) byte =0 8-bit logarithmic
53
- >(9.b+19) byte =1 LZW-compressed linear
54
- >(9.b+19) byte =2 8-bit linear signed
55
- >(9.b+19) byte =3 16-bit linear signed
56
- >(9.b+19) byte =4 SigmaDelta-compressed linear
57
- >(9.b+19) byte =5 SigmaDelta-compressed logarithmic
58
- >(9.b+19) byte >5 unknown format
59
-
60
- 0 string \x02\x01\x13\x13\x14\x12\x01\x0b Digital Symphony song (RISC OS),
61
- >8 byte x version %d,
62
- >9 byte =1 1 voice,
63
- >9 byte !1 %d voices,
64
- >10 leshort =1 1 track,
65
- >10 leshort !1 %d tracks,
66
- >12 leshort =1 1 pattern
67
- >12 leshort !1 %d patterns
68
-
69
- 0 string \x02\x01\x13\x13\x10\x14\x12\x0e
70
- >9 byte =0 Digital Symphony sequence (RISC OS),
71
- >>8 byte x version %d,
72
- >>10 byte =1 1 line,
73
- >>10 byte !1 %d lines,
74
- >>11 leshort =1 1 position
75
- >>11 leshort !1 %d positions
76
- >9 byte =1 Digital Symphony pattern data (RISC OS),
77
- >>8 byte x version %d,
78
- >>10 leshort =1 1 pattern
79
- >>10 leshort !1 %d patterns
80
-
81
- #------------------------------------------------------------------------------
82
- # adi: file(1) magic for ADi's objects
83
- # From Gregory McGarry <g.mcgarry@ieee.org>
84
- #
85
- 0 leshort 0x521c COFF DSP21k
86
- >18 lelong &02 executable,
87
- >18 lelong ^02
88
- >>18 lelong &01 static object,
89
- >>18 lelong ^01 relocatable object,
90
- >18 lelong &010 stripped
91
- >18 lelong ^010 not stripped
92
-
93
- #------------------------------------------------------------------------------
94
- # adventure: file(1) magic for Adventure game files
95
- #
96
- # from Allen Garvin <earendil@faeryland.tamu-commerce.edu>
97
- # Edited by Dave Chapeskie <dchapes@ddm.on.ca> Jun 28, 1998
98
- # Edited by Chris Chittleborough <cchittleborough@yahoo.com.au>, March 2002
99
- #
100
- # ALAN
101
- # I assume there are other, lower versions, but these are the only ones I
102
- # saw in the archive.
103
- 0 beshort 0x0206 ALAN game data
104
- >2 byte <10 version 2.6%d
105
-
106
-
107
- # Infocom (see z-machine)
108
- #------------------------------------------------------------------------------
109
- # Z-machine: file(1) magic for Z-machine binaries.
110
- #
111
- # Updated by Adam Buchbinder <adam.buchbinder@gmail.com>
112
- #
113
- # The first byte is the Z-machine revision; it is always between 1 and 8. We
114
- # had false matches (for instance, inbig5.ocp from the Omega TeX extension as
115
- # well as an occasional MP3 file), so we sanity-check the version number.
116
- #
117
- # It might be possible to sanity-check the release number as well, as it seems
118
- # (at least in classic Infocom games) to always be a relatively small number,
119
- # always under 150 or so, but as this isn't rigorous, we'll wait on that until
120
- # it becomes clear that it's needed.
121
- #
122
- 0 ubyte >0
123
- >0 ubyte <9
124
- >>16 belong&0xfe00f0f0 0x3030 Infocom game data
125
- >>>0 ubyte x (Z-machine %d,
126
- >>>>2 ubeshort x Release %d /
127
- >>>>18 string >\0 Serial %.6s)
128
-
129
- #------------------------------------------------------------------------------
130
- # Glulx: file(1) magic for Glulx binaries.
131
- #
132
- # I haven't checked for false matches yet.
133
- #
134
- 0 string Glul Glulx game data
135
- >4 beshort x (Version %d
136
- >>6 byte x \b.%d
137
- >>8 byte x \b.%d)
138
- >36 string Info Compiled by Inform
139
-
140
-
141
-
142
- # For Quetzal and blorb magic see iff
143
-
144
-
145
- # TADS (Text Adventure Development System)
146
- # All files are machine-independent (games compile to byte-code) and are tagged
147
- # with a version string of the form "V2.<digit>.<digit>\0" (but TADS 3 is
148
- # on the way).
149
- # Game files start with "TADS2 bin\n\r\032\0" then the compiler version.
150
- 0 string TADS2\ bin TADS
151
- >9 belong !0x0A0D1A00 game data, CORRUPTED
152
- >9 belong 0x0A0D1A00
153
- >>13 string >\0 %s game data
154
- # Resource files start with "TADS2 rsc\n\r\032\0" then the compiler version.
155
- 0 string TADS2\ rsc TADS
156
- >9 belong !0x0A0D1A00 resource data, CORRUPTED
157
- >9 belong 0x0A0D1A00
158
- >>13 string >\0 %s resource data
159
- # Some saved game files start with "TADS2 save/g\n\r\032\0", a little-endian
160
- # 2-byte length N, the N-char name of the game file *without* a NUL (darn!),
161
- # "TADS2 save\n\r\032\0" and the interpreter version.
162
- 0 string TADS2\ save/g TADS
163
- >12 belong !0x0A0D1A00 saved game data, CORRUPTED
164
- >12 belong 0x0A0D1A00
165
- >>(16.s+32) string >\0 %s saved game data
166
- # Other saved game files start with "TADS2 save\n\r\032\0" and the interpreter
167
- # version.
168
- 0 string TADS2\ save TADS
169
- >10 belong !0x0A0D1A00 saved game data, CORRUPTED
170
- >10 belong 0x0A0D1A00
171
- >>14 string >\0 %s saved game data
172
-
173
- # Danny Milosavljevic <danny.milo@gmx.net>
174
- # this are adrift (adventure game standard) game files, extension .taf
175
- # depending on version magic continues with 0x93453E6139FA (V 4.0)
176
- # 0x9445376139FA (V 3.90)
177
- # 0x9445366139FA (V 3.80)
178
- # this is from source (http://www.adrift.org.uk/) and I have some taf
179
- # files, and checked them.
180
- #0 belong 0x3C423FC9
181
- #>4 belong 0x6A87C2CF Adrift game file
182
- #!:mime application/x-adrift
183
- #------------------------------------------------------------------------------
184
- # allegro: file(1) magic for Allegro datafiles
185
- # Toby Deshane <hac@shoelace.digivill.net>
186
- #
187
- 0 belong 0x736C6821 Allegro datafile (packed)
188
- 0 belong 0x736C682E Allegro datafile (not packed/autodetect)
189
- 0 belong 0x736C682B Allegro datafile (appended exe data)
190
-
191
- #------------------------------------------------------------------------------
192
- # alliant: file(1) magic for Alliant FX series a.out files
193
- #
194
- # If the FX series is the one that had a processor with a 68K-derived
195
- # instruction set, the "short" should probably become "beshort" and the
196
- # "long" should probably become "belong".
197
- # If it's the i860-based one, they should probably become either the
198
- # big-endian or little-endian versions, depending on the mode they ran
199
- # the 860 in....
200
- #
201
- 0 short 0420 0420 Alliant virtual executable
202
- >2 short &0x0020 common library
203
- >16 long >0 not stripped
204
- 0 short 0421 0421 Alliant compact executable
205
- >2 short &0x0020 common library
206
- >16 long >0 not stripped
207
- #------------------------------------------------------------------------------
208
- # alpha architecture description
209
- #
210
-
211
- 0 leshort 0603 COFF format alpha
212
- >22 leshort&030000 !020000 executable
213
- >24 leshort 0410 pure
214
- >24 leshort 0413 paged
215
- >22 leshort&020000 !0 dynamically linked
216
- >16 lelong !0 not stripped
217
- >16 lelong 0 stripped
218
- >22 leshort&030000 020000 shared library
219
- >24 leshort 0407 object
220
- >27 byte x - version %d
221
- >26 byte x .%d
222
- >28 byte x -%d
223
-
224
- # Basic recognition of Digital UNIX core dumps - Mike Bremford <mike@opac.bl.uk>
225
- #
226
- # The actual magic number is just "Core", followed by a 2-byte version
227
- # number; however, treating any file that begins with "Core" as a Digital
228
- # UNIX core dump file may produce too many false hits, so we include one
229
- # byte of the version number as well; DU 5.0 appears only to be up to
230
- # version 2.
231
- #
232
- 0 string Core\001 Alpha COFF format core dump (Digital UNIX)
233
- >24 string >\0 \b, from '%s'
234
- 0 string Core\002 Alpha COFF format core dump (Digital UNIX)
235
- >24 string >\0 \b, from '%s'
236
-
237
- #------------------------------------------------------------------------------
238
- # amanda: file(1) magic for amanda file format
239
- #
240
- 0 string AMANDA:\ AMANDA
241
- >8 string TAPESTART\ DATE tape header file,
242
- >>23 string X
243
- >>>25 string >\ Unused %s
244
- >>23 string >\ DATE %s
245
- >8 string FILE\ dump file,
246
- >>13 string >\ DATE %s
247
- #------------------------------------------------------------------------------
248
- # amigaos: file(1) magic for AmigaOS binary formats:
249
-
250
- #
251
- # From ignatios@cs.uni-bonn.de (Ignatios Souvatzis)
252
- #
253
- 0 belong 0x000003fa AmigaOS shared library
254
- 0 belong 0x000003f3 AmigaOS loadseg()ble executable/binary
255
- 0 belong 0x000003e7 AmigaOS object/library data
256
- #
257
- 0 beshort 0xe310 Amiga Workbench
258
- >2 beshort 1
259
- >>48 byte 1 disk icon
260
- >>48 byte 2 drawer icon
261
- >>48 byte 3 tool icon
262
- >>48 byte 4 project icon
263
- >>48 byte 5 garbage icon
264
- >>48 byte 6 device icon
265
- >>48 byte 7 kickstart icon
266
- >>48 byte 8 workbench application icon
267
- >2 beshort >1 icon, vers. %d
268
- #
269
- # various sound formats from the Amiga
270
- # G=F6tz Waschk <waschk@informatik.uni-rostock.de>
271
- #
272
- 0 string FC14 Future Composer 1.4 Module sound file
273
- 0 string SMOD Future Composer 1.3 Module sound file
274
- 0 string AON4artofnoise Art Of Noise Module sound file
275
- 1 string MUGICIAN/SOFTEYES Mugician Module sound file
276
- 58 string SIDMON\ II\ -\ THE Sidmon 2.0 Module sound file
277
- 0 string Synth4.0 Synthesis Module sound file
278
- 0 string ARP. The Holy Noise Module sound file
279
- 0 string BeEp\0 JamCracker Module sound file
280
- 0 string COSO\0 Hippel-COSO Module sound file
281
- # Too simple (short, pure ASCII, deep), MPi
282
- #26 string V.3 Brian Postma's Soundmon Module sound file v3
283
- #26 string BPSM Brian Postma's Soundmon Module sound file v3
284
- #26 string V.2 Brian Postma's Soundmon Module sound file v2
285
-
286
- # The following are from: "Stefan A. Haubenthal" <polluks@web.de>
287
- 0 beshort 0x0f00 AmigaOS bitmap font
288
- 0 beshort 0x0f03 AmigaOS outline font
289
- 0 belong 0x80001001 AmigaOS outline tag
290
- 0 string ##\ version catalog translation
291
- 0 string EMOD\0 Amiga E module
292
- 8 string ECXM\0 ECX module
293
- 0 string/c @database AmigaGuide file
294
-
295
- # Amiga disk types
296
- #
297
- 0 string RDSK Rigid Disk Block
298
- >160 string x on %.24s
299
- 0 string DOS\0 Amiga DOS disk
300
- 0 string DOS\1 Amiga FFS disk
301
- 0 string DOS\2 Amiga Inter DOS disk
302
- 0 string DOS\3 Amiga Inter FFS disk
303
- 0 string DOS\4 Amiga Fastdir DOS disk
304
- 0 string DOS\5 Amiga Fastdir FFS disk
305
- 0 string KICK Kickstart disk
306
-
307
- # From: Alex Beregszaszi <alex@fsn.hu>
308
- 0 string LZX LZX compressed archive (Amiga)
309
-
310
-
311
- #------------------------------------------------------------------------------
312
- # animation: file(1) magic for animation/movie formats
313
- #
314
- # animation formats
315
- # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
316
- # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
317
-
318
- # SGI and Apple formats
319
- 0 string MOVI Silicon Graphics movie file
320
- !:mime video/x-sgi-movie
321
- 4 string moov Apple QuickTime
322
- !:mime video/quicktime
323
- >12 string mvhd \b movie (fast start)
324
- >12 string mdra \b URL
325
- >12 string cmov \b movie (fast start, compressed header)
326
- >12 string rmra \b multiple URLs
327
- 4 string mdat Apple QuickTime movie (unoptimized)
328
- !:mime video/quicktime
329
- #4 string wide Apple QuickTime movie (unoptimized)
330
- #!:mime video/quicktime
331
- #4 string skip Apple QuickTime movie (modified)
332
- #!:mime video/quicktime
333
- #4 string free Apple QuickTime movie (modified)
334
- #!:mime video/quicktime
335
- 4 string idsc Apple QuickTime image (fast start)
336
- !:mime image/x-quicktime
337
- #4 string idat Apple QuickTime image (unoptimized)
338
- #!:mime image/x-quicktime
339
- 4 string pckg Apple QuickTime compressed archive
340
- !:mime application/x-quicktime-player
341
- 4 string/B jP JPEG 2000 image
342
- !:mime image/jp2
343
- 4 string ftyp ISO Media
344
- >8 string isom \b, MPEG v4 system, version 1
345
- !:mime video/mp4
346
- >8 string iso2 \b, MPEG v4 system, part 12 revision
347
- >8 string mp41 \b, MPEG v4 system, version 1
348
- !:mime video/mp4
349
- >8 string mp42 \b, MPEG v4 system, version 2
350
- !:mime video/mp4
351
- >8 string mp7t \b, MPEG v4 system, MPEG v7 XML
352
- >8 string mp7b \b, MPEG v4 system, MPEG v7 binary XML
353
- >8 string/B jp2 \b, JPEG 2000
354
- !:mime image/jp2
355
- >8 string 3gp \b, MPEG v4 system, 3GPP
356
- !:mime video/3gpp
357
- >>11 byte 4 \b v4 (H.263/AMR GSM 6.10)
358
- >>11 byte 5 \b v5 (H.263/AMR GSM 6.10)
359
- >>11 byte 6 \b v6 (ITU H.264/AMR GSM 6.10)
360
- >8 string mmp4 \b, MPEG v4 system, 3GPP Mobile
361
- !:mime video/mp4
362
- >8 string avc1 \b, MPEG v4 system, 3GPP JVT AVC
363
- !:mime video/3gpp
364
- >8 string/B M4A \b, MPEG v4 system, iTunes AAC-LC
365
- !:mime audio/mp4
366
- >8 string/B M4V \b, MPEG v4 system, iTunes AVC-LC
367
- !:mime video/mp4
368
- >8 string/B M4P \b, MPEG v4 system, iTunes AES encrypted
369
- >8 string/B M4B \b, MPEG v4 system, iTunes bookmarked
370
- >8 string/B qt \b, Apple QuickTime movie
371
- !:mime video/quicktime
372
-
373
- # MPEG sequences
374
- # Scans for all common MPEG header start codes
375
- 0 belong 0x00000001
376
- >4 byte&0x1F 0x07 JVT NAL sequence, H.264 video
377
- >>5 byte 66 \b, baseline
378
- >>5 byte 77 \b, main
379
- >>5 byte 88 \b, extended
380
- >>7 byte x \b @ L %u
381
- 0 belong&0xFFFFFF00 0x00000100
382
- >3 byte 0xBA MPEG sequence
383
- >>4 byte &0x40 \b, v2, program multiplex
384
- >>4 byte ^0x40 \b, v1, system multiplex
385
- >3 byte 0xBB MPEG sequence, v1/2, multiplex (missing pack header)
386
- >3 byte&0x1F 0x07 MPEG sequence, H.264 video
387
- >>4 byte 66 \b, baseline
388
- >>4 byte 77 \b, main
389
- >>4 byte 88 \b, extended
390
- >>6 byte x \b @ L %u
391
- >3 byte 0xB0 MPEG sequence, v4
392
- >>5 belong 0x000001B5
393
- >>>9 byte &0x80
394
- >>>>10 byte&0xF0 16 \b, video
395
- >>>>10 byte&0xF0 32 \b, still texture
396
- >>>>10 byte&0xF0 48 \b, mesh
397
- >>>>10 byte&0xF0 64 \b, face
398
- >>>9 byte&0xF8 8 \b, video
399
- >>>9 byte&0xF8 16 \b, still texture
400
- >>>9 byte&0xF8 24 \b, mesh
401
- >>>9 byte&0xF8 32 \b, face
402
- >>4 byte 1 \b, simple @ L1
403
- >>4 byte 2 \b, simple @ L2
404
- >>4 byte 3 \b, simple @ L3
405
- >>4 byte 4 \b, simple @ L0
406
- >>4 byte 17 \b, simple scalable @ L1
407
- >>4 byte 18 \b, simple scalable @ L2
408
- >>4 byte 33 \b, core @ L1
409
- >>4 byte 34 \b, core @ L2
410
- >>4 byte 50 \b, main @ L2
411
- >>4 byte 51 \b, main @ L3
412
- >>4 byte 53 \b, main @ L4
413
- >>4 byte 66 \b, n-bit @ L2
414
- >>4 byte 81 \b, scalable texture @ L1
415
- >>4 byte 97 \b, simple face animation @ L1
416
- >>4 byte 98 \b, simple face animation @ L2
417
- >>4 byte 99 \b, simple face basic animation @ L1
418
- >>4 byte 100 \b, simple face basic animation @ L2
419
- >>4 byte 113 \b, basic animation text @ L1
420
- >>4 byte 114 \b, basic animation text @ L2
421
- >>4 byte 129 \b, hybrid @ L1
422
- >>4 byte 130 \b, hybrid @ L2
423
- >>4 byte 145 \b, advanced RT simple @ L!
424
- >>4 byte 146 \b, advanced RT simple @ L2
425
- >>4 byte 147 \b, advanced RT simple @ L3
426
- >>4 byte 148 \b, advanced RT simple @ L4
427
- >>4 byte 161 \b, core scalable @ L1
428
- >>4 byte 162 \b, core scalable @ L2
429
- >>4 byte 163 \b, core scalable @ L3
430
- >>4 byte 177 \b, advanced coding efficiency @ L1
431
- >>4 byte 178 \b, advanced coding efficiency @ L2
432
- >>4 byte 179 \b, advanced coding efficiency @ L3
433
- >>4 byte 180 \b, advanced coding efficiency @ L4
434
- >>4 byte 193 \b, advanced core @ L1
435
- >>4 byte 194 \b, advanced core @ L2
436
- >>4 byte 209 \b, advanced scalable texture @ L1
437
- >>4 byte 210 \b, advanced scalable texture @ L2
438
- >>4 byte 211 \b, advanced scalable texture @ L3
439
- >>4 byte 225 \b, simple studio @ L1
440
- >>4 byte 226 \b, simple studio @ L2
441
- >>4 byte 227 \b, simple studio @ L3
442
- >>4 byte 228 \b, simple studio @ L4
443
- >>4 byte 229 \b, core studio @ L1
444
- >>4 byte 230 \b, core studio @ L2
445
- >>4 byte 231 \b, core studio @ L3
446
- >>4 byte 232 \b, core studio @ L4
447
- >>4 byte 240 \b, advanced simple @ L0
448
- >>4 byte 241 \b, advanced simple @ L1
449
- >>4 byte 242 \b, advanced simple @ L2
450
- >>4 byte 243 \b, advanced simple @ L3
451
- >>4 byte 244 \b, advanced simple @ L4
452
- >>4 byte 245 \b, advanced simple @ L5
453
- >>4 byte 247 \b, advanced simple @ L3b
454
- >>4 byte 248 \b, FGS @ L0
455
- >>4 byte 249 \b, FGS @ L1
456
- >>4 byte 250 \b, FGS @ L2
457
- >>4 byte 251 \b, FGS @ L3
458
- >>4 byte 252 \b, FGS @ L4
459
- >>4 byte 253 \b, FGS @ L5
460
- >3 byte 0xB5 MPEG sequence, v4
461
- >>4 byte &0x80
462
- >>>5 byte&0xF0 16 \b, video (missing profile header)
463
- >>>5 byte&0xF0 32 \b, still texture (missing profile header)
464
- >>>5 byte&0xF0 48 \b, mesh (missing profile header)
465
- >>>5 byte&0xF0 64 \b, face (missing profile header)
466
- >>4 byte&0xF8 8 \b, video (missing profile header)
467
- >>4 byte&0xF8 16 \b, still texture (missing profile header)
468
- >>4 byte&0xF8 24 \b, mesh (missing profile header)
469
- >>4 byte&0xF8 32 \b, face (missing profile header)
470
- >3 byte 0xB3 MPEG sequence
471
- >>12 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
472
- >>12 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
473
- >>12 belong 0x000001B5 \b, v2,
474
- >>>16 byte&0x0F 1 \b HP
475
- >>>16 byte&0x0F 2 \b Spt
476
- >>>16 byte&0x0F 3 \b SNR
477
- >>>16 byte&0x0F 4 \b MP
478
- >>>16 byte&0x0F 5 \b SP
479
- >>>17 byte&0xF0 64 \b@HL
480
- >>>17 byte&0xF0 96 \b@H-14
481
- >>>17 byte&0xF0 128 \b@ML
482
- >>>17 byte&0xF0 160 \b@LL
483
- >>>17 byte &0x08 \b progressive
484
- >>>17 byte ^0x08 \b interlaced
485
- >>>17 byte&0x06 2 \b Y'CbCr 4:2:0 video
486
- >>>17 byte&0x06 4 \b Y'CbCr 4:2:2 video
487
- >>>17 byte&0x06 6 \b Y'CbCr 4:4:4 video
488
- >>11 byte &0x02
489
- >>>75 byte &0x01
490
- >>>>140 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
491
- >>>>140 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
492
- >>>>140 belong 0x000001B5 \b, v2,
493
- >>>>>144 byte&0x0F 1 \b HP
494
- >>>>>144 byte&0x0F 2 \b Spt
495
- >>>>>144 byte&0x0F 3 \b SNR
496
- >>>>>144 byte&0x0F 4 \b MP
497
- >>>>>144 byte&0x0F 5 \b SP
498
- >>>>>145 byte&0xF0 64 \b@HL
499
- >>>>>145 byte&0xF0 96 \b@H-14
500
- >>>>>145 byte&0xF0 128 \b@ML
501
- >>>>>145 byte&0xF0 160 \b@LL
502
- >>>>>145 byte &0x08 \b progressive
503
- >>>>>145 byte ^0x08 \b interlaced
504
- >>>>>145 byte&0x06 2 \b Y'CbCr 4:2:0 video
505
- >>>>>145 byte&0x06 4 \b Y'CbCr 4:2:2 video
506
- >>>>>145 byte&0x06 6 \b Y'CbCr 4:4:4 video
507
- >>76 belong 0x000001B8 \b, v1, progressive Y'CbCr 4:2:0 video
508
- >>76 belong 0x000001B2 \b, v1, progressive Y'CbCr 4:2:0 video
509
- >>76 belong 0x000001B5 \b, v2,
510
- >>>80 byte&0x0F 1 \b HP
511
- >>>80 byte&0x0F 2 \b Spt
512
- >>>80 byte&0x0F 3 \b SNR
513
- >>>80 byte&0x0F 4 \b MP
514
- >>>80 byte&0x0F 5 \b SP
515
- >>>81 byte&0xF0 64 \b@HL
516
- >>>81 byte&0xF0 96 \b@H-14
517
- >>>81 byte&0xF0 128 \b@ML
518
- >>>81 byte&0xF0 160 \b@LL
519
- >>>81 byte &0x08 \b progressive
520
- >>>81 byte ^0x08 \b interlaced
521
- >>>81 byte&0x06 2 \b Y'CbCr 4:2:0 video
522
- >>>81 byte&0x06 4 \b Y'CbCr 4:2:2 video
523
- >>>81 byte&0x06 6 \b Y'CbCr 4:4:4 video
524
- >>4 belong&0xFFFFFF00 0x78043800 \b, HD-TV 1920P
525
- >>>7 byte&0xF0 0x10 \b, 16:9
526
- >>4 belong&0xFFFFFF00 0x50002D00 \b, SD-TV 1280I
527
- >>>7 byte&0xF0 0x10 \b, 16:9
528
- >>4 belong&0xFFFFFF00 0x30024000 \b, PAL Capture
529
- >>>7 byte&0xF0 0x10 \b, 4:3
530
- >>4 beshort&0xFFF0 0x2C00 \b, 4CIF
531
- >>>5 beshort&0x0FFF 0x01E0 \b NTSC
532
- >>>5 beshort&0x0FFF 0x0240 \b PAL
533
- >>>7 byte&0xF0 0x20 \b, 4:3
534
- >>>7 byte&0xF0 0x30 \b, 16:9
535
- >>>7 byte&0xF0 0x40 \b, 11:5
536
- >>>7 byte&0xF0 0x80 \b, PAL 4:3
537
- >>>7 byte&0xF0 0xC0 \b, NTSC 4:3
538
- >>4 belong&0xFFFFFF00 0x2801E000 \b, LD-TV 640P
539
- >>>7 byte&0xF0 0x10 \b, 4:3
540
- >>4 belong&0xFFFFFF00 0x1400F000 \b, 320x240
541
- >>>7 byte&0xF0 0x10 \b, 4:3
542
- >>4 belong&0xFFFFFF00 0x0F00A000 \b, 240x160
543
- >>>7 byte&0xF0 0x10 \b, 4:3
544
- >>4 belong&0xFFFFFF00 0x0A007800 \b, 160x120
545
- >>>7 byte&0xF0 0x10 \b, 4:3
546
- >>4 beshort&0xFFF0 0x1600 \b, CIF
547
- >>>5 beshort&0x0FFF 0x00F0 \b NTSC
548
- >>>5 beshort&0x0FFF 0x0120 \b PAL
549
- >>>7 byte&0xF0 0x20 \b, 4:3
550
- >>>7 byte&0xF0 0x30 \b, 16:9
551
- >>>7 byte&0xF0 0x40 \b, 11:5
552
- >>>7 byte&0xF0 0x80 \b, PAL 4:3
553
- >>>7 byte&0xF0 0xC0 \b, NTSC 4:3
554
- >>>5 beshort&0x0FFF 0x0240 \b PAL 625
555
- >>>>7 byte&0xF0 0x20 \b, 4:3
556
- >>>>7 byte&0xF0 0x30 \b, 16:9
557
- >>>>7 byte&0xF0 0x40 \b, 11:5
558
- >>4 beshort&0xFFF0 0x2D00 \b, CCIR/ITU
559
- >>>5 beshort&0x0FFF 0x01E0 \b NTSC 525
560
- >>>5 beshort&0x0FFF 0x0240 \b PAL 625
561
- >>>7 byte&0xF0 0x20 \b, 4:3
562
- >>>7 byte&0xF0 0x30 \b, 16:9
563
- >>>7 byte&0xF0 0x40 \b, 11:5
564
- >>4 beshort&0xFFF0 0x1E00 \b, SVCD
565
- >>>5 beshort&0x0FFF 0x01E0 \b NTSC 525
566
- >>>5 beshort&0x0FFF 0x0240 \b PAL 625
567
- >>>7 byte&0xF0 0x20 \b, 4:3
568
- >>>7 byte&0xF0 0x30 \b, 16:9
569
- >>>7 byte&0xF0 0x40 \b, 11:5
570
- >>7 byte&0x0F 1 \b, 23.976 fps
571
- >>7 byte&0x0F 2 \b, 24 fps
572
- >>7 byte&0x0F 3 \b, 25 fps
573
- >>7 byte&0x0F 4 \b, 29.97 fps
574
- >>7 byte&0x0F 5 \b, 30 fps
575
- >>7 byte&0x0F 6 \b, 50 fps
576
- >>7 byte&0x0F 7 \b, 59.94 fps
577
- >>7 byte&0x0F 8 \b, 60 fps
578
- >>11 byte &0x04 \b, Constrained
579
-
580
- # MPEG ADTS Audio (*.mpx/mxa/aac)
581
- # from dreesen@math.fu-berlin.de
582
- # modified to fully support MPEG ADTS
583
-
584
- # MP3, M1A
585
- # modified by Joerg Jenderek
586
- # GRR the original test are too common for many DOS files
587
- # so don't accept as MP3 until we've tested the rate
588
- 0 beshort&0xFFFE 0xFFFA
589
- # rates
590
- >2 byte&0xF0 0x10 MPEG ADTS, layer III, v1, 32 kbps
591
- !:mime audio/mpeg
592
- >2 byte&0xF0 0x20 MPEG ADTS, layer III, v1, 40 kbps
593
- !:mime audio/mpeg
594
- >2 byte&0xF0 0x30 MPEG ADTS, layer III, v1, 48 kbps
595
- !:mime audio/mpeg
596
- >2 byte&0xF0 0x40 MPEG ADTS, layer III, v1, 56 kbps
597
- !:mime audio/mpeg
598
- >2 byte&0xF0 0x50 MPEG ADTS, layer III, v1, 64 kbps
599
- !:mime audio/mpeg
600
- >2 byte&0xF0 0x60 MPEG ADTS, layer III, v1, 80 kbps
601
- !:mime audio/mpeg
602
- >2 byte&0xF0 0x70 MPEG ADTS, layer III, v1, 96 kbps
603
- !:mime audio/mpeg
604
- >2 byte&0xF0 0x80 MPEG ADTS, layer III, v1, 112 kbps
605
- !:mime audio/mpeg
606
- >2 byte&0xF0 0x90 MPEG ADTS, layer III, v1, 128 kbps
607
- !:mime audio/mpeg
608
- >2 byte&0xF0 0xA0 MPEG ADTS, layer III, v1, 160 kbps
609
- !:mime audio/mpeg
610
- >2 byte&0xF0 0xB0 MPEG ADTS, layer III, v1, 192 kbps
611
- !:mime audio/mpeg
612
- >2 byte&0xF0 0xC0 MPEG ADTS, layer III, v1, 224 kbps
613
- !:mime audio/mpeg
614
- >2 byte&0xF0 0xD0 MPEG ADTS, layer III, v1, 256 kbps
615
- !:mime audio/mpeg
616
- >2 byte&0xF0 0xE0 MPEG ADTS, layer III, v1, 320 kbps
617
- !:mime audio/mpeg
618
- # timing
619
- >2 byte&0x0C 0x00 \b, 44.1 kHz
620
- >2 byte&0x0C 0x04 \b, 48 kHz
621
- >2 byte&0x0C 0x08 \b, 32 kHz
622
- # channels/options
623
- >3 byte&0xC0 0x00 \b, Stereo
624
- >3 byte&0xC0 0x40 \b, JntStereo
625
- >3 byte&0xC0 0x80 \b, 2x Monaural
626
- >3 byte&0xC0 0xC0 \b, Monaural
627
- #>1 byte ^0x01 \b, Data Verify
628
- #>2 byte &0x02 \b, Packet Pad
629
- #>2 byte &0x01 \b, Custom Flag
630
- #>3 byte &0x08 \b, Copyrighted
631
- #>3 byte &0x04 \b, Original Source
632
- #>3 byte&0x03 1 \b, NR: 50/15 ms
633
- #>3 byte&0x03 3 \b, NR: CCIT J.17
634
-
635
- # MP2, M1A
636
- 0 beshort&0xFFFE 0xFFFC MPEG ADTS, layer II, v1
637
- !:mime audio/mpeg
638
- # rates
639
- >2 byte&0xF0 0x10 \b, 32 kbps
640
- >2 byte&0xF0 0x20 \b, 48 kbps
641
- >2 byte&0xF0 0x30 \b, 56 kbps
642
- >2 byte&0xF0 0x40 \b, 64 kbps
643
- >2 byte&0xF0 0x50 \b, 80 kbps
644
- >2 byte&0xF0 0x60 \b, 96 kbps
645
- >2 byte&0xF0 0x70 \b, 112 kbps
646
- >2 byte&0xF0 0x80 \b, 128 kbps
647
- >2 byte&0xF0 0x90 \b, 160 kbps
648
- >2 byte&0xF0 0xA0 \b, 192 kbps
649
- >2 byte&0xF0 0xB0 \b, 224 kbps
650
- >2 byte&0xF0 0xC0 \b, 256 kbps
651
- >2 byte&0xF0 0xD0 \b, 320 kbps
652
- >2 byte&0xF0 0xE0 \b, 384 kbps
653
- # timing
654
- >2 byte&0x0C 0x00 \b, 44.1 kHz
655
- >2 byte&0x0C 0x04 \b, 48 kHz
656
- >2 byte&0x0C 0x08 \b, 32 kHz
657
- # channels/options
658
- >3 byte&0xC0 0x00 \b, Stereo
659
- >3 byte&0xC0 0x40 \b, JntStereo
660
- >3 byte&0xC0 0x80 \b, 2x Monaural
661
- >3 byte&0xC0 0xC0 \b, Monaural
662
- #>1 byte ^0x01 \b, Data Verify
663
- #>2 byte &0x02 \b, Packet Pad
664
- #>2 byte &0x01 \b, Custom Flag
665
- #>3 byte &0x08 \b, Copyrighted
666
- #>3 byte &0x04 \b, Original Source
667
- #>3 byte&0x03 1 \b, NR: 50/15 ms
668
- #>3 byte&0x03 3 \b, NR: CCIT J.17
669
-
670
- # MPA, M1A
671
- # updated by Joerg Jenderek
672
- # GRR the original test are too common for many DOS files, so test 32 <= kbits <= 448
673
- # GRR this test is still too general as it catches a BOM of UTF-16 files (0xFFFE)
674
- # FIXME: Almost all little endian UTF-16 text with BOM are clobbered by these entries
675
- #0 beshort&0xFFFE 0xFFFE
676
- #>2 ubyte&0xF0 >0x0F
677
- #>>2 ubyte&0xF0 <0xE1 MPEG ADTS, layer I, v1
678
- ## rate
679
- #>>>2 byte&0xF0 0x10 \b, 32 kbps
680
- #>>>2 byte&0xF0 0x20 \b, 64 kbps
681
- #>>>2 byte&0xF0 0x30 \b, 96 kbps
682
- #>>>2 byte&0xF0 0x40 \b, 128 kbps
683
- #>>>2 byte&0xF0 0x50 \b, 160 kbps
684
- #>>>2 byte&0xF0 0x60 \b, 192 kbps
685
- #>>>2 byte&0xF0 0x70 \b, 224 kbps
686
- #>>>2 byte&0xF0 0x80 \b, 256 kbps
687
- #>>>2 byte&0xF0 0x90 \b, 288 kbps
688
- #>>>2 byte&0xF0 0xA0 \b, 320 kbps
689
- #>>>2 byte&0xF0 0xB0 \b, 352 kbps
690
- #>>>2 byte&0xF0 0xC0 \b, 384 kbps
691
- #>>>2 byte&0xF0 0xD0 \b, 416 kbps
692
- #>>>2 byte&0xF0 0xE0 \b, 448 kbps
693
- ## timing
694
- #>>>2 byte&0x0C 0x00 \b, 44.1 kHz
695
- #>>>2 byte&0x0C 0x04 \b, 48 kHz
696
- #>>>2 byte&0x0C 0x08 \b, 32 kHz
697
- ## channels/options
698
- #>>>3 byte&0xC0 0x00 \b, Stereo
699
- #>>>3 byte&0xC0 0x40 \b, JntStereo
700
- #>>>3 byte&0xC0 0x80 \b, 2x Monaural
701
- #>>>3 byte&0xC0 0xC0 \b, Monaural
702
- ##>1 byte ^0x01 \b, Data Verify
703
- ##>2 byte &0x02 \b, Packet Pad
704
- ##>2 byte &0x01 \b, Custom Flag
705
- ##>3 byte &0x08 \b, Copyrighted
706
- ##>3 byte &0x04 \b, Original Source
707
- ##>3 byte&0x03 1 \b, NR: 50/15 ms
708
- ##>3 byte&0x03 3 \b, NR: CCIT J.17
709
-
710
- # MP3, M2A
711
- 0 beshort&0xFFFE 0xFFF2 MPEG ADTS, layer III, v2
712
- !:mime audio/mpeg
713
- # rate
714
- >2 byte&0xF0 0x10 \b, 8 kbps
715
- >2 byte&0xF0 0x20 \b, 16 kbps
716
- >2 byte&0xF0 0x30 \b, 24 kbps
717
- >2 byte&0xF0 0x40 \b, 32 kbps
718
- >2 byte&0xF0 0x50 \b, 40 kbps
719
- >2 byte&0xF0 0x60 \b, 48 kbps
720
- >2 byte&0xF0 0x70 \b, 56 kbps
721
- >2 byte&0xF0 0x80 \b, 64 kbps
722
- >2 byte&0xF0 0x90 \b, 80 kbps
723
- >2 byte&0xF0 0xA0 \b, 96 kbps
724
- >2 byte&0xF0 0xB0 \b, 112 kbps
725
- >2 byte&0xF0 0xC0 \b, 128 kbps
726
- >2 byte&0xF0 0xD0 \b, 144 kbps
727
- >2 byte&0xF0 0xE0 \b, 160 kbps
728
- # timing
729
- >2 byte&0x0C 0x00 \b, 22.05 kHz
730
- >2 byte&0x0C 0x04 \b, 24 kHz
731
- >2 byte&0x0C 0x08 \b, 16 kHz
732
- # channels/options
733
- >3 byte&0xC0 0x00 \b, Stereo
734
- >3 byte&0xC0 0x40 \b, JntStereo
735
- >3 byte&0xC0 0x80 \b, 2x Monaural
736
- >3 byte&0xC0 0xC0 \b, Monaural
737
- #>1 byte ^0x01 \b, Data Verify
738
- #>2 byte &0x02 \b, Packet Pad
739
- #>2 byte &0x01 \b, Custom Flag
740
- #>3 byte &0x08 \b, Copyrighted
741
- #>3 byte &0x04 \b, Original Source
742
- #>3 byte&0x03 1 \b, NR: 50/15 ms
743
- #>3 byte&0x03 3 \b, NR: CCIT J.17
744
-
745
- # MP2, M2A
746
- 0 beshort&0xFFFE 0xFFF4 MPEG ADTS, layer II, v2
747
- # rate
748
- >2 byte&0xF0 0x10 \b, 8 kbps
749
- >2 byte&0xF0 0x20 \b, 16 kbps
750
- >2 byte&0xF0 0x30 \b, 24 kbps
751
- >2 byte&0xF0 0x40 \b, 32 kbps
752
- >2 byte&0xF0 0x50 \b, 40 kbps
753
- >2 byte&0xF0 0x60 \b, 48 kbps
754
- >2 byte&0xF0 0x70 \b, 56 kbps
755
- >2 byte&0xF0 0x80 \b, 64 kbps
756
- >2 byte&0xF0 0x90 \b, 80 kbps
757
- >2 byte&0xF0 0xA0 \b, 96 kbps
758
- >2 byte&0xF0 0xB0 \b, 112 kbps
759
- >2 byte&0xF0 0xC0 \b, 128 kbps
760
- >2 byte&0xF0 0xD0 \b, 144 kbps
761
- >2 byte&0xF0 0xE0 \b, 160 kbps
762
- # timing
763
- >2 byte&0x0C 0x00 \b, 22.05 kHz
764
- >2 byte&0x0C 0x04 \b, 24 kHz
765
- >2 byte&0x0C 0x08 \b, 16 kHz
766
- # channels/options
767
- >3 byte&0xC0 0x00 \b, Stereo
768
- >3 byte&0xC0 0x40 \b, JntStereo
769
- >3 byte&0xC0 0x80 \b, 2x Monaural
770
- >3 byte&0xC0 0xC0 \b, Monaural
771
- #>1 byte ^0x01 \b, Data Verify
772
- #>2 byte &0x02 \b, Packet Pad
773
- #>2 byte &0x01 \b, Custom Flag
774
- #>3 byte &0x08 \b, Copyrighted
775
- #>3 byte &0x04 \b, Original Source
776
- #>3 byte&0x03 1 \b, NR: 50/15 ms
777
- #>3 byte&0x03 3 \b, NR: CCIT J.17
778
-
779
- # MPA, M2A
780
- 0 beshort&0xFFFE 0xFFF6 MPEG ADTS, layer I, v2
781
- # rate
782
- >2 byte&0xF0 0x10 \b, 32 kbps
783
- >2 byte&0xF0 0x20 \b, 48 kbps
784
- >2 byte&0xF0 0x30 \b, 56 kbps
785
- >2 byte&0xF0 0x40 \b, 64 kbps
786
- >2 byte&0xF0 0x50 \b, 80 kbps
787
- >2 byte&0xF0 0x60 \b, 96 kbps
788
- >2 byte&0xF0 0x70 \b, 112 kbps
789
- >2 byte&0xF0 0x80 \b, 128 kbps
790
- >2 byte&0xF0 0x90 \b, 144 kbps
791
- >2 byte&0xF0 0xA0 \b, 160 kbps
792
- >2 byte&0xF0 0xB0 \b, 176 kbps
793
- >2 byte&0xF0 0xC0 \b, 192 kbps
794
- >2 byte&0xF0 0xD0 \b, 224 kbps
795
- >2 byte&0xF0 0xE0 \b, 256 kbps
796
- # timing
797
- >2 byte&0x0C 0x00 \b, 22.05 kHz
798
- >2 byte&0x0C 0x04 \b, 24 kHz
799
- >2 byte&0x0C 0x08 \b, 16 kHz
800
- # channels/options
801
- >3 byte&0xC0 0x00 \b, Stereo
802
- >3 byte&0xC0 0x40 \b, JntStereo
803
- >3 byte&0xC0 0x80 \b, 2x Monaural
804
- >3 byte&0xC0 0xC0 \b, Monaural
805
- #>1 byte ^0x01 \b, Data Verify
806
- #>2 byte &0x02 \b, Packet Pad
807
- #>2 byte &0x01 \b, Custom Flag
808
- #>3 byte &0x08 \b, Copyrighted
809
- #>3 byte &0x04 \b, Original Source
810
- #>3 byte&0x03 1 \b, NR: 50/15 ms
811
- #>3 byte&0x03 3 \b, NR: CCIT J.17
812
-
813
- # MP3, M25A
814
- 0 beshort&0xFFFE 0xFFE2 MPEG ADTS, layer III, v2.5
815
- # rate
816
- >2 byte&0xF0 0x10 \b, 8 kbps
817
- >2 byte&0xF0 0x20 \b, 16 kbps
818
- >2 byte&0xF0 0x30 \b, 24 kbps
819
- >2 byte&0xF0 0x40 \b, 32 kbps
820
- >2 byte&0xF0 0x50 \b, 40 kbps
821
- >2 byte&0xF0 0x60 \b, 48 kbps
822
- >2 byte&0xF0 0x70 \b, 56 kbps
823
- >2 byte&0xF0 0x80 \b, 64 kbps
824
- >2 byte&0xF0 0x90 \b, 80 kbps
825
- >2 byte&0xF0 0xA0 \b, 96 kbps
826
- >2 byte&0xF0 0xB0 \b, 112 kbps
827
- >2 byte&0xF0 0xC0 \b, 128 kbps
828
- >2 byte&0xF0 0xD0 \b, 144 kbps
829
- >2 byte&0xF0 0xE0 \b, 160 kbps
830
- # timing
831
- >2 byte&0x0C 0x00 \b, 11.025 kHz
832
- >2 byte&0x0C 0x04 \b, 12 kHz
833
- >2 byte&0x0C 0x08 \b, 8 kHz
834
- # channels/options
835
- >3 byte&0xC0 0x00 \b, Stereo
836
- >3 byte&0xC0 0x40 \b, JntStereo
837
- >3 byte&0xC0 0x80 \b, 2x Monaural
838
- >3 byte&0xC0 0xC0 \b, Monaural
839
- #>1 byte ^0x01 \b, Data Verify
840
- #>2 byte &0x02 \b, Packet Pad
841
- #>2 byte &0x01 \b, Custom Flag
842
- #>3 byte &0x08 \b, Copyrighted
843
- #>3 byte &0x04 \b, Original Source
844
- #>3 byte&0x03 1 \b, NR: 50/15 ms
845
- #>3 byte&0x03 3 \b, NR: CCIT J.17
846
-
847
- # AAC (aka MPEG-2 NBC audio) and MPEG-4 audio
848
-
849
- # Stored AAC streams (instead of the MP4 format)
850
- 0 string ADIF MPEG ADIF, AAC
851
- !:mime audio/x-hx-aac-adif
852
- >4 byte &0x80
853
- >>13 byte &0x10 \b, VBR
854
- >>13 byte ^0x10 \b, CBR
855
- >>16 byte&0x1E 0x02 \b, single stream
856
- >>16 byte&0x1E 0x04 \b, 2 streams
857
- >>16 byte&0x1E 0x06 \b, 3 streams
858
- >>16 byte &0x08 \b, 4 or more streams
859
- >>16 byte &0x10 \b, 8 or more streams
860
- >>4 byte &0x80 \b, Copyrighted
861
- >>13 byte &0x40 \b, Original Source
862
- >>13 byte &0x20 \b, Home Flag
863
- >4 byte ^0x80
864
- >>4 byte &0x10 \b, VBR
865
- >>4 byte ^0x10 \b, CBR
866
- >>7 byte&0x1E 0x02 \b, single stream
867
- >>7 byte&0x1E 0x04 \b, 2 streams
868
- >>7 byte&0x1E 0x06 \b, 3 streams
869
- >>7 byte &0x08 \b, 4 or more streams
870
- >>7 byte &0x10 \b, 8 or more streams
871
- >>4 byte &0x40 \b, Original Stream(s)
872
- >>4 byte &0x20 \b, Home Source
873
-
874
- # Live or stored single AAC stream (used with MPEG-2 systems)
875
- 0 beshort&0xFFF6 0xFFF0 MPEG ADTS, AAC
876
- !:mime audio/x-hx-aac-adts
877
- >1 byte &0x08 \b, v2
878
- >1 byte ^0x08 \b, v4
879
- # profile
880
- >>2 byte &0xC0 \b LTP
881
- >2 byte&0xc0 0x00 \b Main
882
- >2 byte&0xc0 0x40 \b LC
883
- >2 byte&0xc0 0x80 \b SSR
884
- # timing
885
- >2 byte&0x3c 0x00 \b, 96 kHz
886
- >2 byte&0x3c 0x04 \b, 88.2 kHz
887
- >2 byte&0x3c 0x08 \b, 64 kHz
888
- >2 byte&0x3c 0x0c \b, 48 kHz
889
- >2 byte&0x3c 0x10 \b, 44.1 kHz
890
- >2 byte&0x3c 0x14 \b, 32 kHz
891
- >2 byte&0x3c 0x18 \b, 24 kHz
892
- >2 byte&0x3c 0x1c \b, 22.05 kHz
893
- >2 byte&0x3c 0x20 \b, 16 kHz
894
- >2 byte&0x3c 0x24 \b, 12 kHz
895
- >2 byte&0x3c 0x28 \b, 11.025 kHz
896
- >2 byte&0x3c 0x2c \b, 8 kHz
897
- # channels
898
- >2 beshort&0x01c0 0x0040 \b, monaural
899
- >2 beshort&0x01c0 0x0080 \b, stereo
900
- >2 beshort&0x01c0 0x00c0 \b, stereo + center
901
- >2 beshort&0x01c0 0x0100 \b, stereo+center+LFE
902
- >2 beshort&0x01c0 0x0140 \b, surround
903
- >2 beshort&0x01c0 0x0180 \b, surround + LFE
904
- >2 beshort &0x01C0 \b, surround + side
905
- #>1 byte ^0x01 \b, Data Verify
906
- #>2 byte &0x02 \b, Custom Flag
907
- #>3 byte &0x20 \b, Original Stream
908
- #>3 byte &0x10 \b, Home Source
909
- #>3 byte &0x08 \b, Copyrighted
910
-
911
- # Live MPEG-4 audio streams (instead of RTP FlexMux)
912
- 0 beshort&0xFFE0 0x56E0 MPEG-4 LOAS
913
- !:mime audio/x-mp4a-latm
914
- #>1 beshort&0x1FFF x \b, %u byte packet
915
- >3 byte&0xE0 0x40
916
- >>4 byte&0x3C 0x04 \b, single stream
917
- >>4 byte&0x3C 0x08 \b, 2 streams
918
- >>4 byte&0x3C 0x0C \b, 3 streams
919
- >>4 byte &0x08 \b, 4 or more streams
920
- >>4 byte &0x20 \b, 8 or more streams
921
- >3 byte&0xC0 0
922
- >>4 byte&0x78 0x08 \b, single stream
923
- >>4 byte&0x78 0x10 \b, 2 streams
924
- >>4 byte&0x78 0x18 \b, 3 streams
925
- >>4 byte &0x20 \b, 4 or more streams
926
- >>4 byte &0x40 \b, 8 or more streams
927
- # This magic isn't strong enough (matches plausible ISO-8859-1 text)
928
- #0 beshort 0x4DE1 MPEG-4 LO-EP audio stream
929
- #!:mime audio/x-mp4a-latm
930
-
931
- # Summary: FLI animation format
932
- # Created by: Daniel Quinlan <quinlan@yggdrasil.com>
933
- # Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
934
- 4 leshort 0xAF11
935
- # standard FLI always has 320x200 resolution and 8 bit color
936
- >8 leshort 320
937
- >>10 leshort 200
938
- >>>12 leshort 8 FLI animation, 320x200x8
939
- !:mime video/x-fli
940
- >>>>6 leshort x \b, %d frames
941
- # frame speed is multiple of 1/70s
942
- >>>>16 leshort x \b, %d/70s per frame
943
-
944
- # Summary: FLC animation format
945
- # Created by: Daniel Quinlan <quinlan@yggdrasil.com>
946
- # Modified by (1): Abel Cheung <abelcheung@gmail.com> (avoid over-generic detection)
947
- 4 leshort 0xAF12
948
- # standard FLC always use 8 bit color
949
- >12 leshort 8 FLC animation
950
- !:mime video/x-flc
951
- >>8 leshort x \b, %d
952
- >>10 leshort x \bx%dx8
953
- >>6 uleshort x \b, %d frames
954
- >>16 uleshort x \b, %dms per frame
955
-
956
- # DL animation format
957
- # XXX - collision with most `mips' magic
958
- #
959
- # I couldn't find a real magic number for these, however, this
960
- # -appears- to work. Note that it might catch other files, too, so be
961
- # careful!
962
- #
963
- # Note that title and author appear in the two 20-byte chunks
964
- # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
965
- # 255 (hex FF)! The DL format is really bad.
966
- #
967
- #0 byte 1 DL version 1, medium format (160x100, 4 images/screen)
968
- #!:mime video/x-unknown
969
- #>42 byte x - %d screens,
970
- #>43 byte x %d commands
971
- #0 byte 2 DL version 2
972
- #!:mime video/x-unknown
973
- #>1 byte 1 - large format (320x200,1 image/screen),
974
- #>1 byte 2 - medium format (160x100,4 images/screen),
975
- #>1 byte >2 - unknown format,
976
- #>42 byte x %d screens,
977
- #>43 byte x %d commands
978
- # Based on empirical evidence, DL version 3 have several nulls following the
979
- # \003. Most of them start with non-null values at hex offset 0x34 or so.
980
- #0 string \3\0\0\0\0\0\0\0\0\0\0\0 DL version 3
981
-
982
- # iso 13818 transport stream
983
- #
984
- # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001 (ISO 13818.1)
985
- # (the following is a little bit restrictive and works fine for a stream
986
- # that starts with PAT properly. it won't work for stream data, that is
987
- # cut from an input device data right in the middle, but this shouldn't
988
- # disturb)
989
- # syncbyte 8 bit 0x47
990
- # error_ind 1 bit -
991
- # payload_start 1 bit 1
992
- # priority 1 bit -
993
- # PID 13 bit 0x0000
994
- # scrambling 2 bit -
995
- # adaptfld_ctrl 2 bit 1 or 3
996
- # conti_count 4 bit 0
997
- 0 belong&0xFF5FFF1F 0x47400010 MPEG transport stream data
998
- >188 byte !0x47 CORRUPTED
999
-
1000
- # DIF digital video file format <mpruett@sgi.com>
1001
- 0 belong&0xffffff00 0x1f070000 DIF
1002
- >4 byte &0x01 (DVCPRO) movie file
1003
- >4 byte ^0x01 (DV) movie file
1004
- >3 byte &0x80 (PAL)
1005
- >3 byte ^0x80 (NTSC)
1006
-
1007
- # Microsoft Advanced Streaming Format (ASF) <mpruett@sgi.com>
1008
- 0 belong 0x3026b275 Microsoft ASF
1009
- !:mime video/x-ms-asf
1010
-
1011
- # MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
1012
- 0 string \x8aMNG MNG video data,
1013
- !:mime video/x-mng
1014
- >4 belong !0x0d0a1a0a CORRUPTED,
1015
- >4 belong 0x0d0a1a0a
1016
- >>16 belong x %ld x
1017
- >>20 belong x %ld
1018
-
1019
- # JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
1020
- 0 string \x8bJNG JNG video data,
1021
- !:mime video/x-jng
1022
- >4 belong !0x0d0a1a0a CORRUPTED,
1023
- >4 belong 0x0d0a1a0a
1024
- >>16 belong x %ld x
1025
- >>20 belong x %ld
1026
-
1027
- # Vivo video (Wolfram Kleff)
1028
- 3 string \x0D\x0AVersion:Vivo Vivo video data
1029
-
1030
- # VRML (Virtual Reality Modelling Language)
1031
- 0 string/b #VRML\ V1.0\ ascii VRML 1 file
1032
- !:mime model/vrml
1033
- 0 string/b #VRML\ V2.0\ utf8 ISO/IEC 14772 VRML 97 file
1034
- !:mime model/vrml
1035
-
1036
- # X3D (Extensible 3D) [http://www.web3d.org/specifications/x3d-3.0.dtd]
1037
- # From Michel Briand <michelbriand@free.fr>
1038
- 0 string \<?xml\ version="
1039
- !:strength +1
1040
- >20 search/1000/cb \<!DOCTYPE\ X3D X3D (Extensible 3D) model xml text
1041
- !:mime model/x3d
1042
-
1043
- #---------------------------------------------------------------------------
1044
- # HVQM4: compressed movie format designed by Hudson for Nintendo GameCube
1045
- # From Mark Sheppard <msheppard@climax.co.uk>, 2002-10-03
1046
- #
1047
- 0 string HVQM4 %s
1048
- >6 string >\0 v%s
1049
- >0 byte x GameCube movie,
1050
- >0x34 ubeshort x %d x
1051
- >0x36 ubeshort x %d,
1052
- >0x26 ubeshort x %dµs,
1053
- >0x42 ubeshort 0 no audio
1054
- >0x42 ubeshort >0 %dHz audio
1055
-
1056
- # From: "Stefan A. Haubenthal" <polluks@web.de>
1057
- 0 string DVDVIDEO-VTS Video title set,
1058
- >0x21 byte x v%x
1059
- 0 string DVDVIDEO-VMG Video manager,
1060
- >0x21 byte x v%x
1061
-
1062
- # From: Behan Webster <behanw@websterwood.com>
1063
- # NuppelVideo used by Mythtv (*.nuv)
1064
- # Note: there are two identical stanzas here differing only in the
1065
- # initial string matched. It used to be done with a regex, but we're
1066
- # trying to get rid of those.
1067
- 0 string NuppelVideo MythTV NuppelVideo
1068
- >12 string x v%s
1069
- >20 lelong x (%d
1070
- >24 lelong x \bx%d),
1071
- >36 string P \bprogressive,
1072
- >36 string I \binterlaced,
1073
- >40 ledouble x \baspect:%.2f,
1074
- >48 ledouble x \bfps:%.2f
1075
- 0 string MythTV MythTV NuppelVideo
1076
- >12 string x v%s
1077
- >20 lelong x (%d
1078
- >24 lelong x \bx%d),
1079
- >36 string P \bprogressive,
1080
- >36 string I \binterlaced,
1081
- >40 ledouble x \baspect:%.2f,
1082
- >48 ledouble x \bfps:%.2f
1083
-
1084
- # MPEG file
1085
- # MPEG sequences
1086
- # FIXME: This section is from the old magic.mime file and needs integrating with the rest
1087
- 0 belong 0x000001BA
1088
- >4 byte &0x40
1089
- !:mime video/mp2p
1090
- >4 byte ^0x40
1091
- !:mime video/mpeg
1092
- 0 belong 0x000001BB
1093
- !:mime video/mpeg
1094
- 0 belong 0x000001B0
1095
- !:mime video/mp4v-es
1096
- 0 belong 0x000001B5
1097
- !:mime video/mp4v-es
1098
- 0 belong 0x000001B3
1099
- !:mime video/mpv
1100
- 0 belong&0xFF5FFF1F 0x47400010
1101
- !:mime video/mp2t
1102
- 0 belong 0x00000001
1103
- >4 byte&0x1F 0x07
1104
- !:mime video/h264
1105
-
1106
- # Type: Bink Video
1107
- # URL: http://wiki.multimedia.cx/index.php?title=3DBink_Container
1108
- # From: <hoehle@users.sourceforge.net> 2008-07-18
1109
- 0 string BIK Bink Video
1110
- >3 regex =[a-z] rev.%s
1111
- #>4 ulelong x size %d
1112
- >20 ulelong x \b, %d
1113
- >24 ulelong x \bx%d
1114
- >8 ulelong x \b, %d frames
1115
- >32 ulelong x at rate %d/
1116
- >28 ulelong >1 \b%d
1117
- >40 ulelong =0 \b, no audio
1118
- >40 ulelong !0 \b, %d audio track
1119
- >>40 ulelong !1 \bs
1120
- # follow properties of the first audio track only
1121
- >>48 uleshort x %dHz
1122
- >>51 byte&0x20 0 mono
1123
- >>51 byte&0x20 !0 stereo
1124
- #>>51 byte&0x10 0 FFT
1125
- #>>51 byte&0x10 !0 DCT
1126
-
1127
- #------------------------------------------------------------------------------
1128
- # apl: file(1) magic for APL (see also "pdp" and "vax" for other APL
1129
- # workspaces)
1130
- #
1131
- 0 long 0100554 APL workspace (Ken's original?)
1132
- #------------------------------------------------------------------------------
1133
- # apple: file(1) magic for Apple file formats
1134
- #
1135
- 0 search/1 FiLeStArTfIlEsTaRt binscii (apple ][) text
1136
- 0 string \x0aGL Binary II (apple ][) data
1137
- 0 string \x76\xff Squeezed (apple ][) data
1138
- 0 string NuFile NuFile archive (apple ][) data
1139
- 0 string N\xf5F\xe9l\xe5 NuFile archive (apple ][) data
1140
- 0 belong 0x00051600 AppleSingle encoded Macintosh file
1141
- 0 belong 0x00051607 AppleDouble encoded Macintosh file
1142
-
1143
- # Type: Apple Emulator 2IMG format
1144
- # From: Radek Vokal <rvokal@redhat.com>
1145
- 0 string 2IMG Apple ][ 2IMG Disk Image
1146
- >4 string XGS! \b, XGS
1147
- >4 string CTKG \b, Catakig
1148
- >4 string ShIm \b, Sheppy's ImageMaker
1149
- >4 string WOOF \b, Sweet 16
1150
- >4 string B2TR \b, Bernie ][ the Rescue
1151
- >4 string !nfc \b, ASIMOV2
1152
- >4 string x \b, Unknown Format
1153
- >0xc byte 00 \b, DOS 3.3 sector order
1154
- >>0x10 byte 00 \b, Volume 254
1155
- >>0x10 byte&0x7f x \b, Volume %u
1156
- >0xc byte 01 \b, ProDOS sector order
1157
- >>0x14 short x \b, %u Blocks
1158
- >0xc byte 02 \b, NIB data
1159
-
1160
- # magic for Newton PDA package formats
1161
- # from Ruda Moura <ruda@helllabs.org>
1162
- 0 string package0 Newton package, NOS 1.x,
1163
- >12 belong &0x80000000 AutoRemove,
1164
- >12 belong &0x40000000 CopyProtect,
1165
- >12 belong &0x10000000 NoCompression,
1166
- >12 belong &0x04000000 Relocation,
1167
- >12 belong &0x02000000 UseFasterCompression,
1168
- >16 belong x version %d
1169
-
1170
- 0 string package1 Newton package, NOS 2.x,
1171
- >12 belong &0x80000000 AutoRemove,
1172
- >12 belong &0x40000000 CopyProtect,
1173
- >12 belong &0x10000000 NoCompression,
1174
- >12 belong &0x04000000 Relocation,
1175
- >12 belong &0x02000000 UseFasterCompression,
1176
- >16 belong x version %d
1177
-
1178
- 0 string package4 Newton package,
1179
- >8 byte 8 NOS 1.x,
1180
- >8 byte 9 NOS 2.x,
1181
- >12 belong &0x80000000 AutoRemove,
1182
- >12 belong &0x40000000 CopyProtect,
1183
- >12 belong &0x10000000 NoCompression,
1184
-
1185
- # The following entries for the Apple II are for files that have
1186
- # been transferred as raw binary data from an Apple, without having
1187
- # been encapsulated by any of the above archivers.
1188
- #
1189
- # In general, Apple II formats are hard to identify because Apple DOS
1190
- # and especially Apple ProDOS have strong typing in the file system and
1191
- # therefore programmers never felt much need to include type information
1192
- # in the files themselves.
1193
- #
1194
- # Eric Fischer <enf@pobox.com>
1195
-
1196
- # AppleWorks word processor:
1197
- #
1198
- # This matches the standard tab stops for an AppleWorks file, but if
1199
- # a file has a tab stop set in the first four columns this will fail.
1200
- #
1201
- # The "O" is really the magic number, but that's so common that it's
1202
- # necessary to check the tab stops that follow it to avoid false positives.
1203
-
1204
- 4 string O==== AppleWorks word processor data
1205
- >85 byte&0x01 >0 \b, zoomed
1206
- >90 byte&0x01 >0 \b, paginated
1207
- >92 byte&0x01 >0 \b, with mail merge
1208
- #>91 byte x \b, left margin %d
1209
-
1210
- # AppleWorks database:
1211
- #
1212
- # This isn't really a magic number, but it's the closest thing to one
1213
- # that I could find. The 1 and 2 really mean "order in which you defined
1214
- # categories" and "left to right, top to bottom," respectively; the D and R
1215
- # mean that the cursor should move either down or right when you press Return.
1216
-
1217
- #30 string \x01D AppleWorks database data
1218
- #30 string \x02D AppleWorks database data
1219
- #30 string \x01R AppleWorks database data
1220
- #30 string \x02R AppleWorks database data
1221
-
1222
- # AppleWorks spreadsheet:
1223
- #
1224
- # Likewise, this isn't really meant as a magic number. The R or C means
1225
- # row- or column-order recalculation; the A or M means automatic or manual
1226
- # recalculation.
1227
-
1228
- #131 string RA AppleWorks spreadsheet data
1229
- #131 string RM AppleWorks spreadsheet data
1230
- #131 string CA AppleWorks spreadsheet data
1231
- #131 string CM AppleWorks spreadsheet data
1232
-
1233
- # Applesoft BASIC:
1234
- #
1235
- # This is incredibly sloppy, but will be true if the program was
1236
- # written at its usual memory location of 2048 and its first line
1237
- # number is less than 256. Yuck.
1238
-
1239
- 0 belong&0xff00ff 0x80000 Applesoft BASIC program data
1240
- #>2 leshort x \b, first line number %d
1241
-
1242
- # ORCA/EZ assembler:
1243
- #
1244
- # This will not identify ORCA/M source files, since those have
1245
- # some sort of date code instead of the two zero bytes at 6 and 7
1246
- # XXX Conflicts with ELF
1247
- #4 belong&0xff00ffff 0x01000000 ORCA/EZ assembler source data
1248
- #>5 byte x \b, build number %d
1249
-
1250
- # Broderbund Fantavision
1251
- #
1252
- # I don't know what these values really mean, but they seem to recur.
1253
- # Will they cause too many conflicts?
1254
-
1255
- # Probably :-)
1256
- #2 belong&0xFF00FF 0x040008 Fantavision movie data
1257
-
1258
- # Some attempts at images.
1259
- #
1260
- # These are actually just bit-for-bit dumps of the frame buffer, so
1261
- # there's really no reasonably way to distinguish them except for their
1262
- # address (if preserved) -- 8192 or 16384 -- and their length -- 8192
1263
- # or, occasionally, 8184.
1264
- #
1265
- # Nevertheless this will manage to catch a lot of images that happen
1266
- # to have a solid-colored line at the bottom of the screen.
1267
-
1268
- # GRR: Magic too weak
1269
- #8144 string \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F Apple II image with white background
1270
- #8144 string \x55\x2A\x55\x2A\x55\x2A\x55\x2A Apple II image with purple background
1271
- #8144 string \x2A\x55\x2A\x55\x2A\x55\x2A\x55 Apple II image with green background
1272
- #8144 string \xD5\xAA\xD5\xAA\xD5\xAA\xD5\xAA Apple II image with blue background
1273
- #8144 string \xAA\xD5\xAA\xD5\xAA\xD5\xAA\xD5 Apple II image with orange background
1274
-
1275
- # Beagle Bros. Apple Mechanic fonts
1276
-
1277
- 0 belong&0xFF00FFFF 0x6400D000 Apple Mechanic font
1278
-
1279
- # Apple Universal Disk Image Format (UDIF) - dmg files.
1280
- # From Johan Gade.
1281
- # These entries are disabled for now until we fix the following issues.
1282
- #
1283
- # Note there might be some problems with the "VAX COFF executable"
1284
- # entry. Note this entry should be placed before the mac filesystem section,
1285
- # particularly the "Apple Partition data" entry.
1286
- #
1287
- # The intended meaning of these tests is, that the file is only of the
1288
- # specified type if both of the lines are correct - i.e. if the first
1289
- # line matches and the second doesn't then it is not of that type.
1290
- #
1291
- #0 long 0x7801730d
1292
- #>4 long 0x62626060 UDIF read-only zlib-compressed image (UDZO)
1293
- #
1294
- # Note that this entry is recognized correctly by the "Apple Partition
1295
- # data" entry - however since this entry is more specific - this
1296
- # information seems to be more useful.
1297
- #0 long 0x45520200
1298
- #>0x410 string disk\ image UDIF read/write image (UDRW)
1299
-
1300
- # From: Toby Peterson <toby@apple.com>
1301
- 0 string bplist00 Apple binary property list
1302
-
1303
- # Apple binary property list (bplist)
1304
- # Assumes version bytes are hex.
1305
- # Provides content hints for version 0 files. Assumes that the root
1306
- # object is the first object (true for CoreFoundation implementation).
1307
- # From: David Remahl <dremahl@apple.com>
1308
- 0 string bplist
1309
- >6 byte x \bCoreFoundation binary property list data, version 0x%c
1310
- >>7 byte x \b%c
1311
- >6 string 00 \b
1312
- >>8 byte&0xF0 0x00 \b
1313
- >>>8 byte&0x0F 0x00 \b, root type: null
1314
- >>>8 byte&0x0F 0x08 \b, root type: false boolean
1315
- >>>8 byte&0x0F 0x09 \b, root type: true boolean
1316
- >>8 byte&0xF0 0x10 \b, root type: integer
1317
- >>8 byte&0xF0 0x20 \b, root type: real
1318
- >>8 byte&0xF0 0x30 \b, root type: date
1319
- >>8 byte&0xF0 0x40 \b, root type: data
1320
- >>8 byte&0xF0 0x50 \b, root type: ascii string
1321
- >>8 byte&0xF0 0x60 \b, root type: unicode string
1322
- >>8 byte&0xF0 0x80 \b, root type: uid (CORRUPT)
1323
- >>8 byte&0xF0 0xa0 \b, root type: array
1324
- >>8 byte&0xF0 0xd0 \b, root type: dictionary
1325
-
1326
- # Apple/NeXT typedstream data
1327
- # Serialization format used by NeXT and Apple for various
1328
- # purposes in YellowStep/Cocoa, including some nib files.
1329
- # From: David Remahl <dremahl@apple.com>
1330
- 2 string typedstream NeXT/Apple typedstream data, big endian
1331
- >0 byte x \b, version %hhd
1332
- >0 byte <5 \b
1333
- >>13 byte 0x81 \b
1334
- >>>14 ubeshort x \b, system %hd
1335
- 2 string streamtyped NeXT/Apple typedstream data, little endian
1336
- >0 byte x \b, version %hhd
1337
- >0 byte <5 \b
1338
- >>13 byte 0x81 \b
1339
- >>>14 uleshort x \b, system %hd
1340
-
1341
- #------------------------------------------------------------------------------
1342
- # CAF: Apple CoreAudio File Format
1343
- #
1344
- # Container format for high-end audio purposes.
1345
- # From: David Remahl <dremahl@apple.com>
1346
- #
1347
- 0 string caff CoreAudio Format audio file
1348
- >4 beshort <10 version %d
1349
- >6 beshort x
1350
-
1351
-
1352
- #------------------------------------------------------------------------------
1353
- # Keychain database files
1354
- 0 string kych Mac OS X Keychain File
1355
-
1356
- #------------------------------------------------------------------------------
1357
- # Code Signing related file types
1358
- 0 belong 0xfade0c00 Mac OS X Code Requirement
1359
- >8 belong 1 (opExpr)
1360
- >4 belong x - %d bytes
1361
-
1362
- 0 belong 0xfade0c01 Mac OS X Code Requirement Set
1363
- >8 belong >1 containing %d items
1364
- >4 belong x - %d bytes
1365
-
1366
- 0 belong 0xfade0c02 Mac OS X Code Directory
1367
- >8 belong x version %x
1368
- >12 belong >0 flags 0x%x
1369
- >4 belong x - %d bytes
1370
-
1371
- 0 belong 0xfade0cc0 Mac OS X Detached Code Signature (non-executable)
1372
- >4 belong x - %d bytes
1373
-
1374
- 0 belong 0xfade0cc1 Mac OS X Detached Code Signature
1375
- >8 belong >1 (%d elements)
1376
- >4 belong x - %d bytes
1377
-
1378
- # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
1379
- # .vdi
1380
- 4 string innotek\ VirtualBox\ Disk\ Image %s
1381
-
1382
- #------------------------------------------------------------------------------
1383
- # applix: file(1) magic for Applixware
1384
- # From: Peter Soos <sp@osb.hu>
1385
- #
1386
- 0 string *BEGIN Applixware
1387
- >7 string WORDS Words Document
1388
- >7 string GRAPHICS Graphic
1389
- >7 string RASTER Bitmap
1390
- >7 string SPREADSHEETS Spreadsheet
1391
- >7 string MACRO Macro
1392
- >7 string BUILDER Builder Object
1393
- #------------------------------------------------------------------------------
1394
- # archive: file(1) magic for archive formats (see also "msdos" for self-
1395
- # extracting compressed archives)
1396
- #
1397
- # cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
1398
- # pre-POSIX "tar" archives are handled in the C code.
1399
-
1400
- # POSIX tar archives
1401
- 257 string ustar\0 POSIX tar archive
1402
- !:mime application/x-tar # encoding: posix
1403
- 257 string ustar\040\040\0 GNU tar archive
1404
- !:mime application/x-tar # encoding: gnu
1405
-
1406
- # cpio archives
1407
- #
1408
- # Yes, the top two "cpio archive" formats *are* supposed to just be "short".
1409
- # The idea is to indicate archives produced on machines with the same
1410
- # byte order as the machine running "file" with "cpio archive", and
1411
- # to indicate archives produced on machines with the opposite byte order
1412
- # from the machine running "file" with "byte-swapped cpio archive".
1413
- #
1414
- # The SVR4 "cpio(4)" hints that there are additional formats, but they
1415
- # are defined as "short"s; I think all the new formats are
1416
- # character-header formats and thus are strings, not numbers.
1417
- 0 short 070707 cpio archive
1418
- !:mime application/x-cpio
1419
- 0 short 0143561 byte-swapped cpio archive
1420
- !:mime application/x-cpio # encoding: swapped
1421
- 0 string 070707 ASCII cpio archive (pre-SVR4 or odc)
1422
- 0 string 070701 ASCII cpio archive (SVR4 with no CRC)
1423
- 0 string 070702 ASCII cpio archive (SVR4 with CRC)
1424
-
1425
- # Debian package (needs to go before regular portable archives)
1426
- #
1427
- 0 string =!<arch>\ndebian
1428
- !:mime application/x-debian-package
1429
- >8 string debian-split part of multipart Debian package
1430
- >8 string debian-binary Debian binary package
1431
- >8 string !debian
1432
- >68 string >\0 (format %s)
1433
- # These next two lines do not work, because a bzip2 Debian archive
1434
- # still uses gzip for the control.tar (first in the archive). Only
1435
- # data.tar varies, and the location of its filename varies too.
1436
- # file/libmagic does not current have support for ascii-string based
1437
- # (offsets) as of 2005-09-15.
1438
- #>81 string bz2 \b, uses bzip2 compression
1439
- #>84 string gz \b, uses gzip compression
1440
- #>136 ledate x created: %s
1441
-
1442
- # other archives
1443
- 0 long 0177555 very old archive
1444
- 0 short 0177555 very old PDP-11 archive
1445
- 0 long 0177545 old archive
1446
- 0 short 0177545 old PDP-11 archive
1447
- 0 long 0100554 apl workspace
1448
- 0 string =<ar> archive
1449
- !:mime application/x-archive
1450
-
1451
- # MIPS archive (needs to go before regular portable archives)
1452
- #
1453
- 0 string =!<arch>\n__________E MIPS archive
1454
- >20 string U with MIPS Ucode members
1455
- >21 string L with MIPSEL members
1456
- >21 string B with MIPSEB members
1457
- >19 string L and an EL hash table
1458
- >19 string B and an EB hash table
1459
- >22 string X -- out of date
1460
-
1461
- 0 search/1 -h- Software Tools format archive text
1462
-
1463
- #
1464
- # XXX - why are there multiple <ar> thingies? Note that 0x213c6172 is
1465
- # "!<ar", so, for new-style (4.xBSD/SVR2andup) archives, we have:
1466
- #
1467
- # 0 string =!<arch> current ar archive
1468
- # 0 long 0x213c6172 archive file
1469
- #
1470
- # and for SVR1 archives, we have:
1471
- #
1472
- # 0 string \<ar> System V Release 1 ar archive
1473
- # 0 string =<ar> archive
1474
- #
1475
- # XXX - did Aegis really store shared libraries, breakpointed modules,
1476
- # and absolute code program modules in the same format as new-style
1477
- # "ar" archives?
1478
- #
1479
- 0 string =!<arch> current ar archive
1480
- !:mime application/x-archive
1481
- >8 string __.SYMDEF random library
1482
- >0 belong =65538 - pre SR9.5
1483
- >0 belong =65539 - post SR9.5
1484
- >0 beshort 2 - object archive
1485
- >0 beshort 3 - shared library module
1486
- >0 beshort 4 - debug break-pointed module
1487
- >0 beshort 5 - absolute code program module
1488
- 0 string \<ar> System V Release 1 ar archive
1489
- 0 string =<ar> archive
1490
- #
1491
- # XXX - from "vax", which appears to collect a bunch of byte-swapped
1492
- # thingies, to help you recognize VAX files on big-endian machines;
1493
- # with "leshort", "lelong", and "string", that's no longer necessary....
1494
- #
1495
- 0 belong 0x65ff0000 VAX 3.0 archive
1496
- 0 belong 0x3c61723e VAX 5.0 archive
1497
- #
1498
- 0 long 0x213c6172 archive file
1499
- 0 lelong 0177555 very old VAX archive
1500
- 0 leshort 0177555 very old PDP-11 archive
1501
- #
1502
- # XXX - "pdp" claims that 0177545 can have an __.SYMDEF member and thus
1503
- # be a random library (it said 0xff65 rather than 0177545).
1504
- #
1505
- 0 lelong 0177545 old VAX archive
1506
- >8 string __.SYMDEF random library
1507
- 0 leshort 0177545 old PDP-11 archive
1508
- >8 string __.SYMDEF random library
1509
- #
1510
- # From "pdp" (but why a 4-byte quantity?)
1511
- #
1512
- 0 lelong 0x39bed PDP-11 old archive
1513
- 0 lelong 0x39bee PDP-11 4.0 archive
1514
-
1515
- # ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
1516
- #
1517
- # The first byte is the magic (0x1a), byte 2 is the compression type for
1518
- # the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
1519
- # filename of the first file (null terminated). Since some types collide
1520
- # we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
1521
- # 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%). 0x01 collides with terminfo.
1522
- 0 lelong&0x8080ffff 0x0000081a ARC archive data, dynamic LZW
1523
- !:mime application/x-arc
1524
- 0 lelong&0x8080ffff 0x0000091a ARC archive data, squashed
1525
- !:mime application/x-arc
1526
- 0 lelong&0x8080ffff 0x0000021a ARC archive data, uncompressed
1527
- !:mime application/x-arc
1528
- 0 lelong&0x8080ffff 0x0000031a ARC archive data, packed
1529
- !:mime application/x-arc
1530
- 0 lelong&0x8080ffff 0x0000041a ARC archive data, squeezed
1531
- !:mime application/x-arc
1532
- 0 lelong&0x8080ffff 0x0000061a ARC archive data, crunched
1533
- !:mime application/x-arc
1534
- # [JW] stuff taken from idarc, obviously ARC successors:
1535
- 0 lelong&0x8080ffff 0x00000a1a PAK archive data
1536
- !:mime application/x-arc
1537
- 0 lelong&0x8080ffff 0x0000141a ARC+ archive data
1538
- !:mime application/x-arc
1539
- 0 lelong&0x8080ffff 0x0000481a HYP archive data
1540
- !:mime application/x-arc
1541
-
1542
- # Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
1543
- # I can't create either SPARK or ArcFS archives so I have not tested this stuff
1544
- # [GRR: the original entries collide with ARC, above; replaced with combined
1545
- # version (not tested)]
1546
- #0 byte 0x1a RISC OS archive (spark format)
1547
- 0 string \032archive RISC OS archive (ArcFS format)
1548
- 0 string Archive\000 RISC OS archive (ArcFS format)
1549
-
1550
- # All these were taken from idarc, many could not be verified. Unfortunately,
1551
- # there were many low-quality sigs, i.e. easy to trigger false positives.
1552
- # Please notify me of any real-world fishy/ambiguous signatures and I'll try
1553
- # to get my hands on the actual archiver and see if I find something better. [JW]
1554
- # probably many can be enhanced by finding some 0-byte or control char near the start
1555
-
1556
- # idarc calls this Crush/Uncompressed... *shrug*
1557
- 0 string CRUSH Crush archive data
1558
- # Squeeze It (.sqz)
1559
- 0 string HLSQZ Squeeze It archive data
1560
- # SQWEZ
1561
- 0 string SQWEZ SQWEZ archive data
1562
- # HPack (.hpk)
1563
- 0 string HPAK HPack archive data
1564
- # HAP
1565
- 0 string \x91\x33HF HAP archive data
1566
- # MD/MDCD
1567
- 0 string MDmd MDCD archive data
1568
- # LIM
1569
- 0 string LIM\x1a LIM archive data
1570
- # SAR
1571
- 3 string LH5 SAR archive data
1572
- # BSArc/BS2
1573
- 0 string \212\3SB \0 BSArc/BS2 archive data
1574
- # MAR
1575
- 2 string =-ah MAR archive data
1576
- # ACB
1577
- 0 belong&0x00f800ff 0x00800000 ACB archive data
1578
- # CPZ
1579
- # TODO, this is what idarc says: 0 string \0\0\0 CPZ archive data
1580
- # JRC
1581
- 0 string JRchive JRC archive data
1582
- # Quantum
1583
- 0 string DS\0 Quantum archive data
1584
- # ReSOF
1585
- 0 string PK\3\6 ReSOF archive data
1586
- # QuArk
1587
- 0 string 7\4 QuArk archive data
1588
- # YAC
1589
- 14 string YC YAC archive data
1590
- # X1
1591
- 0 string X1 X1 archive data
1592
- 0 string XhDr X1 archive data
1593
- # CDC Codec (.dqt)
1594
- 0 belong&0xffffe000 0x76ff2000 CDC Codec archive data
1595
- # AMGC
1596
- 0 string \xad6" AMGC archive data
1597
- # NuLIB
1598
- 0 string NõFélå NuLIB archive data
1599
- # PakLeo
1600
- 0 string LEOLZW PAKLeo archive data
1601
- # ChArc
1602
- 0 string SChF ChArc archive data
1603
- # PSA
1604
- 0 string PSA PSA archive data
1605
- # CrossePAC
1606
- 0 string DSIGDCC CrossePAC archive data
1607
- # Freeze
1608
- 0 string \x1f\x9f\x4a\x10\x0a Freeze archive data
1609
- # KBoom
1610
- 0 string ¨MP¨ KBoom archive data
1611
- # NSQ, must go after CDC Codec
1612
- 0 string \x76\xff NSQ archive data
1613
- # DPA
1614
- 0 string Dirk\ Paehl DPA archive data
1615
- # BA
1616
- # TODO: idarc says "bytes 0-2 == bytes 3-5"
1617
- # TTComp
1618
- 0 string \0\6 TTComp archive data
1619
- # ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation?
1620
- 0 string ESP ESP archive data
1621
- # ZPack
1622
- 0 string \1ZPK\1 ZPack archive data
1623
- # Sky
1624
- 0 string \xbc\x40 Sky archive data
1625
- # UFA
1626
- 0 string UFA UFA archive data
1627
- # Dry
1628
- 0 string =-H2O DRY archive data
1629
- # FoxSQZ
1630
- 0 string FOXSQZ FoxSQZ archive data
1631
- # AR7
1632
- 0 string ,AR7 AR7 archive data
1633
- # PPMZ
1634
- 0 string PPMZ PPMZ archive data
1635
- # MS Compress
1636
- 4 string \x88\xf0\x27 MS Compress archive data
1637
- # updated by Joerg Jenderek
1638
- >9 string \0
1639
- >>0 string KWAJ
1640
- >>>7 string \321\003 MS Compress archive data
1641
- >>>>14 ulong >0 \b, original size: %ld bytes
1642
- >>>>18 ubyte >0x65
1643
- >>>>>18 string x \b, was %.8s
1644
- >>>>>(10.b-4) string x \b.%.3s
1645
- # MP3 (archiver, not lossy audio compression)
1646
- 0 string MP3\x1a MP3-Archiver archive data
1647
- # ZET
1648
- 0 string OZÝ ZET archive data
1649
- # TSComp
1650
- 0 string \x65\x5d\x13\x8c\x08\x01\x03\x00 TSComp archive data
1651
- # ARQ
1652
- 0 string gW\4\1 ARQ archive data
1653
- # Squash
1654
- 3 string OctSqu Squash archive data
1655
- # Terse
1656
- 0 string \5\1\1\0 Terse archive data
1657
- # PUCrunch
1658
- 0 string \x01\x08\x0b\x08\xef\x00\x9e\x32\x30\x36\x31 PUCrunch archive data
1659
- # UHarc
1660
- 0 string UHA UHarc archive data
1661
- # ABComp
1662
- 0 string \2AB ABComp archive data
1663
- 0 string \3AB2 ABComp archive data
1664
- # CMP
1665
- 0 string CO\0 CMP archive data
1666
- # Splint
1667
- 0 string \x93\xb9\x06 Splint archive data
1668
- # InstallShield
1669
- 0 string \x13\x5d\x65\x8c InstallShield Z archive Data
1670
- # Gather
1671
- 1 string GTH Gather archive data
1672
- # BOA
1673
- 0 string BOA BOA archive data
1674
- # RAX
1675
- 0 string ULEB\xa RAX archive data
1676
- # Xtreme
1677
- 0 string ULEB\0 Xtreme archive data
1678
- # Pack Magic
1679
- 0 string @â\1\0 Pack Magic archive data
1680
- # BTS
1681
- 0 belong&0xfeffffff 0x1a034465 BTS archive data
1682
- # ELI 5750
1683
- 0 string Ora\ ELI 5750 archive data
1684
- # QFC
1685
- 0 string \x1aFC\x1a QFC archive data
1686
- 0 string \x1aQF\x1a QFC archive data
1687
- # PRO-PACK
1688
- 0 string RNC PRO-PACK archive data
1689
- # 777
1690
- 0 string 777 777 archive data
1691
- # LZS221
1692
- 0 string sTaC LZS221 archive data
1693
- # HPA
1694
- 0 string HPA HPA archive data
1695
- # Arhangel
1696
- 0 string LG Arhangel archive data
1697
- # EXP1, uses bzip2
1698
- 0 string 0123456789012345BZh EXP1 archive data
1699
- # IMP
1700
- 0 string IMP\xa IMP archive data
1701
- # NRV
1702
- 0 string \x00\x9E\x6E\x72\x76\xFF NRV archive data
1703
- # Squish
1704
- 0 string \x73\xb2\x90\xf4 Squish archive data
1705
- # Par
1706
- 0 string PHILIPP Par archive data
1707
- 0 string PAR Par archive data
1708
- # HIT
1709
- 0 string UB HIT archive data
1710
- # SBX
1711
- 0 belong&0xfffff000 0x53423000 SBX archive data
1712
- # NaShrink
1713
- 0 string NSK NaShrink archive data
1714
- # SAPCAR
1715
- 0 string #\ CAR\ archive\ header SAPCAR archive data
1716
- 0 string CAR\ 2.00RG SAPCAR archive data
1717
- # Disintegrator
1718
- 0 string DST Disintegrator archive data
1719
- # ASD
1720
- 0 string ASD ASD archive data
1721
- # InstallShield CAB
1722
- 0 string ISc( InstallShield CAB
1723
- # TOP4
1724
- 0 string T4\x1a TOP4 archive data
1725
- # BatComp left out: sig looks like COM executable
1726
- # so TODO: get real 4dos batcomp file and find sig
1727
- # BlakHole
1728
- 0 string BH\5\7 BlakHole archive data
1729
- # BIX
1730
- 0 string BIX0 BIX archive data
1731
- # ChiefLZA
1732
- 0 string ChfLZ ChiefLZA archive data
1733
- # Blink
1734
- 0 string Blink Blink archive data
1735
- # Logitech Compress
1736
- 0 string \xda\xfa Logitech Compress archive data
1737
- # ARS-Sfx (FIXME: really a SFX? then goto COM/EXE)
1738
- 1 string (C)\ STEPANYUK ARS-Sfx archive data
1739
- # AKT/AKT32
1740
- 0 string AKT32 AKT32 archive data
1741
- 0 string AKT AKT archive data
1742
- # NPack
1743
- 0 string MSTSM NPack archive data
1744
- # PFT
1745
- 0 string \0\x50\0\x14 PFT archive data
1746
- # SemOne
1747
- 0 string SEM SemOne archive data
1748
- # PPMD
1749
- 0 string \x8f\xaf\xac\x84 PPMD archive data
1750
- # FIZ
1751
- 0 string FIZ FIZ archive data
1752
- # MSXiE
1753
- 0 belong&0xfffff0f0 0x4d530000 MSXiE archive data
1754
- # DeepFreezer
1755
- 0 belong&0xfffffff0 0x797a3030 DeepFreezer archive data
1756
- # DC
1757
- 0 string =<DC- DC archive data
1758
- # TPac
1759
- 0 string \4TPAC\3 TPac archive data
1760
- # Ai
1761
- 0 string Ai\1\1\0 Ai archive data
1762
- 0 string Ai\1\0\0 Ai archive data
1763
- # Ai32
1764
- 0 string Ai\2\0 Ai32 archive data
1765
- 0 string Ai\2\1 Ai32 archive data
1766
- # SBC
1767
- 0 string SBC SBC archive data
1768
- # Ybs
1769
- 0 string YBS Ybs archive data
1770
- # DitPack
1771
- 0 string \x9e\0\0 DitPack archive data
1772
- # DMS
1773
- 0 string DMS! DMS archive data
1774
- # EPC
1775
- 0 string \x8f\xaf\xac\x8c EPC archive data
1776
- # VSARC
1777
- 0 string VS\x1a VSARC archive data
1778
- # PDZ
1779
- 0 string PDZ PDZ archive data
1780
- # ReDuq
1781
- 0 string rdqx ReDuq archive data
1782
- # GCA
1783
- 0 string GCAX GCA archive data
1784
- # PPMN
1785
- 0 string pN PPMN archive data
1786
- # WinImage
1787
- 3 string WINIMAGE WinImage archive data
1788
- # Compressia
1789
- 0 string CMP0CMP Compressia archive data
1790
- # UHBC
1791
- 0 string UHB UHBC archive data
1792
- # WinHKI
1793
- 0 string \x61\x5C\x04\x05 WinHKI archive data
1794
- # WWPack data file
1795
- 0 string WWP WWPack archive data
1796
- # BSN (BSA, PTS-DOS)
1797
- 0 string \xffBSG BSN archive data
1798
- 1 string \xffBSG BSN archive data
1799
- 3 string \xffBSG BSN archive data
1800
- 1 string \0\xae\2 BSN archive data
1801
- 1 string \0\xae\3 BSN archive data
1802
- 1 string \0\xae\7 BSN archive data
1803
- # AIN
1804
- 0 string \x33\x18 AIN archive data
1805
- 0 string \x33\x17 AIN archive data
1806
- # XPA32
1807
- 0 string xpa\0\1 XPA32 archive data
1808
- # SZip (TODO: doesn't catch all versions)
1809
- 0 string SZ\x0a\4 SZip archive data
1810
- # XPack DiskImage
1811
- 0 string jm XPack DiskImage archive data
1812
- # XPack Data
1813
- 0 string xpa XPack archive data
1814
- # XPack Single Data
1815
- 0 string Í\ jm XPack single archive data
1816
-
1817
- # TODO: missing due to unknown magic/magic at end of file:
1818
- #DWC
1819
- #ARG
1820
- #ZAR
1821
- #PC/3270
1822
- #InstallIt
1823
- #RKive
1824
- #RK
1825
- #XPack Diskimage
1826
-
1827
- # These were inspired by idarc, but actually verified
1828
- # Dzip archiver (.dz)
1829
- 0 string DZ Dzip archive data
1830
- >2 byte x \b, version %i
1831
- >3 byte x \b.%i
1832
- # ZZip archiver (.zz)
1833
- 0 string ZZ\ \0\0 ZZip archive data
1834
- 0 string ZZ0 ZZip archive data
1835
- # PAQ archiver (.paq)
1836
- 0 string \xaa\x40\x5f\x77\x1f\xe5\x82\x0d PAQ archive data
1837
- 0 string PAQ PAQ archive data
1838
- >3 byte&0xf0 0x30
1839
- >>3 byte x (v%c)
1840
- # JAR archiver (.j), this is the successor to ARJ, not Java's JAR (which is essentially ZIP)
1841
- 0xe string \x1aJar\x1b JAR (ARJ Software, Inc.) archive data
1842
- 0 string JARCS JAR (ARJ Software, Inc.) archive data
1843
-
1844
- # ARJ archiver (jason@jarthur.Claremont.EDU)
1845
- 0 leshort 0xea60 ARJ archive data
1846
- !:mime application/x-arj
1847
- >5 byte x \b, v%d,
1848
- >8 byte &0x04 multi-volume,
1849
- >8 byte &0x10 slash-switched,
1850
- >8 byte &0x20 backup,
1851
- >34 string x original name: %s,
1852
- >7 byte 0 os: MS-DOS
1853
- >7 byte 1 os: PRIMOS
1854
- >7 byte 2 os: Unix
1855
- >7 byte 3 os: Amiga
1856
- >7 byte 4 os: Macintosh
1857
- >7 byte 5 os: OS/2
1858
- >7 byte 6 os: Apple ][ GS
1859
- >7 byte 7 os: Atari ST
1860
- >7 byte 8 os: NeXT
1861
- >7 byte 9 os: VAX/VMS
1862
- >3 byte >0 %d]
1863
- # [JW] idarc says this is also possible
1864
- 2 leshort 0xea60 ARJ archive data
1865
-
1866
- # HA archiver (Greg Roelofs, newt@uchicago.edu)
1867
- # This is a really bad format. A file containing HAWAII will match this...
1868
- #0 string HA HA archive data,
1869
- #>2 leshort =1 1 file,
1870
- #>2 leshort >1 %u files,
1871
- #>4 byte&0x0f =0 first is type CPY
1872
- #>4 byte&0x0f =1 first is type ASC
1873
- #>4 byte&0x0f =2 first is type HSC
1874
- #>4 byte&0x0f =0x0e first is type DIR
1875
- #>4 byte&0x0f =0x0f first is type SPECIAL
1876
- # suggestion: at least identify small archives (<1024 files)
1877
- 0 belong&0xffff00fc 0x48410000 HA archive data
1878
- >2 leshort =1 1 file,
1879
- >2 leshort >1 %u files,
1880
- >4 byte&0x0f =0 first is type CPY
1881
- >4 byte&0x0f =1 first is type ASC
1882
- >4 byte&0x0f =2 first is type HSC
1883
- >4 byte&0x0f =0x0e first is type DIR
1884
- >4 byte&0x0f =0x0f first is type SPECIAL
1885
-
1886
- # HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
1887
- 0 string HPAK HPACK archive data
1888
-
1889
- # JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
1890
- 0 string \351,\001JAM\ JAM archive,
1891
- >7 string >\0 version %.4s
1892
- >0x26 byte =0x27 -
1893
- >>0x2b string >\0 label %.11s,
1894
- >>0x27 lelong x serial %08x,
1895
- >>0x36 string >\0 fstype %.8s
1896
-
1897
- # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
1898
- 2 string -lh0- LHarc 1.x/ARX archive data [lh0]
1899
- !:mime application/x-lharc
1900
- 2 string -lh1- LHarc 1.x/ARX archive data [lh1]
1901
- !:mime application/x-lharc
1902
- 2 string -lz4- LHarc 1.x archive data [lz4]
1903
- !:mime application/x-lharc
1904
- 2 string -lz5- LHarc 1.x archive data [lz5]
1905
- !:mime application/x-lharc
1906
- # [never seen any but the last; -lh4- reported in comp.compression:]
1907
- 2 string -lzs- LHa/LZS archive data [lzs]
1908
- !:mime application/x-lha
1909
- 2 string -lh\40- LHa 2.x? archive data [lh ]
1910
- !:mime application/x-lha
1911
- 2 string -lhd- LHa 2.x? archive data [lhd]
1912
- !:mime application/x-lha
1913
- 2 string -lh2- LHa 2.x? archive data [lh2]
1914
- !:mime application/x-lha
1915
- 2 string -lh3- LHa 2.x? archive data [lh3]
1916
- !:mime application/x-lha
1917
- 2 string -lh4- LHa (2.x) archive data [lh4]
1918
- !:mime application/x-lha
1919
- 2 string -lh5- LHa (2.x) archive data [lh5]
1920
- !:mime application/x-lha
1921
- 2 string -lh6- LHa (2.x) archive data [lh6]
1922
- !:mime application/x-lha
1923
- 2 string -lh7- LHa (2.x)/LHark archive data [lh7]
1924
- !:mime application/x-lha
1925
- >20 byte x - header level %d
1926
- # taken from idarc [JW]
1927
- 2 string -lZ PUT archive data
1928
- 2 string -lz LZS archive data
1929
- 2 string -sw1- Swag archive data
1930
-
1931
- # RAR archiver (Greg Roelofs, newt@uchicago.edu)
1932
- 0 string Rar! RAR archive data,
1933
- !:mime application/x-rar
1934
- >44 byte x v%0x,
1935
- >10 byte >0 flags:
1936
- >>10 byte &0x01 Archive volume,
1937
- >>10 byte &0x02 Commented,
1938
- >>10 byte &0x04 Locked,
1939
- >>10 byte &0x08 Solid,
1940
- >>10 byte &0x20 Authenticated,
1941
- >35 byte 0 os: MS-DOS
1942
- >35 byte 1 os: OS/2
1943
- >35 byte 2 os: Win32
1944
- >35 byte 3 os: Unix
1945
- # some old version? idarc says:
1946
- 0 string RE\x7e\x5e RAR archive data
1947
-
1948
- # SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
1949
- 0 string SQSH squished archive data (Acorn RISCOS)
1950
-
1951
- # UC2 archiver (Greg Roelofs, newt@uchicago.edu)
1952
- # [JW] see exe section for self-extracting version
1953
- 0 string UC2\x1a UC2 archive data
1954
-
1955
- # ZIP archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
1956
- 0 string PK\003\004
1957
- >4 byte 0x00 Zip archive data
1958
- !:mime application/zip
1959
- >4 byte 0x09 Zip archive data, at least v0.9 to extract
1960
- !:mime application/zip
1961
- >4 byte 0x0a Zip archive data, at least v1.0 to extract
1962
- !:mime application/zip
1963
- >4 byte 0x0b Zip archive data, at least v1.1 to extract
1964
- !:mime application/zip
1965
- >0x161 string WINZIP Zip archive data, WinZIP self-extracting
1966
- !:mime application/zip
1967
- >4 byte 0x14
1968
- >>30 ubelong !0x6d696d65 Zip archive data, at least v2.0 to extract
1969
- !:mime application/zip
1970
-
1971
- # OpenOffice.org / KOffice / StarOffice documents
1972
- # Listed here because they ARE zip files
1973
- #
1974
- # From: Abel Cheung <abel@oaka.org>
1975
- >4 byte 0x14
1976
- >>30 string mimetype
1977
-
1978
- # KOffice (1.2 or above) formats
1979
- >>>50 string vnd.kde. KOffice (>=1.2)
1980
- >>>>58 string karbon Karbon document
1981
- >>>>58 string kchart KChart document
1982
- >>>>58 string kformula KFormula document
1983
- >>>>58 string kivio Kivio document
1984
- >>>>58 string kontour Kontour document
1985
- >>>>58 string kpresenter KPresenter document
1986
- >>>>58 string kspread KSpread document
1987
- >>>>58 string kword KWord document
1988
-
1989
- # OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7)
1990
- >>>50 string vnd.sun.xml. OpenOffice.org 1.x
1991
- >>>>62 string writer Writer
1992
- >>>>>68 byte !0x2e document
1993
- >>>>>68 string .template template
1994
- >>>>>68 string .global global document
1995
- >>>>62 string calc Calc
1996
- >>>>>66 byte !0x2e spreadsheet
1997
- >>>>>66 string .template template
1998
- >>>>62 string draw Draw
1999
- >>>>>66 byte !0x2e document
2000
- >>>>>66 string .template template
2001
- >>>>62 string impress Impress
2002
- >>>>>69 byte !0x2e presentation
2003
- >>>>>69 string .template template
2004
- >>>>62 string math Math document
2005
- >>>>62 string base Database file
2006
-
2007
- # OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
2008
- # http://lists.oasis-open.org/archives/office/200505/msg00006.html
2009
- >>>50 string vnd.oasis.opendocument. OpenDocument
2010
- >>>>73 string text
2011
- >>>>>77 byte !0x2d Text
2012
- !:mime application/vnd.oasis.opendocument.text
2013
- >>>>>77 string -template Text Template
2014
- >>>>>77 string -web HTML Document Template
2015
- >>>>>77 string -master Master Document
2016
- >>>>73 string graphics Drawing
2017
- >>>>>81 string -template Template
2018
- >>>>73 string presentation Presentation
2019
- >>>>>85 string -template Template
2020
- >>>>73 string spreadsheet Spreadsheet
2021
- >>>>>84 string -template Template
2022
- >>>>73 string chart Chart
2023
- >>>>>78 string -template Template
2024
- >>>>73 string formula Formula
2025
- >>>>>80 string -template Template
2026
- >>>>73 string database Database
2027
- >>>>73 string image Image
2028
-
2029
- # Zoo archiver
2030
- 20 lelong 0xfdc4a7dc Zoo archive data
2031
- !:mime application/x-zoo
2032
- >4 byte >48 \b, v%c.
2033
- >>6 byte >47 \b%c
2034
- >>>7 byte >47 \b%c
2035
- >32 byte >0 \b, modify: v%d
2036
- >>33 byte x \b.%d+
2037
- >42 lelong 0xfdc4a7dc \b,
2038
- >>70 byte >0 extract: v%d
2039
- >>>71 byte x \b.%d+
2040
-
2041
- # Shell archives
2042
- 10 string #\ This\ is\ a\ shell\ archive shell archive text
2043
- !:mime application/octet-stream
2044
-
2045
- #
2046
- # LBR. NB: May conflict with the questionable
2047
- # "binary Computer Graphics Metafile" format.
2048
- #
2049
- 0 string \0\ \ \ \ \ \ \ \ \ \ \ \0\0 LBR archive data
2050
- #
2051
- # PMA (CP/M derivative of LHA)
2052
- #
2053
- 2 string -pm0- PMarc archive data [pm0]
2054
- 2 string -pm1- PMarc archive data [pm1]
2055
- 2 string -pm2- PMarc archive data [pm2]
2056
- 2 string -pms- PMarc SFX archive (CP/M, DOS)
2057
- 5 string -pc1- PopCom compressed executable (CP/M)
2058
-
2059
- # From Rafael Laboissiere <rafael@laboissiere.net>
2060
- # The Project Revision Control System (see
2061
- # http://prcs.sourceforge.net) generates a packaged project
2062
- # file which is recognized by the following entry:
2063
- 0 leshort 0xeb81 PRCS packaged project
2064
-
2065
- # Microsoft cabinets
2066
- # by David Necas (Yeti) <yeti@physics.muni.cz>
2067
- #0 string MSCF\0\0\0\0 Microsoft cabinet file data,
2068
- #>25 byte x v%d
2069
- #>24 byte x \b.%d
2070
- # MPi: All CABs have version 1.3, so this is pointless.
2071
- # Better magic in debian-additions.
2072
-
2073
- # GTKtalog catalogs
2074
- # by David Necas (Yeti) <yeti@physics.muni.cz>
2075
- 4 string gtktalog\ GTKtalog catalog data,
2076
- >13 string 3 version 3
2077
- >>14 beshort 0x677a (gzipped)
2078
- >>14 beshort !0x677a (not gzipped)
2079
- >13 string >3 version %s
2080
-
2081
- ############################################################################
2082
- # Parity archive reconstruction file, the 'par' file format now used on Usenet.
2083
- 0 string PAR\0 PARity archive data
2084
- >48 leshort =0 - Index file
2085
- >48 leshort >0 - file number %d
2086
-
2087
- # Felix von Leitner <felix-file@fefe.de>
2088
- 0 string d8:announce BitTorrent file
2089
- !:mime application/x-bittorrent
2090
-
2091
- # Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
2092
- 0 beshort 0x0e0f Atari MSA archive data
2093
- >2 beshort x \b, %d sectors per track
2094
- >4 beshort 0 \b, 1 sided
2095
- >4 beshort 1 \b, 2 sided
2096
- >6 beshort x \b, starting track: %d
2097
- >8 beshort x \b, ending track: %d
2098
-
2099
- # Alternate ZIP string (amc@arwen.cs.berkeley.edu)
2100
- 0 string PK00PK\003\004 Zip archive data
2101
-
2102
- # ACE archive (from http://www.wotsit.org/download.asp?f=ace)
2103
- # by Stefan `Sec` Zehl <sec@42.org>
2104
- 7 string **ACE** ACE archive data
2105
- >15 byte >0 version %d
2106
- >16 byte =0x00 \b, from MS-DOS
2107
- >16 byte =0x01 \b, from OS/2
2108
- >16 byte =0x02 \b, from Win/32
2109
- >16 byte =0x03 \b, from Unix
2110
- >16 byte =0x04 \b, from MacOS
2111
- >16 byte =0x05 \b, from WinNT
2112
- >16 byte =0x06 \b, from Primos
2113
- >16 byte =0x07 \b, from AppleGS
2114
- >16 byte =0x08 \b, from Atari
2115
- >16 byte =0x09 \b, from Vax/VMS
2116
- >16 byte =0x0A \b, from Amiga
2117
- >16 byte =0x0B \b, from Next
2118
- >14 byte x \b, version %d to extract
2119
- >5 leshort &0x0080 \b, multiple volumes,
2120
- >>17 byte x \b (part %d),
2121
- >5 leshort &0x0002 \b, contains comment
2122
- >5 leshort &0x0200 \b, sfx
2123
- >5 leshort &0x0400 \b, small dictionary
2124
- >5 leshort &0x0800 \b, multi-volume
2125
- >5 leshort &0x1000 \b, contains AV-String
2126
- >>30 string \x16*UNREGISTERED\x20VERSION* (unregistered)
2127
- >5 leshort &0x2000 \b, with recovery record
2128
- >5 leshort &0x4000 \b, locked
2129
- >5 leshort &0x8000 \b, solid
2130
- # Date in MS-DOS format (whatever that is)
2131
- #>18 lelong x Created on
2132
-
2133
- # sfArk : compression program for Soundfonts (sf2) by Dirk Jagdmann
2134
- # <doj@cubic.org>
2135
- 0x1A string sfArk sfArk compressed Soundfont
2136
- >0x15 string 2
2137
- >>0x1 string >\0 Version %s
2138
- >>0x2A string >\0 : %s
2139
-
2140
- # DR-DOS 7.03 Packed File *.??_
2141
- 0 string Packed\ File\ Personal NetWare Packed File
2142
- >12 string x \b, was "%.12s"
2143
-
2144
- # EET archive
2145
- # From: Tilman Sauerbeck <tilman@code-monkey.de>
2146
- 0 belong 0x1ee7ff00 EET archive
2147
- !:mime application/x-eet
2148
-
2149
- # rzip archives
2150
- 0 string RZIP rzip compressed data
2151
- >4 byte x - version %d
2152
- >5 byte x \b.%d
2153
- >6 belong x (%d bytes)
2154
-
2155
- # From: "Robert Dale" <robdale@gmail.com>
2156
- 0 belong 123 dar archive,
2157
- >4 belong x label "%.8x
2158
- >>8 belong x %.8x
2159
- >>>12 beshort x %.4x"
2160
- >14 byte 0x54 end slice
2161
- >14 beshort 0x4e4e multi-part
2162
- >14 beshort 0x4e53 multi-part, with -S
2163
-
2164
- # Symbian installation files
2165
- # http://www.thouky.co.uk/software/psifs/sis.html
2166
- # http://developer.symbian.com/main/downloads/papers/SymbianOSv91/softwareinstallsis.pdf
2167
- 8 lelong 0x10000419 Symbian installation file
2168
- !:mime application/vnd.symbian.install
2169
- >4 lelong 0x1000006D (EPOC release 3/4/5)
2170
- >4 lelong 0x10003A12 (EPOC release 6)
2171
- 0 lelong 0x10201A7A Symbian installation file (Symbian OS 9.x)
2172
- !:mime x-epoc/x-sisx-app
2173
-
2174
- # From "Nelson A. de Oliveira" <naoliv@gmail.com>
2175
- 0 string MPQ\032 MoPaQ (MPQ) archive
2176
-
2177
- # From: Dirk Jagdmann <doj@cubic.org>
2178
- # xar archive format: http://code.google.com/p/xar/
2179
- 0 string xar! xar archive
2180
- >6 beshort x - version %ld
2181
-
2182
- # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
2183
- # .kgb
2184
- 0 string KGB_arch KGB Archiver file
2185
- >10 string x with compression level %.1s
2186
-
2187
- # xar (eXtensible ARchiver) archive
2188
- # From: "David Remahl" <dremahl@apple.com>
2189
- 0 string xar! xar archive
2190
- #>4 beshort x header size %d
2191
- >6 beshort x version %d,
2192
- #>8 quad x compressed TOC: %d,
2193
- #>16 quad x uncompressed TOC: %d,
2194
- >24 belong 0 no checksum
2195
- >24 belong 1 SHA-1 checksum
2196
- >24 belong 2 MD5 checksum
2197
-
2198
- # Type: Parity Archive
2199
- # From: Daniel van Eeden <daniel_e@dds.nl>
2200
- 0 string PAR2 Parity Archive Volume Set
2201
-
2202
- #------------------------------------------------------------------------------
2203
- # asterix: file(1) magic for Aster*x; SunOS 5.5.1 gave the 4-character
2204
- # strings as "long" - we assume they're just strings:
2205
- # From: guy@netapp.com (Guy Harris)
2206
- #
2207
- 0 string *STA Aster*x
2208
- >7 string WORD Words Document
2209
- >7 string GRAP Graphic
2210
- >7 string SPRE Spreadsheet
2211
- >7 string MACR Macro
2212
- 0 string 2278 Aster*x Version 2
2213
- >29 byte 0x36 Words Document
2214
- >29 byte 0x35 Graphic
2215
- >29 byte 0x32 Spreadsheet
2216
- >29 byte 0x38 Macro
2217
-
2218
-
2219
- #------------------------------------------------------------------------------
2220
- # att3b: file(1) magic for AT&T 3B machines
2221
- #
2222
- # The `versions' should be un-commented if they work for you.
2223
- # (Was the problem just one of endianness?)
2224
- #
2225
- # 3B20
2226
- #
2227
- # The 3B20 conflicts with SCCS.
2228
- #0 beshort 0550 3b20 COFF executable
2229
- #>12 belong >0 not stripped
2230
- #>22 beshort >0 - version %ld
2231
- #0 beshort 0551 3b20 COFF executable (TV)
2232
- #>12 belong >0 not stripped
2233
- #>22 beshort >0 - version %ld
2234
- #
2235
- # WE32K
2236
- #
2237
- 0 beshort 0560 WE32000 COFF
2238
- >18 beshort ^00000020 object
2239
- >18 beshort &00000020 executable
2240
- >12 belong >0 not stripped
2241
- >18 beshort ^00010000 N/A on 3b2/300 w/paging
2242
- >18 beshort &00020000 32100 required
2243
- >18 beshort &00040000 and MAU hardware required
2244
- >20 beshort 0407 (impure)
2245
- >20 beshort 0410 (pure)
2246
- >20 beshort 0413 (demand paged)
2247
- >20 beshort 0443 (target shared library)
2248
- >22 beshort >0 - version %ld
2249
- 0 beshort 0561 WE32000 COFF executable (TV)
2250
- >12 belong >0 not stripped
2251
- #>18 beshort &00020000 - 32100 required
2252
- #>18 beshort &00040000 and MAU hardware required
2253
- #>22 beshort >0 - version %ld
2254
- #
2255
- # core file for 3b2
2256
- 0 string \000\004\036\212\200 3b2 core file
2257
- >364 string >\0 of '%s'
2258
- #------------------------------------------------------------------------------
2259
- # audio: file(1) magic for sound formats (see also "iff")
2260
- #
2261
- # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
2262
- # and others
2263
- #
2264
-
2265
- # Sun/NeXT audio data
2266
- 0 string .snd Sun/NeXT audio data:
2267
- >12 belong 1 8-bit ISDN mu-law,
2268
- !:mime audio/basic
2269
- >12 belong 2 8-bit linear PCM [REF-PCM],
2270
- !:mime audio/basic
2271
- >12 belong 3 16-bit linear PCM,
2272
- !:mime audio/basic
2273
- >12 belong 4 24-bit linear PCM,
2274
- !:mime audio/basic
2275
- >12 belong 5 32-bit linear PCM,
2276
- !:mime audio/basic
2277
- >12 belong 6 32-bit IEEE floating point,
2278
- !:mime audio/basic
2279
- >12 belong 7 64-bit IEEE floating point,
2280
- !:mime audio/basic
2281
- >12 belong 8 Fragmented sample data,
2282
- >12 belong 10 DSP program,
2283
- >12 belong 11 8-bit fixed point,
2284
- >12 belong 12 16-bit fixed point,
2285
- >12 belong 13 24-bit fixed point,
2286
- >12 belong 14 32-bit fixed point,
2287
- >12 belong 18 16-bit linear with emphasis,
2288
- >12 belong 19 16-bit linear compressed,
2289
- >12 belong 20 16-bit linear with emphasis and compression,
2290
- >12 belong 21 Music kit DSP commands,
2291
- >12 belong 23 8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice enc.),
2292
- !:mime audio/x-adpcm
2293
- >12 belong 24 compressed (8-bit CCITT G.722 ADPCM)
2294
- >12 belong 25 compressed (3-bit CCITT G.723.3 ADPCM),
2295
- >12 belong 26 compressed (5-bit CCITT G.723.5 ADPCM),
2296
- >12 belong 27 8-bit A-law (CCITT G.711),
2297
- >20 belong 1 mono,
2298
- >20 belong 2 stereo,
2299
- >20 belong 4 quad,
2300
- >16 belong >0 %d Hz
2301
-
2302
- # DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
2303
- # that uses little-endian encoding and has a different magic number
2304
- 0 lelong 0x0064732E DEC audio data:
2305
- >12 lelong 1 8-bit ISDN mu-law,
2306
- !:mime audio/x-dec-basic
2307
- >12 lelong 2 8-bit linear PCM [REF-PCM],
2308
- !:mime audio/x-dec-basic
2309
- >12 lelong 3 16-bit linear PCM,
2310
- !:mime audio/x-dec-basic
2311
- >12 lelong 4 24-bit linear PCM,
2312
- !:mime audio/x-dec-basic
2313
- >12 lelong 5 32-bit linear PCM,
2314
- !:mime audio/x-dec-basic
2315
- >12 lelong 6 32-bit IEEE floating point,
2316
- !:mime audio/x-dec-basic
2317
- >12 lelong 7 64-bit IEEE floating point,
2318
- !:mime audio/x-dec-basic
2319
- >12 belong 8 Fragmented sample data,
2320
- >12 belong 10 DSP program,
2321
- >12 belong 11 8-bit fixed point,
2322
- >12 belong 12 16-bit fixed point,
2323
- >12 belong 13 24-bit fixed point,
2324
- >12 belong 14 32-bit fixed point,
2325
- >12 belong 18 16-bit linear with emphasis,
2326
- >12 belong 19 16-bit linear compressed,
2327
- >12 belong 20 16-bit linear with emphasis and compression,
2328
- >12 belong 21 Music kit DSP commands,
2329
- >12 lelong 23 8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice enc.),
2330
- !:mime audio/x-dec-basic
2331
- >12 belong 24 compressed (8-bit CCITT G.722 ADPCM)
2332
- >12 belong 25 compressed (3-bit CCITT G.723.3 ADPCM),
2333
- >12 belong 26 compressed (5-bit CCITT G.723.5 ADPCM),
2334
- >12 belong 27 8-bit A-law (CCITT G.711),
2335
- >20 lelong 1 mono,
2336
- >20 lelong 2 stereo,
2337
- >20 lelong 4 quad,
2338
- >16 lelong >0 %d Hz
2339
-
2340
- # Creative Labs AUDIO stuff
2341
- 0 string MThd Standard MIDI data
2342
- !:mime audio/midi
2343
- >8 beshort x (format %d)
2344
- >10 beshort x using %d track
2345
- >10 beshort >1 \bs
2346
- >12 beshort&0x7fff x at 1/%d
2347
- >12 beshort&0x8000 >0 SMPTE
2348
-
2349
- 0 string CTMF Creative Music (CMF) data
2350
- !:mime audio/x-unknown
2351
- 0 string SBI SoundBlaster instrument data
2352
- !:mime audio/x-unknown
2353
- 0 string Creative\ Voice\ File Creative Labs voice data
2354
- !:mime audio/x-unknown
2355
- # is this next line right? it came this way...
2356
- >19 byte 0x1A
2357
- >23 byte >0 - version %d
2358
- >22 byte >0 \b.%d
2359
-
2360
- # first entry is also the string "NTRK"
2361
- 0 belong 0x4e54524b MultiTrack sound data
2362
- >4 belong x - version %ld
2363
-
2364
- # Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED
2365
- # [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi]
2366
- 0 string EMOD Extended MOD sound data,
2367
- >4 byte&0xf0 x version %d
2368
- >4 byte&0x0f x \b.%d,
2369
- >45 byte x %d instruments
2370
- >83 byte 0 (module)
2371
- >83 byte 1 (song)
2372
-
2373
- # Real Audio (Magic .ra\0375)
2374
- 0 belong 0x2e7261fd RealAudio sound file
2375
- !:mime audio/x-pn-realaudio
2376
- 0 string .RMF\0\0\0 RealMedia file
2377
- !:mime application/vnd.rn-realmedia
2378
- #video/x-pn-realvideo
2379
- #video/vnd.rn-realvideo
2380
- #application/vnd.rn-realmedia
2381
- # sigh, there are many mimes for that but the above are the most common.
2382
-
2383
- # MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net]
2384
- # Oct 31, 1995
2385
- # fixed by <doj@cubic.org> 2003-06-24
2386
- # Too short...
2387
- #0 string MTM MultiTracker Module sound file
2388
- #0 string if Composer 669 Module sound data
2389
- #0 string JN Composer 669 Module sound data (extended format)
2390
- 0 string MAS_U ULT(imate) Module sound data
2391
-
2392
- #0 string FAR Module sound data
2393
- #>4 string >\15 Title: "%s"
2394
-
2395
- 0x2c string SCRM ScreamTracker III Module sound data
2396
- >0 string >\0 Title: "%s"
2397
-
2398
- # Gravis UltraSound patches
2399
- # From <ache@nagual.ru>
2400
-
2401
- 0 string GF1PATCH110\0ID#000002\0 GUS patch
2402
- 0 string GF1PATCH100\0ID#000002\0 Old GUS patch
2403
-
2404
- # mime types according to http://www.geocities.com/nevilo/mod.htm:
2405
- # audio/it .it
2406
- # audio/x-zipped-it .itz
2407
- # audio/xm fasttracker modules
2408
- # audio/x-s3m screamtracker modules
2409
- # audio/s3m screamtracker modules
2410
- # audio/x-zipped-mod mdz
2411
- # audio/mod mod
2412
- # audio/x-mod All modules (mod, s3m, 669, mtm, med, xm, it, mdz, stm, itz, xmz, s3z)
2413
-
2414
- #
2415
- # Taken from loader code from mikmod version 2.14
2416
- # by Steve McIntyre (stevem@chiark.greenend.org.uk)
2417
- # <doj@cubic.org> added title printing on 2003-06-24
2418
- 0 string MAS_UTrack_V00
2419
- >14 string >/0 ultratracker V1.%.1s module sound data
2420
- !:mime audio/x-mod
2421
- #audio/x-tracker-module
2422
-
2423
- 0 string UN05 MikMod UNI format module sound data
2424
-
2425
- 0 string Extended\ Module: Fasttracker II module sound data
2426
- !:mime audio/x-mod
2427
- #audio/x-tracker-module
2428
- >17 string >\0 Title: "%s"
2429
-
2430
- 21 string/c =!SCREAM! Screamtracker 2 module sound data
2431
- !:mime audio/x-mod
2432
- #audio/x-screamtracker-module
2433
- 21 string BMOD2STM Screamtracker 2 module sound data
2434
- !:mime audio/x-mod
2435
- #audio/x-screamtracker-module
2436
- 1080 string M.K. 4-channel Protracker module sound data
2437
- !:mime audio/x-mod
2438
- #audio/x-protracker-module
2439
- >0 string >\0 Title: "%s"
2440
- 1080 string M!K! 4-channel Protracker module sound data
2441
- !:mime audio/x-mod
2442
- #audio/x-protracker-module
2443
- >0 string >\0 Title: "%s"
2444
- 1080 string FLT4 4-channel Startracker module sound data
2445
- !:mime audio/x-mod
2446
- #audio/x-startracker-module
2447
- >0 string >\0 Title: "%s"
2448
- 1080 string FLT8 8-channel Startracker module sound data
2449
- !:mime audio/x-mod
2450
- #audio/x-startracker-module
2451
- >0 string >\0 Title: "%s"
2452
- 1080 string 4CHN 4-channel Fasttracker module sound data
2453
- !:mime audio/x-mod
2454
- #audio/x-fasttracker-module
2455
- >0 string >\0 Title: "%s"
2456
- 1080 string 6CHN 6-channel Fasttracker module sound data
2457
- !:mime audio/x-mod
2458
- #audio/x-fasttracker-module
2459
- >0 string >\0 Title: "%s"
2460
- 1080 string 8CHN 8-channel Fasttracker module sound data
2461
- !:mime audio/x-mod
2462
- #audio/x-fasttracker-module
2463
- >0 string >\0 Title: "%s"
2464
- 1080 string CD81 8-channel Octalyser module sound data
2465
- !:mime audio/x-mod
2466
- #audio/x-octalysertracker-module
2467
- >0 string >\0 Title: "%s"
2468
- 1080 string OKTA 8-channel Octalyzer module sound data
2469
- !:mime audio/x-mod
2470
- #audio/x-octalysertracker-module
2471
- >0 string >\0 Title: "%s"
2472
- # Not good enough.
2473
- #1082 string CH
2474
- #>1080 string >/0 %.2s-channel Fasttracker "oktalyzer" module sound data
2475
- 1080 string 16CN 16-channel Taketracker module sound data
2476
- !:mime audio/x-mod
2477
- #audio/x-taketracker-module
2478
- >0 string >\0 Title: "%s"
2479
- 1080 string 32CN 32-channel Taketracker module sound data
2480
- !:mime audio/x-mod
2481
- #audio/x-taketracker-module
2482
- >0 string >\0 Title: "%s"
2483
-
2484
- # TOC sound files -Trevor Johnson <trevor@jpj.net>
2485
- #
2486
- 0 string TOC TOC sound file
2487
-
2488
- # sidfiles <pooka@iki.fi>
2489
- # added name,author,(c) and new RSID type by <doj@cubic.org> 2003-06-24
2490
- 0 string SIDPLAY\ INFOFILE Sidplay info file
2491
-
2492
- 0 string PSID PlaySID v2.2+ (AMIGA) sidtune
2493
- >4 beshort >0 w/ header v%d,
2494
- >14 beshort =1 single song,
2495
- >14 beshort >1 %d songs,
2496
- >16 beshort >0 default song: %d
2497
- >0x16 string >\0 name: "%s"
2498
- >0x36 string >\0 author: "%s"
2499
- >0x56 string >\0 copyright: "%s"
2500
-
2501
- 0 string RSID RSID sidtune PlaySID compatible
2502
- >4 beshort >0 w/ header v%d,
2503
- >14 beshort =1 single song,
2504
- >14 beshort >1 %d songs,
2505
- >16 beshort >0 default song: %d
2506
- >0x16 string >\0 name: "%s"
2507
- >0x36 string >\0 author: "%s"
2508
- >0x56 string >\0 copyright: "%s"
2509
-
2510
- # IRCAM <mpruett@sgi.com>
2511
- # VAX and MIPS files are little-endian; Sun and NeXT are big-endian
2512
- 0 belong 0x64a30100 IRCAM file (VAX)
2513
- 0 belong 0x64a30200 IRCAM file (Sun)
2514
- 0 belong 0x64a30300 IRCAM file (MIPS little-endian)
2515
- 0 belong 0x64a30400 IRCAM file (NeXT)
2516
-
2517
- # NIST SPHERE <mpruett@sgi.com>
2518
- 0 string NIST_1A\n\ \ \ 1024\n NIST SPHERE file
2519
-
2520
- # Sample Vision <mpruett@sgi.com>
2521
- 0 string SOUND\ SAMPLE\ DATA\ Sample Vision file
2522
-
2523
- # Audio Visual Research <tonigonenstein@users.sourceforge.net>
2524
- 0 string 2BIT Audio Visual Research file,
2525
- >12 beshort =0 mono,
2526
- >12 beshort =-1 stereo,
2527
- >14 beshort x %d bits
2528
- >16 beshort =0 unsigned,
2529
- >16 beshort =-1 signed,
2530
- >22 belong&0x00ffffff x %d Hz,
2531
- >18 beshort =0 no loop,
2532
- >18 beshort =-1 loop,
2533
- >21 ubyte <128 note %d,
2534
- >22 byte =0 replay 5.485 KHz
2535
- >22 byte =1 replay 8.084 KHz
2536
- >22 byte =2 replay 10.971 Khz
2537
- >22 byte =3 replay 16.168 Khz
2538
- >22 byte =4 replay 21.942 KHz
2539
- >22 byte =5 replay 32.336 KHz
2540
- >22 byte =6 replay 43.885 KHz
2541
- >22 byte =7 replay 47.261 KHz
2542
-
2543
- # SGI SoundTrack <mpruett@sgi.com>
2544
- 0 string _SGI_SoundTrack SGI SoundTrack project file
2545
- # ID3 version 2 tags <waschk@informatik.uni-rostock.de>
2546
- 0 string ID3 Audio file with ID3 version 2
2547
- >3 byte x \b.%d
2548
- >4 byte x \b.%d
2549
- >>5 byte &0x80 \b, unsynchronized frames
2550
- >>5 byte &0x40 \b, extended header
2551
- >>5 byte &0x20 \b, experimental
2552
- >>5 byte &0x10 \b, footer present
2553
- >(6.I) indirect x \b, contains:
2554
-
2555
- # NSF (NES sound file) magic
2556
- 0 string NESM\x1a NES Sound File
2557
- >14 string >\0 ("%s" by
2558
- >46 string >\0 %s, copyright
2559
- >78 string >\0 %s),
2560
- >5 byte x version %d,
2561
- >6 byte x %d tracks,
2562
- >122 byte&0x2 =1 dual PAL/NTSC
2563
- >122 byte&0x1 =1 PAL
2564
- >122 byte&0x1 =0 NTSC
2565
-
2566
- # Type: SNES SPC700 sound files
2567
- # From: Josh Triplett <josh@freedesktop.org>
2568
- 0 string SNES-SPC700\ Sound\ File\ Data\ v SNES SPC700 sound file
2569
- >&0 string 0.30 \b, version %s
2570
- >>0x23 byte 0x1B \b, without ID666 tag
2571
- >>0x23 byte 0x1A \b, with ID666 tag
2572
- >>>0x2E string >\0 \b, song "%.32s"
2573
- >>>0x4E string >\0 \b, game "%.32s"
2574
-
2575
- # Impulse tracker module (audio/x-it)
2576
- 0 string IMPM Impulse Tracker module sound data -
2577
- !:mime audio/x-mod
2578
- >4 string >\0 "%s"
2579
- >40 leshort !0 compatible w/ITv%x
2580
- >42 leshort !0 created w/ITv%x
2581
-
2582
- # Imago Orpheus module (audio/x-imf)
2583
- 60 string IM10 Imago Orpheus module sound data -
2584
- >0 string >\0 "%s"
2585
-
2586
- # From <collver1@attbi.com>
2587
- # These are the /etc/magic entries to decode modules, instruments, and
2588
- # samples in Impulse Tracker's native format.
2589
-
2590
- 0 string IMPS Impulse Tracker Sample
2591
- >18 byte &2 16 bit
2592
- >18 byte ^2 8 bit
2593
- >18 byte &4 stereo
2594
- >18 byte ^4 mono
2595
- 0 string IMPI Impulse Tracker Instrument
2596
- >28 leshort !0 ITv%x
2597
- >30 byte !0 %d samples
2598
-
2599
- # Yamaha TX Wave: file(1) magic for Yamaha TX Wave audio files
2600
- # From <collver1@attbi.com>
2601
- 0 string LM8953 Yamaha TX Wave
2602
- >22 byte 0x49 looped
2603
- >22 byte 0xC9 non-looped
2604
- >23 byte 1 33kHz
2605
- >23 byte 2 50kHz
2606
- >23 byte 3 16kHz
2607
-
2608
- # scream tracker: file(1) magic for Scream Tracker sample files
2609
- #
2610
- # From <collver1@attbi.com>
2611
- 76 string SCRS Scream Tracker Sample
2612
- >0 byte 1 sample
2613
- >0 byte 2 adlib melody
2614
- >0 byte >2 adlib drum
2615
- >31 byte &2 stereo
2616
- >31 byte ^2 mono
2617
- >31 byte &4 16bit little endian
2618
- >31 byte ^4 8bit
2619
- >30 byte 0 unpacked
2620
- >30 byte 1 packed
2621
-
2622
- # audio
2623
- # From: Cory Dikkers <cdikkers@swbell.net>
2624
- 0 string MMD0 MED music file, version 0
2625
- 0 string MMD1 OctaMED Pro music file, version 1
2626
- 0 string MMD3 OctaMED Soundstudio music file, version 3
2627
- 0 string OctaMEDCmpr OctaMED Soundstudio compressed file
2628
- 0 string MED MED_Song
2629
- 0 string SymM Symphonie SymMOD music file
2630
- #
2631
- 0 string THX AHX version
2632
- >3 byte =0 1 module data
2633
- >3 byte =1 2 module data
2634
- #
2635
- 0 string OKTASONG Oktalyzer module data
2636
- #
2637
- 0 string DIGI\ Booster\ module\0 %s
2638
- >20 byte >0 %c
2639
- >>21 byte >0 \b%c
2640
- >>>22 byte >0 \b%c
2641
- >>>>23 byte >0 \b%c
2642
- >610 string >\0 \b, "%s"
2643
- #
2644
- 0 string DBM0 DIGI Booster Pro Module
2645
- >4 byte >0 V%X.
2646
- >>5 byte x \b%02X
2647
- >16 string >\0 \b, "%s"
2648
- #
2649
- 0 string FTMN FaceTheMusic module
2650
- >16 string >\0d \b, "%s"
2651
-
2652
- # From: <doj@cubic.org> 2003-06-24
2653
- 0 string AMShdr\32 Velvet Studio AMS Module v2.2
2654
- 0 string Extreme Extreme Tracker AMS Module v1.3
2655
- 0 string DDMF Xtracker DMF Module
2656
- >4 byte x v%i
2657
- >0xD string >\0 Title: "%s"
2658
- >0x2B string >\0 Composer: "%s"
2659
- 0 string DSM\32 Dynamic Studio Module DSM
2660
- 0 string SONG DigiTrekker DTM Module
2661
- 0 string DMDL DigiTrakker MDL Module
2662
- 0 string PSM\32 Protracker Studio PSM Module
2663
- 44 string PTMF Poly Tracker PTM Module
2664
- >0 string >\32 Title: "%s"
2665
- 0 string MT20 MadTracker 2.0 Module MT2
2666
- 0 string RAD\40by\40REALiTY!! RAD Adlib Tracker Module RAD
2667
- 0 string RTMM RTM Module
2668
- 0x426 string MaDoKaN96 XMS Adlib Module
2669
- >0 string >\0 Composer: "%s"
2670
- 0 string AMF AMF Module
2671
- >4 string >\0 Title: "%s"
2672
- 0 string MODINFO1 Open Cubic Player Module Inforation MDZ
2673
- 0 string Extended\40Instrument: Fast Tracker II Instrument
2674
-
2675
- # From: Takeshi Hamasaki <hma@syd.odn.ne.jp>
2676
- # NOA Nancy Codec file
2677
- 0 string \210NOA\015\012\032 NOA Nancy Codec Movie file
2678
- # Yamaha SMAF format
2679
- 0 string MMMD Yamaha SMAF file
2680
- # Sharp Jisaku Melody format for PDC
2681
- 0 string \001Sharp\040JisakuMelody SHARP Cell-Phone ringing Melody
2682
- >20 string Ver01.00 Ver. 1.00
2683
- >>32 byte x , %d tracks
2684
-
2685
- # Free lossless audio codec <http://flac.sourceforge.net>
2686
- # From: Przemyslaw Augustyniak <silvathraec@rpg.pl>
2687
- 0 string fLaC FLAC audio bitstream data
2688
- !:mime audio/x-flac
2689
- >4 byte&0x7f >0 \b, unknown version
2690
- >4 byte&0x7f 0 \b
2691
- # some common bits/sample values
2692
- >>20 beshort&0x1f0 0x030 \b, 4 bit
2693
- >>20 beshort&0x1f0 0x050 \b, 6 bit
2694
- >>20 beshort&0x1f0 0x070 \b, 8 bit
2695
- >>20 beshort&0x1f0 0x0b0 \b, 12 bit
2696
- >>20 beshort&0x1f0 0x0f0 \b, 16 bit
2697
- >>20 beshort&0x1f0 0x170 \b, 24 bit
2698
- >>20 byte&0xe 0x0 \b, mono
2699
- >>20 byte&0xe 0x2 \b, stereo
2700
- >>20 byte&0xe 0x4 \b, 3 channels
2701
- >>20 byte&0xe 0x6 \b, 4 channels
2702
- >>20 byte&0xe 0x8 \b, 5 channels
2703
- >>20 byte&0xe 0xa \b, 6 channels
2704
- >>20 byte&0xe 0xc \b, 7 channels
2705
- >>20 byte&0xe 0xe \b, 8 channels
2706
- # some common sample rates
2707
- >>17 belong&0xfffff0 0x0ac440 \b, 44.1 kHz
2708
- >>17 belong&0xfffff0 0x0bb800 \b, 48 kHz
2709
- >>17 belong&0xfffff0 0x07d000 \b, 32 kHz
2710
- >>17 belong&0xfffff0 0x056220 \b, 22.05 kHz
2711
- >>17 belong&0xfffff0 0x05dc00 \b, 24 kHz
2712
- >>17 belong&0xfffff0 0x03e800 \b, 16 kHz
2713
- >>17 belong&0xfffff0 0x02b110 \b, 11.025 kHz
2714
- >>17 belong&0xfffff0 0x02ee00 \b, 12 kHz
2715
- >>17 belong&0xfffff0 0x01f400 \b, 8 kHz
2716
- >>17 belong&0xfffff0 0x177000 \b, 96 kHz
2717
- >>17 belong&0xfffff0 0x0fa000 \b, 64 kHz
2718
- >>21 byte&0xf >0 \b, >4G samples
2719
- >>21 byte&0xf 0 \b
2720
- >>>22 belong >0 \b, %u samples
2721
- >>>22 belong 0 \b, length unknown
2722
-
2723
- # (ISDN) VBOX voice message file (Wolfram Kleff)
2724
- 0 string VBOX VBOX voice message data
2725
-
2726
- # ReBorn Song Files (.rbs)
2727
- # David J. Singer <doc@deadvirgins.org.uk>
2728
- 8 string RB40 RBS Song file
2729
- >29 string ReBorn created by ReBorn
2730
- >37 string Propellerhead created by ReBirth
2731
-
2732
- # Synthesizer Generator and Kimwitu share their file format
2733
- 0 string A#S#C#S#S#L#V#3 Synthesizer Generator or Kimwitu data
2734
- # Kimwitu++ uses a slightly different magic
2735
- 0 string A#S#C#S#S#L#HUB Kimwitu++ data
2736
-
2737
- # From "Simon Hosie
2738
- 0 string TFMX-SONG TFMX module sound data
2739
-
2740
- # Monkey's Audio compressed audio format (.ape)
2741
- # From danny.milo@gmx.net (Danny Milosavljevic)
2742
- # New version from Abel Cheung <abel (@) oaka.org>
2743
- 0 string MAC\040 Monkey's Audio compressed format
2744
- >4 uleshort >0x0F8B version %d
2745
- >>(0x08.l) uleshort =1000 with fast compression
2746
- >>(0x08.l) uleshort =2000 with normal compression
2747
- >>(0x08.l) uleshort =3000 with high compression
2748
- >>(0x08.l) uleshort =4000 with extra high compression
2749
- >>(0x08.l) uleshort =5000 with insane compression
2750
- >>(0x08.l+18) uleshort =1 \b, mono
2751
- >>(0x08.l+18) uleshort =2 \b, stereo
2752
- >>(0x08.l+20) ulelong x \b, sample rate %d
2753
- >4 uleshort <0x0F8C version %d
2754
- >>6 uleshort =1000 with fast compression
2755
- >>6 uleshort =2000 with normal compression
2756
- >>6 uleshort =3000 with high compression
2757
- >>6 uleshort =4000 with extra high compression
2758
- >>6 uleshort =5000 with insane compression
2759
- >>10 uleshort =1 \b, mono
2760
- >>10 uleshort =2 \b, stereo
2761
- >>12 ulelong x \b, sample rate %d
2762
-
2763
- # adlib sound files
2764
- # From Gürkan Sengün <gurkan@linuks.mine.nu>, http://www.linuks.mine.nu
2765
- 0 string RAWADATA RdosPlay RAW
2766
-
2767
- 1068 string RoR AMUSIC Adlib Tracker
2768
-
2769
- 0 string JCH EdLib
2770
-
2771
- 0 string mpu401tr MPU-401 Trakker
2772
-
2773
- 0 string SAdT Surprise! Adlib Tracker
2774
- >4 byte x Version %d
2775
-
2776
- 0 string XAD! eXotic ADlib
2777
-
2778
- 0 string ofTAZ! eXtra Simple Music
2779
-
2780
- # Spectrum 128 tunes (.ay files).
2781
- # From: Emanuel Haupt <ehaupt@critical.ch>
2782
- 0 string ZXAYEMUL Spectrum 128 tune
2783
-
2784
- 0 string \0BONK BONK,
2785
- #>5 byte x version %d
2786
- >14 byte x %d channel(s),
2787
- >15 byte =1 lossless,
2788
- >15 byte =0 lossy,
2789
- >16 byte x mid-side
2790
-
2791
- 384 string LockStream LockStream Embedded file (mostly MP3 on old Nokia phones)
2792
-
2793
- # format VQF (proprietary codec for sound)
2794
- # some infos on the header file available at :
2795
- # http://www.twinvq.org/english/technology_format.html
2796
- 0 string TWIN97012000 VQF data
2797
- >27 short 0 \b, Mono
2798
- >27 short 1 \b, Stereo
2799
- >31 short >0 \b, %d kbit/s
2800
- >35 short >0 \b, %d kHz
2801
-
2802
- # Nelson A. de Oliveira (naoliv@gmail.com)
2803
- # .eqf
2804
- 0 string Winamp\ EQ\ library\ file %s
2805
- # it will match only versions like v<digit>.<digit>
2806
- # Since I saw only eqf files with version v1.1 I think that it's OK
2807
- >23 string x \b%.4s
2808
- # .preset
2809
- 0 string [Equalizer\ preset] XMMS equalizer preset
2810
- # .m3u
2811
- 0 search/1 #EXTM3U M3U playlist text
2812
- # .pls
2813
- 0 search/1 [playlist] PLS playlist text
2814
- # licq.conf
2815
- 1 string [licq] LICQ configuration file
2816
-
2817
- # Atari ST audio files by Dirk Jagdmann <doj@cubic.org>
2818
- 0 string ICE! SNDH Atari ST music
2819
- 0 string SC68\ Music-file\ /\ (c)\ (BeN)jami sc68 Atari ST music
2820
-
2821
- # musepak support From: "Jiri Pejchal" <jiri.pejchal@gmail.com>
2822
- 0 string MP+ Musepack audio
2823
- >3 byte 255 \b, SV pre8
2824
- >3 byte&0xF 0x6 \b, SV 6
2825
- >3 byte&0xF 0x8 \b, SV 8
2826
- >3 byte&0xF 0x7 \b, SV 7
2827
- >>3 byte&0xF0 0x0 \b.0
2828
- >>3 byte&0xF0 0x10 \b.1
2829
- >>3 byte&0xF0 240 \b.15
2830
- >>10 byte&0xF0 0x0 \b, no profile
2831
- >>10 byte&0xF0 0x10 \b, profile 'Unstable/Experimental'
2832
- >>10 byte&0xF0 0x50 \b, quality 0
2833
- >>10 byte&0xF0 0x60 \b, quality 1
2834
- >>10 byte&0xF0 0x70 \b, quality 2 (Telephone)
2835
- >>10 byte&0xF0 0x80 \b, quality 3 (Thumb)
2836
- >>10 byte&0xF0 0x90 \b, quality 4 (Radio)
2837
- >>10 byte&0xF0 0xA0 \b, quality 5 (Standard)
2838
- >>10 byte&0xF0 0xB0 \b, quality 6 (Xtreme)
2839
- >>10 byte&0xF0 0xC0 \b, quality 7 (Insane)
2840
- >>10 byte&0xF0 0xD0 \b, quality 8 (BrainDead)
2841
- >>10 byte&0xF0 0xE0 \b, quality 9
2842
- >>10 byte&0xF0 0xF0 \b, quality 10
2843
- >>27 byte 0x0 \b, Buschmann 1.7.0-9, Klemm 0.90-1.05
2844
- >>27 byte 102 \b, Beta 1.02
2845
- >>27 byte 104 \b, Beta 1.04
2846
- >>27 byte 105 \b, Alpha 1.05
2847
- >>27 byte 106 \b, Beta 1.06
2848
- >>27 byte 110 \b, Release 1.1
2849
- >>27 byte 111 \b, Alpha 1.11
2850
- >>27 byte 112 \b, Beta 1.12
2851
- >>27 byte 113 \b, Alpha 1.13
2852
- >>27 byte 114 \b, Beta 1.14
2853
- >>27 byte 115 \b, Alpha 1.15
2854
-
2855
- # IMY
2856
- # from http://filext.com/detaillist.php?extdetail=IMY
2857
- # http://cellphones.about.com/od/cellularfaqs/f/rf_imelody.htm
2858
- # http://download.ncl.ie/doc/api/ie/ncl/media/music/IMelody.html
2859
- # http://www.wx800.com/msg/download/irda/iMelody.pdf
2860
- 0 string BEGIN:IMELODY iMelody Ringtone Format
2861
-
2862
- # From: "Mateus Caruccio" <mateus@caruccio.com>
2863
- # guitar pro v3,4,5 from http://filext.com/file-extension/gp3
2864
- 0 string \030FICHIER\ GUITAR\ PRO\ v3. Guitar Pro Ver. 3 Tablature
2865
-
2866
- # From: "Leslie P. Polzer" <leslie.polzer@gmx.net>
2867
- 60 string SONG SoundFX Module sound file
2868
-
2869
- # Type: Adaptive Multi-Rate Codec
2870
- # URL: http://filext.com/detaillist.php?extdetail=AMR
2871
- # From: Russell Coker <russell@coker.com.au>
2872
- 0 string #!AMR Adaptive Multi-Rate Codec (GSM telephony)
2873
-
2874
- # Type: SuperCollider 3 Synth Definition File Format
2875
- # From: Mario Lang <mlang@debian.org>
2876
- 0 string SCgf SuperCollider3 Synth Definition file,
2877
- >4 belong x version %d
2878
- #----------------------------------------------------------------
2879
- # basis: file(1) magic for BBx/Pro5-files
2880
- # Oliver Dammer <dammer@olida.de> 2005/11/07
2881
- # http://www.basis.com business-basic-files.
2882
- #
2883
- 0 string \074\074bbx\076\076 BBx
2884
- >7 string \000 indexed file
2885
- >7 string \001 serial file
2886
- >7 string \002 keyed file
2887
- >>13 short 0 (sort)
2888
- >7 string \004 program
2889
- >>18 byte x (LEVEL %d)
2890
- >>>23 string >\000 psaved
2891
- >7 string \006 mkeyed file
2892
- >>13 short 0 (sort)
2893
- >>8 string \000 (mkey)
2894
- #------------------------------------------------------------------------------
2895
- # bFLT: file(1) magic for BFLT uclinux binary files
2896
- #
2897
- # From Philippe De Muyter <phdm@macqel.be>
2898
- #
2899
- 0 string bFLT BFLT executable
2900
- >4 belong x - version %ld
2901
- >4 belong 4
2902
- >>36 belong&0x1 0x1 ram
2903
- >>36 belong&0x2 0x2 gotpic
2904
- >>36 belong&0x4 0x4 gzip
2905
- >>36 belong&0x8 0x8 gzdata
2906
- #------------------------------------------------------------------------------
2907
- # blender: file(1) magic for Blender 3D related files
2908
- #
2909
- # Native format rule v1.2. For questions use the developers list
2910
- # http://lists.blender.org/mailman/listinfo/bf-committers
2911
- # GLOB chunk was moved near start and provides subversion info since 2.42
2912
-
2913
- 0 string =BLENDER Blender3D,
2914
- >7 string =_ saved as 32-bits
2915
- >>8 string =v little endian
2916
- >>>9 byte x with version %c.
2917
- >>>10 byte x \b%c
2918
- >>>11 byte x \b%c
2919
- >>>0x40 string =GLOB \b.
2920
- >>>>0x58 leshort x \b%.4d
2921
- >>8 string =V big endian
2922
- >>>9 byte x with version %c.
2923
- >>>10 byte x \b%c
2924
- >>>11 byte x \b%c
2925
- >>>0x40 string =GLOB \b.
2926
- >>>>0x58 beshort x \b%.4d
2927
- >7 string =- saved as 64-bits
2928
- >>8 string =v little endian
2929
- >>9 byte x with version %c.
2930
- >>10 byte x \b%c
2931
- >>11 byte x \b%c
2932
- >>0x44 string =GLOB \b.
2933
- >>>0x60 leshort x \b%.4d
2934
- >>8 string =V big endian
2935
- >>>9 byte x with version %c.
2936
- >>>10 byte x \b%c
2937
- >>>11 byte x \b%c
2938
- >>>0x44 string =GLOB \b.
2939
- >>>>0x60 beshort x \b%.4d
2940
-
2941
- # Scripts that run in the embeded Python interpreter
2942
- 0 string #!BPY Blender3D BPython script
2943
-
2944
- #------------------------------------------------------------------------------
2945
- # blit: file(1) magic for 68K Blit stuff as seen from 680x0 machine
2946
- #
2947
- # Note that this 0407 conflicts with several other a.out formats...
2948
- #
2949
- # XXX - should this be redone with "be" and "le", so that it works on
2950
- # little-endian machines as well? If so, what's the deal with
2951
- # "VAX-order" and "VAX-order2"?
2952
- #
2953
- #0 long 0407 68K Blit (standalone) executable
2954
- #0 short 0407 VAX-order2 68K Blit (standalone) executable
2955
- 0 short 03401 VAX-order 68K Blit (standalone) executable
2956
- 0 long 0406 68k Blit mpx/mux executable
2957
- 0 short 0406 VAX-order2 68k Blit mpx/mux executable
2958
- 0 short 03001 VAX-order 68k Blit mpx/mux executable
2959
- # Need more values for WE32 DMD executables.
2960
- # Note that 0520 is the same as COFF
2961
- #0 short 0520 tty630 layers executable
2962
- #
2963
- # i80960 b.out objects and archives
2964
- #
2965
- 0 long 0x10d i960 b.out relocatable object
2966
- >16 long >0 not stripped
2967
- #
2968
- # b.out archive (hp-rt on i960)
2969
- 0 string =!<bout> b.out archive
2970
- >8 string __.SYMDEF random library
2971
- #------------------------------------------------------------------------------
2972
- # bsdi: file(1) magic for BSD/OS (from BSDI) objects
2973
- #
2974
-
2975
- 0 lelong 0314 386 compact demand paged pure executable
2976
- >16 lelong >0 not stripped
2977
- >32 byte 0x6a (uses shared libs)
2978
-
2979
- 0 lelong 0407 386 executable
2980
- >16 lelong >0 not stripped
2981
- >32 byte 0x6a (uses shared libs)
2982
-
2983
- 0 lelong 0410 386 pure executable
2984
- >16 lelong >0 not stripped
2985
- >32 byte 0x6a (uses shared libs)
2986
-
2987
- 0 lelong 0413 386 demand paged pure executable
2988
- >16 lelong >0 not stripped
2989
- >32 byte 0x6a (uses shared libs)
2990
-
2991
- # same as in SunOS 4.x, except for static shared libraries
2992
- 0 belong&077777777 0600413 sparc demand paged
2993
- >0 byte &0x80
2994
- >>20 belong <4096 shared library
2995
- >>20 belong =4096 dynamically linked executable
2996
- >>20 belong >4096 dynamically linked executable
2997
- >0 byte ^0x80 executable
2998
- >16 belong >0 not stripped
2999
- >36 belong 0xb4100001 (uses shared libs)
3000
-
3001
- 0 belong&077777777 0600410 sparc pure
3002
- >0 byte &0x80 dynamically linked executable
3003
- >0 byte ^0x80 executable
3004
- >16 belong >0 not stripped
3005
- >36 belong 0xb4100001 (uses shared libs)
3006
-
3007
- 0 belong&077777777 0600407 sparc
3008
- >0 byte &0x80 dynamically linked executable
3009
- >0 byte ^0x80 executable
3010
- >16 belong >0 not stripped
3011
- >36 belong 0xb4100001 (uses shared libs)
3012
- #------------------------------------------------------------------------------
3013
- # BTSnoop: file(1) magic for BTSnoop files
3014
- #
3015
- # From <marcel@holtmann.org>
3016
- 0 string btsnoop\0 BTSnoop
3017
- >8 belong x version %d,
3018
- >12 belong 1001 Unencapsulated HCI
3019
- >12 belong 1002 HCI UART (H4)
3020
- >12 belong 1003 HCI BCSP
3021
- >12 belong 1004 HCI Serial (H5)
3022
- >>12 belong x type %d
3023
- #------------------------------------------------------------------------------
3024
- # c-lang: file(1) magic for C programs (or REXX)
3025
- #
3026
-
3027
- # XPM icons (Greg Roelofs, newt@uchicago.edu)
3028
- # if you uncomment "/*" for C/REXX below, also uncomment this entry
3029
- #0 string /*\ XPM\ */ X pixmap image data
3030
- #!:mime image/x-xpmi
3031
-
3032
- # 3DS (3d Studio files) Conflicts with diff output 0x3d '='
3033
- #16 beshort 0x3d3d image/x-3ds
3034
-
3035
- # this first will upset you if you're a PL/1 shop...
3036
- # in which case rm it; ascmagic will catch real C programs
3037
- #0 search/1 /* C or REXX program text
3038
- #0 search/1 // C++ program text
3039
-
3040
- # From: Mikhail Teterin <mi@aldan.algebra.com>
3041
- 0 string cscope cscope reference data
3042
- >7 string x version %.2s
3043
- # We skip the path here, because it is often long (so file will
3044
- # truncate it) and mostly redundant.
3045
- # The inverted index functionality was added some time betwen
3046
- # versions 11 and 15, so look for -q if version is above 14:
3047
- >7 string >14
3048
- >>10 search/100 \ -q\ with inverted index
3049
- >10 search/100 \ -c\ text (non-compressed)
3050
- #------------------------------------------------------------------------------
3051
- # c64: file(1) magic for various commodore 64 related files
3052
- #
3053
- # From: Dirk Jagdmann <doj@cubic.org>
3054
-
3055
- 0x16500 belong 0x12014100 D64 Image
3056
- 0x16500 belong 0x12014180 D71 Image
3057
- 0x61800 belong 0x28034400 D81 Image
3058
- 0 string C64\40CARTRIDGE CCS C64 Emultar Cartridge Image
3059
- 0 belong 0x43154164 X64 Image
3060
-
3061
- 0 string GCR-1541 GCR Image
3062
- >8 byte x version: %i
3063
- >9 byte x tracks: %i
3064
-
3065
- 9 string PSUR ARC archive (c64)
3066
- 2 string -LH1- LHA archive (c64)
3067
-
3068
- 0 string C64File PC64 Emulator file
3069
- >8 string >\0 "%s"
3070
- 0 string C64Image PC64 Freezer Image
3071
-
3072
- 0 beshort 0x38CD C64 PCLink Image
3073
- 0 string CBM\144\0\0 Power 64 C64 Emulator Snapshot
3074
-
3075
- 0 belong 0xFF424CFF WRAptor packer (c64)
3076
-
3077
- 0 string C64S\x20tape\x20file T64 tape Image
3078
- >32 leshort x Version:0x%x
3079
- >36 leshort !0 Entries:%i
3080
- >40 string x Name:%.24s
3081
-
3082
- 0 string C64\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 T64 tape Image
3083
- >32 leshort x Version:0x%x
3084
- >36 leshort !0 Entries:%i
3085
- >40 string x Name:%.24s
3086
-
3087
- 0 string C64S\x20tape\x20image\x20file\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0 T64 tape Image
3088
- >32 leshort x Version:0x%x
3089
- >36 leshort !0 Entries:%i
3090
- >40 string x Name:%.24s
3091
-
3092
- #------------------------------------------------------------------------------
3093
- # autocad: file(1) magic for cad files
3094
- #
3095
-
3096
- # AutoCAD DWG versions R13/R14 (www.autodesk.com)
3097
- # Written December 01, 2003 by Lester Hightower
3098
- # Based on the DWG File Format Specifications at http://www.opendwg.org/
3099
- 0 string \101\103\061\060\061 AutoCAD
3100
- >5 string \062\000\000\000\000 DWG ver. R13
3101
- >5 string \064\000\000\000\000 DWG ver. R14
3102
-
3103
- # Microstation DGN/CIT Files (www.bentley.com)
3104
- # Last updated July 29, 2005 by Lester Hightower
3105
- # DGN is the default file extension of Microstation/Intergraph CAD files.
3106
- # CIT is the proprietary raster format (similar to TIFF) used to attach
3107
- # raster underlays to Microstation DGN (vector) drawings.
3108
- #
3109
- # http://www.wotsit.org/search.asp
3110
- # http://filext.com/detaillist.php?extdetail=DGN
3111
- # http://filext.com/detaillist.php?extdetail=CIT
3112
- #
3113
- # http://www.bentley.com/products/default.cfm?objectid=97F351F5-9C35-4E5E-89C2
3114
- # 3F86C928&method=display&p_objectid=97F351F5-9C35-4E5E-89C280A93F86C928
3115
- # http://www.bentley.com/products/default.cfm?objectid=A5C2FD43-3AC9-4C71-B682
3116
- # 721C479F&method=display&p_objectid=A5C2FD43-3AC9-4C71-B682C7BE721C479F
3117
- 0 string \010\011\376 Microstation
3118
- >3 string \002
3119
- >>30 string \026\105 DGNFile
3120
- >>30 string \034\105 DGNFile
3121
- >>30 string \073\107 DGNFile
3122
- >>30 string \073\110 DGNFile
3123
- >>30 string \106\107 DGNFile
3124
- >>30 string \110\103 DGNFile
3125
- >>30 string \120\104 DGNFile
3126
- >>30 string \172\104 DGNFile
3127
- >>30 string \172\105 DGNFile
3128
- >>30 string \172\106 DGNFile
3129
- >>30 string \234\106 DGNFile
3130
- >>30 string \273\105 DGNFile
3131
- >>30 string \306\106 DGNFile
3132
- >>30 string \310\104 DGNFile
3133
- >>30 string \341\104 DGNFile
3134
- >>30 string \372\103 DGNFile
3135
- >>30 string \372\104 DGNFile
3136
- >>30 string \372\106 DGNFile
3137
- >>30 string \376\103 DGNFile
3138
- >4 string \030\000\000 CITFile
3139
- >4 string \030\000\003 CITFile
3140
-
3141
- # AutoCad, from Nahuel Greco
3142
- # AutoCAD DWG versions R12/R13/R14 (www.autodesk.com)
3143
- 0 string AC1012 AutoCad (release 12)
3144
- 0 string AC1013 AutoCad (release 13)
3145
- 0 string AC1014 AutoCad (release 14)
3146
-
3147
- # CAD: file(1) magic for computer aided design files
3148
- # Phillip Griffith <phillip dot griffith at gmail dot com>
3149
- # AutoCAD magic taken from the Open Design Alliance's OpenDWG specifications.
3150
- #
3151
- 0 belong 0x08051700 Bentley/Intergraph MicroStation DGN cell library
3152
- 0 belong 0x0809fe02 Bentley/Intergraph MicroStation DGN vector CAD
3153
- 0 belong 0xc809fe02 Bentley/Intergraph MicroStation DGN vector CAD
3154
- 0 beshort 0x0809 Bentley/Intergraph MicroStation
3155
- >0x02 byte 0xfe
3156
- >>0x04 beshort 0x1800 CIT raster CAD
3157
- 0 string AC1012 AutoDesk AutoCAD R13
3158
- 0 string AC1014 AutoDesk AutoCAD R14
3159
- 0 string AC1015 AutoDesk AutoCAD R2000
3160
- #------------------------------------------------------------------------------
3161
- # Cafe Babes unite!
3162
- #
3163
- # Since Java bytecode and Mach-O fat-files have the same magic number, the test
3164
- # must be performed in the same "magic" sequence to get both right. The long
3165
- # at offset 4 in a mach-O fat file tells the number of architectures; the short at
3166
- # offset 4 in a Java bytecode file is the JVM minor version and the
3167
- # short at offset 6 is the JVM major version. Since there are only
3168
- # only 18 labeled Mach-O architectures at current, and the first released
3169
- # Java class format was version 43.0, we can safely choose any number
3170
- # between 18 and 39 to test the number of architectures against
3171
- # (and use as a hack). Let's not use 18, because the Mach-O people
3172
- # might add another one or two as time goes by...
3173
- #
3174
- 0 belong 0xcafebabe
3175
- !:mime application/x-java-applet
3176
- >4 belong >30 compiled Java class data,
3177
- >>6 beshort x version %d.
3178
- >>4 beshort x \b%d
3179
- # Which is which?
3180
- #>>4 belong 0x032d (Java 1.0)
3181
- #>>4 belong 0x032d (Java 1.1)
3182
- >>4 belong 0x002e (Java 1.2)
3183
- >>4 belong 0x002f (Java 1.3)
3184
- >>4 belong 0x0030 (Java 1.4)
3185
- >>4 belong 0x0031 (Java 1.5)
3186
- >>4 belong 0x0032 (Java 1.6)
3187
-
3188
-
3189
- 0 belong 0xcafebabe
3190
- >4 belong 1 Mach-O fat file with 1 architecture
3191
- >4 belong >1
3192
- >>4 belong <20 Mach-O fat file with %ld architectures
3193
-
3194
- 0 belong 0xcafed00d JAR compressed with pack200,
3195
- >>5 byte x version %d.
3196
- >>4 byte x \b%d
3197
- !:mime application/x-java-pack200
3198
- #------------------------------------------------------------------------------
3199
- # CDDB: file(1) magic for CDDB(tm) format CD text data files
3200
- #
3201
- # From <steve@gracenote.com>
3202
- #
3203
- # This is the /etc/magic entry to decode datafiles as used by
3204
- # CDDB-enabled CD player applications.
3205
- #
3206
-
3207
- 0 search/1/b #\040xmcd CDDB(tm) format CD text data
3208
-
3209
- #------------------------------------------------------------------------------
3210
- # chord: file(1) magic for Chord music sheet typesetting utility input files
3211
- #
3212
- # From Philippe De Muyter <phdm@macqel.be>
3213
- # File format is actually free, but many distributed files begin with `{title'
3214
- #
3215
- 0 string {title Chord text file
3216
-
3217
- # Type: PowerTab file format
3218
- # URL: http://www.power-tab.net/
3219
- # From: Jelmer Vernooij <jelmer@samba.org>
3220
- 0 string ptab\003\000 Power-Tab v3 Tablature File
3221
- 0 string ptab\004\000 Power-Tab v4 Tablature File
3222
- #------------------------------------------------------------------------------
3223
- # cisco: file(1) magic for cisco Systems routers
3224
- #
3225
- # Most cisco file-formats are covered by the generic elf code
3226
- #
3227
- # Microcode files are non-ELF, 0x8501 conflicts with NetBSD/alpha.
3228
- 0 belong&0xffffff00 0x85011400 cisco IOS microcode
3229
- >7 string >\0 for '%s'
3230
- 0 belong&0xffffff00 0x8501cb00 cisco IOS experimental microcode
3231
- >7 string >\0 for '%s'
3232
- #------------------------------------------------------------------------------
3233
- # citrus locale declaration
3234
- #
3235
-
3236
- 0 string RuneCT Citrus locale declaration for LC_CTYPE
3237
-
3238
-
3239
- #------------------------------------------------------------------------------
3240
- # clarion: file(1) magic for # Clarion Personal/Professional Developer
3241
- # (v2 and above)
3242
- # From: Julien Blache <jb@jblache.org>
3243
-
3244
- # Database files
3245
- # signature
3246
- 0 leshort 0x3343 Clarion Developer (v2 and above) data file
3247
- # attributes
3248
- >2 leshort &0x0001 \b, locked
3249
- >2 leshort &0x0004 \b, encrypted
3250
- >2 leshort &0x0008 \b, memo file exists
3251
- >2 leshort &0x0010 \b, compressed
3252
- >2 leshort &0x0040 \b, read only
3253
- # number of records
3254
- >5 lelong x \b, %ld records
3255
-
3256
- # Memo files
3257
- 0 leshort 0x334d Clarion Developer (v2 and above) memo data
3258
-
3259
- # Key/Index files
3260
- # No magic? :(
3261
-
3262
- # Help files
3263
- 0 leshort 0x49e0 Clarion Developer (v2 and above) help data
3264
-
3265
- #------------------------------------------------------------------------------
3266
- # claris: file(1) magic for claris
3267
- # "H. Nanosecond" <aldomel@ix.netcom.com>
3268
- # Claris Works a word processor, etc.
3269
- # Version 3.0
3270
-
3271
- # .pct claris works clip art files
3272
- #0000000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000 000
3273
- #*
3274
- #0001000 #010 250 377 377 377 377 000 213 000 230 000 021 002 377 014 000
3275
- #null to byte 1000 octal
3276
- 514 string \377\377\377\377\000 Claris clip art?
3277
- >0 string \0\0\0\0\0\0\0\0\0\0\0\0\0 yes.
3278
- 514 string \377\377\377\377\001 Claris clip art?
3279
- >0 string \0\0\0\0\0\0\0\0\0\0\0\0\0 yes.
3280
-
3281
- # Claris works files
3282
- # .cwk
3283
- 0 string \002\000\210\003\102\117\102\117\000\001\206 Claris works document
3284
- # .plt
3285
- 0 string \020\341\000\000\010\010 Claris Works pallete files .plt
3286
-
3287
- # .msp a dictionary file I am not sure about this I have only one .msp file
3288
- 0 string \002\271\262\000\040\002\000\164 Claris works dictionary
3289
-
3290
- # .usp are user dictionary bits
3291
- # I am not sure about a magic header:
3292
- #0000000 001 123 160 146 070 125 104 040 136 123 015 012 160 157 144 151
3293
- # soh S p f 8 U D sp ^ S cr nl p o d i
3294
- #0000020 141 164 162 151 163 164 040 136 123 015 012 144 151 166 040 043
3295
- # a t r i s t sp ^ S cr nl d i v sp #
3296
-
3297
- # .mth Thesaurus
3298
- # starts with \0 but no magic header
3299
-
3300
- # .chy Hyphenation file
3301
- # I am not sure: 000 210 034 000 000
3302
-
3303
- # other claris files
3304
- #./windows/claris/useng.ndx: data
3305
- #./windows/claris/xtndtran.l32: data
3306
- #./windows/claris/xtndtran.lst: data
3307
- #./windows/claris/clworks.lbl: data
3308
- #./windows/claris/clworks.prf: data
3309
- #./windows/claris/userd.spl: data
3310
-
3311
- #------------------------------------------------------------------------------
3312
- # clipper: file(1) magic for Intergraph (formerly Fairchild) Clipper.
3313
- #
3314
- # XXX - what byte order does the Clipper use?
3315
- #
3316
- # XXX - what's the "!" stuff:
3317
- #
3318
- # >18 short !074000,000000 C1 R1
3319
- # >18 short !074000,004000 C2 R1
3320
- # >18 short !074000,010000 C3 R1
3321
- # >18 short !074000,074000 TEST
3322
- #
3323
- # I shall assume it's ANDing the field with the first value and
3324
- # comparing it with the second, and rewrite it as:
3325
- #
3326
- # >18 short&074000 000000 C1 R1
3327
- # >18 short&074000 004000 C2 R1
3328
- # >18 short&074000 010000 C3 R1
3329
- # >18 short&074000 074000 TEST
3330
- #
3331
- # as SVR3.1's "file" doesn't support anything of the "!074000,000000"
3332
- # sort, nor does SunOS 4.x, so either it's something Intergraph added
3333
- # in CLIX, or something AT&T added in SVR3.2 or later, or something
3334
- # somebody else thought was a good idea; it's not documented in the
3335
- # man page for this version of "magic", nor does it appear to be
3336
- # implemented (at least not after I blew off the bogus code to turn
3337
- # old-style "&"s into new-style "&"s, which just didn't work at all).
3338
- #
3339
- 0 short 0575 CLIPPER COFF executable (VAX #)
3340
- >20 short 0407 (impure)
3341
- >20 short 0410 (5.2 compatible)
3342
- >20 short 0411 (pure)
3343
- >20 short 0413 (demand paged)
3344
- >20 short 0443 (target shared library)
3345
- >12 long >0 not stripped
3346
- >22 short >0 - version %ld
3347
- 0 short 0577 CLIPPER COFF executable
3348
- >18 short&074000 000000 C1 R1
3349
- >18 short&074000 004000 C2 R1
3350
- >18 short&074000 010000 C3 R1
3351
- >18 short&074000 074000 TEST
3352
- >20 short 0407 (impure)
3353
- >20 short 0410 (pure)
3354
- >20 short 0411 (separate I&D)
3355
- >20 short 0413 (paged)
3356
- >20 short 0443 (target shared library)
3357
- >12 long >0 not stripped
3358
- >22 short >0 - version %ld
3359
- >48 long&01 01 alignment trap enabled
3360
- >52 byte 1 -Ctnc
3361
- >52 byte 2 -Ctsw
3362
- >52 byte 3 -Ctpw
3363
- >52 byte 4 -Ctcb
3364
- >53 byte 1 -Cdnc
3365
- >53 byte 2 -Cdsw
3366
- >53 byte 3 -Cdpw
3367
- >53 byte 4 -Cdcb
3368
- >54 byte 1 -Csnc
3369
- >54 byte 2 -Cssw
3370
- >54 byte 3 -Cspw
3371
- >54 byte 4 -Cscb
3372
- 4 string pipe CLIPPER instruction trace
3373
- 4 string prof CLIPPER instruction profile
3374
-
3375
- #------------------------------------------------------------------------------
3376
- # commands: file(1) magic for various shells and interpreters
3377
- #
3378
- #0 string : shell archive or script for antique kernel text
3379
- 0 string/b #!\ /bin/sh POSIX shell script text executable
3380
- !:mime text/x-shellscript
3381
- 0 string/b #!\ /bin/csh C shell script text executable
3382
- !:mime text/x-shellscript
3383
- # korn shell magic, sent by George Wu, gwu@clyde.att.com
3384
- 0 string/b #!\ /bin/ksh Korn shell script text executable
3385
- !:mime text/x-shellscript
3386
- 0 string/b #!\ /bin/tcsh Tenex C shell script text executable
3387
- !:mime text/x-shellscript
3388
- 0 string/b #!\ /usr/bin/tcsh Tenex C shell script text executable
3389
- !:mime text/x-shellscript
3390
- 0 string/b #!\ /usr/local/tcsh Tenex C shell script text executable
3391
- !:mime text/x-shellscript
3392
- 0 string/b #!\ /usr/local/bin/tcsh Tenex C shell script text executable
3393
- !:mime text/x-shellscript
3394
-
3395
- #
3396
- # zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
3397
- 0 string/b #!\ /bin/zsh Paul Falstad's zsh script text executable
3398
- !:mime text/x-shellscript
3399
- 0 string/b #!\ /usr/bin/zsh Paul Falstad's zsh script text executable
3400
- !:mime text/x-shellscript
3401
- 0 string/b #!\ /usr/local/bin/zsh Paul Falstad's zsh script text executable
3402
- !:mime text/x-shellscript
3403
- 0 string/b #!\ /usr/local/bin/ash Neil Brown's ash script text executable
3404
- !:mime text/x-shellscript
3405
- 0 string/b #!\ /usr/local/bin/ae Neil Brown's ae script text executable
3406
- !:mime text/x-shellscript
3407
- 0 string/b #!\ /bin/nawk new awk script text executable
3408
- !:mime text/x-nawk
3409
- 0 string/b #!\ /usr/bin/nawk new awk script text executable
3410
- !:mime text/x-nawk
3411
- 0 string/b #!\ /usr/local/bin/nawk new awk script text executable
3412
- !:mime text/x-nawk
3413
- 0 string/b #!\ /bin/gawk GNU awk script text executable
3414
- !:mime text/x-gawk
3415
- 0 string/b #!\ /usr/bin/gawk GNU awk script text executable
3416
- !:mime text/x-gawk
3417
- 0 string/b #!\ /usr/local/bin/gawk GNU awk script text executable
3418
- !:mime text/x-gawk
3419
- #
3420
- 0 string/b #!\ /bin/awk awk script text executable
3421
- !:mime text/x-awk
3422
- 0 string/b #!\ /usr/bin/awk awk script text executable
3423
- !:mime text/x-awk
3424
- # update to distinguish from *.vcf files
3425
- # this is broken because postscript has /EBEGIN{ for example.
3426
- #0 search/Bb BEGIN { awk script text
3427
- 0 regex =^\\s*BEGIN\\s*[{] awk script text
3428
-
3429
- # AT&T Bell Labs' Plan 9 shell
3430
- 0 string/b #!\ /bin/rc Plan 9 rc shell script text executable
3431
-
3432
- # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
3433
- 0 string/b #!\ /bin/bash Bourne-Again shell script text executable
3434
- !:mime text/x-shellscript
3435
- 0 string/b #!\ /usr/bin/bash Bourne-Again shell script text executable
3436
- !:mime text/x-shellscript
3437
- 0 string/b #!\ /usr/local/bash Bourne-Again shell script text executable
3438
- !:mime text/x-shellscript
3439
- 0 string/b #!\ /usr/local/bin/bash Bourne-Again shell script text executable
3440
- !:mime text/x-shellscript
3441
-
3442
- # using env
3443
- 0 string #!/usr/bin/env a
3444
- >15 string >\0 %s script text executable
3445
- 0 string #!\ /usr/bin/env a
3446
- >16 string >\0 %s script text executable
3447
-
3448
- # PHP scripts
3449
- # Ulf Harnhammar <ulfh@update.uu.se>
3450
- 0 search/1/c =<?php PHP script text
3451
- !:mime text/x-php
3452
- 0 search/1 =<?\n PHP script text
3453
- !:mime text/x-php
3454
- 0 search/1 =<?\r PHP script text
3455
- !:mime text/x-php
3456
- 0 search/1/b #!\ /usr/local/bin/php PHP script text executable
3457
- !:mime text/x-php
3458
- 0 search/1/b #!\ /usr/bin/php PHP script text executable
3459
- !:mime text/x-php
3460
-
3461
- 0 string Zend\x00 PHP script Zend Optimizer data
3462
-
3463
- 0 string $! DCL command file
3464
-
3465
- # Type: Pdmenu
3466
- # URL: http://packages.debian.org/pdmenu
3467
- # From: Edward Betts <edward@debian.org>
3468
- 0 string #!/usr/bin/pdmenu Pdmenu configuration file text
3469
-
3470
- #----------------------------------------------------------------------------
3471
- # communication
3472
-
3473
- # TTCN is the Tree and Tabular Combined Notation described in ISO 9646-3.
3474
- # It is used for conformance testing of communication protocols.
3475
- # Added by W. Borgert <debacle@debian.org>.
3476
- 0 string $Suite TTCN Abstract Test Suite
3477
- >&1 string $SuiteId
3478
- >>&1 string >\n %s
3479
- >&2 string $SuiteId
3480
- >>&1 string >\n %s
3481
- >&3 string $SuiteId
3482
- >>&1 string >\n %s
3483
-
3484
- # MSC (message sequence charts) are a formal description technique,
3485
- # described in ITU-T Z.120, mainly used for communication protocols.
3486
- # Added by W. Borgert <debacle@debian.org>.
3487
- 0 string mscdocument Message Sequence Chart (document)
3488
- 0 string msc Message Sequence Chart (chart)
3489
- 0 string submsc Message Sequence Chart (subchart)
3490
-
3491
- #------------------------------------------------------------------------------
3492
- # compress: file(1) magic for pure-compression formats (no archives)
3493
- #
3494
- # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
3495
- #
3496
- # Formats for various forms of compressed data
3497
- # Formats for "compress" proper have been moved into "compress.c",
3498
- # because it tries to uncompress it to figure out what's inside.
3499
-
3500
- # standard unix compress
3501
- 0 string \037\235 compress'd data
3502
- !:mime application/x-compress
3503
- !:apple LZIVZIVU
3504
- >2 byte&0x80 >0 block compressed
3505
- >2 byte&0x1f x %d bits
3506
-
3507
- # gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
3508
- # Edited by Chris Chittleborough <cchittleborough@yahoo.com.au>, March 2002
3509
- # * Original filename is only at offset 10 if "extra field" absent
3510
- # * Produce shorter output - notably, only report compression methods
3511
- # other than 8 ("deflate", the only method defined in RFC 1952).
3512
- 0 string \037\213 gzip compressed data
3513
- !:mime application/x-gzip
3514
- >2 byte <8 \b, reserved method
3515
- >2 byte >8 \b, unknown method
3516
- >3 byte &0x01 \b, ASCII
3517
- >3 byte &0x02 \b, has CRC
3518
- >3 byte &0x04 \b, extra field
3519
- >3 byte&0xC =0x08
3520
- >>10 string x \b, was "%s"
3521
- >3 byte &0x10 \b, has comment
3522
- >9 byte =0x00 \b, from FAT filesystem (MS-DOS, OS/2, NT)
3523
- >9 byte =0x01 \b, from Amiga
3524
- >9 byte =0x02 \b, from VMS
3525
- >9 byte =0x03 \b, from Unix
3526
- >9 byte =0x04 \b, from VM/CMS
3527
- >9 byte =0x05 \b, from Atari
3528
- >9 byte =0x06 \b, from HPFS filesystem (OS/2, NT)
3529
- >9 byte =0x07 \b, from MacOS
3530
- >9 byte =0x08 \b, from Z-System
3531
- >9 byte =0x09 \b, from CP/M
3532
- >9 byte =0x0A \b, from TOPS/20
3533
- >9 byte =0x0B \b, from NTFS filesystem (NT)
3534
- >9 byte =0x0C \b, from QDOS
3535
- >9 byte =0x0D \b, from Acorn RISCOS
3536
- >3 byte &0x10 \b, comment
3537
- >3 byte &0x20 \b, encrypted
3538
- >4 ledate >0 \b, last modified: %s
3539
- >8 byte 2 \b, max compression
3540
- >8 byte 4 \b, max speed
3541
-
3542
- # packed data, Huffman (minimum redundancy) codes on a byte-by-byte basis
3543
- 0 string \037\036 packed data
3544
- !:mime application/octet-stream
3545
- >2 belong >1 \b, %d characters originally
3546
- >2 belong =1 \b, %d character originally
3547
- #
3548
- # This magic number is byte-order-independent.
3549
- 0 short 0x1f1f old packed data
3550
- !:mime application/octet-stream
3551
-
3552
- # XXX - why *two* entries for "compacted data", one of which is
3553
- # byte-order independent, and one of which is byte-order dependent?
3554
- #
3555
- 0 short 0x1fff compacted data
3556
- !:mime application/octet-stream
3557
- # This string is valid for SunOS (BE) and a matching "short" is listed
3558
- # in the Ultrix (LE) magic file.
3559
- 0 string \377\037 compacted data
3560
- !:mime application/octet-stream
3561
- 0 short 0145405 huf output
3562
- !:mime application/octet-stream
3563
-
3564
- # bzip2
3565
- 0 string BZh bzip2 compressed data
3566
- !:mime application/x-bzip2
3567
- >3 byte >47 \b, block size = %c00k
3568
-
3569
- # lzip
3570
- 0 string LZIP lzip compressed data
3571
- !:mime application/x-lzip
3572
- >4 byte x \b, version: %d
3573
-
3574
- # squeeze and crunch
3575
- # Michael Haardt <michael@cantor.informatik.rwth-aachen.de>
3576
- 0 beshort 0x76FF squeezed data,
3577
- >4 string x original name %s
3578
- 0 beshort 0x76FE crunched data,
3579
- >2 string x original name %s
3580
- 0 beshort 0x76FD LZH compressed data,
3581
- >2 string x original name %s
3582
-
3583
- # Freeze
3584
- 0 string \037\237 frozen file 2.1
3585
- 0 string \037\236 frozen file 1.0 (or gzip 0.5)
3586
-
3587
- # SCO compress -H (LZH)
3588
- 0 string \037\240 SCO compress -H (LZH) data
3589
-
3590
- # European GSM 06.10 is a provisional standard for full-rate speech
3591
- # transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse
3592
- # excitation/long term prediction) coding at 13 kbit/s.
3593
- #
3594
- # There's only a magic nibble (4 bits); that nibble repeats every 33
3595
- # bytes. This isn't suited for use, but maybe we can use it someday.
3596
- #
3597
- # This will cause very short GSM files to be declared as data and
3598
- # mismatches to be declared as data too!
3599
- #0 byte&0xF0 0xd0 data
3600
- #>33 byte&0xF0 0xd0
3601
- #>66 byte&0xF0 0xd0
3602
- #>99 byte&0xF0 0xd0
3603
- #>132 byte&0xF0 0xd0 GSM 06.10 compressed audio
3604
-
3605
- # bzip a block-sorting file compressor
3606
- # by Julian Seward <sewardj@cs.man.ac.uk> and others
3607
- #
3608
- #0 string BZ bzip compressed data
3609
- #>2 byte x \b, version: %c
3610
- #>3 string =1 \b, compression block size 100k
3611
- #>3 string =2 \b, compression block size 200k
3612
- #>3 string =3 \b, compression block size 300k
3613
- #>3 string =4 \b, compression block size 400k
3614
- #>3 string =5 \b, compression block size 500k
3615
- #>3 string =6 \b, compression block size 600k
3616
- #>3 string =7 \b, compression block size 700k
3617
- #>3 string =8 \b, compression block size 800k
3618
- #>3 string =9 \b, compression block size 900k
3619
-
3620
- # lzop from <markus.oberhumer@jk.uni-linz.ac.at>
3621
- 0 string \x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a lzop compressed data
3622
- >9 beshort <0x0940
3623
- >>9 byte&0xf0 =0x00 - version 0.
3624
- >>9 beshort&0x0fff x \b%03x,
3625
- >>13 byte 1 LZO1X-1,
3626
- >>13 byte 2 LZO1X-1(15),
3627
- >>13 byte 3 LZO1X-999,
3628
- ## >>22 bedate >0 last modified: %s,
3629
- >>14 byte =0x00 os: MS-DOS
3630
- >>14 byte =0x01 os: Amiga
3631
- >>14 byte =0x02 os: VMS
3632
- >>14 byte =0x03 os: Unix
3633
- >>14 byte =0x05 os: Atari
3634
- >>14 byte =0x06 os: OS/2
3635
- >>14 byte =0x07 os: MacOS
3636
- >>14 byte =0x0A os: Tops/20
3637
- >>14 byte =0x0B os: WinNT
3638
- >>14 byte =0x0E os: Win32
3639
- >9 beshort >0x0939
3640
- >>9 byte&0xf0 =0x00 - version 0.
3641
- >>9 byte&0xf0 =0x10 - version 1.
3642
- >>9 byte&0xf0 =0x20 - version 2.
3643
- >>9 beshort&0x0fff x \b%03x,
3644
- >>15 byte 1 LZO1X-1,
3645
- >>15 byte 2 LZO1X-1(15),
3646
- >>15 byte 3 LZO1X-999,
3647
- ## >>25 bedate >0 last modified: %s,
3648
- >>17 byte =0x00 os: MS-DOS
3649
- >>17 byte =0x01 os: Amiga
3650
- >>17 byte =0x02 os: VMS
3651
- >>17 byte =0x03 os: Unix
3652
- >>17 byte =0x05 os: Atari
3653
- >>17 byte =0x06 os: OS/2
3654
- >>17 byte =0x07 os: MacOS
3655
- >>17 byte =0x0A os: Tops/20
3656
- >>17 byte =0x0B os: WinNT
3657
- >>17 byte =0x0E os: Win32
3658
-
3659
- # 4.3BSD-Quasijarus Strong Compression
3660
- # http://minnie.tuhs.org/Quasijarus/compress.html
3661
- 0 string \037\241 Quasijarus strong compressed data
3662
-
3663
- # From: Cory Dikkers <cdikkers@swbell.net>
3664
- 0 string XPKF Amiga xpkf.library compressed data
3665
- 0 string PP11 Power Packer 1.1 compressed data
3666
- 0 string PP20 Power Packer 2.0 compressed data,
3667
- >4 belong 0x09090909 fast compression
3668
- >4 belong 0x090A0A0A mediocre compression
3669
- >4 belong 0x090A0B0B good compression
3670
- >4 belong 0x090A0C0C very good compression
3671
- >4 belong 0x090A0C0D best compression
3672
-
3673
- # 7-zip archiver, from Thomas Klausner (wiz@danbala.tuwien.ac.at)
3674
- # http://www.7-zip.org or DOC/7zFormat.txt
3675
- #
3676
- 0 string 7z\274\257\047\034 7-zip archive data,
3677
- >6 byte x version %d
3678
- >7 byte x \b.%d
3679
-
3680
- # Type: LZMA
3681
- # URL: http://www.7-zip.org/sdk.html
3682
- # From: Robert Millan <rmh@aybabtu.com> and Reuben Thomas <rrt@sc3d.org>
3683
- # Commented out because apparently not reliable (according to Debian
3684
- # bug #364260)
3685
- #0 string ]\000\000\200\000 LZMA compressed data
3686
-
3687
- # http://tukaani.org/xz/xz-file-format.txt
3688
- 0 ustring \xFD7zXZ\x00 xz compressed data
3689
- !:mime application/x-xz
3690
-
3691
- # AFX compressed files (Wolfram Kleff)
3692
- 2 string -afx- AFX compressed file data
3693
-
3694
- # Supplementary magic data for the file(1) command to support
3695
- # rzip(1). The format is described in magic(5).
3696
- #
3697
- # Copyright (C) 2003 by Andrew Tridgell. You may do whatever you want with
3698
- # this file.
3699
- #
3700
- 0 string RZIP rzip compressed data
3701
- >4 byte x - version %d
3702
- >5 byte x \b.%d
3703
- >6 belong x (%d bytes)
3704
-
3705
- # Type: XZ
3706
- # URL: http://tukaani.org/xz/
3707
- 0 string \xfd\x37\x7a\x58\x5a\x00 XZ compressed data
3708
- !:mime application/x-xz
3709
- #------------------------------------------------------------------------------
3710
- # Console game magic
3711
- # Toby Deshane <hac@shoelace.digivill.net>
3712
- # ines: file(1) magic for Marat's iNES Nintendo Entertainment System
3713
- # ROM dump format
3714
-
3715
- 0 string NES\032 iNES ROM dump,
3716
- >4 byte x %dx16k PRG
3717
- >5 byte x \b, %dx8k CHR
3718
- >6 byte&0x01 =0x1 \b, [Vert.]
3719
- >6 byte&0x01 =0x0 \b, [Horiz.]
3720
- >6 byte&0x02 =0x2 \b, [SRAM]
3721
- >6 byte&0x04 =0x4 \b, [Trainer]
3722
- >6 byte&0x04 =0x8 \b, [4-Scr]
3723
-
3724
- #------------------------------------------------------------------------------
3725
- # gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format
3726
- #
3727
- 0x104 belong 0xCEED6666 Gameboy ROM:
3728
- >0x134 string >\0 "%.16s"
3729
- >0x146 byte 0x03 \b,[SGB]
3730
- >0x147 byte 0x00 \b, [ROM ONLY]
3731
- >0x147 byte 0x01 \b, [ROM+MBC1]
3732
- >0x147 byte 0x02 \b, [ROM+MBC1+RAM]
3733
- >0x147 byte 0x03 \b, [ROM+MBC1+RAM+BATT]
3734
- >0x147 byte 0x05 \b, [ROM+MBC2]
3735
- >0x147 byte 0x06 \b, [ROM+MBC2+BATTERY]
3736
- >0x147 byte 0x08 \b, [ROM+RAM]
3737
- >0x147 byte 0x09 \b, [ROM+RAM+BATTERY]
3738
- >0x147 byte 0x0B \b, [ROM+MMM01]
3739
- >0x147 byte 0x0C \b, [ROM+MMM01+SRAM]
3740
- >0x147 byte 0x0D \b, [ROM+MMM01+SRAM+BATT]
3741
- >0x147 byte 0x0F \b, [ROM+MBC3+TIMER+BATT]
3742
- >0x147 byte 0x10 \b, [ROM+MBC3+TIMER+RAM+BATT]
3743
- >0x147 byte 0x11 \b, [ROM+MBC3]
3744
- >0x147 byte 0x12 \b, [ROM+MBC3+RAM]
3745
- >0x147 byte 0x13 \b, [ROM+MBC3+RAM+BATT]
3746
- >0x147 byte 0x19 \b, [ROM+MBC5]
3747
- >0x147 byte 0x1A \b, [ROM+MBC5+RAM]
3748
- >0x147 byte 0x1B \b, [ROM+MBC5+RAM+BATT]
3749
- >0x147 byte 0x1C \b, [ROM+MBC5+RUMBLE]
3750
- >0x147 byte 0x1D \b, [ROM+MBC5+RUMBLE+SRAM]
3751
- >0x147 byte 0x1E \b, [ROM+MBC5+RUMBLE+SRAM+BATT]
3752
- >0x147 byte 0x1F \b, [Pocket Camera]
3753
- >0x147 byte 0xFD \b, [Bandai TAMA5]
3754
- >0x147 byte 0xFE \b, [Hudson HuC-3]
3755
- >0x147 byte 0xFF \b, [Hudson HuC-1]
3756
-
3757
- >0x148 byte 0 \b, ROM: 256Kbit
3758
- >0x148 byte 1 \b, ROM: 512Kbit
3759
- >0x148 byte 2 \b, ROM: 1Mbit
3760
- >0x148 byte 3 \b, ROM: 2Mbit
3761
- >0x148 byte 4 \b, ROM: 4Mbit
3762
- >0x148 byte 5 \b, ROM: 8Mbit
3763
- >0x148 byte 6 \b, ROM: 16Mbit
3764
- >0x148 byte 0x52 \b, ROM: 9Mbit
3765
- >0x148 byte 0x53 \b, ROM: 10Mbit
3766
- >0x148 byte 0x54 \b, ROM: 12Mbit
3767
-
3768
- >0x149 byte 1 \b, RAM: 16Kbit
3769
- >0x149 byte 2 \b, RAM: 64Kbit
3770
- >0x149 byte 3 \b, RAM: 128Kbit
3771
- >0x149 byte 4 \b, RAM: 1Mbit
3772
-
3773
- #>0x14e long x \b, CRC: %x
3774
-
3775
- #------------------------------------------------------------------------------
3776
- # genesis: file(1) magic for the Sega MegaDrive/Genesis raw ROM format
3777
- #
3778
- 0x100 string SEGA Sega MegaDrive/Genesis raw ROM dump
3779
- >0x120 string >\0 Name: "%.16s"
3780
- >0x110 string >\0 %.16s
3781
- >0x1B0 string RA with SRAM
3782
-
3783
- #------------------------------------------------------------------------------
3784
- # genesis: file(1) magic for the Super MegaDrive ROM dump format
3785
- #
3786
- 0x280 string EAGN Super MagicDrive ROM dump
3787
- >0 byte x %dx16k blocks
3788
- >2 byte 0 \b, last in series or standalone
3789
- >2 byte >0 \b, split ROM
3790
- >8 byte 0xAA
3791
- >9 byte 0xBB
3792
-
3793
- #------------------------------------------------------------------------------
3794
- # genesis: file(1) alternate magic for the Super MegaDrive ROM dump format
3795
- #
3796
- 0x280 string EAMG Super MagicDrive ROM dump
3797
- >0 byte x %dx16k blocks
3798
- >2 byte x \b, last in series or standalone
3799
- >8 byte 0xAA
3800
- >9 byte 0xBB
3801
-
3802
- #------------------------------------------------------------------------------
3803
- # smsgg: file(1) magic for Sega Master System and Game Gear ROM dumps
3804
- #
3805
- # Does not detect all images. Very preliminary guesswork. Need more data
3806
- # on format.
3807
- #
3808
- # FIXME: need a little more info...;P
3809
- #
3810
- #0 byte 0xF3
3811
- #>1 byte 0xED Sega Master System/Game Gear ROM dump
3812
- #>1 byte 0x31 Sega Master System/Game Gear ROM dump
3813
- #>1 byte 0xDB Sega Master System/Game Gear ROM dump
3814
- #>1 byte 0xAF Sega Master System/Game Gear ROM dump
3815
- #>1 byte 0xC3 Sega Master System/Game Gear ROM dump
3816
-
3817
- #------------------------------------------------------------------------------
3818
- # dreamcast: file(1) uncertain magic for the Sega Dreamcast VMU image format
3819
- #
3820
- 0 belong 0x21068028 Sega Dreamcast VMU game image
3821
- 0 string LCDi Dream Animator file
3822
-
3823
- #------------------------------------------------------------------------------
3824
- # v64: file(1) uncertain magic for the V64 format N64 ROM dumps
3825
- #
3826
- 0 belong 0x37804012 V64 Nintendo 64 ROM dump
3827
-
3828
- # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
3829
- # Nintendo .nds
3830
- 192 string \044\377\256Qi\232 Nintendo DS Game ROM Image
3831
- # Nintendo .gba
3832
- 0 string \056\000\000\352$\377\256Qi Nintendo Game Boy Advance ROM Image
3833
-
3834
- #------------------------------------------------------------------------------
3835
- # msx: file(1) magic for MSX game cartridge dumps
3836
- # Too simple - MPi
3837
- #0 beshort 0x4142 MSX game cartridge dump
3838
-
3839
- #------------------------------------------------------------------------------
3840
- # Sony Playstation executables (Adam Sjoegren <asjo@diku.dk>) :
3841
- 0 string PS-X\ EXE Sony Playstation executable
3842
- # Area:
3843
- >113 string x (%s)
3844
-
3845
- #------------------------------------------------------------------------------
3846
- # Microsoft Xbox executables .xbe (Esa Hyytiä <ehyytia@cc.hut.fi>)
3847
- 0 string XBEH XBE, Microsoft Xbox executable
3848
- # probabilistic checks whether signed or not
3849
- >0x0004 ulelong =0x0
3850
- >>&2 ulelong =0x0
3851
- >>>&2 ulelong =0x0 \b, not signed
3852
- >0x0004 ulelong >0
3853
- >>&2 ulelong >0
3854
- >>>&2 ulelong >0 \b, signed
3855
- # expect base address of 0x10000
3856
- >0x0104 ulelong =0x10000
3857
- >>(0x0118-0x0FF60) ulelong&0x80000007 0x80000007 \b, all regions
3858
- >>(0x0118-0x0FF60) ulelong&0x80000007 !0x80000007
3859
- >>>(0x0118-0x0FF60) ulelong >0 (regions:
3860
- >>>>(0x0118-0x0FF60) ulelong &0x00000001 NA
3861
- >>>>(0x0118-0x0FF60) ulelong &0x00000002 Japan
3862
- >>>>(0x0118-0x0FF60) ulelong &0x00000004 Rest_of_World
3863
- >>>>(0x0118-0x0FF60) ulelong &0x80000000 Manufacturer
3864
- >>>(0x0118-0x0FF60) ulelong >0 \b)
3865
-
3866
- # --------------------------------
3867
- # Microsoft Xbox data file formats
3868
- 0 string XIP0 XIP, Microsoft Xbox data
3869
- 0 string XTF0 XTF, Microsoft Xbox data
3870
-
3871
- # Atari Lynx cartridge dump (EXE/BLL header)
3872
- # From: "Stefan A. Haubenthal" <polluks@web.de>
3873
-
3874
- 0 beshort 0x8008 Lynx cartridge,
3875
- >2 beshort x RAM start $%04x
3876
- >6 string BS93
3877
-
3878
- # Opera file system that is used on the 3DO console
3879
- # From: Serge van den Boom <svdb@stack.nl>
3880
- 0 string \x01ZZZZZ\x01 3DO "Opera" file system
3881
-
3882
- # From Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
3883
- 0 string GBS Nintendo Gameboy Music/Audio Data
3884
- 12 string GameBoy\ Music\ Module Nintendo Gameboy Music Module
3885
-
3886
- # Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at>
3887
- 0 string PPF30 Playstation Patch File version 3.0
3888
- >5 byte 0 \b, PPF 1.0 patch
3889
- >5 byte 1 \b, PPF 2.0 patch
3890
- >5 byte 2 \b, PPF 3.0 patch
3891
- >>56 byte 0 \b, Imagetype BIN (any)
3892
- >>56 byte 1 \b, Imagetype GI (PrimoDVD)
3893
- >>57 byte 0 \b, Blockcheck disabled
3894
- >>57 byte 1 \b, Blockcheck enabled
3895
- >>58 byte 0 \b, Undo data not available
3896
- >>58 byte 1 \b, Undo data available
3897
- >6 string x \b, description: %s
3898
-
3899
- 0 string PPF20 Playstation Patch File version 2.0
3900
- >5 byte 0 \b, PPF 1.0 patch
3901
- >5 byte 1 \b, PPF 2.0 patch
3902
- >>56 lelong >0 \b, size of file to patch %d
3903
- >6 string x \b, description: %s
3904
-
3905
- 0 string PPF10 Playstation Patch File version 1.0
3906
- >5 byte 0 \b, Simple Encoding
3907
- >6 string x \b, description: %s
3908
-
3909
- # From: Daniel Dawson <ddawson@icehouse.net>
3910
- # SNES9x .smv "movie" file format.
3911
- 0 string SMV\x1A SNES9x input recording
3912
- >0x4 lelong x \b, version %d
3913
- # version 4 is latest so far
3914
- >0x4 lelong <5
3915
- >>0x8 ledate x \b, recorded at %s
3916
- >>0xc lelong >0 \b, rerecorded %d times
3917
- >>0x10 lelong x \b, %d frames long
3918
- >>0x14 byte >0 \b, data for controller(s):
3919
- >>>0x14 byte &0x1 #1
3920
- >>>0x14 byte &0x2 #2
3921
- >>>0x14 byte &0x4 #3
3922
- >>>0x14 byte &0x8 #4
3923
- >>>0x14 byte &0x10 #5
3924
- >>0x15 byte ^0x1 \b, begins from snapshot
3925
- >>0x15 byte &0x1 \b, begins from reset
3926
- >>0x15 byte ^0x2 \b, NTSC standard
3927
- >>0x15 byte &0x2 \b, PAL standard
3928
- >>0x17 byte &0x1 \b, settings:
3929
- # WIP1Timing not used as of version 4
3930
- >>>0x4 lelong <4
3931
- >>>>0x17 byte &0x2 WIP1Timing
3932
- >>>0x17 byte &0x4 Left+Right
3933
- >>>0x17 byte &0x8 VolumeEnvX
3934
- >>>0x17 byte &0x10 FakeMute
3935
- >>>0x17 byte &0x20 SyncSound
3936
- # New flag as of version 4
3937
- >>>0x4 lelong >3
3938
- >>>>0x17 byte &0x80 NoCPUShutdown
3939
- >>0x4 lelong <4
3940
- >>>0x18 lelong >0x23
3941
- >>>>0x20 leshort !0
3942
- >>>>>0x20 lestring16 x \b, metadata: "%s"
3943
- >>0x4 lelong >3
3944
- >>>0x24 byte >0 \b, port 1:
3945
- >>>>0x24 byte 1 joypad
3946
- >>>>0x24 byte 2 mouse
3947
- >>>>0x24 byte 3 SuperScope
3948
- >>>>0x24 byte 4 Justifier
3949
- >>>>0x24 byte 5 multitap
3950
- >>>0x24 byte >0 \b, port 2:
3951
- >>>>0x25 byte 1 joypad
3952
- >>>>0x25 byte 2 mouse
3953
- >>>>0x25 byte 3 SuperScope
3954
- >>>>0x25 byte 4 Justifier
3955
- >>>>0x25 byte 5 multitap
3956
- >>>0x18 lelong >0x43
3957
- >>>>0x40 leshort !0
3958
- >>>>>0x40 lestring16 x \b, metadata: "%s"
3959
- >>0x17 byte &0x40 \b, ROM:
3960
- >>>(0x18.l-26) lelong x CRC32 0x%08x
3961
- >>>(0x18.l-23) string x "%s"
3962
-
3963
- # Type: scummVM savegame files
3964
- # From: Sven Hartge <debian@ds9.argh.org>
3965
- 0 string SCVM ScummVM savegame
3966
- >12 string >\0 "%s"
3967
- #------------------------------------------------------------------------------
3968
- # convex: file(1) magic for Convex boxes
3969
- #
3970
- # Convexes are big-endian.
3971
- #
3972
- # /*\
3973
- # * Below are the magic numbers and tests added for Convex.
3974
- # * Added at beginning, because they are expected to be used most.
3975
- # \*/
3976
- 0 belong 0507 Convex old-style object
3977
- >16 belong >0 not stripped
3978
- 0 belong 0513 Convex old-style demand paged executable
3979
- >16 belong >0 not stripped
3980
- 0 belong 0515 Convex old-style pre-paged executable
3981
- >16 belong >0 not stripped
3982
- 0 belong 0517 Convex old-style pre-paged, non-swapped executable
3983
- >16 belong >0 not stripped
3984
- 0 belong 0x011257 Core file
3985
- #
3986
- # The following are a series of dump format magic numbers. Each one
3987
- # corresponds to a drastically different dump format. The first on is
3988
- # the original dump format on a 4.1 BSD or earlier file system. The
3989
- # second marks the change between the 4.1 file system and the 4.2 file
3990
- # system. The Third marks the changing of the block size from 1K
3991
- # to 2K to be compatible with an IDC file system. The fourth indicates
3992
- # a dump that is dependent on Convex Storage Manager, because data in
3993
- # secondary storage is not physically contained within the dump.
3994
- # The restore program uses these number to determine how the data is
3995
- # to be extracted.
3996
- #
3997
- 24 belong =60011 dump format, 4.1 BSD or earlier
3998
- 24 belong =60012 dump format, 4.2 or 4.3 BSD without IDC
3999
- 24 belong =60013 dump format, 4.2 or 4.3 BSD (IDC compatible)
4000
- 24 belong =60014 dump format, Convex Storage Manager by-reference dump
4001
- #
4002
- # what follows is a bunch of bit-mask checks on the flags field of the opthdr.
4003
- # If there is no `=' sign, assume just checking for whether the bit is set?
4004
- #
4005
- 0 belong 0601 Convex SOFF
4006
- >88 belong&0x000f0000 =0x00000000 c1
4007
- >88 belong &0x00010000 c2
4008
- >88 belong &0x00020000 c2mp
4009
- >88 belong &0x00040000 parallel
4010
- >88 belong &0x00080000 intrinsic
4011
- >88 belong &0x00000001 demand paged
4012
- >88 belong &0x00000002 pre-paged
4013
- >88 belong &0x00000004 non-swapped
4014
- >88 belong &0x00000008 POSIX
4015
- #
4016
- >84 belong &0x80000000 executable
4017
- >84 belong &0x40000000 object
4018
- >84 belong&0x20000000 =0 not stripped
4019
- >84 belong&0x18000000 =0x00000000 native fpmode
4020
- >84 belong&0x18000000 =0x10000000 ieee fpmode
4021
- >84 belong&0x18000000 =0x18000000 undefined fpmode
4022
- #
4023
- 0 belong 0605 Convex SOFF core
4024
- #
4025
- 0 belong 0607 Convex SOFF checkpoint
4026
- >88 belong&0x000f0000 =0x00000000 c1
4027
- >88 belong &0x00010000 c2
4028
- >88 belong &0x00020000 c2mp
4029
- >88 belong &0x00040000 parallel
4030
- >88 belong &0x00080000 intrinsic
4031
- >88 belong &0x00000008 POSIX
4032
- #
4033
- >84 belong&0x18000000 =0x00000000 native fpmode
4034
- >84 belong&0x18000000 =0x10000000 ieee fpmode
4035
- >84 belong&0x18000000 =0x18000000 undefined fpmode
4036
-
4037
- #------------------------------------------------------------------------------
4038
- # cracklib: file (1) magic for cracklib v2.7
4039
-
4040
- 0 lelong 0x70775631 Cracklib password index, little endian
4041
- >4 long >0 (%i words)
4042
- >4 long 0 ("64-bit")
4043
- >>8 long >-1 (%i words)
4044
- 0 belong 0x70775631 Cracklib password index, big endian
4045
- >4 belong >-1 (%i words)
4046
- # really bellong 0x0000000070775631
4047
- 0 search/1 \0\0\0\0pwV1 Cracklib password index, big endian ("64-bit")
4048
- >12 belong >0 (%i words)
4049
- # ----------------------------------------------------------------------------
4050
- # ctags: file (1) magic for Exuberant Ctags files
4051
- # From: Alexander Mai <mai@migdal.ikp.physik.tu-darmstadt.de>
4052
- 0 search/1 =!_TAG Exuberant Ctags tag file text
4053
-
4054
- #------------------------------------------------------------------------------
4055
- # dact: file(1) magic for DACT compressed files
4056
- #
4057
- 0 long 0x444354C3 DACT compressed data
4058
- >4 byte >-1 (version %i.
4059
- >5 byte >-1 $BS%i.
4060
- >6 byte >-1 $BS%i)
4061
- >7 long >0 $BS, original size: %i bytes
4062
- >15 long >30 $BS, block size: %i bytes
4063
-
4064
- #------------------------------------------------------------------------------
4065
- # database: file(1) magic for various databases
4066
- #
4067
- # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
4068
- #
4069
- #
4070
- # GDBM magic numbers
4071
- # Will be maintained as part of the GDBM distribution in the future.
4072
- # <downsj@teeny.org>
4073
- 0 belong 0x13579ace GNU dbm 1.x or ndbm database, big endian
4074
- !:mime application/x-gdbm
4075
- 0 lelong 0x13579ace GNU dbm 1.x or ndbm database, little endian
4076
- !:mime application/x-gdbm
4077
- 0 string GDBM GNU dbm 2.x database
4078
- !:mime application/x-gdbm
4079
- #
4080
- # Berkeley DB
4081
- #
4082
- # Ian Darwin's file /etc/magic files: big/little-endian version.
4083
- #
4084
- # Hash 1.85/1.86 databases store metadata in network byte order.
4085
- # Btree 1.85/1.86 databases store the metadata in host byte order.
4086
- # Hash and Btree 2.X and later databases store the metadata in host byte order.
4087
-
4088
- 0 long 0x00061561 Berkeley DB
4089
- !:mime application/x-dbm
4090
- >8 belong 4321
4091
- >>4 belong >2 1.86
4092
- >>4 belong <3 1.85
4093
- >>4 belong >0 (Hash, version %d, native byte-order)
4094
- >8 belong 1234
4095
- >>4 belong >2 1.86
4096
- >>4 belong <3 1.85
4097
- >>4 belong >0 (Hash, version %d, little-endian)
4098
-
4099
- 0 belong 0x00061561 Berkeley DB
4100
- >8 belong 4321
4101
- >>4 belong >2 1.86
4102
- >>4 belong <3 1.85
4103
- >>4 belong >0 (Hash, version %d, big-endian)
4104
- >8 belong 1234
4105
- >>4 belong >2 1.86
4106
- >>4 belong <3 1.85
4107
- >>4 belong >0 (Hash, version %d, native byte-order)
4108
-
4109
- 0 long 0x00053162 Berkeley DB 1.85/1.86
4110
- >4 long >0 (Btree, version %d, native byte-order)
4111
- 0 belong 0x00053162 Berkeley DB 1.85/1.86
4112
- >4 belong >0 (Btree, version %d, big-endian)
4113
- 0 lelong 0x00053162 Berkeley DB 1.85/1.86
4114
- >4 lelong >0 (Btree, version %d, little-endian)
4115
-
4116
- 12 long 0x00061561 Berkeley DB
4117
- >16 long >0 (Hash, version %d, native byte-order)
4118
- 12 belong 0x00061561 Berkeley DB
4119
- >16 belong >0 (Hash, version %d, big-endian)
4120
- 12 lelong 0x00061561 Berkeley DB
4121
- >16 lelong >0 (Hash, version %d, little-endian)
4122
-
4123
- 12 long 0x00053162 Berkeley DB
4124
- >16 long >0 (Btree, version %d, native byte-order)
4125
- 12 belong 0x00053162 Berkeley DB
4126
- >16 belong >0 (Btree, version %d, big-endian)
4127
- 12 lelong 0x00053162 Berkeley DB
4128
- >16 lelong >0 (Btree, version %d, little-endian)
4129
-
4130
- 12 long 0x00042253 Berkeley DB
4131
- >16 long >0 (Queue, version %d, native byte-order)
4132
- 12 belong 0x00042253 Berkeley DB
4133
- >16 belong >0 (Queue, version %d, big-endian)
4134
- 12 lelong 0x00042253 Berkeley DB
4135
- >16 lelong >0 (Queue, version %d, little-endian)
4136
-
4137
- # From Max Bowsher.
4138
- 12 long 0x00040988 Berkeley DB
4139
- >16 long >0 (Log, version %d, native byte-order)
4140
- 12 belong 0x00040988 Berkeley DB
4141
- >16 belong >0 (Log, version %d, big-endian)
4142
- 12 lelong 0x00040988 Berkeley DB
4143
- >16 lelong >0 (Log, version %d, little-endian)
4144
-
4145
- #
4146
- #
4147
- # Round Robin Database Tool by Tobias Oetiker <oetiker@ee.ethz.ch>
4148
- 0 string RRD RRDTool DB
4149
- >4 string x version %s
4150
- #----------------------------------------------------------------------
4151
- # ROOT: file(1) magic for ROOT databases
4152
- #
4153
- 0 string root\0 ROOT file
4154
- >4 belong x Version %d
4155
- >33 belong x (Compression: %d)
4156
-
4157
- # XXX: Weak magic.
4158
- # Alex Ott <ott@jet.msk.su>
4159
- ## Paradox file formats
4160
- #2 leshort 0x0800 Paradox
4161
- #>0x39 byte 3 v. 3.0
4162
- #>0x39 byte 4 v. 3.5
4163
- #>0x39 byte 9 v. 4.x
4164
- #>0x39 byte 10 v. 5.x
4165
- #>0x39 byte 11 v. 5.x
4166
- #>0x39 byte 12 v. 7.x
4167
- #>>0x04 byte 0 indexed .DB data file
4168
- #>>0x04 byte 1 primary index .PX file
4169
- #>>0x04 byte 2 non-indexed .DB data file
4170
- #>>0x04 byte 3 non-incrementing secondary index .Xnn file
4171
- #>>0x04 byte 4 secondary index .Ynn file
4172
- #>>0x04 byte 5 incrementing secondary index .Xnn file
4173
- #>>0x04 byte 6 non-incrementing secondary index .XGn file
4174
- #>>0x04 byte 7 secondary index .YGn file
4175
- #>>>0x04 byte 8 incrementing secondary index .XGn file
4176
-
4177
- ## XBase database files
4178
- #0 byte 0x02
4179
- #>8 leshort >0
4180
- #>>12 leshort 0 FoxBase
4181
- #!:mime application/x-dbf
4182
- #>>>0x04 lelong 0 (no records)
4183
- #>>>0x04 lelong >0 (%ld records)
4184
- #
4185
- #0 byte 0x03
4186
- #!:mime application/x-dbf
4187
- #>8 leshort >0
4188
- #>>12 leshort 0 FoxBase+, FoxPro, dBaseIII+, dBaseIV, no memo
4189
- #>>>0x04 lelong 0 (no records)
4190
- #>>>0x04 lelong >0 (%ld records)
4191
- #
4192
- #0 byte 0x04
4193
- #!:mime application/x-dbf
4194
- #>8 leshort >0
4195
- #>>12 leshort 0 dBASE IV no memo file
4196
- #>>>0x04 lelong 0 (no records)
4197
- #>>>0x04 lelong >0 (%ld records)
4198
- #
4199
- #0 byte 0x05
4200
- #!:mime application/x-dbf
4201
- #>8 leshort >0
4202
- #>>12 leshort 0 dBASE V no memo file
4203
- #>>>0x04 lelong 0 (no records)
4204
- #>>>0x04 lelong >0 (%ld records)
4205
- #
4206
- #0 byte 0x30
4207
- #!:mime application/x-dbf
4208
- #>8 leshort >0
4209
- #>>12 leshort 0 Visual FoxPro
4210
- #>>>0x04 lelong 0 (no records)
4211
- #>>>0x04 lelong >0 (%ld records)
4212
- #
4213
- #0 byte 0x43
4214
- #!:mime application/x-dbf
4215
- #>8 leshort >0
4216
- #>>12 leshort 0 FlagShip with memo var size
4217
- #>>>0x04 lelong 0 (no records)
4218
- #>>>0x04 lelong >0 (%ld records)
4219
- #
4220
- #0 byte 0x7b
4221
- #!:mime application/x-dbf
4222
- #>8 leshort >0
4223
- #>>12 leshort 0 dBASEIV with memo
4224
- #>>>0x04 lelong 0 (no records)
4225
- #>>>0x04 lelong >0 (%ld records)
4226
- #
4227
- #0 byte 0x83
4228
- #!:mime application/x-dbf
4229
- #>8 leshort >0
4230
- #>>12 leshort 0 FoxBase+, dBaseIII+ with memo
4231
- #>>>0x04 lelong 0 (no records)
4232
- #>>>0x04 lelong >0 (%ld records)
4233
- #
4234
- #0 byte 0x8b
4235
- #!:mime application/x-dbf
4236
- #>8 leshort >0
4237
- #>>12 leshort 0 dBaseIV with memo
4238
- #>>>0x04 lelong 0 (no records)
4239
- #>>>0x04 lelong >0 (%ld records)
4240
- #
4241
- #0 byte 0x8e
4242
- #!:mime application/x-dbf
4243
- #>8 leshort >0
4244
- #>>12 leshort 0 dBaseIV with SQL Table
4245
- #>>>0x04 lelong 0 (no records)
4246
- #>>>0x04 lelong >0 (%ld records)
4247
- #
4248
- #0 byte 0xb3
4249
- #!:mime application/x-dbf
4250
- #>8 leshort >0
4251
- #>>12 leshort 0 FlagShip with .dbt memo
4252
- #>>>0x04 lelong 0 (no records)
4253
- #>>>0x04 lelong >0 (%ld records)
4254
- #
4255
- #0 byte 0xf5
4256
- #!:mime application/x-dbf
4257
- #>8 leshort >0
4258
- #>>12 leshort 0 FoxPro with memo
4259
- #>>>0x04 lelong 0 (no records)
4260
- #>>>0x04 lelong >0 (%ld records)
4261
- #
4262
- #0 leshort 0x0006 DBase 3 index file
4263
-
4264
- # MS Access database
4265
- 4 string Standard\ Jet\ DB Microsoft Access Database
4266
- !:mime application/x-msaccess
4267
-
4268
- # TDB database from Samba et al - Martin Pool <mbp@samba.org>
4269
- 0 string TDB\ file TDB database
4270
- >32 lelong 0x2601196D version 6, little-endian
4271
- >>36 lelong x hash size %d bytes
4272
-
4273
- # SE Linux policy database
4274
- 0 lelong 0xf97cff8c SE Linux policy
4275
- >16 lelong x v%d
4276
- >20 lelong 1 MLS
4277
- >24 lelong x %d symbols
4278
- >28 lelong x %d ocons
4279
-
4280
- # ICE authority file data (Wolfram Kleff)
4281
- 2 string ICE ICE authority data
4282
-
4283
- # X11 Xauthority file (Wolfram Kleff)
4284
- 10 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
4285
- 11 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
4286
- 12 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
4287
- 13 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
4288
- 14 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
4289
- 15 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
4290
- 16 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
4291
- 17 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
4292
- 18 string MIT-MAGIC-COOKIE-1 X11 Xauthority data
4293
-
4294
- # From: Maxime Henrion <mux@FreeBSD.org>
4295
- # PostgreSQL's custom dump format, Maxime Henrion <mux@FreeBSD.org>
4296
- 0 string PGDMP PostgreSQL custom database dump
4297
- >5 byte x - v%d
4298
- >6 byte x \b.%d
4299
- >5 beshort <0x101 \b-0
4300
- >5 beshort >0x100
4301
- >>7 byte x \b-%d
4302
-
4303
- # Type: Advanced Data Format (ADF) database
4304
- # URL: http://www.grc.nasa.gov/WWW/cgns/adf/
4305
- # From: Nicolas Chauvat <nicolas.chauvat@logilab.fr>
4306
- 0 string @(#)ADF\ Database CGNS Advanced Data Format
4307
-
4308
- # Tokyo Cabinet magic data
4309
- # http://tokyocabinet.sourceforge.net/index.html
4310
- 0 string ToKyO\ CaBiNeT\n Tokyo Cabinet
4311
- >14 string x \b (%s)
4312
- >32 byte 0 \b, Hash
4313
- !:mime application/x-tokyocabinet-hash
4314
- >32 byte 1 \b, B+ tree
4315
- !:mime application/x-tokyocabinet-btree
4316
- >32 byte 2 \b, Fixed-length
4317
- !:mime application/x-tokyocabinet-fixed
4318
- >32 byte 3 \b, Table
4319
- !:mime application/x-tokyocabinet-table
4320
- >33 byte &1 \b, [open]
4321
- >33 byte &2 \b, [fatal]
4322
- >34 byte x \b, apow=%d
4323
- >35 byte x \b, fpow=%d
4324
- >36 byte &0x01 \b, [large]
4325
- >36 byte &0x02 \b, [deflate]
4326
- >36 byte &0x04 \b, [bzip]
4327
- >36 byte &0x08 \b, [tcbs]
4328
- >36 byte &0x10 \b, [excodec]
4329
- >40 lequad x \b, bnum=%lld
4330
- >48 lequad x \b, rnum=%lld
4331
- >56 lequad x \b, fsiz=%lld
4332
-
4333
- # Type: QDBM Quick Database Manager
4334
- # From: Benoit Sibaud <bsibaud@april.org>
4335
- 0 string \\[depot\\]\n\f Quick Database Manager, little endian
4336
- 0 string \\[DEPOT\\]\n\f Quick Database Manager, big endian
4337
-
4338
- # Type: TokyoCabinet database
4339
- # URL: http://tokyocabinet.sourceforge.net/
4340
- # From: Benoit Sibaud <bsibaud@april.org>
4341
- 0 string ToKyO\ CaBiNeT\n TokyoCabinet database
4342
- >14 string x (version %s)
4343
-
4344
- #------------------------------------------------------------------------------
4345
- # diamond: file(1) magic for Diamond system
4346
- #
4347
- # ... diamond is a multi-media mail and electronic conferencing system....
4348
- #
4349
- # XXX - I think it was either renamed Slate, or replaced by Slate....
4350
- #
4351
- # The full deal is too long...
4352
- #0 string <list>\n<protocol\ bbn-multimedia-format> Diamond Multimedia Document
4353
- 0 string =<list>\n<protocol\ bbn-m Diamond Multimedia Document
4354
- #------------------------------------------------------------------------------
4355
- # diff: file(1) magic for diff(1) output
4356
- #
4357
- 0 search/1 diff\ diff output text
4358
- !:mime text/x-diff
4359
- 0 search/1 ***\ diff output text
4360
- !:mime text/x-diff
4361
- 0 search/1 Only\ in\ diff output text
4362
- !:mime text/x-diff
4363
- 0 search/1 Common\ subdirectories:\ diff output text
4364
- !:mime text/x-diff
4365
-
4366
- 0 search/1 Index: RCS/CVS diff output text
4367
- !:mime text/x-diff
4368
- # Digital UNIX - Info
4369
- #
4370
- 0 string =!<arch>\n________64E Alpha archive
4371
- >22 string X -- out of date
4372
- #
4373
- # Alpha COFF Based Executables
4374
- # The stripped stuff really needs to be an 8 byte (64 bit) compare,
4375
- # but this works
4376
- 0 leshort 0x183 COFF format alpha
4377
- >22 leshort&020000 &010000 sharable library,
4378
- >22 leshort&020000 ^010000 dynamically linked,
4379
- >24 leshort 0410 pure
4380
- >24 leshort 0413 demand paged
4381
- >8 lelong >0 executable or object module, not stripped
4382
- >8 lelong 0
4383
- >>12 lelong 0 executable or object module, stripped
4384
- >>12 lelong >0 executable or object module, not stripped
4385
- >27 byte >0 - version %d.
4386
- >26 byte >0 %d-
4387
- >28 leshort >0 %d
4388
- #
4389
- # The next is incomplete, we could tell more about this format,
4390
- # but its not worth it.
4391
- 0 leshort 0x188 Alpha compressed COFF
4392
- 0 leshort 0x18f Alpha u-code object
4393
- #
4394
- #
4395
- # Some other interesting Digital formats,
4396
- 0 string \377\377\177 ddis/ddif
4397
- 0 string \377\377\174 ddis/dots archive
4398
- 0 string \377\377\176 ddis/dtif table data
4399
- 0 string \033c\033 LN03 output
4400
- 0 long 04553207 X image
4401
- #
4402
- 0 string =!<PDF>!\n profiling data file
4403
- #
4404
- # Locale data tables (MIPS and Alpha).
4405
- #
4406
- 0 short 0x0501 locale data table
4407
- >6 short 0x24 for MIPS
4408
- >6 short 0x40 for Alpha
4409
- # ATSC A/53 aka AC-3 aka Dolby Digital <ashitaka@gmx.at>
4410
- # from http://www.atsc.org/standards/a_52a.pdf
4411
- # corrections, additions, etc. are always welcome!
4412
- #
4413
- # syncword
4414
- 0 beshort 0x0b77 ATSC A/52 aka AC-3 aka Dolby Digital stream,
4415
- # fscod
4416
- >4 byte&0xc0 0x00 48 kHz,
4417
- >4 byte&0xc0 0x40 44.1 kHz,
4418
- >4 byte&0xc0 0x80 32 kHz,
4419
- # is this one used for 96 kHz?
4420
- >4 byte&0xc0 0xc0 reserved frequency,
4421
- #
4422
- >5 byte&7 = 0 \b, complete main (CM)
4423
- >5 byte&7 = 1 \b, music and effects (ME)
4424
- >5 byte&7 = 2 \b, visually impaired (VI)
4425
- >5 byte&7 = 3 \b, hearing impaired (HI)
4426
- >5 byte&7 = 4 \b, dialogue (D)
4427
- >5 byte&7 = 5 \b, commentary (C)
4428
- >5 byte&7 = 6 \b, emergency (E)
4429
- # acmod
4430
- >6 byte&0xe0 0x00 1+1 front,
4431
- >6 byte&0xe0 0x20 1 front/0 rear,
4432
- >6 byte&0xe0 0x40 2 front/0 rear,
4433
- >6 byte&0xe0 0x60 3 front/0 rear,
4434
- >6 byte&0xe0 0x80 2 front/1 rear,
4435
- >6 byte&0xe0 0xa0 3 front/1 rear,
4436
- >6 byte&0xe0 0xc0 2 front/2 rear,
4437
- >6 byte&0xe0 0xe0 3 front/2 rear,
4438
- # lfeon (these may be incorrect)
4439
- >7 byte&0x40 0x00 LFE off,
4440
- >7 byte&0x40 0x40 LFE on,
4441
- #
4442
- >4 byte&0x3e = 0x00 \b, 32 kbit/s
4443
- >4 byte&0x3e = 0x02 \b, 40 kbit/s
4444
- >4 byte&0x3e = 0x04 \b, 48 kbit/s
4445
- >4 byte&0x3e = 0x06 \b, 56 kbit/s
4446
- >4 byte&0x3e = 0x08 \b, 64 kbit/s
4447
- >4 byte&0x3e = 0x0a \b, 80 kbit/s
4448
- >4 byte&0x3e = 0x0c \b, 96 kbit/s
4449
- >4 byte&0x3e = 0x0e \b, 112 kbit/s
4450
- >4 byte&0x3e = 0x10 \b, 128 kbit/s
4451
- >4 byte&0x3e = 0x12 \b, 160 kbit/s
4452
- >4 byte&0x3e = 0x14 \b, 192 kbit/s
4453
- >4 byte&0x3e = 0x16 \b, 224 kbit/s
4454
- >4 byte&0x3e = 0x18 \b, 256 kbit/s
4455
- >4 byte&0x3e = 0x1a \b, 320 kbit/s
4456
- >4 byte&0x3e = 0x1c \b, 384 kbit/s
4457
- >4 byte&0x3e = 0x1e \b, 448 kbit/s
4458
- >4 byte&0x3e = 0x20 \b, 512 kbit/s
4459
- >4 byte&0x3e = 0x22 \b, 576 kbit/s
4460
- >4 byte&0x3e = 0x24 \b, 640 kbit/s
4461
- # dsurmod (these may be incorrect)
4462
- >6 beshort&0x0180 0x0000 Dolby Surround not indicated
4463
- >6 beshort&0x0180 0x0080 not Dolby Surround encoded
4464
- >6 beshort&0x0180 0x0100 Dolby Surround encoded
4465
- >6 beshort&0x0180 0x0180 reserved Dolby Surround mode
4466
-
4467
- #------------------------------------------------------------------------------
4468
- # dump: file(1) magic for dump file format--for new and old dump filesystems
4469
- #
4470
- # We specify both byte orders in order to recognize byte-swapped dumps.
4471
- #
4472
- 24 belong 60012 new-fs dump file (big endian),
4473
- >4 bedate x Previous dump %s,
4474
- >8 bedate x This dump %s,
4475
- >12 belong >0 Volume %ld,
4476
- >692 belong 0 Level zero, type:
4477
- >692 belong >0 Level %d, type:
4478
- >0 belong 1 tape header,
4479
- >0 belong 2 beginning of file record,
4480
- >0 belong 3 map of inodes on tape,
4481
- >0 belong 4 continuation of file record,
4482
- >0 belong 5 end of volume,
4483
- >0 belong 6 map of inodes deleted,
4484
- >0 belong 7 end of medium (for floppy),
4485
- >676 string >\0 Label %s,
4486
- >696 string >\0 Filesystem %s,
4487
- >760 string >\0 Device %s,
4488
- >824 string >\0 Host %s,
4489
- >888 belong >0 Flags %x
4490
-
4491
- 24 belong 60011 old-fs dump file (big endian),
4492
- #>4 bedate x Previous dump %s,
4493
- #>8 bedate x This dump %s,
4494
- >12 belong >0 Volume %ld,
4495
- >692 belong 0 Level zero, type:
4496
- >692 belong >0 Level %d, type:
4497
- >0 belong 1 tape header,
4498
- >0 belong 2 beginning of file record,
4499
- >0 belong 3 map of inodes on tape,
4500
- >0 belong 4 continuation of file record,
4501
- >0 belong 5 end of volume,
4502
- >0 belong 6 map of inodes deleted,
4503
- >0 belong 7 end of medium (for floppy),
4504
- >676 string >\0 Label %s,
4505
- >696 string >\0 Filesystem %s,
4506
- >760 string >\0 Device %s,
4507
- >824 string >\0 Host %s,
4508
- >888 belong >0 Flags %x
4509
-
4510
- 24 lelong 60012 new-fs dump file (little endian),
4511
- >4 ledate x This dump %s,
4512
- >8 ledate x Previous dump %s,
4513
- >12 lelong >0 Volume %ld,
4514
- >692 lelong 0 Level zero, type:
4515
- >692 lelong >0 Level %d, type:
4516
- >0 lelong 1 tape header,
4517
- >0 lelong 2 beginning of file record,
4518
- >0 lelong 3 map of inodes on tape,
4519
- >0 lelong 4 continuation of file record,
4520
- >0 lelong 5 end of volume,
4521
- >0 lelong 6 map of inodes deleted,
4522
- >0 lelong 7 end of medium (for floppy),
4523
- >676 string >\0 Label %s,
4524
- >696 string >\0 Filesystem %s,
4525
- >760 string >\0 Device %s,
4526
- >824 string >\0 Host %s,
4527
- >888 lelong >0 Flags %x
4528
-
4529
- 24 lelong 60011 old-fs dump file (little endian),
4530
- #>4 ledate x Previous dump %s,
4531
- #>8 ledate x This dump %s,
4532
- >12 lelong >0 Volume %ld,
4533
- >692 lelong 0 Level zero, type:
4534
- >692 lelong >0 Level %d, type:
4535
- >0 lelong 1 tape header,
4536
- >0 lelong 2 beginning of file record,
4537
- >0 lelong 3 map of inodes on tape,
4538
- >0 lelong 4 continuation of file record,
4539
- >0 lelong 5 end of volume,
4540
- >0 lelong 6 map of inodes deleted,
4541
- >0 lelong 7 end of medium (for floppy),
4542
- >676 string >\0 Label %s,
4543
- >696 string >\0 Filesystem %s,
4544
- >760 string >\0 Device %s,
4545
- >824 string >\0 Host %s,
4546
- >888 lelong >0 Flags %x
4547
-
4548
- 18 leshort 60011 old-fs dump file (16-bit, assuming PDP-11 endianness),
4549
- >2 medate x Previous dump %s,
4550
- >6 medate x This dump %s,
4551
- >10 leshort >0 Volume %ld,
4552
- >0 leshort 1 tape header.
4553
- >0 leshort 2 beginning of file record.
4554
- >0 leshort 3 map of inodes on tape.
4555
- >0 leshort 4 continuation of file record.
4556
- >0 leshort 5 end of volume.
4557
- >0 leshort 6 map of inodes deleted.
4558
- >0 leshort 7 end of medium (for floppy).
4559
-
4560
- 24 belong 0x19540119 new-fs dump file (ufs2, big endian),
4561
- >896 beqdate x Previous dump %s,
4562
- >904 beqdate x This dump %s,
4563
- >12 belong >0 Volume %ld,
4564
- >692 belong 0 Level zero, type:
4565
- >692 belong >0 Level %d, type:
4566
- >0 belong 1 tape header,
4567
- >0 belong 2 beginning of file record,
4568
- >0 belong 3 map of inodes on tape,
4569
- >0 belong 4 continuation of file record,
4570
- >0 belong 5 end of volume,
4571
- >0 belong 6 map of inodes deleted,
4572
- >0 belong 7 end of medium (for floppy),
4573
- >676 string >\0 Label %s,
4574
- >696 string >\0 Filesystem %s,
4575
- >760 string >\0 Device %s,
4576
- >824 string >\0 Host %s,
4577
- >888 belong >0 Flags %x
4578
-
4579
- 24 lelong 0x19540119 new-fs dump file (ufs2, little endian),
4580
- >896 leqdate x This dump %s,
4581
- >904 leqdate x Previous dump %s,
4582
- >12 lelong >0 Volume %ld,
4583
- >692 lelong 0 Level zero, type:
4584
- >692 lelong >0 Level %d, type:
4585
- >0 lelong 1 tape header,
4586
- >0 lelong 2 beginning of file record,
4587
- >0 lelong 3 map of inodes on tape,
4588
- >0 lelong 4 continuation of file record,
4589
- >0 lelong 5 end of volume,
4590
- >0 lelong 6 map of inodes deleted,
4591
- >0 lelong 7 end of medium (for floppy),
4592
- >676 string >\0 Label %s,
4593
- >696 string >\0 Filesystem %s,
4594
- >760 string >\0 Device %s,
4595
- >824 string >\0 Host %s,
4596
- >888 lelong >0 Flags %x
4597
-
4598
- #------------------------------------------------------------------------------
4599
- # Dyadic: file(1) magic for Dyalog APL.
4600
- #
4601
- 0 byte 0xaa
4602
- >1 byte <4 Dyalog APL
4603
- >>1 byte 0x00 incomplete workspace
4604
- >>1 byte 0x01 component file
4605
- >>1 byte 0x02 external variable
4606
- >>1 byte 0x03 workspace
4607
- >>2 byte x version %d
4608
- >>3 byte x .%d
4609
-
4610
- #------------------------------------------------------------------------------
4611
- # T602 editor documents
4612
- # by David Necas <yeti@physics.muni.cz>
4613
- 0 string @CT\ T602 document data,
4614
- >4 string 0 Kamenicky
4615
- >4 string 1 CP 852
4616
- >4 string 2 KOI8-CS
4617
- >4 string >2 unknown encoding
4618
-
4619
- # Vi IMproved Encrypted file
4620
- # by David Necas <yeti@physics.muni.cz>
4621
- 0 string VimCrypt~ Vim encrypted file data
4622
- # Vi IMproved Swap file
4623
- # by Sven Wegener <swegener@gentoo.org>
4624
- 0 string b0VIM\ Vim swap file
4625
- >&0 string >\0 \b, version %s
4626
-
4627
- #------------------------------------------------------------------------------
4628
- # efi: file(1) magic for Universal EFI binaries
4629
-
4630
- 0 lelong 0x0ef1fab9
4631
- >4 lelong 1 Universal EFI binary with 1 architecture
4632
- >>&0 lelong 7 \b, i386
4633
- >>&0 lelong 0x01000007 \b, x86_64
4634
- >4 lelong 2 Universal EFI binary with 2 architectures
4635
- >>&0 lelong 7 \b, i386
4636
- >>&0 lelong 0x01000007 \b, x86_64
4637
- >>&20 lelong 7 \b, i386
4638
- >>&20 lelong 0x01000007 \b, x86_64
4639
- >4 lelong >2 Universal EFI binary with %ld architectures
4640
-
4641
- #------------------------------------------------------------------------------
4642
- # elf: file(1) magic for ELF executables
4643
- #
4644
- # We have to check the byte order flag to see what byte order all the
4645
- # other stuff in the header is in.
4646
- #
4647
- # What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
4648
- #
4649
- # Created by: unknown
4650
- # Modified by (1): Daniel Quinlan <quinlan@yggdrasil.com>
4651
- # Modified by (2): Peter Tobias <tobias@server.et-inf.fho-emden.de> (core support)
4652
- # Modified by (3): Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de> (fix of core support)
4653
- # Modified by (4): <gerardo.cacciari@gmail.com> (VMS Itanium)
4654
- # Modified by (5): Matthias Urlichs <smurf@debian.org> (Listing of many architectures)
4655
- 0 string \177ELF ELF
4656
- >4 byte 0 invalid class
4657
- >4 byte 1 32-bit
4658
- >4 byte 2 64-bit
4659
- >5 byte 0 invalid byte order
4660
- >5 byte 1 LSB
4661
- >>16 leshort 0 no file type,
4662
- !:strength *2
4663
- !:mime application/octet-stream
4664
- >>16 leshort 1 relocatable,
4665
- !:mime application/x-object
4666
- >>16 leshort 2 executable,
4667
- !:mime application/x-executable
4668
- >>16 leshort 3 shared object,
4669
- !:mime application/x-sharedlib
4670
- >>16 leshort 4 core file
4671
- !:mime application/x-coredump
4672
- # Core file detection is not reliable.
4673
- #>>>(0x38+0xcc) string >\0 of '%s'
4674
- #>>>(0x38+0x10) lelong >0 (signal %d),
4675
- >>16 leshort &0xff00 processor-specific,
4676
- >>18 leshort 0 no machine,
4677
- >>18 leshort 1 AT&T WE32100 - invalid byte order,
4678
- >>18 leshort 2 SPARC - invalid byte order,
4679
- >>18 leshort 3 Intel 80386,
4680
- >>18 leshort 4 Motorola
4681
- >>>36 lelong &0x01000000 68000 - invalid byte order,
4682
- >>>36 lelong &0x00810000 CPU32 - invalid byte order,
4683
- >>>36 lelong 0 68020 - invalid byte order,
4684
- >>18 leshort 5 Motorola 88000 - invalid byte order,
4685
- >>18 leshort 6 Intel 80486,
4686
- >>18 leshort 7 Intel 80860,
4687
- # The official e_machine number for MIPS is now #8, regardless of endianness.
4688
- # The second number (#10) will be deprecated later. For now, we still
4689
- # say something if #10 is encountered, but only gory details for #8.
4690
- >>18 leshort 8 MIPS,
4691
- >>>36 lelong &0x20 N32
4692
- >>18 leshort 10 MIPS,
4693
- >>>36 lelong &0x20 N32
4694
- >>18 leshort 8
4695
- # only for 32-bit
4696
- >>>4 byte 1
4697
- >>>>36 lelong&0xf0000000 0x00000000 MIPS-I
4698
- >>>>36 lelong&0xf0000000 0x10000000 MIPS-II
4699
- >>>>36 lelong&0xf0000000 0x20000000 MIPS-III
4700
- >>>>36 lelong&0xf0000000 0x30000000 MIPS-IV
4701
- >>>>36 lelong&0xf0000000 0x40000000 MIPS-V
4702
- >>>>36 lelong&0xf0000000 0x50000000 MIPS32
4703
- >>>>36 lelong&0xf0000000 0x60000000 MIPS64
4704
- >>>>36 lelong&0xf0000000 0x70000000 MIPS32 rel2
4705
- >>>>36 lelong&0xf0000000 0x80000000 MIPS64 rel2
4706
- # only for 64-bit
4707
- >>>4 byte 2
4708
- >>>>48 lelong&0xf0000000 0x00000000 MIPS-I
4709
- >>>>48 lelong&0xf0000000 0x10000000 MIPS-II
4710
- >>>>48 lelong&0xf0000000 0x20000000 MIPS-III
4711
- >>>>48 lelong&0xf0000000 0x30000000 MIPS-IV
4712
- >>>>48 lelong&0xf0000000 0x40000000 MIPS-V
4713
- >>>>48 lelong&0xf0000000 0x50000000 MIPS32
4714
- >>>>48 lelong&0xf0000000 0x60000000 MIPS64
4715
- >>>>48 lelong&0xf0000000 0x70000000 MIPS32 rel2
4716
- >>>>48 lelong&0xf0000000 0x80000000 MIPS64 rel2
4717
- >>18 leshort 9 Amdahl - invalid byte order,
4718
- >>18 leshort 10 MIPS (deprecated),
4719
- >>18 leshort 11 RS6000 - invalid byte order,
4720
- >>18 leshort 15 PA-RISC - invalid byte order,
4721
- >>>50 leshort 0x0214 2.0
4722
- >>>48 leshort &0x0008 (LP64),
4723
- >>18 leshort 16 nCUBE,
4724
- >>18 leshort 17 Fujitsu VPP500,
4725
- >>18 leshort 18 SPARC32PLUS - invalid byte order,
4726
- >>18 leshort 20 PowerPC,
4727
- >>18 leshort 22 IBM S/390,
4728
- >>18 leshort 36 NEC V800,
4729
- >>18 leshort 37 Fujitsu FR20,
4730
- >>18 leshort 38 TRW RH-32,
4731
- >>18 leshort 39 Motorola RCE,
4732
- >>18 leshort 40 ARM,
4733
- >>18 leshort 41 Alpha,
4734
- >>18 leshort 0xa390 IBM S/390 (obsolete),
4735
- >>18 leshort 42 Renesas SH,
4736
- >>18 leshort 43 SPARC V9 - invalid byte order,
4737
- >>18 leshort 44 Siemens Tricore Embedded Processor,
4738
- >>18 leshort 45 Argonaut RISC Core, Argonaut Technologies Inc.,
4739
- >>18 leshort 46 Renesas H8/300,
4740
- >>18 leshort 47 Renesas H8/300H,
4741
- >>18 leshort 48 Renesas H8S,
4742
- >>18 leshort 49 Renesas H8/500,
4743
- >>18 leshort 50 IA-64,
4744
- >>18 leshort 51 Stanford MIPS-X,
4745
- >>18 leshort 52 Motorola Coldfire,
4746
- >>18 leshort 53 Motorola M68HC12,
4747
- >>18 leshort 54 Fujitsu MMA,
4748
- >>18 leshort 55 Siemens PCP,
4749
- >>18 leshort 56 Sony nCPU,
4750
- >>18 leshort 57 Denso NDR1,
4751
- >>18 leshort 58 Start*Core,
4752
- >>18 leshort 59 Toyota ME16,
4753
- >>18 leshort 60 ST100,
4754
- >>18 leshort 61 Tinyj emb.,
4755
- >>18 leshort 62 x86-64,
4756
- >>18 leshort 63 Sony DSP,
4757
- >>18 leshort 66 FX66,
4758
- >>18 leshort 67 ST9+ 8/16 bit,
4759
- >>18 leshort 68 ST7 8 bit,
4760
- >>18 leshort 69 MC68HC16,
4761
- >>18 leshort 70 MC68HC11,
4762
- >>18 leshort 71 MC68HC08,
4763
- >>18 leshort 72 MC68HC05,
4764
- >>18 leshort 73 SGI SVx,
4765
- >>18 leshort 74 ST19 8 bit,
4766
- >>18 leshort 75 Digital VAX,
4767
- >>18 leshort 76 Axis cris,
4768
- >>18 leshort 77 Infineon 32-bit embedded,
4769
- >>18 leshort 78 Element 14 64-bit DSP,
4770
- >>18 leshort 79 LSI Logic 16-bit DSP,
4771
- >>18 leshort 80 MMIX,
4772
- >>18 leshort 81 Harvard machine-independent,
4773
- >>18 leshort 82 SiTera Prism,
4774
- >>18 leshort 83 Atmel AVR 8-bit,
4775
- >>18 leshort 84 Fujitsu FR30,
4776
- >>18 leshort 85 Mitsubishi D10V,
4777
- >>18 leshort 86 Mitsubishi D30V,
4778
- >>18 leshort 87 NEC v850,
4779
- >>18 leshort 88 Renesas M32R,
4780
- >>18 leshort 89 Matsushita MN10300,
4781
- >>18 leshort 90 Matsushita MN10200,
4782
- >>18 leshort 91 picoJava,
4783
- >>18 leshort 92 OpenRISC,
4784
- >>18 leshort 93 ARC Cores Tangent-A5,
4785
- >>18 leshort 94 Tensilica Xtensa,
4786
- >>18 leshort 97 NatSemi 32k,
4787
- >>18 leshort 106 Analog Devices Blackfin,
4788
- >>18 leshort 113 Altera Nios II,
4789
- >>18 leshort 0xae META,
4790
- >>18 leshort 0x3426 OpenRISC (obsolete),
4791
- >>18 leshort 0x8472 OpenRISC (obsolete),
4792
- >>18 leshort 0x9026 Alpha (unofficial),
4793
- >>20 lelong 0 invalid version
4794
- >>20 lelong 1 version 1
4795
- >>36 lelong 1 MathCoPro/FPU/MAU Required
4796
- >5 byte 2 MSB
4797
- >>16 beshort 0 no file type,
4798
- !:mime application/octet-stream
4799
- >>16 beshort 1 relocatable,
4800
- !:mime application/x-object
4801
- >>16 beshort 2 executable,
4802
- !:mime application/x-executable
4803
- >>16 beshort 3 shared object,
4804
- !:mime application/x-sharedlib
4805
- >>16 beshort 4 core file,
4806
- !:mime application/x-coredump
4807
- #>>>(0x38+0xcc) string >\0 of '%s'
4808
- #>>>(0x38+0x10) belong >0 (signal %d),
4809
- >>16 beshort &0xff00 processor-specific,
4810
- >>18 beshort 0 no machine,
4811
- >>18 beshort 1 AT&T WE32100,
4812
- >>18 beshort 2 SPARC,
4813
- >>18 beshort 3 Intel 80386 - invalid byte order,
4814
- >>18 beshort 4 Motorola
4815
- >>>36 belong &0x01000000 68000,
4816
- >>>36 belong &0x00810000 CPU32,
4817
- >>>36 belong 0 68020,
4818
- >>18 beshort 5 Motorola 88000,
4819
- >>18 beshort 6 Intel 80486 - invalid byte order,
4820
- >>18 beshort 7 Intel 80860,
4821
- # only for MIPS - see comment in little-endian section above.
4822
- >>18 beshort 8 MIPS,
4823
- >>>36 belong &0x20 N32
4824
- >>18 beshort 10 MIPS,
4825
- >>>36 belong &0x20 N32
4826
- >>18 beshort 8
4827
- # only for 32-bit
4828
- >>>4 byte 1
4829
- >>>>36 belong&0xf0000000 0x00000000 MIPS-I
4830
- >>>>36 belong&0xf0000000 0x10000000 MIPS-II
4831
- >>>>36 belong&0xf0000000 0x20000000 MIPS-III
4832
- >>>>36 belong&0xf0000000 0x30000000 MIPS-IV
4833
- >>>>36 belong&0xf0000000 0x40000000 MIPS-V
4834
- >>>>36 belong&0xf0000000 0x50000000 MIPS32
4835
- >>>>36 belong&0xf0000000 0x60000000 MIPS64
4836
- >>>>36 belong&0xf0000000 0x70000000 MIPS32 rel2
4837
- >>>>36 belong&0xf0000000 0x80000000 MIPS64 rel2
4838
- # only for 64-bit
4839
- >>>4 byte 2
4840
- >>>>48 belong&0xf0000000 0x00000000 MIPS-I
4841
- >>>>48 belong&0xf0000000 0x10000000 MIPS-II
4842
- >>>>48 belong&0xf0000000 0x20000000 MIPS-III
4843
- >>>>48 belong&0xf0000000 0x30000000 MIPS-IV
4844
- >>>>48 belong&0xf0000000 0x40000000 MIPS-V
4845
- >>>>48 belong&0xf0000000 0x50000000 MIPS32
4846
- >>>>48 belong&0xf0000000 0x60000000 MIPS64
4847
- >>>>48 belong&0xf0000000 0x70000000 MIPS32 rel2
4848
- >>>>48 belong&0xf0000000 0x80000000 MIPS64 rel2
4849
- >>18 beshort 9 Amdahl,
4850
- >>18 beshort 10 MIPS (deprecated),
4851
- >>18 beshort 11 RS6000,
4852
- >>18 beshort 15 PA-RISC
4853
- >>>50 beshort 0x0214 2.0
4854
- >>>48 beshort &0x0008 (LP64)
4855
- >>18 beshort 16 nCUBE,
4856
- >>18 beshort 17 Fujitsu VPP500,
4857
- >>18 beshort 18 SPARC32PLUS,
4858
- >>>36 belong&0xffff00 0x000100 V8+ Required,
4859
- >>>36 belong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
4860
- >>>36 belong&0xffff00 0x000400 HaL R1 Extensions Required,
4861
- >>>36 belong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
4862
- >>18 beshort 20 PowerPC or cisco 4500,
4863
- >>18 beshort 21 64-bit PowerPC or cisco 7500,
4864
- >>18 beshort 22 IBM S/390,
4865
- >>18 beshort 23 Cell SPU,
4866
- >>18 beshort 24 cisco SVIP,
4867
- >>18 beshort 25 cisco 7200,
4868
- >>18 beshort 36 NEC V800 or cisco 12000,
4869
- >>18 beshort 37 Fujitsu FR20,
4870
- >>18 beshort 38 TRW RH-32,
4871
- >>18 beshort 39 Motorola RCE,
4872
- >>18 beshort 40 ARM,
4873
- >>18 beshort 41 Alpha,
4874
- >>18 beshort 42 Renesas SH,
4875
- >>18 beshort 43 SPARC V9,
4876
- >>>48 belong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
4877
- >>>48 belong&0xffff00 0x000400 HaL R1 Extensions Required,
4878
- >>>48 belong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
4879
- >>>48 belong&0x3 0 total store ordering,
4880
- >>>48 belong&0x3 1 partial store ordering,
4881
- >>>48 belong&0x3 2 relaxed memory ordering,
4882
- >>18 beshort 44 Siemens Tricore Embedded Processor,
4883
- >>18 beshort 45 Argonaut RISC Core, Argonaut Technologies Inc.,
4884
- >>18 beshort 46 Renesas H8/300,
4885
- >>18 beshort 47 Renesas H8/300H,
4886
- >>18 beshort 48 Renesas H8S,
4887
- >>18 beshort 49 Renesas H8/500,
4888
- >>18 beshort 50 IA-64,
4889
- >>18 beshort 51 Stanford MIPS-X,
4890
- >>18 beshort 52 Motorola Coldfire,
4891
- >>18 beshort 53 Motorola M68HC12,
4892
- >>18 beshort 73 Cray NV1,
4893
- >>18 beshort 75 Digital VAX,
4894
- >>18 beshort 88 Renesas M32R,
4895
- >>18 leshort 92 OpenRISC,
4896
- >>18 leshort 0x3426 OpenRISC (obsolete),
4897
- >>18 leshort 0x8472 OpenRISC (obsolete),
4898
- >>18 beshort 94 Tensilica Xtensa,
4899
- >>18 beshort 97 NatSemi 32k,
4900
- >>18 beshort 0x18ad AVR32 (unofficial),
4901
- >>18 beshort 0x9026 Alpha (unofficial),
4902
- >>18 beshort 0xa390 IBM S/390 (obsolete),
4903
- >>20 belong 0 invalid version
4904
- >>20 belong 1 version 1
4905
- >>36 belong 1 MathCoPro/FPU/MAU Required
4906
- # Up to now only 0, 1 and 2 are defined; I've seen a file with 0x83, it seemed
4907
- # like proper ELF, but extracting the string had bad results.
4908
- >4 byte <0x80
4909
- >>8 string >\0 (%s)
4910
- >8 string \0
4911
- >>7 byte 0 (SYSV)
4912
- >>7 byte 1 (HP-UX)
4913
- >>7 byte 2 (NetBSD)
4914
- >>7 byte 3 (GNU/Linux)
4915
- >>7 byte 4 (GNU/Hurd)
4916
- >>7 byte 5 (86Open)
4917
- >>7 byte 6 (Solaris)
4918
- >>7 byte 7 (Monterey)
4919
- >>7 byte 8 (IRIX)
4920
- >>7 byte 9 (FreeBSD)
4921
- >>7 byte 10 (Tru64)
4922
- >>7 byte 11 (Novell Modesto)
4923
- >>7 byte 12 (OpenBSD)
4924
- >8 string \2
4925
- >>7 byte 13 (OpenVMS)
4926
- >>7 byte 97 (ARM)
4927
- >>7 byte 255 (embedded)
4928
-
4929
- #------------------------------------------------------------------------------
4930
- # encore: file(1) magic for Encore machines
4931
- #
4932
- # XXX - needs to have the byte order specified (NS32K was little-endian,
4933
- # dunno whether they run the 88K in little-endian mode or not).
4934
- #
4935
- 0 short 0x154 Encore
4936
- >20 short 0x107 executable
4937
- >20 short 0x108 pure executable
4938
- >20 short 0x10b demand-paged executable
4939
- >20 short 0x10f unsupported executable
4940
- >12 long >0 not stripped
4941
- >22 short >0 - version %ld
4942
- >22 short 0 -
4943
- #>4 date x stamp %s
4944
- 0 short 0x155 Encore unsupported executable
4945
- >12 long >0 not stripped
4946
- >22 short >0 - version %ld
4947
- >22 short 0 -
4948
- #>4 date x stamp %s
4949
- #------------------------------------------------------------------------------
4950
- # EPOC : file(1) magic for EPOC documents [Psion Series 5/Osaris/Geofox 1]
4951
- # Stefan Praszalowicz (hpicollo@worldnet.fr)
4952
- # Useful information for improving this file can be found at:
4953
- # http://software.frodo.looijaard.name/psiconv/formats/Index.html
4954
- 0 lelong 0x10000037
4955
- >4 lelong 0x1000006D
4956
- >>8 lelong 0x1000007F Psion Word
4957
- >>8 lelong 0x10000088 Psion Sheet
4958
- >>8 lelong 0x1000007D Psion Sketch
4959
- >>8 lelong 0x10000085 Psion TextEd
4960
-
4961
- #------------------------------------------------------------------------------
4962
- # erlang: file(1) magic for Erlang JAM and BEAM files
4963
- # URL: http://www.erlang.org/faq/x779.html#AEN812
4964
-
4965
- # OTP R3-R4
4966
- 0 string \0177BEAM! Old Erlang BEAM file
4967
- >6 short >0 - version %d
4968
-
4969
- # OTP R5 and onwards
4970
- 0 string FOR1
4971
- >8 string BEAM Erlang BEAM file
4972
-
4973
- # 4.2 version may have a copyright notice!
4974
- 4 string Tue\ Jan\ 22\ 14:32:44\ MET\ 1991 Erlang JAM file - version 4.2
4975
- 79 string Tue\ Jan\ 22\ 14:32:44\ MET\ 1991 Erlang JAM file - version 4.2
4976
-
4977
- 4 string 1.0\ Fri\ Feb\ 3\ 09:55:56\ MET\ 1995 Erlang JAM file - version 4.3
4978
-
4979
- #------------------------------------------------------------------------------
4980
- # ESRI Shapefile format (.shp .shx .dbf=DBaseIII)
4981
- # Based on info from
4982
- # <URL:http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf>
4983
- 0 belong 9994 ESRI Shapefile
4984
- >4 belong =0
4985
- >8 belong =0
4986
- >12 belong =0
4987
- >16 belong =0
4988
- >20 belong =0
4989
- >28 lelong x version %d
4990
- >24 belong x length %d
4991
- >32 lelong =0 type Null Shape
4992
- >32 lelong =1 type Point
4993
- >32 lelong =3 type PolyLine
4994
- >32 lelong =5 type Polygon
4995
- >32 lelong =8 type MultiPoint
4996
- >32 lelong =11 type PointZ
4997
- >32 lelong =13 type PolyLineZ
4998
- >32 lelong =15 type PolygonZ
4999
- >32 lelong =18 type MultiPointZ
5000
- >32 lelong =21 type PointM
5001
- >32 lelong =23 type PolyLineM
5002
- >32 lelong =25 type PolygonM
5003
- >32 lelong =28 type MultiPointM
5004
- >32 lelong =31 type MultiPatch
5005
-
5006
- #------------------------------------------------------------------------------
5007
- # fcs: file(1) magic for FCS (Flow Cytometry Standard) data files
5008
- # From Roger Leigh <roger@whinlatter.uklinux.net>
5009
- 0 string FCS1.0 Flow Cytometry Standard (FCS) data, version 1.0
5010
- 0 string FCS2.0 Flow Cytometry Standard (FCS) data, version 2.0
5011
- 0 string FCS3.0 Flow Cytometry Standard (FCS) data, version 3.0
5012
-
5013
-
5014
- #------------------------------------------------------------------------------
5015
- # filesystems: file(1) magic for different filesystems
5016
- #
5017
- 0 string \366\366\366\366 PC formatted floppy with no filesystem
5018
- # Sun disk labels
5019
- # From /usr/include/sun/dklabel.h:
5020
- 0774 beshort 0xdabe
5021
- # modified by Joerg Jenderek, because original test
5022
- # succeeds for Cabinet archive dao360.dl_ with negative blocks
5023
- >0770 long >0 Sun disk label
5024
- >>0 string x '%s
5025
- >>>31 string >\0 \b%s
5026
- >>>>63 string >\0 \b%s
5027
- >>>>>95 string >\0 \b%s
5028
- >>0 string x \b'
5029
- >>0734 short >0 %d rpm,
5030
- >>0736 short >0 %d phys cys,
5031
- >>0740 short >0 %d alts/cyl,
5032
- >>0746 short >0 %d interleave,
5033
- >>0750 short >0 %d data cyls,
5034
- >>0752 short >0 %d alt cyls,
5035
- >>0754 short >0 %d heads/partition,
5036
- >>0756 short >0 %d sectors/track,
5037
- >>0764 long >0 start cyl %ld,
5038
- >>0770 long x %ld blocks
5039
- # Is there a boot block written 1 sector in?
5040
- >512 belong&077777777 0600407 \b, boot block present
5041
- # Joerg Jenderek: Smart Boot Manager backup file is 41 byte header + first sectors of disc
5042
- # (http://btmgr.sourceforge.net/docs/user-guide-3.html)
5043
- 0 string SBMBAKUP_ Smart Boot Manager backup file
5044
- >9 string x \b, version %-5.5s
5045
- >>14 string =_
5046
- >>>15 string x %-.1s
5047
- >>>>16 string =_ \b.
5048
- >>>>>17 string x \b%-.1s
5049
- >>>>>>18 string =_ \b.
5050
- >>>>>>>19 string x \b%-.1s
5051
- >>>22 ubyte 0
5052
- >>>>21 ubyte x \b, from drive 0x%x
5053
- >>>22 ubyte >0
5054
- >>>>21 string x \b, from drive %s
5055
-
5056
- # Joerg Jenderek
5057
- # DOS Emulator image is 128 byte, null right padded header + harddisc image
5058
- 0 string DOSEMU\0
5059
- >0x27E leshort 0xAA55
5060
- #offset is 128
5061
- >>19 ubyte 128
5062
- >>>(19.b-1) ubyte 0x0 DOS Emulator image
5063
- >>>>7 ulelong >0 \b, %u heads
5064
- >>>>11 ulelong >0 \b, %d sectors/track
5065
- >>>>15 ulelong >0 \b, %d cylinders
5066
-
5067
- # updated by Joerg Jenderek at Sep 2007
5068
- # only for sector sizes with 512 or more Bytes
5069
- 0x1FE leshort 0xAA55 x86 boot sector
5070
- # to do also for sectors < than 512 Bytes and some other files, GRR
5071
- #30 search/481 \x55\xAA x86 boot sector
5072
- # not for BeOS floppy 1440k, MBRs
5073
- #(11.s-2) uleshort 0xAA55 x86 boot sector
5074
- >2 string OSBS \b, OS/BS MBR
5075
- # J\xf6rg Jenderek <joerg dot jenderek at web dot de>
5076
- >0x8C string Invalid\ partition\ table \b, MS-DOS MBR
5077
- # dr-dos with some upper-, lowercase variants
5078
- >0x9D string Invalid\ partition\ table$
5079
- >>181 string No\ Operating\ System$
5080
- >>>201 string Operating\ System\ load\ error$ \b, DR-DOS MBR, Version 7.01 to 7.03
5081
- >0x9D string Invalid\ partition\ table$
5082
- >>181 string No\ operating\ system$
5083
- >>>201 string Operating\ system\ load\ error$ \b, DR-DOS MBR, Version 7.01 to 7.03
5084
- >342 string Invalid\ partition\ table$
5085
- >>366 string No\ operating\ system$
5086
- >>>386 string Operating\ system\ load\ error$ \b, DR-DOS MBR, version 7.01 to 7.03
5087
- >295 string NEWLDR\0
5088
- >>302 string Bad\ PT\ $
5089
- >>>310 string No\ OS\ $
5090
- >>>>317 string OS\ load\ err$
5091
- >>>>>329 string Moved\ or\ missing\ IBMBIO.LDR\n\r
5092
- >>>>>>358 string Press\ any\ key\ to\ continue.\n\r$
5093
- >>>>>>>387 string Copyright\ (c)\ 1984,1998
5094
- >>>>>>>>411 string Caldera\ Inc.\0 \b, DR-DOS MBR (IBMBIO.LDR)
5095
- >0x10F string Ung\201ltige\ Partitionstabelle \b, MS-DOS MBR, german version 4.10.1998, 4.10.2222
5096
- >>0x1B8 ubelong >0 \b, Serial 0x%-.4x
5097
- >0x8B string Ung\201ltige\ Partitionstabelle \b, MS-DOS MBR, german version 5.00 to 4.00.950
5098
- >271 string Invalid\ partition\ table\0
5099
- >>295 string Error\ loading\ operating\ system\0
5100
- >>>326 string Missing\ operating\ system\0 \b, mbr
5101
- #
5102
- >139 string Invalid\ partition\ table\0
5103
- >>163 string Error\ loading\ operating\ system\0
5104
- >>>194 string Missing\ operating\ system\0 \b, Microsoft Windows XP mbr
5105
- # http://www.heise.de/ct/05/09/006/ page 184
5106
- #HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices\DosDevices\?:=Serial4Bytes+8Bytes
5107
- >>>>0x1B8 ulelong >0 \b,Serial 0x%-.4x
5108
- >300 string Invalid\ partition\ table\0
5109
- >>324 string Error\ loading\ operating\ system\0
5110
- >>>355 string Missing\ operating\ system\0 \b, Microsoft Windows XP MBR
5111
- #??>>>389 string Invalid\ system\ disk
5112
- >>>>0x1B8 ulelong >0 \b, Serial 0x%-.4x
5113
- >300 string Ung\201ltige\ Partitionstabelle
5114
- #split string to avoid error: String too long
5115
- >>328 string Fehler\ beim\ Laden\
5116
- >>>346 string des\ Betriebssystems
5117
- >>>>366 string Betriebssystem\ nicht\ vorhanden \b, Microsoft Windows XP MBR (german)
5118
- >>>>>0x1B8 ulelong >0 \b, Serial 0x%-.4x
5119
- #>0x145 string Default:\ F \b, FREE-DOS MBR
5120
- #>0x14B string Default:\ F \b, FREE-DOS 1.0 MBR
5121
- >0x145 search/7 Default:\ F \b, FREE-DOS MBR
5122
- #>>313 string F0\ .\ .\ .
5123
- #>>>322 string disk\ 1
5124
- #>>>>382 string FAT3
5125
- >64 string no\ active\ partition\ found
5126
- >>96 string read\ error\ while\ reading\ drive \b, FREE-DOS Beta 0.9 MBR
5127
- # Ranish Partition Manager http://www.ranish.com/part/
5128
- >387 search/4 \0\ Error!\r
5129
- >>378 search/7 Virus!
5130
- >>>397 search/4 Booting\
5131
- >>>>408 search/4 HD1/\0 \b, Ranish MBR (
5132
- >>>>>416 string Writing\ changes... \b2.37
5133
- >>>>>>438 ubyte x \b,0x%x dots
5134
- >>>>>>440 ubyte >0 \b,virus check
5135
- >>>>>>441 ubyte >0 \b,partition %c
5136
- #2.38,2.42,2.44
5137
- >>>>>416 string !Writing\ changes... \b
5138
- >>>>>>418 ubyte 1 \bvirus check,
5139
- >>>>>>419 ubyte x \b0x%x seconds
5140
- >>>>>>420 ubyte&0x0F >0 \b,partition
5141
- >>>>>>>420 ubyte&0x0F <5 \b %x
5142
- >>>>>>>420 ubyte&0x0F 0Xf \b ask
5143
- >>>>>420 ubyte x \b)
5144
- #
5145
- >271 string Operating\ system\ loading
5146
- >>296 string error\r \b, SYSLINUX MBR (2.10)
5147
- # http://www.acronis.de/
5148
- >362 string MBR\ Error\ \0\r
5149
- >>376 string ress\ any\ key\ to\
5150
- >>>392 string boot\ from\ floppy...\0 \b, Acronis MBR
5151
- # added by Joerg Jenderek
5152
- # http://www.visopsys.org/
5153
- # http://partitionlogic.org.uk/
5154
- >309 string No\ bootable\ partition\ found\r
5155
- >>339 string I/O\ Error\ reading\ boot\ sector\r \b, Visopsys MBR
5156
- >349 string No\ bootable\ partition\ found\r
5157
- >>379 string I/O\ Error\ reading\ boot\ sector\r \b, simple Visopsys MBR
5158
- # bootloader, bootmanager
5159
- >0x40 string SBML
5160
- # label with 11 characters of FAT 12 bit filesystem
5161
- >>43 string SMART\ BTMGR
5162
- >>>430 string SBMK\ Bad!\r \b, Smart Boot Manager
5163
- # OEM-ID not always "SBM"
5164
- #>>>>3 strings SBM
5165
- >>>>6 string >\0 \b, version %s
5166
- >382 string XOSLLOADXCF \b, eXtended Operating System Loader
5167
- >6 string LILO \b, LInux i386 boot LOader
5168
- >>120 string LILO \b, version 22.3.4 SuSe
5169
- >>172 string LILO \b, version 22.5.8 Debian
5170
- # updated by Joerg Jenderek at Oct 2008
5171
- # variables according to grub-0.97/stage1/stage1.S or
5172
- # http://www.gnu.org/software/grub/manual/grub.html#Embedded-data
5173
- # usual values are marked with comments to get only informations of strange GRUB loaders
5174
- >342 search/60 \0Geom\0
5175
- #>0 ulelong x %x=0x009048EB , 0x2a9048EB 0
5176
- >>0x41 ubyte <2
5177
- >>>0x3E ubyte >2 \b; GRand Unified Bootloader
5178
- # 0x3 for 0.5.95,0.93,0.94,0.96 0x4 for 1.90
5179
- >>>>0x3E ubyte x \b, stage1 version 0x%x
5180
- #If it is 0xFF, use a drive passed by BIOS
5181
- >>>>0x40 ubyte <0xFF \b, boot drive 0x%x
5182
- # in most case 0,1,0x2e for GRUB 0.5.95
5183
- >>>>0x41 ubyte >0 \b, LBA flag 0x%x
5184
- >>>>0x42 uleshort <0x8000 \b, stage2 address 0x%x
5185
- #>>>>0x42 uleshort =0x8000 \b, stage2 address 0x%x (usual)
5186
- >>>>0x42 uleshort >0x8000 \b, stage2 address 0x%x
5187
- #>>>>0x44 ulelong =1 \b, 1st sector stage2 0x%x (default)
5188
- >>>>0x44 ulelong >1 \b, 1st sector stage2 0x%x
5189
- >>>>0x48 uleshort <0x800 \b, stage2 segment 0x%x
5190
- #>>>>0x48 uleshort =0x800 \b, stage2 segment 0x%x (usual)
5191
- >>>>0x48 uleshort >0x800 \b, stage2 segment 0x%x
5192
- >>>>402 string Geom\0Hard\ Disk\0Read\0\ Error\0
5193
- >>>>>394 string stage1 \b, GRUB version 0.5.95
5194
- >>>>382 string Geom\0Hard\ Disk\0Read\0\ Error\0
5195
- >>>>>376 string GRUB\ \0 \b, GRUB version 0.93 or 1.94
5196
- >>>>383 string Geom\0Hard\ Disk\0Read\0\ Error\0
5197
- >>>>>377 string GRUB\ \0 \b, GRUB version 0.94
5198
- >>>>385 string Geom\0Hard\ Disk\0Read\0\ Error\0
5199
- >>>>>379 string GRUB\ \0 \b, GRUB version 0.95 or 0.96
5200
- >>>>391 string Geom\0Hard\ Disk\0Read\0\ Error\0
5201
- >>>>>385 string GRUB\ \0 \b, GRUB version 0.97
5202
- #unkown version
5203
- >>>343 string Geom\0Read\0\ Error\0
5204
- >>>>321 string Loading\ stage1.5 \b, GRUB version x.y
5205
- >>>380 string Geom\0Hard\ Disk\0Read\0\ Error\0
5206
- >>>>374 string GRUB\ \0 \b, GRUB version n.m
5207
- # http://syslinux.zytor.com/
5208
- >478 string Boot\ failed\r
5209
- >>495 string LDLINUX\ SYS \b, SYSLINUX bootloader (1.62)
5210
- >480 string Boot\ failed\r
5211
- >>495 string LDLINUX\ SYS \b, SYSLINUX bootloader (2.06 or 2.11)
5212
- >484 string Boot\ error\r \b, SYSLINUX bootloader (3.11)
5213
- >395 string chksum\0\ ERROR!\0 \b, Gujin bootloader
5214
- # http://www.bcdwb.de/bcdw/index_e.htm
5215
- >3 string BCDL
5216
- >>498 string BCDL\ \ \ \ BIN \b, Bootable CD Loader (1.50Z)
5217
- # mbr partion table entries
5218
- # OEM-ID does not contain MicroSoft,NEWLDR,DOS,SYSLINUX,or MTOOLs
5219
- >3 string !MS
5220
- >>3 string !SYSLINUX
5221
- >>>3 string !MTOOL
5222
- >>>>3 string !NEWLDR
5223
- >>>>>5 string !DOS
5224
- # not FAT (32 bit)
5225
- >>>>>>82 string !FAT32
5226
- #not Linux kernel
5227
- >>>>>>>514 string !HdrS
5228
- #not BeOS
5229
- >>>>>>>>422 string !Be\ Boot\ Loader
5230
- # active flag 0 or 0x80 and type > 0
5231
- >>>>>>>>>446 ubyte <0x81
5232
- >>>>>>>>>>446 ubyte&0x7F 0
5233
- >>>>>>>>>>>450 ubyte >0 \b; partition 1: ID=0x%x
5234
- >>>>>>>>>>>>446 ubyte 0x80 \b, active
5235
- >>>>>>>>>>>>447 ubyte x \b, starthead %u
5236
- #>>>>>>>>>>>>448 ubyte x \b, start C_S: 0x%x
5237
- #>>>>>>>>>>>>448 ubeshort&1023 x \b, startcylinder? %d
5238
- >>>>>>>>>>>>454 ulelong x \b, startsector %u
5239
- >>>>>>>>>>>>458 ulelong x \b, %u sectors
5240
- #
5241
- >>>>>>>>>462 ubyte <0x81
5242
- >>>>>>>>>>462 ubyte&0x7F 0
5243
- >>>>>>>>>>>466 ubyte >0 \b; partition 2: ID=0x%x
5244
- >>>>>>>>>>>>462 ubyte 0x80 \b, active
5245
- >>>>>>>>>>>>463 ubyte x \b, starthead %u
5246
- #>>>>>>>>>>>>464 ubyte x \b, start C_S: 0x%x
5247
- #>>>>>>>>>>>>464 ubeshort&1023 x \b, startcylinder? %d
5248
- >>>>>>>>>>>>470 ulelong x \b, startsector %u
5249
- >>>>>>>>>>>>474 ulelong x \b, %u sectors
5250
- #
5251
- >>>>>>>>>478 ubyte <0x81
5252
- >>>>>>>>>>478 ubyte&0x7F 0
5253
- >>>>>>>>>>>482 ubyte >0 \b; partition 3: ID=0x%x
5254
- >>>>>>>>>>>>478 ubyte 0x80 \b, active
5255
- >>>>>>>>>>>>479 ubyte x \b, starthead %u
5256
- #>>>>>>>>>>>>480 ubyte x \b, start C_S: 0x%x
5257
- #>>>>>>>>>>>>481 ubyte x \b, start C2S: 0x%x
5258
- #>>>>>>>>>>>>480 ubeshort&1023 x \b, startcylinder? %d
5259
- >>>>>>>>>>>>486 ulelong x \b, startsector %u
5260
- >>>>>>>>>>>>490 ulelong x \b, %u sectors
5261
- #
5262
- >>>>>>>>>494 ubyte <0x81
5263
- >>>>>>>>>>494 ubyte&0x7F 0
5264
- >>>>>>>>>>>498 ubyte >0 \b; partition 4: ID=0x%x
5265
- >>>>>>>>>>>>494 ubyte 0x80 \b, active
5266
- >>>>>>>>>>>>495 ubyte x \b, starthead %u
5267
- #>>>>>>>>>>>>496 ubyte x \b, start C_S: 0x%x
5268
- #>>>>>>>>>>>>496 ubeshort&1023 x \b, startcylinder? %d
5269
- >>>>>>>>>>>>502 ulelong x \b, startsector %u
5270
- >>>>>>>>>>>>506 ulelong x \b, %u sectors
5271
- # mbr partion table entries end
5272
- # http://www.acronis.de/
5273
- #FAT label=ACRONIS\ SZ
5274
- #OEM-ID=BOOTWIZ0
5275
- >442 string Non-system\ disk,\
5276
- >>459 string press\ any\ key...\x7\0 \b, Acronis Startup Recovery Loader
5277
- # DOS names like F11.SYS are 8 right space padded bytes+3 bytes
5278
- >>>477 ubyte&0xDF >0
5279
- >>>>477 string x \b %-.3s
5280
- >>>>>480 ubyte&0xDF >0
5281
- >>>>>>480 string x \b%-.5s
5282
- >>>>485 ubyte&0xDF >0
5283
- >>>>>485 string x \b.%-.3s
5284
- #
5285
- >185 string FDBOOT\ Version\
5286
- >>204 string \rNo\ Systemdisk.\
5287
- >>>220 string Booting\ from\ harddisk.\n\r
5288
- >>>245 string Cannot\ load\ from\ harddisk.\n\r
5289
- >>>>273 string Insert\ Systemdisk\
5290
- >>>>>291 string and\ press\ any\ key.\n\r \b, FDBOOT harddisk Bootloader
5291
- >>>>>>200 string >\0 \b, version %-3s
5292
- >242 string Bootsector\ from\ C.H.\ Hochst\204
5293
- >>278 string No\ Systemdisk.\
5294
- >>>293 string Booting\ from\ harddisk.\n\r
5295
- >>>441 string Cannot\ load\ from\ harddisk.\n\r
5296
- >>>>469 string Insert\ Systemdisk\
5297
- >>>>>487 string and\ press\ any\ key.\n\r \b, WinImage harddisk Bootloader
5298
- >>>>>>209 string >\0 \b, version %-4.4s
5299
- >(1.b+2) ubyte 0xe
5300
- >>(1.b+3) ubyte 0x1f
5301
- >>>(1.b+4) ubyte 0xbe
5302
- >>>>(1.b+5) ubyte 0x77
5303
- >>>>(1.b+6) ubyte 0x7c
5304
- >>>>>(1.b+7) ubyte 0xac
5305
- >>>>>>(1.b+8) ubyte 0x22
5306
- >>>>>>>(1.b+9) ubyte 0xc0
5307
- >>>>>>>>(1.b+10) ubyte 0x74
5308
- >>>>>>>>>(1.b+11) ubyte 0xb
5309
- >>>>>>>>>>(1.b+12) ubyte 0x56
5310
- >>>>>>>>>>(1.b+13) ubyte 0xb4 \b, mkdosfs boot message display
5311
- >214 string Please\ try\ to\ install\ FreeDOS\ \b, DOS Emulator boot message display
5312
- #>>244 string from\ dosemu-freedos-*-bin.tgz\r
5313
- #>>>170 string Sorry,\ could\ not\ load\ an\
5314
- #>>>>195 string operating\ system.\r\n
5315
- #
5316
- >103 string This\ is\ not\ a\ bootable\ disk.\
5317
- >>132 string Please\ insert\ a\ bootable\
5318
- >>>157 string floppy\ and\r\n
5319
- >>>>169 string press\ any\ key\ to\ try\ again...\r \b, FREE-DOS message display
5320
- #
5321
- >66 string Solaris\ Boot\ Sector
5322
- >>99 string Incomplete\ MDBoot\ load.
5323
- >>>89 string Version \b, Sun Solaris Bootloader
5324
- >>>>97 byte x version %c
5325
- #
5326
- >408 string OS/2\ !!\ SYS01475\r\0
5327
- >>429 string OS/2\ !!\ SYS02025\r\0
5328
- >>>450 string OS/2\ !!\ SYS02027\r\0
5329
- >>>469 string OS2BOOT\ \ \ \ \b, IBM OS/2 Warp bootloader
5330
- #
5331
- >409 string OS/2\ !!\ SYS01475\r\0
5332
- >>430 string OS/2\ !!\ SYS02025\r\0
5333
- >>>451 string OS/2\ !!\ SYS02027\r\0
5334
- >>>470 string OS2BOOT\ \ \ \ \b, IBM OS/2 Warp Bootloader
5335
- >112 string This\ disk\ is\ not\ bootable\r
5336
- >>142 string If\ you\ wish\ to\ make\ it\ bootable
5337
- >>>176 string run\ the\ DOS\ program\ SYS\
5338
- >>>200 string after\ the\r
5339
- >>>>216 string system\ has\ been\ loaded\r\n
5340
- >>>>>242 string Please\ insert\ a\ DOS\ diskette\
5341
- >>>>>271 string into\r\n\ the\ drive\ and\
5342
- >>>>>>292 string strike\ any\ key...\0 \b, IBM OS/2 Warp message display
5343
- # XP
5344
- >430 string NTLDR\ is\ missing\xFF\r\n
5345
- >>449 string Disk\ error\xFF\r\n
5346
- >>>462 string Press\ any\ key\ to\ restart\r \b, Microsoft Windows XP Bootloader
5347
- # DOS names like NTLDR,CMLDR,$LDR$ are 8 right space padded bytes+3 bytes
5348
- >>>>417 ubyte&0xDF >0
5349
- >>>>>417 string x %-.5s
5350
- >>>>>>422 ubyte&0xDF >0
5351
- >>>>>>>422 string x \b%-.3s
5352
- >>>>>425 ubyte&0xDF >0
5353
- >>>>>>425 string >\ \b.%-.3s
5354
- #
5355
- >>>>371 ubyte >0x20
5356
- >>>>>368 ubyte&0xDF >0
5357
- >>>>>>368 string x %-.5s
5358
- >>>>>>>373 ubyte&0xDF >0
5359
- >>>>>>>>373 string x \b%-.3s
5360
- >>>>>>376 ubyte&0xDF >0
5361
- >>>>>>>376 string x \b.%-.3s
5362
- #
5363
- >430 string NTLDR\ nicht\ gefunden\xFF\r\n
5364
- >>453 string Datentr\204gerfehler\xFF\r\n
5365
- >>>473 string Neustart\ mit\ beliebiger\ Taste\r \b, Microsoft Windows XP Bootloader (german)
5366
- >>>>417 ubyte&0xDF >0
5367
- >>>>>417 string x %-.5s
5368
- >>>>>>422 ubyte&0xDF >0
5369
- >>>>>>>422 string x \b%-.3s
5370
- >>>>>425 ubyte&0xDF >0
5371
- >>>>>>425 string >\ \b.%-.3s
5372
- # offset variant
5373
- >>>>379 string \0
5374
- >>>>>368 ubyte&0xDF >0
5375
- >>>>>>368 string x %-.5s
5376
- >>>>>>>373 ubyte&0xDF >0
5377
- >>>>>>>>373 string x \b%-.3s
5378
- #
5379
- >430 string NTLDR\ fehlt\xFF\r\n
5380
- >>444 string Datentr\204gerfehler\xFF\r\n
5381
- >>>464 string Neustart\ mit\ beliebiger\ Taste\r \b, Microsoft Windows XP Bootloader (2.german)
5382
- >>>>417 ubyte&0xDF >0
5383
- >>>>>417 string x %-.5s
5384
- >>>>>>422 ubyte&0xDF >0
5385
- >>>>>>>422 string x \b%-.3s
5386
- >>>>>425 ubyte&0xDF >0
5387
- >>>>>>425 string >\ \b.%-.3s
5388
- # variant
5389
- >>>>371 ubyte >0x20
5390
- >>>>>368 ubyte&0xDF >0
5391
- >>>>>>368 string x %-.5s
5392
- >>>>>>>373 ubyte&0xDF >0
5393
- >>>>>>>>373 string x \b%-.3s
5394
- >>>>>>376 ubyte&0xDF >0
5395
- >>>>>>>376 string x \b.%-.3s
5396
- #
5397
- >430 string NTLDR\ fehlt\xFF\r\n
5398
- >>444 string Medienfehler\xFF\r\n
5399
- >>>459 string Neustart:\ Taste\ dr\201cken\r \b, Microsoft Windows XP Bootloader (3.german)
5400
- >>>>371 ubyte >0x20
5401
- >>>>>368 ubyte&0xDF >0
5402
- >>>>>>368 string x %-.5s
5403
- >>>>>>>373 ubyte&0xDF >0
5404
- >>>>>>>>373 string x \b%-.3s
5405
- >>>>>>376 ubyte&0xDF >0
5406
- >>>>>>>376 string x \b.%-.3s
5407
- # variant
5408
- >>>>417 ubyte&0xDF >0
5409
- >>>>>417 string x %-.5s
5410
- >>>>>>422 ubyte&0xDF >0
5411
- >>>>>>>422 string x \b%-.3s
5412
- >>>>>425 ubyte&0xDF >0
5413
- >>>>>>425 string >\ \b.%-.3s
5414
- #
5415
- >430 string Datentr\204ger\ entfernen\xFF\r\n
5416
- >>454 string Medienfehler\xFF\r\n
5417
- >>>469 string Neustart:\ Taste\ dr\201cken\r \b, Microsoft Windows XP Bootloader (4.german)
5418
- >>>>379 string \0
5419
- >>>>>368 ubyte&0xDF >0
5420
- >>>>>>368 string x %-.5s
5421
- >>>>>>>373 ubyte&0xDF >0
5422
- >>>>>>>>373 string x \b%-.3s
5423
- >>>>>>376 ubyte&0xDF >0
5424
- >>>>>>>376 string x \b.%-.3s
5425
- # variant
5426
- >>>>417 ubyte&0xDF >0
5427
- >>>>>417 string x %-.5s
5428
- >>>>>>422 ubyte&0xDF >0
5429
- >>>>>>>422 string x \b%-.3s
5430
- >>>>>425 ubyte&0xDF >0
5431
- >>>>>>425 string >\ \b.%-.3s
5432
- #
5433
-
5434
- #>3 string NTFS\ \ \ \
5435
- >389 string Fehler\ beim\ Lesen\
5436
- >>407 string des\ Datentr\204gers
5437
- >>>426 string NTLDR\ fehlt
5438
- >>>>440 string NTLDR\ ist\ komprimiert
5439
- >>>>>464 string Neustart\ mit\ Strg+Alt+Entf\r \b, Microsoft Windows XP Bootloader NTFS (german)
5440
- #>3 string NTFS\ \ \ \
5441
- >313 string A\ disk\ read\ error\ occurred.\r
5442
- >>345 string A\ kernel\ file\ is\ missing\
5443
- >>>370 string from\ the\ disk.\r
5444
- >>>>484 string NTLDR\ is\ compressed
5445
- >>>>>429 string Insert\ a\ system\ diskette\
5446
- >>>>>>454 string and\ restart\r\nthe\ system.\r \b, Microsoft Windows XP Bootloader NTFS
5447
- # DOS loader variants different languages,offsets
5448
- >472 ubyte&0xDF >0
5449
- >>389 string Invalid\ system\ disk\xFF\r\n
5450
- >>>411 string Disk\ I/O\ error
5451
- >>>>428 string Replace\ the\ disk,\ and\
5452
- >>>>>455 string press\ any\ key \b, Microsoft Windows 98 Bootloader
5453
- #IO.SYS
5454
- >>>>>>472 ubyte&0xDF >0
5455
- >>>>>>>472 string x \b %-.2s
5456
- >>>>>>>>474 ubyte&0xDF >0
5457
- >>>>>>>>>474 string x \b%-.5s
5458
- >>>>>>>>>>479 ubyte&0xDF >0
5459
- >>>>>>>>>>>479 string x \b%-.1s
5460
- >>>>>>>480 ubyte&0xDF >0
5461
- >>>>>>>>480 string x \b.%-.3s
5462
- #MSDOS.SYS
5463
- >>>>>>>483 ubyte&0xDF >0 \b+
5464
- >>>>>>>>483 string x \b%-.5s
5465
- >>>>>>>>>488 ubyte&0xDF >0
5466
- >>>>>>>>>>488 string x \b%-.3s
5467
- >>>>>>>>491 ubyte&0xDF >0
5468
- >>>>>>>>>491 string x \b.%-.3s
5469
- #
5470
- >>390 string Invalid\ system\ disk\xFF\r\n
5471
- >>>412 string Disk\ I/O\ error\xFF\r\n
5472
- >>>>429 string Replace\ the\ disk,\ and\
5473
- >>>>>451 string then\ press\ any\ key\r \b, Microsoft Windows 98 Bootloader
5474
- >>388 string Ungueltiges\ System\ \xFF\r\n
5475
- >>>410 string E/A-Fehler\ \ \ \ \xFF\r\n
5476
- >>>>427 string Datentraeger\ wechseln\ und\
5477
- >>>>>453 string Taste\ druecken\r \b, Microsoft Windows 95/98/ME Bootloader (german)
5478
- #WINBOOT.SYS only not spaces (0xDF)
5479
- >>>>>>497 ubyte&0xDF >0
5480
- >>>>>>>497 string x %-.5s
5481
- >>>>>>>>502 ubyte&0xDF >0
5482
- >>>>>>>>>502 string x \b%-.1s
5483
- >>>>>>>>>>503 ubyte&0xDF >0
5484
- >>>>>>>>>>>503 string x \b%-.1s
5485
- >>>>>>>>>>>>504 ubyte&0xDF >0
5486
- >>>>>>>>>>>>>504 string x \b%-.1s
5487
- >>>>>>505 ubyte&0xDF >0
5488
- >>>>>>>505 string x \b.%-.3s
5489
- #IO.SYS
5490
- >>>>>>472 ubyte&0xDF >0 or
5491
- >>>>>>>472 string x \b %-.2s
5492
- >>>>>>>>474 ubyte&0xDF >0
5493
- >>>>>>>>>474 string x \b%-.5s
5494
- >>>>>>>>>>479 ubyte&0xDF >0
5495
- >>>>>>>>>>>479 string x \b%-.1s
5496
- >>>>>>>480 ubyte&0xDF >0
5497
- >>>>>>>>480 string x \b.%-.3s
5498
- #MSDOS.SYS
5499
- >>>>>>>483 ubyte&0xDF >0 \b+
5500
- >>>>>>>>483 string x \b%-.5s
5501
- >>>>>>>>>488 ubyte&0xDF >0
5502
- >>>>>>>>>>488 string x \b%-.3s
5503
- >>>>>>>>491 ubyte&0xDF >0
5504
- >>>>>>>>>491 string x \b.%-.3s
5505
- #
5506
- >>390 string Ungueltiges\ System\ \xFF\r\n
5507
- >>>412 string E/A-Fehler\ \ \ \ \xFF\r\n
5508
- >>>>429 string Datentraeger\ wechseln\ und\
5509
- >>>>>455 string Taste\ druecken\r \b, Microsoft Windows 95/98/ME Bootloader (German)
5510
- #WINBOOT.SYS only not spaces (0xDF)
5511
- >>>>>>497 ubyte&0xDF >0
5512
- >>>>>>>497 string x %-.7s
5513
- >>>>>>>>504 ubyte&0xDF >0
5514
- >>>>>>>>>504 string x \b%-.1s
5515
- >>>>>>505 ubyte&0xDF >0
5516
- >>>>>>>505 string x \b.%-.3s
5517
- #IO.SYS
5518
- >>>>>>472 ubyte&0xDF >0 or
5519
- >>>>>>>472 string x \b %-.2s
5520
- >>>>>>>>474 ubyte&0xDF >0
5521
- >>>>>>>>>474 string x \b%-.6s
5522
- >>>>>>>480 ubyte&0xDF >0
5523
- >>>>>>>>480 string x \b.%-.3s
5524
- #MSDOS.SYS
5525
- >>>>>>>483 ubyte&0xDF >0 \b+
5526
- >>>>>>>>483 string x \b%-.5s
5527
- >>>>>>>>>488 ubyte&0xDF >0
5528
- >>>>>>>>>>488 string x \b%-.3s
5529
- >>>>>>>>491 ubyte&0xDF >0
5530
- >>>>>>>>>491 string x \b.%-.3s
5531
- #
5532
- >>389 string Ungueltiges\ System\ \xFF\r\n
5533
- >>>411 string E/A-Fehler\ \ \ \ \xFF\r\n
5534
- >>>>428 string Datentraeger\ wechseln\ und\
5535
- >>>>>454 string Taste\ druecken\r \b, Microsoft Windows 95/98/ME Bootloader (GERMAN)
5536
- # DOS names like IO.SYS,WINBOOT.SYS,MSDOS.SYS,WINBOOT.INI are 8 right space padded bytes+3 bytes
5537
- >>>>>>472 string x %-.2s
5538
- >>>>>>>474 ubyte&0xDF >0
5539
- >>>>>>>>474 string x \b%-.5s
5540
- >>>>>>>>479 ubyte&0xDF >0
5541
- >>>>>>>>>479 string x \b%-.1s
5542
- >>>>>>480 ubyte&0xDF >0
5543
- >>>>>>>480 string x \b.%-.3s
5544
- >>>>>>483 ubyte&0xDF >0 \b+
5545
- >>>>>>>483 string x \b%-.5s
5546
- >>>>>>>488 ubyte&0xDF >0
5547
- >>>>>>>>488 string x \b%-.2s
5548
- >>>>>>>>490 ubyte&0xDF >0
5549
- >>>>>>>>>490 string x \b%-.1s
5550
- >>>>>>>491 ubyte&0xDF >0
5551
- >>>>>>>>491 string x \b.%-.3s
5552
- >479 ubyte&0xDF >0
5553
- >>416 string Kein\ System\ oder\
5554
- >>>433 string Laufwerksfehler
5555
- >>>>450 string Wechseln\ und\ Taste\ dr\201cken \b, Microsoft DOS Bootloader (german)
5556
- #IO.SYS
5557
- >>>>>479 string x \b %-.2s
5558
- >>>>>>481 ubyte&0xDF >0
5559
- >>>>>>>481 string x \b%-.6s
5560
- >>>>>487 ubyte&0xDF >0
5561
- >>>>>>487 string x \b.%-.3s
5562
- #MSDOS.SYS
5563
- >>>>>>490 ubyte&0xDF >0 \b+
5564
- >>>>>>>490 string x \b%-.5s
5565
- >>>>>>>>495 ubyte&0xDF >0
5566
- >>>>>>>>>495 string x \b%-.3s
5567
- >>>>>>>498 ubyte&0xDF >0
5568
- >>>>>>>>498 string x \b.%-.3s
5569
- #
5570
- >376 search/41 Non-System\ disk\ or\
5571
- >>395 search/41 disk\ error\r
5572
- >>>407 search/41 Replace\ and\
5573
- >>>>419 search/41 press\ \b,
5574
- >>>>419 search/41 strike\ \b, old
5575
- >>>>426 search/41 any\ key\ when\ ready\r MS or PC-DOS bootloader
5576
- #449 Disk\ Boot\ failure\r MS 3.21
5577
- #466 Boot\ Failure\r MS 3.30
5578
- >>>>>468 search/18 \0
5579
- #IO.SYS,IBMBIO.COM
5580
- >>>>>>&0 string x \b %-.2s
5581
- >>>>>>>&-20 ubyte&0xDF >0
5582
- >>>>>>>>&-1 string x \b%-.4s
5583
- >>>>>>>>>&-16 ubyte&0xDF >0
5584
- >>>>>>>>>>&-1 string x \b%-.2s
5585
- >>>>>>&8 ubyte&0xDF >0 \b.
5586
- >>>>>>>&-1 string x \b%-.3s
5587
- #MSDOS.SYS,IBMDOS.COM
5588
- >>>>>>&11 ubyte&0xDF >0 \b+
5589
- >>>>>>>&-1 string x \b%-.5s
5590
- >>>>>>>>&-6 ubyte&0xDF >0
5591
- >>>>>>>>>&-1 string x \b%-.1s
5592
- >>>>>>>>>>&-5 ubyte&0xDF >0
5593
- >>>>>>>>>>>&-1 string x \b%-.2s
5594
- >>>>>>>&7 ubyte&0xDF >0 \b.
5595
- >>>>>>>>&-1 string x \b%-.3s
5596
- >441 string Cannot\ load\ from\ harddisk.\n\r
5597
- >>469 string Insert\ Systemdisk\
5598
- >>>487 string and\ press\ any\ key.\n\r \b, MS (2.11) DOS bootloader
5599
- #>43 string \224R-LOADER\ \ SYS =label
5600
- >54 string SYS
5601
- >>324 string VASKK
5602
- >>>495 string NEWLDR\0 \b, DR-DOS Bootloader (LOADER.SYS)
5603
- #
5604
- >98 string Press\ a\ key\ to\ retry\0\r
5605
- >>120 string Cannot\ find\ file\ \0\r
5606
- >>>139 string Disk\ read\ error\0\r
5607
- >>>>156 string Loading\ ...\0 \b, DR-DOS (3.41) Bootloader
5608
- #DRBIOS.SYS
5609
- >>>>>44 ubyte&0xDF >0
5610
- >>>>>>44 string x \b %-.6s
5611
- >>>>>>>50 ubyte&0xDF >0
5612
- >>>>>>>>50 string x \b%-.2s
5613
- >>>>>>52 ubyte&0xDF >0
5614
- >>>>>>>52 string x \b.%-.3s
5615
- #
5616
- >70 string IBMBIO\ \ COM
5617
- >>472 string Cannot\ load\ DOS!\
5618
- >>>489 string Any\ key\ to\ retry \b, DR-DOS Bootloader
5619
- >>471 string Cannot\ load\ DOS\
5620
- >>487 string press\ key\ to\ retry \b, Open-DOS Bootloader
5621
- #??
5622
- >444 string KERNEL\ \ SYS
5623
- >>314 string BOOT\ error! \b, FREE-DOS Bootloader
5624
- >499 string KERNEL\ \ SYS
5625
- >>305 string BOOT\ err!\0 \b, Free-DOS Bootloader
5626
- >449 string KERNEL\ \ SYS
5627
- >>319 string BOOT\ error! \b, FREE-DOS 0.5 Bootloader
5628
- #
5629
- >449 string Loading\ FreeDOS
5630
- >>0x1AF ulelong >0 \b, FREE-DOS 0.95,1.0 Bootloader
5631
- >>>497 ubyte&0xDF >0
5632
- >>>>497 string x \b %-.6s
5633
- >>>>>503 ubyte&0xDF >0
5634
- >>>>>>503 string x \b%-.1s
5635
- >>>>>>>504 ubyte&0xDF >0
5636
- >>>>>>>>504 string x \b%-.1s
5637
- >>>>505 ubyte&0xDF >0
5638
- >>>>>505 string x \b.%-.3s
5639
- #
5640
- >331 string Error!.0 \b, FREE-DOS 1.0 bootloader
5641
- #
5642
- >125 string Loading\ FreeDOS...\r
5643
- >>311 string BOOT\ error!\r \b, FREE-DOS bootloader
5644
- >>>441 ubyte&0xDF >0
5645
- >>>>441 string x \b %-.6s
5646
- >>>>>447 ubyte&0xDF >0
5647
- >>>>>>447 string x \b%-.1s
5648
- >>>>>>>448 ubyte&0xDF >0
5649
- >>>>>>>>448 string x \b%-.1s
5650
- >>>>449 ubyte&0xDF >0
5651
- >>>>>449 string x \b.%-.3s
5652
- >124 string FreeDOS\0
5653
- >>331 string \ err\0 \b, FREE-DOS BETa 0.9 Bootloader
5654
- # DOS names like KERNEL.SYS,KERNEL16.SYS,KERNEL32.SYS,METAKERN.SYS are 8 right space padded bytes+3 bytes
5655
- >>>497 ubyte&0xDF >0
5656
- >>>>497 string x \b %-.6s
5657
- >>>>>503 ubyte&0xDF >0
5658
- >>>>>>503 string x \b%-.1s
5659
- >>>>>>>504 ubyte&0xDF >0
5660
- >>>>>>>>504 string x \b%-.1s
5661
- >>>>505 ubyte&0xDF >0
5662
- >>>>>505 string x \b.%-.3s
5663
- >>333 string \ err\0 \b, FREE-DOS BEta 0.9 Bootloader
5664
- >>>497 ubyte&0xDF >0
5665
- >>>>497 string x \b %-.6s
5666
- >>>>>503 ubyte&0xDF >0
5667
- >>>>>>503 string x \b%-.1s
5668
- >>>>>>>504 ubyte&0xDF >0
5669
- >>>>>>>>504 string x \b%-.1s
5670
- >>>>505 ubyte&0xDF >0
5671
- >>>>>505 string x \b.%-.3s
5672
- >>334 string \ err\0 \b, FREE-DOS Beta 0.9 Bootloader
5673
- >>>497 ubyte&0xDF >0
5674
- >>>>497 string x \b %-.6s
5675
- >>>>>503 ubyte&0xDF >0
5676
- >>>>>>503 string x \b%-.1s
5677
- >>>>>>>504 ubyte&0xDF >0
5678
- >>>>>>>>504 string x \b%-.1s
5679
- >>>>505 ubyte&0xDF >0
5680
- >>>>>505 string x \b.%-.3s
5681
- >336 string Error!\
5682
- >>343 string Hit\ a\ key\ to\ reboot. \b, FREE-DOS Beta 0.9sr1 Bootloader
5683
- >>>497 ubyte&0xDF >0
5684
- >>>>497 string x \b %-.6s
5685
- >>>>>503 ubyte&0xDF >0
5686
- >>>>>>503 string x \b%-.1s
5687
- >>>>>>>504 ubyte&0xDF >0
5688
- >>>>>>>>504 string x \b%-.1s
5689
- >>>>505 ubyte&0xDF >0
5690
- >>>>>505 string x \b.%-.3s
5691
- # added by Joerg Jenderek
5692
- # http://www.visopsys.org/
5693
- # http://partitionlogic.org.uk/
5694
- # OEM-ID=Visopsys
5695
- >478 ulelong 0
5696
- >>(1.b+326) string I/O\ Error\ reading\
5697
- >>>(1.b+344) string Visopsys\ loader\r
5698
- >>>>(1.b+361) string Press\ any\ key\ to\ continue.\r \b, Visopsys loader
5699
- # http://alexfru.chat.ru/epm.html#bootprog
5700
- >494 ubyte >0x4D
5701
- >>495 string >E
5702
- >>>495 string <S
5703
- #OEM-ID is not reliable
5704
- >>>>3 string BootProg
5705
- # It just looks for a program file name at the root directory
5706
- # and loads corresponding file with following execution.
5707
- # DOS names like STARTUP.BIN,STARTUPC.COM,STARTUPE.EXE are 8 right space padded bytes+3 bytes
5708
- >>>>499 ubyte&0xDF >0 \b, COM/EXE Bootloader
5709
- >>>>>499 string x \b %-.1s
5710
- >>>>>>500 ubyte&0xDF >0
5711
- >>>>>>>500 string x \b%-.1s
5712
- >>>>>>>>501 ubyte&0xDF >0
5713
- >>>>>>>>>501 string x \b%-.1s
5714
- >>>>>>>>>>502 ubyte&0xDF >0
5715
- >>>>>>>>>>>502 string x \b%-.1s
5716
- >>>>>>>>>>>>503 ubyte&0xDF >0
5717
- >>>>>>>>>>>>>503 string x \b%-.1s
5718
- >>>>>>>>>>>>>>504 ubyte&0xDF >0
5719
- >>>>>>>>>>>>>>>504 string x \b%-.1s
5720
- >>>>>>>>>>>>>>>>505 ubyte&0xDF >0
5721
- >>>>>>>>>>>>>>>>>505 string x \b%-.1s
5722
- >>>>>>>>>>>>>>>>>>506 ubyte&0xDF >0
5723
- >>>>>>>>>>>>>>>>>>>506 string x \b%-.1s
5724
- #name extension
5725
- >>>>>507 ubyte&0xDF >0 \b.
5726
- >>>>>>507 string x \b%-.1s
5727
- >>>>>>>508 ubyte&0xDF >0
5728
- >>>>>>>>508 string x \b%-.1s
5729
- >>>>>>>>>509 ubyte&0xDF >0
5730
- >>>>>>>>>>509 string x \b%-.1s
5731
- #If the boot sector fails to read any other sector,
5732
- #it prints a very short message ("RE") to the screen and hangs the computer.
5733
- #If the boot sector fails to find needed program in the root directory,
5734
- #it also hangs with another message ("NF").
5735
- >>>>>492 string RENF \b, FAT (12 bit)
5736
- >>>>>495 string RENF \b, FAT (16 bit)
5737
- # http://alexfru.chat.ru/epm.html#bootprog
5738
- >494 ubyte >0x4D
5739
- >>495 string >E
5740
- >>>495 string <S
5741
- #OEM-ID is not reliable
5742
- >>>>3 string BootProg
5743
- # It just looks for a program file name at the root directory
5744
- # and loads corresponding file with following execution.
5745
- # DOS names like STARTUP.BIN,STARTUPC.COM,STARTUPE.EXE are 8 right space padded bytes+3 bytes
5746
- >>>>499 ubyte&0xDF >0 \b, COM/EXE Bootloader
5747
- >>>>>499 string x \b %-.1s
5748
- >>>>>>500 ubyte&0xDF >0
5749
- >>>>>>>500 string x \b%-.1s
5750
- >>>>>>>>501 ubyte&0xDF >0
5751
- >>>>>>>>>501 string x \b%-.1s
5752
- >>>>>>>>>>502 ubyte&0xDF >0
5753
- >>>>>>>>>>>502 string x \b%-.1s
5754
- >>>>>>>>>>>>503 ubyte&0xDF >0
5755
- >>>>>>>>>>>>>503 string x \b%-.1s
5756
- >>>>>>>>>>>>>>504 ubyte&0xDF >0
5757
- >>>>>>>>>>>>>>>504 string x \b%-.1s
5758
- >>>>>>>>>>>>>>>>505 ubyte&0xDF >0
5759
- >>>>>>>>>>>>>>>>>505 string x \b%-.1s
5760
- >>>>>>>>>>>>>>>>>>506 ubyte&0xDF >0
5761
- >>>>>>>>>>>>>>>>>>>506 string x \b%-.1s
5762
- #name extension
5763
- >>>>>507 ubyte&0xDF >0 \b.
5764
- >>>>>>507 string x \b%-.1s
5765
- >>>>>>>508 ubyte&0xDF >0
5766
- >>>>>>>>508 string x \b%-.1s
5767
- >>>>>>>>>509 ubyte&0xDF >0
5768
- >>>>>>>>>>509 string x \b%-.1s
5769
- #If the boot sector fails to read any other sector,
5770
- #it prints a very short message ("RE") to the screen and hangs the computer.
5771
- #If the boot sector fails to find needed program in the root directory,
5772
- #it also hangs with another message ("NF").
5773
- >>>>>492 string RENF \b, FAT (12 bit)
5774
- >>>>>495 string RENF \b, FAT (16 bit)
5775
- # x86 bootloader end
5776
- # updated by Joerg Jenderek at Sep 2007
5777
- >3 ubyte 0
5778
- #no active flag
5779
- >>446 ubyte 0
5780
- # partition 1 not empty
5781
- >>>450 ubyte >0
5782
- # partitions 3,4 empty
5783
- >>>>482 ubyte 0
5784
- >>>>>498 ubyte 0
5785
- # partition 2 ID=0,5,15
5786
- >>>>>>466 ubyte <0x10
5787
- >>>>>>>466 ubyte 0x05 \b, extended partition table
5788
- >>>>>>>466 ubyte 0x0F \b, extended partition table (LBA)
5789
- >>>>>>>466 ubyte 0x0 \b, extended partition table (last)
5790
- # JuMP short bootcodeoffset NOP assembler instructions will usually be EB xx 90
5791
- # http://mirror.href.com/thestarman/asm/2bytejumps.htmm#FWD
5792
- # older drives may use Near JuMP instruction E9 xx xx
5793
- >0 lelong&0x009000EB 0x009000EB
5794
- >0 lelong&0x000000E9 0x000000E9
5795
- # minimal short forward jump found 03cx??
5796
- # maximal short forward jump is 07fx
5797
- >1 ubyte <0xff \b, code offset 0x%x
5798
- # mtools-3.9.8/msdos.h
5799
- # usual values are marked with comments to get only informations of strange FAT systems
5800
- # valid sectorsize must be a power of 2 from 32 to 32768
5801
- >>11 uleshort&0x000f x
5802
- >>>11 uleshort <32769
5803
- >>>>11 uleshort >31
5804
- >>>>>21 ubyte&0xf0 0xF0
5805
- >>>>>>3 string >\0 \b, OEM-ID "%8.8s"
5806
- #http://mirror.href.com/thestarman/asm/debug/debug2.htm#IHC
5807
- >>>>>>>8 string IHC \b cached by Windows 9M
5808
- >>>>>>11 uleshort >512 \b, Bytes/sector %u
5809
- #>>>>>>11 uleshort =512 \b, Bytes/sector %u=512 (usual)
5810
- >>>>>>11 uleshort <512 \b, Bytes/sector %u
5811
- >>>>>>13 ubyte >1 \b, sectors/cluster %u
5812
- #>>>>>>13 ubyte =1 \b, sectors/cluster %u (usual on Floppies)
5813
- >>>>>>14 uleshort >32 \b, reserved sectors %u
5814
- #>>>>>>14 uleshort =32 \b, reserved sectors %u (usual Fat32)
5815
- #>>>>>>14 uleshort >1 \b, reserved sectors %u
5816
- #>>>>>>14 uleshort =1 \b, reserved sectors %u (usual FAT12,FAT16)
5817
- >>>>>>14 uleshort <1 \b, reserved sectors %u
5818
- >>>>>>16 ubyte >2 \b, FATs %u
5819
- #>>>>>>16 ubyte =2 \b, FATs %u (usual)
5820
- >>>>>>16 ubyte =1 \b, FAT %u
5821
- >>>>>>16 ubyte >0
5822
- >>>>>>17 uleshort >0 \b, root entries %u
5823
- #>>>>>>17 uleshort =0 \b, root entries %u=0 (usual Fat32)
5824
- >>>>>>19 uleshort >0 \b, sectors %u (volumes <=32 MB)
5825
- #>>>>>>19 uleshort =0 \b, sectors %u=0 (usual Fat32)
5826
- >>>>>>21 ubyte >0xF0 \b, Media descriptor 0x%x
5827
- #>>>>>>21 ubyte =0xF0 \b, Media descriptor 0x%x (usual floppy)
5828
- >>>>>>21 ubyte <0xF0 \b, Media descriptor 0x%x
5829
- >>>>>>22 uleshort >0 \b, sectors/FAT %u
5830
- #>>>>>>22 uleshort =0 \b, sectors/FAT %u=0 (usual Fat32)
5831
- >>>>>>26 ubyte >2 \b, heads %u
5832
- #>>>>>>26 ubyte =2 \b, heads %u (usual floppy)
5833
- >>>>>>26 ubyte =1 \b, heads %u
5834
- #skip for Digital Research DOS (version 3.41) 1440 kB Bootdisk
5835
- >>>>>>38 ubyte !0x70
5836
- >>>>>>>28 ulelong >0 \b, hidden sectors %u
5837
- #>>>>>>>28 ulelong =0 \b, hidden sectors %u (usual floppy)
5838
- >>>>>>>32 ulelong >0 \b, sectors %u (volumes > 32 MB)
5839
- #>>>>>>>32 ulelong =0 \b, sectors %u (volumes > 32 MB)
5840
- # FAT<32 specific
5841
- >>>>>>82 string !FAT32
5842
- #>>>>>>>36 ubyte 0x80 \b, physical drive 0x%x=0x80 (usual harddisk)
5843
- #>>>>>>>36 ubyte 0 \b, physical drive 0x%x=0 (usual floppy)
5844
- >>>>>>>36 ubyte !0x80
5845
- >>>>>>>>36 ubyte !0 \b, physical drive 0x%x
5846
- >>>>>>>37 ubyte >0 \b, reserved 0x%x
5847
- #>>>>>>>37 ubyte =0 \b, reserved 0x%x
5848
- >>>>>>>38 ubyte >0x29 \b, dos < 4.0 BootSector (0x%x)
5849
- >>>>>>>38 ubyte <0x29 \b, dos < 4.0 BootSector (0x%x)
5850
- >>>>>>>38 ubyte =0x29
5851
- >>>>>>>>39 ulelong x \b, serial number 0x%x
5852
- >>>>>>>>43 string <NO\ NAME \b, label: "%11.11s"
5853
- >>>>>>>>43 string >NO\ NAME \b, label: "%11.11s"
5854
- >>>>>>>>43 string =NO\ NAME \b, unlabeled
5855
- >>>>>>>54 string FAT \b, FAT
5856
- >>>>>>>>54 string FAT12 \b (12 bit)
5857
- >>>>>>>>54 string FAT16 \b (16 bit)
5858
- # FAT32 specific
5859
- >>>>>>82 string FAT32 \b, FAT (32 bit)
5860
- >>>>>>>36 ulelong x \b, sectors/FAT %u
5861
- >>>>>>>40 uleshort >0 \b, extension flags %u
5862
- #>>>>>>>40 uleshort =0 \b, extension flags %u
5863
- >>>>>>>42 uleshort >0 \b, fsVersion %u
5864
- #>>>>>>>42 uleshort =0 \b, fsVersion %u (usual)
5865
- >>>>>>>44 ulelong >2 \b, rootdir cluster %u
5866
- #>>>>>>>44 ulelong =2 \b, rootdir cluster %u
5867
- #>>>>>>>44 ulelong =1 \b, rootdir cluster %u
5868
- >>>>>>>48 uleshort >1 \b, infoSector %u
5869
- #>>>>>>>48 uleshort =1 \b, infoSector %u (usual)
5870
- >>>>>>>48 uleshort <1 \b, infoSector %u
5871
- >>>>>>>50 uleshort >6 \b, Backup boot sector %u
5872
- #>>>>>>>50 uleshort =6 \b, Backup boot sector %u (usual)
5873
- >>>>>>>50 uleshort <6 \b, Backup boot sector %u
5874
- >>>>>>>54 ulelong >0 \b, reserved1 0x%x
5875
- >>>>>>>58 ulelong >0 \b, reserved2 0x%x
5876
- >>>>>>>62 ulelong >0 \b, reserved3 0x%x
5877
- # same structure as FAT1X
5878
- >>>>>>>64 ubyte >0x80 \b, physical drive 0x%x
5879
- #>>>>>>>64 ubyte =0x80 \b, physical drive 0x%x=80 (usual harddisk)
5880
- >>>>>>>64 ubyte&0x7F >0 \b, physical drive 0x%x
5881
- #>>>>>>>64 ubyte =0 \b, physical drive 0x%x=0 (usual floppy)
5882
- >>>>>>>65 ubyte >0 \b, reserved 0x%x
5883
- >>>>>>>66 ubyte >0x29 \b, dos < 4.0 BootSector (0x%x)
5884
- >>>>>>>66 ubyte <0x29 \b, dos < 4.0 BootSector (0x%x)
5885
- >>>>>>>66 ubyte =0x29
5886
- >>>>>>>>67 ulelong x \b, serial number 0x%x
5887
- >>>>>>>>71 string <NO\ NAME \b, label: "%11.11s"
5888
- >>>>>>>71 string >NO\ NAME \b, label: "%11.11s"
5889
- >>>>>>>71 string =NO\ NAME \b, unlabeled
5890
- ### FATs end
5891
- >0x200 lelong 0x82564557 \b, BSD disklabel
5892
- # FATX
5893
- 0 string FATX FATX filesystem data
5894
-
5895
-
5896
- # Minix filesystems - Juan Cespedes <cespedes@debian.org>
5897
- 0x410 leshort 0x137f Minix filesystem
5898
- 0x410 beshort 0x137f Minix filesystem (big endian)
5899
- >0x402 beshort !0 \b, %d zones
5900
- >0x1e string minix \b, bootable
5901
- 0x410 leshort 0x138f Minix filesystem, 30 char names
5902
- 0x410 leshort 0x2468 Minix filesystem, version 2
5903
- 0x410 leshort 0x2478 Minix filesystem, version 2, 30 char names
5904
-
5905
- # romfs filesystems - Juan Cespedes <cespedes@debian.org>
5906
- 0 string -rom1fs- romfs filesystem, version 1
5907
- >8 belong x %d bytes,
5908
- >16 string x named %s.
5909
-
5910
- # netboot image - Juan Cespedes <cespedes@debian.org>
5911
- 0 lelong 0x1b031336L Netboot image,
5912
- >4 lelong&0xFFFFFF00 0
5913
- >>4 lelong&0x100 0x000 mode 2
5914
- >>4 lelong&0x100 0x100 mode 3
5915
- >4 lelong&0xFFFFFF00 !0 unknown mode
5916
-
5917
- 0x18b string OS/2 OS/2 Boot Manager
5918
-
5919
- # updated by Joerg Jenderek at Oct 2008!!
5920
- # http://syslinux.zytor.com/iso.php
5921
- 0 ulelong 0x7c40eafa isolinux Loader
5922
- # http://syslinux.zytor.com/pxe.php
5923
- 0 ulelong 0x007c05ea pxelinux Loader
5924
- 0 ulelong 0x60669c66 pxelinux Loader
5925
-
5926
- # added by Joerg Jenderek
5927
- # In the second sector (+0x200) are variables according to grub-0.97/stage2/asm.S or
5928
- # grub-1.94/kern/i386/pc/startup.S
5929
- # http://www.gnu.org/software/grub/manual/grub.html#Embedded-data
5930
- # usual values are marked with comments to get only informations of strange GRUB loaders
5931
- 0x200 uleshort 0x70EA
5932
- # found only version 3.{1,2}
5933
- >0x206 ubeshort >0x0300
5934
- # GRUB version (0.5.)95,0.93,0.94,0.96,0.97 > "00"
5935
- >>0x212 ubyte >0x29
5936
- >>>0x213 ubyte >0x29
5937
- # not iso9660_stage1_5
5938
- #>>>0 ulelong&0x00BE5652 0x00BE5652
5939
- >>>>0x213 ubyte >0x29 GRand Unified Bootloader
5940
- # config_file for stage1_5 is 0xffffffff + default "/boot/grub/stage2"
5941
- >>>>0x217 ubyte 0xFF stage1_5
5942
- >>>>0x217 ubyte <0xFF stage2
5943
- >>>>0x206 ubyte x \b version %u
5944
- >>>>0x207 ubyte x \b.%u
5945
- # module_size for 1.94
5946
- >>>>0x208 ulelong <0xffffff \b, installed partition %u
5947
- #>>>>0x208 ulelong =0xffffff \b, %u (default)
5948
- >>>>0x208 ulelong >0xffffff \b, installed partition %u
5949
- # GRUB 0.5.95 unofficial
5950
- >>>>0x20C ulelong&0x2E300000 0x2E300000
5951
- # 0=stage2 1=ffs 2=e2fs 3=fat 4=minix 5=reiserfs
5952
- >>>>>0x20C ubyte x \b, identifier 0x%x
5953
- #>>>>>0x20D ubyte =0 \b, LBA flag 0x%x (default)
5954
- >>>>>0x20D ubyte >0 \b, LBA flag 0x%x
5955
- # GRUB version as string
5956
- >>>>>0x20E string >\0 \b, GRUB version %-s
5957
- # for stage1_5 is 0xffffffff + config_file "/boot/grub/stage2" default
5958
- >>>>>>0x215 ulong 0xffffffff
5959
- >>>>>>>0x219 string >\0 \b, configuration file %-s
5960
- >>>>>>0x215 ulong !0xffffffff
5961
- >>>>>>>0x215 string >\0 \b, configuration file %-s
5962
- # newer GRUB versions
5963
- >>>>0x20C ulelong&0x2E300000 !0x2E300000
5964
- ##>>>>>0x20C ulelong =0 \b, saved entry %d (usual)
5965
- >>>>>0x20C ulelong >0 \b, saved entry %d
5966
- # for 1.94 contains kernel image size
5967
- # for 0.93,0.94,0.96,0.97
5968
- # 0=stage2 1=ffs 2=e2fs 3=fat 4=minix 5=reiserfs 6=vstafs 7=jfs 8=xfs 9=iso9660 a=ufs2
5969
- >>>>>0x210 ubyte x \b, identifier 0x%x
5970
- # The flag for LBA forcing is in most cases 0
5971
- #>>>>>0x211 ubyte =0 \b, LBA flag 0x%x (default)
5972
- >>>>>0x211 ubyte >0 \b, LBA flag 0x%x
5973
- # GRUB version as string
5974
- >>>>>0x212 string >\0 \b, GRUB version %-s
5975
- # for stage1_5 is 0xffffffff + config_file "/boot/grub/stage2" default
5976
- >>>>>0x217 ulong 0xffffffff
5977
- >>>>>>0x21b string >\0 \b, configuration file %-s
5978
- >>>>>0x217 ulong !0xffffffff
5979
- >>>>>>0x217 string >\0 \b, configuration file %-s
5980
-
5981
- 9564 lelong 0x00011954 Unix Fast File system [v1] (little-endian),
5982
- >8404 string x last mounted on %s,
5983
- #>9504 ledate x last checked at %s,
5984
- >8224 ledate x last written at %s,
5985
- >8401 byte x clean flag %d,
5986
- >8228 lelong x number of blocks %d,
5987
- >8232 lelong x number of data blocks %d,
5988
- >8236 lelong x number of cylinder groups %d,
5989
- >8240 lelong x block size %d,
5990
- >8244 lelong x fragment size %d,
5991
- >8252 lelong x minimum percentage of free blocks %d,
5992
- >8256 lelong x rotational delay %dms,
5993
- >8260 lelong x disk rotational speed %drps,
5994
- >8320 lelong 0 TIME optimization
5995
- >8320 lelong 1 SPACE optimization
5996
-
5997
- 42332 lelong 0x19540119 Unix Fast File system [v2] (little-endian)
5998
- >&-1164 string x last mounted on %s,
5999
- >&-696 string >\0 volume name %s,
6000
- >&-304 leqldate x last written at %s,
6001
- >&-1167 byte x clean flag %d,
6002
- >&-1168 byte x readonly flag %d,
6003
- >&-296 lequad x number of blocks %lld,
6004
- >&-288 lequad x number of data blocks %lld,
6005
- >&-1332 lelong x number of cylinder groups %d,
6006
- >&-1328 lelong x block size %d,
6007
- >&-1324 lelong x fragment size %d,
6008
- >&-180 lelong x average file size %d,
6009
- >&-176 lelong x average number of files in dir %d,
6010
- >&-272 lequad x pending blocks to free %lld,
6011
- >&-264 lelong x pending inodes to free %ld,
6012
- >&-664 lequad x system-wide uuid %0llx,
6013
- >&-1316 lelong x minimum percentage of free blocks %d,
6014
- >&-1248 lelong 0 TIME optimization
6015
- >&-1248 lelong 1 SPACE optimization
6016
-
6017
- 66908 lelong 0x19540119 Unix Fast File system [v2] (little-endian)
6018
- >&-1164 string x last mounted on %s,
6019
- >&-696 string >\0 volume name %s,
6020
- >&-304 leqldate x last written at %s,
6021
- >&-1167 byte x clean flag %d,
6022
- >&-1168 byte x readonly flag %d,
6023
- >&-296 lequad x number of blocks %lld,
6024
- >&-288 lequad x number of data blocks %lld,
6025
- >&-1332 lelong x number of cylinder groups %d,
6026
- >&-1328 lelong x block size %d,
6027
- >&-1324 lelong x fragment size %d,
6028
- >&-180 lelong x average file size %d,
6029
- >&-176 lelong x average number of files in dir %d,
6030
- >&-272 lequad x pending blocks to free %lld,
6031
- >&-264 lelong x pending inodes to free %ld,
6032
- >&-664 lequad x system-wide uuid %0llx,
6033
- >&-1316 lelong x minimum percentage of free blocks %d,
6034
- >&-1248 lelong 0 TIME optimization
6035
- >&-1248 lelong 1 SPACE optimization
6036
-
6037
- 9564 belong 0x00011954 Unix Fast File system [v1] (big-endian),
6038
- >7168 belong 0x4c41424c Apple UFS Volume
6039
- >>7186 string x named %s,
6040
- >>7176 belong x volume label version %d,
6041
- >>7180 bedate x created on %s,
6042
- >8404 string x last mounted on %s,
6043
- #>9504 bedate x last checked at %s,
6044
- >8224 bedate x last written at %s,
6045
- >8401 byte x clean flag %d,
6046
- >8228 belong x number of blocks %d,
6047
- >8232 belong x number of data blocks %d,
6048
- >8236 belong x number of cylinder groups %d,
6049
- >8240 belong x block size %d,
6050
- >8244 belong x fragment size %d,
6051
- >8252 belong x minimum percentage of free blocks %d,
6052
- >8256 belong x rotational delay %dms,
6053
- >8260 belong x disk rotational speed %drps,
6054
- >8320 belong 0 TIME optimization
6055
- >8320 belong 1 SPACE optimization
6056
-
6057
- 42332 belong 0x19540119 Unix Fast File system [v2] (big-endian)
6058
- >&-1164 string x last mounted on %s,
6059
- >&-696 string >\0 volume name %s,
6060
- >&-304 beqldate x last written at %s,
6061
- >&-1167 byte x clean flag %d,
6062
- >&-1168 byte x readonly flag %d,
6063
- >&-296 bequad x number of blocks %lld,
6064
- >&-288 bequad x number of data blocks %lld,
6065
- >&-1332 belong x number of cylinder groups %d,
6066
- >&-1328 belong x block size %d,
6067
- >&-1324 belong x fragment size %d,
6068
- >&-180 belong x average file size %d,
6069
- >&-176 belong x average number of files in dir %d,
6070
- >&-272 bequad x pending blocks to free %lld,
6071
- >&-264 belong x pending inodes to free %ld,
6072
- >&-664 bequad x system-wide uuid %0llx,
6073
- >&-1316 belong x minimum percentage of free blocks %d,
6074
- >&-1248 belong 0 TIME optimization
6075
- >&-1248 belong 1 SPACE optimization
6076
-
6077
- 66908 belong 0x19540119 Unix Fast File system [v2] (big-endian)
6078
- >&-1164 string x last mounted on %s,
6079
- >&-696 string >\0 volume name %s,
6080
- >&-304 beqldate x last written at %s,
6081
- >&-1167 byte x clean flag %d,
6082
- >&-1168 byte x readonly flag %d,
6083
- >&-296 bequad x number of blocks %lld,
6084
- >&-288 bequad x number of data blocks %lld,
6085
- >&-1332 belong x number of cylinder groups %d,
6086
- >&-1328 belong x block size %d,
6087
- >&-1324 belong x fragment size %d,
6088
- >&-180 belong x average file size %d,
6089
- >&-176 belong x average number of files in dir %d,
6090
- >&-272 bequad x pending blocks to free %lld,
6091
- >&-264 belong x pending inodes to free %ld,
6092
- >&-664 bequad x system-wide uuid %0llx,
6093
- >&-1316 belong x minimum percentage of free blocks %d,
6094
- >&-1248 belong 0 TIME optimization
6095
- >&-1248 belong 1 SPACE optimization
6096
-
6097
- # ext2/ext3 filesystems - Andreas Dilger <adilger@dilger.ca>
6098
- # ext4 filesystem - Eric Sandeen <sandeen@sandeen.net>
6099
- # volume label and UUID Russell Coker
6100
- # http://etbe.coker.com.au/2008/07/08/label-vs-uuid-vs-device/
6101
- 0x438 leshort 0xEF53 Linux
6102
- >0x44c lelong x rev %d
6103
- >0x43e leshort x \b.%d
6104
- # No journal? ext2
6105
- >0x45c lelong ^0x0000004 ext2 filesystem data
6106
- >>0x43a leshort ^0x0000001 (mounted or unclean)
6107
- # Has a journal? ext3 or ext4
6108
- >0x45c lelong &0x0000004
6109
- # and small INCOMPAT?
6110
- >>0x460 lelong <0x0000040
6111
- # and small RO_COMPAT?
6112
- >>>0x464 lelong <0x0000008 ext3 filesystem data
6113
- # else large RO_COMPAT?
6114
- >>>0x464 lelong >0x0000007 ext4 filesystem data
6115
- # else large INCOMPAT?
6116
- >>0x460 lelong >0x000003f ext4 filesystem data
6117
- >0x468 belong x \b, UUID=%08x
6118
- >0x46c beshort x \b-%04x
6119
- >0x46e beshort x \b-%04x
6120
- >0x470 beshort x \b-%04x
6121
- >0x472 belong x \b-%08x
6122
- >0x476 beshort x \b%04x
6123
- >0x478 string >0 \b, volume name "%s"
6124
- # General flags for any ext* fs
6125
- >0x460 lelong &0x0000004 (needs journal recovery)
6126
- >0x43a leshort &0x0000002 (errors)
6127
- # INCOMPAT flags
6128
- >0x460 lelong &0x0000001 (compressed)
6129
- #>0x460 lelong &0x0000002 (filetype)
6130
- #>0x460 lelong &0x0000010 (meta bg)
6131
- >0x460 lelong &0x0000040 (extents)
6132
- >0x460 lelong &0x0000080 (64bit)
6133
- #>0x460 lelong &0x0000100 (mmp)
6134
- #>0x460 lelong &0x0000200 (flex bg)
6135
- # RO_INCOMPAT flags
6136
- #>0x464 lelong &0x0000001 (sparse super)
6137
- >0x464 lelong &0x0000002 (large files)
6138
- >0x464 lelong &0x0000008 (huge files)
6139
- #>0x464 lelong &0x0000010 (gdt checksum)
6140
- #>0x464 lelong &0x0000020 (many subdirs)
6141
- #>0x463 lelong &0x0000040 (extra isize)
6142
-
6143
- # SGI disk labels - Nathan Scott <nathans@debian.org>
6144
- 0 belong 0x0BE5A941 SGI disk label (volume header)
6145
-
6146
- # SGI XFS filesystem - Nathan Scott <nathans@debian.org>
6147
- 0 belong 0x58465342 SGI XFS filesystem data
6148
- >0x4 belong x (blksz %d,
6149
- >0x68 beshort x inosz %d,
6150
- >0x64 beshort ^0x2004 v1 dirs)
6151
- >0x64 beshort &0x2004 v2 dirs)
6152
-
6153
- ############################################################################
6154
- # Minix-ST kernel floppy
6155
- 0x800 belong 0x46fc2700 Atari-ST Minix kernel image
6156
- >19 string \240\5\371\5\0\011\0\2\0 \b, 720k floppy
6157
- >19 string \320\2\370\5\0\011\0\1\0 \b, 360k floppy
6158
-
6159
- ############################################################################
6160
- # Hmmm, is this a better way of detecting _standard_ floppy images ?
6161
- 19 string \320\2\360\3\0\011\0\1\0 DOS floppy 360k
6162
- >0x1FE leshort 0xAA55 \b, x86 hard disk boot sector
6163
- 19 string \240\5\371\3\0\011\0\2\0 DOS floppy 720k
6164
- >0x1FE leshort 0xAA55 \b, x86 hard disk boot sector
6165
- 19 string \100\013\360\011\0\022\0\2\0 DOS floppy 1440k
6166
- >0x1FE leshort 0xAA55 \b, x86 hard disk boot sector
6167
-
6168
- 19 string \240\5\371\5\0\011\0\2\0 DOS floppy 720k, IBM
6169
- >0x1FE leshort 0xAA55 \b, x86 hard disk boot sector
6170
- 19 string \100\013\371\5\0\011\0\2\0 DOS floppy 1440k, mkdosfs
6171
- >0x1FE leshort 0xAA55 \b, x86 hard disk boot sector
6172
-
6173
- 19 string \320\2\370\5\0\011\0\1\0 Atari-ST floppy 360k
6174
- 19 string \240\5\371\5\0\011\0\2\0 Atari-ST floppy 720k
6175
-
6176
- # Valid media descriptor bytes for MS-DOS:
6177
- #
6178
- # Byte Capacity Media Size and Type
6179
- # -------------------------------------------------
6180
- #
6181
- # F0 2.88 MB 3.5-inch, 2-sided, 36-sector
6182
- # F0 1.44 MB 3.5-inch, 2-sided, 18-sector
6183
- # F9 720K 3.5-inch, 2-sided, 9-sector
6184
- # F9 1.2 MB 5.25-inch, 2-sided, 15-sector
6185
- # FD 360K 5.25-inch, 2-sided, 9-sector
6186
- # FF 320K 5.25-inch, 2-sided, 8-sector
6187
- # FC 180K 5.25-inch, 1-sided, 9-sector
6188
- # FE 160K 5.25-inch, 1-sided, 8-sector
6189
- # FE 250K 8-inch, 1-sided, single-density
6190
- # FD 500K 8-inch, 2-sided, single-density
6191
- # FE 1.2 MB 8-inch, 2-sided, double-density
6192
- # F8 ----- Fixed disk
6193
- #
6194
- # FC xxxK Apricot 70x1x9 boot disk.
6195
- #
6196
- # Originally a bitmap:
6197
- # xxxxxxx0 Not two sided
6198
- # xxxxxxx1 Double sided
6199
- # xxxxxx0x Not 8 SPT
6200
- # xxxxxx1x 8 SPT
6201
- # xxxxx0xx Not Removable drive
6202
- # xxxxx1xx Removable drive
6203
- # 11111xxx Must be one.
6204
- #
6205
- # But now it's rather random:
6206
- # 111111xx Low density disk
6207
- # 00 SS, Not 8 SPT
6208
- # 01 DS, Not 8 SPT
6209
- # 10 SS, 8 SPT
6210
- # 11 DS, 8 SPT
6211
- #
6212
- # 11111001 Double density 3� floppy disk, high density 5�
6213
- # 11110000 High density 3� floppy disk
6214
- # 11111000 Hard disk any format
6215
- #
6216
-
6217
- # CDROM Filesystems
6218
- # Modified for UDF by gerardo.cacciari@gmail.com
6219
- 32769 string CD001
6220
- !:mime application/x-iso9660-image
6221
- >38913 string !NSR0 ISO 9660 CD-ROM filesystem data
6222
- >38913 string NSR0 UDF filesystem data
6223
- >>38917 string 1 (version 1.0)
6224
- >>38917 string 2 (version 1.5)
6225
- >>38917 string 3 (version 2.0)
6226
- >>38917 byte >0x33 (unknown version, ID 0x%X)
6227
- >>38917 byte <0x31 (unknown version, ID 0x%X)
6228
- # "application id" which appears to be used as a volume label
6229
- >32808 string >\0 '%s'
6230
- >34816 string \000CD001\001EL\ TORITO\ SPECIFICATION (bootable)
6231
- 37633 string CD001 ISO 9660 CD-ROM filesystem data (raw 2352 byte sectors)
6232
- !:mime application/x-iso9660-image
6233
- 32776 string CDROM High Sierra CD-ROM filesystem data
6234
-
6235
- # cramfs filesystem - russell@coker.com.au
6236
- 0 lelong 0x28cd3d45 Linux Compressed ROM File System data, little endian
6237
- >4 lelong x size %lu
6238
- >8 lelong &1 version #2
6239
- >8 lelong &2 sorted_dirs
6240
- >8 lelong &4 hole_support
6241
- >32 lelong x CRC 0x%x,
6242
- >36 lelong x edition %lu,
6243
- >40 lelong x %lu blocks,
6244
- >44 lelong x %lu files
6245
-
6246
- 0 belong 0x28cd3d45 Linux Compressed ROM File System data, big endian
6247
- >4 belong x size %lu
6248
- >8 belong &1 version #2
6249
- >8 belong &2 sorted_dirs
6250
- >8 belong &4 hole_support
6251
- >32 belong x CRC 0x%x,
6252
- >36 belong x edition %lu,
6253
- >40 belong x %lu blocks,
6254
- >44 belong x %lu files
6255
-
6256
- # reiserfs - russell@coker.com.au
6257
- 0x10034 string ReIsErFs ReiserFS V3.5
6258
- 0x10034 string ReIsEr2Fs ReiserFS V3.6
6259
- 0x10034 string ReIsEr3Fs ReiserFS V3.6.19
6260
- >0x1002c leshort x block size %d
6261
- >0x10032 leshort &2 (mounted or unclean)
6262
- >0x10000 lelong x num blocks %d
6263
- >0x10040 lelong 1 tea hash
6264
- >0x10040 lelong 2 yura hash
6265
- >0x10040 lelong 3 r5 hash
6266
-
6267
- # JFFS - russell@coker.com.au
6268
- 0 lelong 0x34383931 Linux Journalled Flash File system, little endian
6269
- 0 belong 0x34383931 Linux Journalled Flash File system, big endian
6270
-
6271
- # EST flat binary format (which isn't, but anyway)
6272
- # From: Mark Brown <broonie@sirena.org.uk>
6273
- 0 string ESTFBINR EST flat binary
6274
-
6275
- # Aculab VoIP firmware
6276
- # From: Mark Brown <broonie@sirena.org.uk>
6277
- 0 string VoIP\ Startup\ and Aculab VoIP firmware
6278
- >35 string x format %s
6279
-
6280
- # u-boot/PPCBoot image file
6281
- # From: Mark Brown <broonie@sirena.org.uk>
6282
- 0 belong 0x27051956 u-boot/PPCBoot image
6283
- >4 string PPCBoot
6284
- >>12 string x version %s
6285
-
6286
- # JFFS2 file system
6287
- 0 leshort 0x1984 Linux old jffs2 filesystem data little endian
6288
- 0 leshort 0x1985 Linux jffs2 filesystem data little endian
6289
-
6290
- # Squashfs
6291
- 0 string sqsh Squashfs filesystem, big endian,
6292
- >28 beshort x version %d.
6293
- >30 beshort x \b%d,
6294
- >28 beshort <3
6295
- >>8 belong x %d bytes,
6296
- >28 beshort >2
6297
- >>63 bequad x %lld bytes,
6298
- #>>67 belong x %d bytes,
6299
- >4 belong x %d inodes,
6300
- >28 beshort <2
6301
- >>32 beshort x blocksize: %d bytes,
6302
- >28 beshort >1
6303
- >>51 belong x blocksize: %d bytes,
6304
- >39 bedate x created: %s
6305
- 0 string hsqs Squashfs filesystem, little endian,
6306
- >28 leshort x version %d.
6307
- >30 leshort x \b%d,
6308
- >28 leshort <3
6309
- >>8 lelong x %d bytes,
6310
- >28 leshort >2
6311
- >>63 lequad x %lld bytes,
6312
- #>>63 lelong x %d bytes,
6313
- >4 lelong x %d inodes,
6314
- >28 leshort <2
6315
- >>32 leshort x blocksize: %d bytes,
6316
- >28 leshort >1
6317
- >>51 lelong x blocksize: %d bytes,
6318
- >39 ledate x created: %s
6319
-
6320
- 0 string td\000 floppy image data (TeleDisk)
6321
-
6322
- # AFS Dump Magic
6323
- # From: Ty Sarna <tsarna@sarna.org>
6324
- 0 string \x01\xb3\xa1\x13\x22 AFS Dump
6325
- >&0 belong x (v%d)
6326
- >>&0 byte 0x76
6327
- >>>&0 belong x Vol %d,
6328
- >>>>&0 byte 0x6e
6329
- >>>>>&0 string x %s
6330
- >>>>>>&1 byte 0x74
6331
- >>>>>>>&0 beshort 2
6332
- >>>>>>>>&4 bedate x on: %s
6333
- >>>>>>>>&0 bedate =0 full dump
6334
- >>>>>>>>&0 bedate !0 incremental since: %s
6335
-
6336
- #----------------------------------------------------------
6337
- # VMS backup savesets - gerardo.cacciari@gmail.com
6338
- #
6339
- 4 string \x01\x00\x01\x00\x01\x00
6340
- >(0.s+16) string \x01\x01
6341
- >>&(&0.b+8) byte 0x42 OpenVMS backup saveset data
6342
- >>>40 lelong x (block size %d,
6343
- >>>49 string >\0 original name '%s',
6344
- >>>2 short 1024 VAX generated)
6345
- >>>2 short 2048 AXP generated)
6346
- >>>2 short 4096 I64 generated)
6347
-
6348
- # Summary: Oracle Clustered Filesystem
6349
- # Created by: Aaron Botsis <redhat@digitalmafia.org>
6350
- 8 string OracleCFS Oracle Clustered Filesystem,
6351
- >4 long x rev %d
6352
- >0 long x \b.%d,
6353
- >560 string x label: %.64s,
6354
- >136 string x mountpoint: %.128s
6355
-
6356
- # Summary: Oracle ASM tagged volume
6357
- # Created by: Aaron Botsis <redhat@digitalmafia.org>
6358
- 32 string ORCLDISK Oracle ASM Volume,
6359
- >40 string x Disk Name: %0.12s
6360
- 32 string ORCLCLRD Oracle ASM Volume (cleared),
6361
- >40 string x Disk Name: %0.12s
6362
-
6363
- # Oracle Clustered Filesystem - Aaron Botsis <redhat@digitalmafia.org>
6364
- 8 string OracleCFS Oracle Clustered Filesystem,
6365
- >4 long x rev %d
6366
- >0 long x \b.%d,
6367
- >560 string x label: %.64s,
6368
- >136 string x mountpoint: %.128s
6369
-
6370
- # Oracle ASM tagged volume - Aaron Botsis <redhat@digitalmafia.org>
6371
- 32 string ORCLDISK Oracle ASM Volume,
6372
- >40 string x Disk Name: %0.12s
6373
- 32 string ORCLCLRD Oracle ASM Volume (cleared),
6374
- >40 string x Disk Name: %0.12s
6375
-
6376
- # Compaq/HP RILOE floppy image
6377
- # From: Dirk Jagdmann <doj@cubic.org>
6378
- 0 string CPQRFBLO Compaq/HP RILOE floppy image
6379
-
6380
- #------------------------------------------------------------------------------
6381
- # Files-11 On-Disk Structure (OpenVMS file system) - gerardo.cacciari@gmail.com
6382
- # These bits come from LBN 1 (home block) of ODS-2 and ODS-5 volumes, which is
6383
- # mapped to VBN 2 of [000000]INDEXF.SYS;1
6384
- #
6385
- 1008 string DECFILE11B Files-11 On-Disk Structure
6386
- >525 byte x Level %d
6387
- >525 byte x (ODS-%d OpenVMS file system),
6388
- >984 string x volume label is '%-12.12s'
6389
-
6390
- # From: Thomas Klausner <wiz@NetBSD.org>
6391
- # http://filext.com/file-extension/DAA
6392
- # describes the daa file format. The magic would be:
6393
- 0 string DAA\x0\x0\x0\x0\x0 PowerISO Direct-Access-Archive
6394
-
6395
- # From Albert Cahalan <acahalan@gmail.com>
6396
- # really le32 operation,destination,payloadsize (but quite predictable)
6397
- # 01 00 00 00 00 00 00 c0 00 02 00 00
6398
- 0 string \1\0\0\0\0\0\0\300\0\2\0\0 Marvell Libertas firmware
6399
-
6400
- # From Eric Sandeen
6401
- # GFS2
6402
- 0x10000 belong 0x01161970 GFS2 Filesystem
6403
- >0x10024 belong x (blocksize %d,
6404
- >0x10060 string >\0 lockproto %s)
6405
-
6406
- # BTRFS
6407
- 0x10040 string _BHRfS_M BTRFS Filesystem
6408
- >0x1012b string >\0 (label "%s",
6409
- >0x10090 lelong x sectorsize %d,
6410
- >0x10094 lelong x nodesize %d,
6411
- >0x10098 lelong x leafsize %d)
6412
-
6413
-
6414
- # dvdisaster's .ecc
6415
- # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
6416
- 0 string *dvdisaster* dvdisaster error correction file
6417
-
6418
- # Type: CROM filesystem
6419
- # From: Werner Fink <werner@suse.de>
6420
- 0 string CROMFS CROMFS
6421
- >6 string >\0 \b version %2.2s,
6422
- >8 ulequad >0 \b block data at %lld,
6423
- >16 ulequad >0 \b fblock table at %lld,
6424
- >24 ulequad >0 \b inode table at %lld,
6425
- >32 ulequad >0 \b root at %lld,
6426
- >40 ulelong >0 \b fblock size = %ld,
6427
- >44 ulelong >0 \b block size = %ld,
6428
- >48 ulequad >0 \b bytes = %lld
6429
-
6430
- #------------------------------------------------------------------------------
6431
- # flash: file(1) magic for Macromedia Flash file format
6432
- #
6433
- # See
6434
- #
6435
- # http://www.macromedia.com/software/flash/open/
6436
- #
6437
- 0 string FWS Macromedia Flash data,
6438
- >3 byte x version %d
6439
- !:mime application/x-shockwave-flash
6440
- 0 string CWS Macromedia Flash data (compressed),
6441
- !:mime application/x-shockwave-flash
6442
- >3 byte x version %d
6443
- # From: Cal Peake <cp@absolutedigital.net>
6444
- 0 string FLV Macromedia Flash Video
6445
- !:mime video/x-flv
6446
-
6447
- #
6448
- # From Dave Wilson
6449
- 0 string AGD4\xbe\xb8\xbb\xcb\x00 Macromedia Freehand 9 Document
6450
- #------------------------------------------------------------------------------
6451
- # fonts: file(1) magic for font data
6452
- #
6453
- 0 search/1 FONT ASCII vfont text
6454
- 0 short 0436 Berkeley vfont data
6455
- 0 short 017001 byte-swapped Berkeley vfont data
6456
-
6457
- # PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com
6458
- 0 string %!PS-AdobeFont-1. PostScript Type 1 font text
6459
- >20 string >\0 (%s)
6460
- 6 string %!PS-AdobeFont-1. PostScript Type 1 font program data
6461
-
6462
- # X11 font files in SNF (Server Natural Format) format
6463
- 0 belong 00000004 X11 SNF font data, MSB first
6464
- 0 lelong 00000004 X11 SNF font data, LSB first
6465
-
6466
- # X11 Bitmap Distribution Format, from Daniel Quinlan (quinlan@yggdrasil.com)
6467
- 0 search/1 STARTFONT\ X11 BDF font text
6468
-
6469
- # X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com)
6470
- # PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides)
6471
- 0 string \001fcp X11 Portable Compiled Font data
6472
- >12 byte 0x02 \b, LSB first
6473
- >12 byte 0x0a \b, MSB first
6474
- 0 string D1.0\015 X11 Speedo font data
6475
-
6476
- #------------------------------------------------------------------------------
6477
- # FIGlet fonts and controlfiles
6478
- # From figmagic supplied with Figlet version 2.2
6479
- # "David E. O'Brien" <obrien@FreeBSD.ORG>
6480
- 0 string flf FIGlet font
6481
- >3 string >2a version %-2.2s
6482
- 0 string flc FIGlet controlfile
6483
- >3 string >2a version %-2.2s
6484
-
6485
- # libGrx graphics lib fonts, from Albert Cahalan (acahalan@cs.uml.edu)
6486
- # Used with djgpp (DOS Gnu C++), sometimes Linux or Turbo C++
6487
- 0 belong 0x14025919 libGrx font data,
6488
- >8 leshort x %dx
6489
- >10 leshort x \b%d
6490
- >40 string x %s
6491
- # Misc. DOS VGA fonts, from Albert Cahalan (acahalan@cs.uml.edu)
6492
- 0 belong 0xff464f4e DOS code page font data collection
6493
- 7 belong 0x00454741 DOS code page font data
6494
- 7 belong 0x00564944 DOS code page font data (from Linux?)
6495
- 4098 string DOSFONT DOSFONT2 encrypted font data
6496
-
6497
- # downloadable fonts for browser (prints type) anthon@mnt.org
6498
- 0 string PFR1 PFR1 font
6499
- >102 string >0 \b: %s
6500
-
6501
- # True Type fonts
6502
- 0 string \000\001\000\000\000 TrueType font data
6503
-
6504
- 0 string \007\001\001\000Copyright\ (c)\ 199 Adobe Multiple Master font
6505
- 0 string \012\001\001\000Copyright\ (c)\ 199 Adobe Multiple Master font
6506
-
6507
- 0 string ttcf TrueType font collection data
6508
-
6509
- # Opentype font data from Avi Bercovich
6510
- 0 string OTTO OpenType font data
6511
-
6512
- # Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
6513
- 0 string SplineFontDB: Spline Font Database
6514
- >14 string x version %s
6515
- # FORTRAN source
6516
- 0 regex/100 \^[Cc][\ \t] FORTRAN program
6517
- !:mime text/x-fortran
6518
- #------------------------------------------------------------------------------
6519
- # frame: file(1) magic for FrameMaker files
6520
- #
6521
- # This stuff came on a FrameMaker demo tape, most of which is
6522
- # copyright, but this file is "published" as witness the following:
6523
- #
6524
- # Note that this is the Framemaker Maker Interchange Format, not the
6525
- # Normal format which would be application/vnd.framemaker.
6526
- #
6527
- 0 string \<MakerFile FrameMaker document
6528
- !:mime application/x-mif
6529
- >11 string 5.5 (5.5
6530
- >11 string 5.0 (5.0
6531
- >11 string 4.0 (4.0
6532
- >11 string 3.0 (3.0
6533
- >11 string 2.0 (2.0
6534
- >11 string 1.0 (1.0
6535
- >14 byte x %c)
6536
- 0 string \<MIFFile FrameMaker MIF (ASCII) file
6537
- !:mime application/x-mif
6538
- >9 string 4.0 (4.0)
6539
- >9 string 3.0 (3.0)
6540
- >9 string 2.0 (2.0)
6541
- >9 string 1.0 (1.x)
6542
- 0 search/1 \<MakerDictionary FrameMaker Dictionary text
6543
- !:mime application/x-mif
6544
- >17 string 3.0 (3.0)
6545
- >17 string 2.0 (2.0)
6546
- >17 string 1.0 (1.x)
6547
- 0 string \<MakerScreenFont FrameMaker Font file
6548
- !:mime application/x-mif
6549
- >17 string 1.01 (%s)
6550
- 0 string \<MML FrameMaker MML file
6551
- !:mime application/x-mif
6552
- 0 string \<BookFile FrameMaker Book file
6553
- !:mime application/x-mif
6554
- >10 string 3.0 (3.0
6555
- >10 string 2.0 (2.0
6556
- >10 string 1.0 (1.0
6557
- >13 byte x %c)
6558
- # XXX - this book entry should be verified, if you find one, uncomment this
6559
- #0 string \<Book\ FrameMaker Book (ASCII) file
6560
- #!:mime application/x-mif
6561
- #>6 string 3.0 (3.0)
6562
- #>6 string 2.0 (2.0)
6563
- #>6 string 1.0 (1.0)
6564
- 0 string \<Maker Intermediate Print File FrameMaker IPL file
6565
- !:mime application/x-mif
6566
-
6567
- #------------------------------------------------------------------------------
6568
- # freebsd: file(1) magic for FreeBSD objects
6569
- #
6570
- # All new-style FreeBSD magic numbers are in host byte order (i.e.,
6571
- # little-endian on x86).
6572
- #
6573
- # XXX - this comes from the file "freebsd" in a recent FreeBSD version of
6574
- # "file"; it, and the NetBSD stuff in "netbsd", appear to use different
6575
- # schemes for distinguishing between executable images, shared libraries,
6576
- # and object files.
6577
- #
6578
- # FreeBSD says:
6579
- #
6580
- # Regardless of whether it's pure, demand-paged, or none of the
6581
- # above:
6582
- #
6583
- # if the entry point is < 4096, then it's a shared library if
6584
- # the "has run-time loader information" bit is set, and is
6585
- # position-independent if the "is position-independent" bit
6586
- # is set;
6587
- #
6588
- # if the entry point is >= 4096 (or >4095, same thing), then it's
6589
- # an executable, and is dynamically-linked if the "has run-time
6590
- # loader information" bit is set.
6591
- #
6592
- # On x86, NetBSD says:
6593
- #
6594
- # If it's neither pure nor demand-paged:
6595
- #
6596
- # if it has the "has run-time loader information" bit set, it's
6597
- # a dynamically-linked executable;
6598
- #
6599
- # if it doesn't have that bit set, then:
6600
- #
6601
- # if it has the "is position-independent" bit set, it's
6602
- # position-independent;
6603
- #
6604
- # if the entry point is non-zero, it's an executable, otherwise
6605
- # it's an object file.
6606
- #
6607
- # If it's pure:
6608
- #
6609
- # if it has the "has run-time loader information" bit set, it's
6610
- # a dynamically-linked executable, otherwise it's just an
6611
- # executable.
6612
- #
6613
- # If it's demand-paged:
6614
- #
6615
- # if it has the "has run-time loader information" bit set,
6616
- # then:
6617
- #
6618
- # if the entry point is < 4096, it's a shared library;
6619
- #
6620
- # if the entry point is = 4096 or > 4096 (i.e., >= 4096),
6621
- # it's a dynamically-linked executable);
6622
- #
6623
- # if it doesn't have the "has run-time loader information" bit
6624
- # set, then it's just an executable.
6625
- #
6626
- # (On non-x86, NetBSD does much the same thing, except that it uses
6627
- # 8192 on 68K - except for "68k4k", which is presumably "68K with 4K
6628
- # pages - SPARC, and MIPS, presumably because Sun-3's and Sun-4's
6629
- # had 8K pages; dunno about MIPS.)
6630
- #
6631
- # I suspect the two will differ only in perverse and uninteresting cases
6632
- # ("shared" libraries that aren't demand-paged and whose pages probably
6633
- # won't actually be shared, executables with entry points <4096).
6634
- #
6635
- # I leave it to those more familiar with FreeBSD and NetBSD to figure out
6636
- # what the right answer is (although using ">4095", FreeBSD-style, is
6637
- # probably better than separately checking for "=4096" and ">4096",
6638
- # NetBSD-style). (The old "netbsd" file analyzed FreeBSD demand paged
6639
- # executables using the NetBSD technique.)
6640
- #
6641
- 0 lelong&0377777777 041400407 FreeBSD/i386
6642
- >20 lelong <4096
6643
- >>3 byte&0xC0 &0x80 shared library
6644
- >>3 byte&0xC0 0x40 PIC object
6645
- >>3 byte&0xC0 0x00 object
6646
- >20 lelong >4095
6647
- >>3 byte&0x80 0x80 dynamically linked executable
6648
- >>3 byte&0x80 0x00 executable
6649
- >16 lelong >0 not stripped
6650
-
6651
- 0 lelong&0377777777 041400410 FreeBSD/i386 pure
6652
- >20 lelong <4096
6653
- >>3 byte&0xC0 &0x80 shared library
6654
- >>3 byte&0xC0 0x40 PIC object
6655
- >>3 byte&0xC0 0x00 object
6656
- >20 lelong >4095
6657
- >>3 byte&0x80 0x80 dynamically linked executable
6658
- >>3 byte&0x80 0x00 executable
6659
- >16 lelong >0 not stripped
6660
-
6661
- 0 lelong&0377777777 041400413 FreeBSD/i386 demand paged
6662
- >20 lelong <4096
6663
- >>3 byte&0xC0 &0x80 shared library
6664
- >>3 byte&0xC0 0x40 PIC object
6665
- >>3 byte&0xC0 0x00 object
6666
- >20 lelong >4095
6667
- >>3 byte&0x80 0x80 dynamically linked executable
6668
- >>3 byte&0x80 0x00 executable
6669
- >16 lelong >0 not stripped
6670
-
6671
- 0 lelong&0377777777 041400314 FreeBSD/i386 compact demand paged
6672
- >20 lelong <4096
6673
- >>3 byte&0xC0 &0x80 shared library
6674
- >>3 byte&0xC0 0x40 PIC object
6675
- >>3 byte&0xC0 0x00 object
6676
- >20 lelong >4095
6677
- >>3 byte&0x80 0x80 dynamically linked executable
6678
- >>3 byte&0x80 0x00 executable
6679
- >16 lelong >0 not stripped
6680
-
6681
- # XXX gross hack to identify core files
6682
- # cores start with a struct tss; we take advantage of the following:
6683
- # byte 7: highest byte of the kernel stack pointer, always 0xfe
6684
- # 8/9: kernel (ring 0) ss value, always 0x0010
6685
- # 10 - 27: ring 1 and 2 ss/esp, unused, thus always 0
6686
- # 28: low order byte of the current PTD entry, always 0 since the
6687
- # PTD is page-aligned
6688
- #
6689
- 7 string \357\020\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 FreeBSD/i386 a.out core file
6690
- >1039 string >\0 from '%s'
6691
-
6692
- # /var/run/ld.so.hints
6693
- # What are you laughing about?
6694
- 0 lelong 011421044151 ld.so hints file (Little Endian
6695
- >4 lelong >0 \b, version %d)
6696
- >4 belong <1 \b)
6697
- 0 belong 011421044151 ld.so hints file (Big Endian
6698
- >4 belong >0 \b, version %d)
6699
- >4 belong <1 \b)
6700
-
6701
- #
6702
- # Files generated by FreeBSD scrshot(1)/vidcontrol(1) utilities
6703
- #
6704
- 0 string SCRSHOT_ scrshot(1) screenshot,
6705
- >8 byte x version %d,
6706
- >9 byte 2 %d bytes in header,
6707
- >>10 byte x %d chars wide by
6708
- >>11 byte x %d chars high
6709
-
6710
- #------------------------------------------------------------------------------
6711
- # fsav: file(1) magic for datafellows fsav virus definition files
6712
- # Anthon van der Neut (anthon@mnt.org)
6713
-
6714
- # ftp://ftp.f-prot.com/pub/{macrdef2.zip,nomacro.def}
6715
- 0 beshort 0x1575 fsav macro virus signatures
6716
- >8 leshort >0 (%d-
6717
- >11 byte >0 \b%02d-
6718
- >10 byte >0 \b%02d)
6719
- # ftp://ftp.f-prot.com/pub/sign.zip
6720
- #10 ubyte <12
6721
- #>9 ubyte <32
6722
- #>>8 ubyte 0x0a
6723
- #>>>12 ubyte 0x07
6724
- #>>>>11 uleshort >0 fsav DOS/Windows virus signatures (%d-
6725
- #>>>>10 byte 0 \b01-
6726
- #>>>>10 byte 1 \b02-
6727
- #>>>>10 byte 2 \b03-
6728
- #>>>>10 byte 3 \b04-
6729
- #>>>>10 byte 4 \b05-
6730
- #>>>>10 byte 5 \b06-
6731
- #>>>>10 byte 6 \b07-
6732
- #>>>>10 byte 7 \b08-
6733
- #>>>>10 byte 8 \b09-
6734
- #>>>>10 byte 9 \b10-
6735
- #>>>>10 byte 10 \b11-
6736
- #>>>>10 byte 11 \b12-
6737
- #>>>>9 ubyte >0 \b%02d)
6738
- # ftp://ftp.f-prot.com/pub/sign2.zip
6739
- #0 ubyte 0x62
6740
- #>1 ubyte 0xF5
6741
- #>>2 ubyte 0x1
6742
- #>>>3 ubyte 0x1
6743
- #>>>>4 ubyte 0x0e
6744
- #>>>>>13 ubyte >0 fsav virus signatures
6745
- #>>>>>>11 ubyte x size 0x%02x
6746
- #>>>>>>12 ubyte x \b%02x
6747
- #>>>>>>13 ubyte x \b%02x bytes
6748
-
6749
- # Joerg Jenderek: joerg dot jenderek at web dot de
6750
- # http://www.clamav.net/doc/latest/html/node45.html
6751
- # .cvd files start with a 512 bytes colon separated header
6752
- # ClamAV-VDB:buildDate:version:signaturesNumbers:functionalityLevelRequired:MD5:Signature:builder:buildTime
6753
- # + gzipped tarball files
6754
- 0 string ClamAV-VDB:
6755
- >11 string >\0 Clam AntiVirus database %-.23s
6756
- >>34 string :
6757
- >>>35 string !: \b, version
6758
- >>>>35 string x \b%-.1s
6759
- >>>>>36 string !:
6760
- >>>>>>36 string x \b%-.1s
6761
- >>>>>>>37 string !:
6762
- >>>>>>>>37 string x \b%-.1s
6763
- >>>>>>>>>38 string !:
6764
- >>>>>>>>>>38 string x \b%-.1s
6765
- >512 string \037\213 \b, gzipped
6766
- >769 string ustar\0 \b, tarred
6767
-
6768
- # Type: Grisoft AVG AntiVirus
6769
- # From: David Newgas <david@newgas.net>
6770
- 0 string AVG7_ANTIVIRUS_VAULT_FILE AVG 7 Antivirus vault file data
6771
- #------------------------------------------------------------------------------
6772
- # games: file(1) for games
6773
-
6774
- # Fabio Bonelli <fabiobonelli@libero.it>
6775
- # Quake II - III data files
6776
- 0 string IDP2 Quake II 3D Model file,
6777
- >20 long x %lu skin(s),
6778
- >8 long x (%lu x
6779
- >12 long x %lu),
6780
- >40 long x %lu frame(s),
6781
- >16 long x Frame size %lu bytes,
6782
- >24 long x %lu vertices/frame,
6783
- >28 long x %lu texture coordinates,
6784
- >32 long x %lu triangles/frame
6785
-
6786
- 0 string IBSP Quake
6787
- >4 long 0x26 II Map file (BSP)
6788
- >4 long 0x2E III Map file (BSP)
6789
-
6790
- 0 string IDS2 Quake II SP2 sprite file
6791
-
6792
- #---------------------------------------------------------------------------
6793
- # Doom and Quake
6794
- # submitted by Nicolas Patrois
6795
-
6796
- 0 string \xcb\x1dBoom\xe6\xff\x03\x01 Boom or linuxdoom demo
6797
- # some doom lmp files don't match, I've got one beginning with \x6d\x02\x01\x01
6798
-
6799
- 24 string LxD\ 203 Linuxdoom save
6800
- >0 string x , name=%s
6801
- >44 string x , world=%s
6802
-
6803
- # Quake
6804
-
6805
- 0 string PACK Quake I or II world or extension
6806
- >8 lelong >0 \b, %d entries
6807
-
6808
- #0 string -1\x0a Quake I demo
6809
- #>30 string x version %.4s
6810
- #>61 string x level %s
6811
-
6812
- #0 string 5\x0a Quake I save
6813
-
6814
- # The levels
6815
-
6816
- # Quake 1
6817
-
6818
- 0 string 5\x0aIntroduction Quake I save: start Introduction
6819
- 0 string 5\x0athe_Slipgate_Complex Quake I save: e1m1 The slipgate complex
6820
- 0 string 5\x0aCastle_of_the_Damned Quake I save: e1m2 Castle of the damned
6821
- 0 string 5\x0athe_Necropolis Quake I save: e1m3 The necropolis
6822
- 0 string 5\x0athe_Grisly_Grotto Quake I save: e1m4 The grisly grotto
6823
- 0 string 5\x0aZiggurat_Vertigo Quake I save: e1m8 Ziggurat vertigo (secret)
6824
- 0 string 5\x0aGloom_Keep Quake I save: e1m5 Gloom keep
6825
- 0 string 5\x0aThe_Door_To_Chthon Quake I save: e1m6 The door to Chthon
6826
- 0 string 5\x0aThe_House_of_Chthon Quake I save: e1m7 The house of Chthon
6827
- 0 string 5\x0athe_Installation Quake I save: e2m1 The installation
6828
- 0 string 5\x0athe_Ogre_Citadel Quake I save: e2m2 The ogre citadel
6829
- 0 string 5\x0athe_Crypt_of_Decay Quake I save: e2m3 The crypt of decay (dopefish lives!)
6830
- 0 string 5\x0aUnderearth Quake I save: e2m7 Underearth (secret)
6831
- 0 string 5\x0athe_Ebon_Fortress Quake I save: e2m4 The ebon fortress
6832
- 0 string 5\x0athe_Wizard's_Manse Quake I save: e2m5 The wizard's manse
6833
- 0 string 5\x0athe_Dismal_Oubliette Quake I save: e2m6 The dismal oubliette
6834
- 0 string 5\x0aTermination_Central Quake I save: e3m1 Termination central
6835
- 0 string 5\x0aVaults_of_Zin Quake I save: e3m2 Vaults of Zin
6836
- 0 string 5\x0athe_Tomb_of_Terror Quake I save: e3m3 The tomb of terror
6837
- 0 string 5\x0aSatan's_Dark_Delight Quake I save: e3m4 Satan's dark delight
6838
- 0 string 5\x0athe_Haunted_Halls Quake I save: e3m7 The haunted halls (secret)
6839
- 0 string 5\x0aWind_Tunnels Quake I save: e3m5 Wind tunnels
6840
- 0 string 5\x0aChambers_of_Torment Quake I save: e3m6 Chambers of torment
6841
- 0 string 5\x0athe_Sewage_System Quake I save: e4m1 The sewage system
6842
- 0 string 5\x0aThe_Tower_of_Despair Quake I save: e4m2 The tower of despair
6843
- 0 string 5\x0aThe_Elder_God_Shrine Quake I save: e4m3 The elder god shrine
6844
- 0 string 5\x0athe_Palace_of_Hate Quake I save: e4m4 The palace of hate
6845
- 0 string 5\x0aHell's_Atrium Quake I save: e4m5 Hell's atrium
6846
- 0 string 5\x0athe_Nameless_City Quake I save: e4m8 The nameless city (secret)
6847
- 0 string 5\x0aThe_Pain_Maze Quake I save: e4m6 The pain maze
6848
- 0 string 5\x0aAzure_Agony Quake I save: e4m7 Azure agony
6849
- 0 string 5\x0aShub-Niggurath's_Pit Quake I save: end Shub-Niggurath's pit
6850
-
6851
- # Quake DeathMatch levels
6852
-
6853
- 0 string 5\x0aPlace_of_Two_Deaths Quake I save: dm1 Place of two deaths
6854
- 0 string 5\x0aClaustrophobopolis Quake I save: dm2 Claustrophobopolis
6855
- 0 string 5\x0aThe_Abandoned_Base Quake I save: dm3 The abandoned base
6856
- 0 string 5\x0aThe_Bad_Place Quake I save: dm4 The bad place
6857
- 0 string 5\x0aThe_Cistern Quake I save: dm5 The cistern
6858
- 0 string 5\x0aThe_Dark_Zone Quake I save: dm6 The dark zone
6859
-
6860
- # Scourge of Armagon
6861
-
6862
- 0 string 5\x0aCommand_HQ Quake I save: start Command HQ
6863
- 0 string 5\x0aThe_Pumping_Station Quake I save: hip1m1 The pumping station
6864
- 0 string 5\x0aStorage_Facility Quake I save: hip1m2 Storage facility
6865
- 0 string 5\x0aMilitary_Complex Quake I save: hip1m5 Military complex (secret)
6866
- 0 string 5\x0athe_Lost_Mine Quake I save: hip1m3 The lost mine
6867
- 0 string 5\x0aResearch_Facility Quake I save: hip1m4 Research facility
6868
- 0 string 5\x0aAncient_Realms Quake I save: hip2m1 Ancient realms
6869
- 0 string 5\x0aThe_Gremlin's_Domain Quake I save: hip2m6 The gremlin's domain (secret)
6870
- 0 string 5\x0aThe_Black_Cathedral Quake I save: hip2m2 The black cathedral
6871
- 0 string 5\x0aThe_Catacombs Quake I save: hip2m3 The catacombs
6872
- 0 string 5\x0athe_Crypt__ Quake I save: hip2m4 The crypt
6873
- 0 string 5\x0aMortum's_Keep Quake I save: hip2m5 Mortum's keep
6874
- 0 string 5\x0aTur_Torment Quake I save: hip3m1 Tur torment
6875
- 0 string 5\x0aPandemonium Quake I save: hip3m2 Pandemonium
6876
- 0 string 5\x0aLimbo Quake I save: hip3m3 Limbo
6877
- 0 string 5\x0athe_Edge_of_Oblivion Quake I save: hipdm1 The edge of oblivion (secret)
6878
- 0 string 5\x0aThe_Gauntlet Quake I save: hip3m4 The gauntlet
6879
- 0 string 5\x0aArmagon's_Lair Quake I save: hipend Armagon's lair
6880
-
6881
- # Malice
6882
-
6883
- 0 string 5\x0aThe_Academy Quake I save: start The academy
6884
- 0 string 5\x0aThe_Lab Quake I save: d1 The lab
6885
- 0 string 5\x0aArea_33 Quake I save: d1b Area 33
6886
- 0 string 5\x0aSECRET_MISSIONS Quake I save: d3b Secret missions
6887
- 0 string 5\x0aThe_Hospital Quake I save: d10 The hospital (secret)
6888
- 0 string 5\x0aThe_Genetics_Lab Quake I save: d11 The genetics lab (secret)
6889
- 0 string 5\x0aBACK_2_MALICE Quake I save: d4b Back to Malice
6890
- 0 string 5\x0aArea44 Quake I save: d1c Area 44
6891
- 0 string 5\x0aTakahiro_Towers Quake I save: d2 Takahiro towers
6892
- 0 string 5\x0aA_Rat's_Life Quake I save: d3 A rat's life
6893
- 0 string 5\x0aInto_The_Flood Quake I save: d4 Into the flood
6894
- 0 string 5\x0aThe_Flood Quake I save: d5 The flood
6895
- 0 string 5\x0aNuclear_Plant Quake I save: d6 Nuclear plant
6896
- 0 string 5\x0aThe_Incinerator_Plant Quake I save: d7 The incinerator plant
6897
- 0 string 5\x0aThe_Foundry Quake I save: d7b The foundry
6898
- 0 string 5\x0aThe_Underwater_Base Quake I save: d8 The underwater base
6899
- 0 string 5\x0aTakahiro_Base Quake I save: d9 Takahiro base
6900
- 0 string 5\x0aTakahiro_Laboratories Quake I save: d12 Takahiro laboratories
6901
- 0 string 5\x0aStayin'_Alive Quake I save: d13 Stayin' alive
6902
- 0 string 5\x0aB.O.S.S._HQ Quake I save: d14 B.O.S.S. HQ
6903
- 0 string 5\x0aSHOWDOWN! Quake I save: d15 Showdown!
6904
-
6905
- # Malice DeathMatch levels
6906
-
6907
- 0 string 5\x0aThe_Seventh_Precinct Quake I save: ddm1 The seventh precinct
6908
- 0 string 5\x0aSub_Station Quake I save: ddm2 Sub station
6909
- 0 string 5\x0aCrazy_Eights! Quake I save: ddm3 Crazy eights!
6910
- 0 string 5\x0aEast_Side_Invertationa Quake I save: ddm4 East side invertationa
6911
- 0 string 5\x0aSlaughterhouse Quake I save: ddm5 Slaughterhouse
6912
- 0 string 5\x0aDOMINO Quake I save: ddm6 Domino
6913
- 0 string 5\x0aSANDRA'S_LADDER Quake I save: ddm7 Sandra's ladder
6914
-
6915
-
6916
- 0 string MComprHD MAME CHD compressed hard disk image,
6917
- >12 belong x version %lu
6918
-
6919
- # doom - submitted by Jon Dowland
6920
-
6921
- 0 string =IWAD doom main IWAD data
6922
- >4 lelong x containing %d lumps
6923
- 0 string =PWAD doom patch PWAD data
6924
- >4 lelong x containing %d lumps
6925
-
6926
-
6927
- # Summary: Warcraft 3 save
6928
- # Extension: .w3g
6929
- # Created by: "Nelson A. de Oliveira" <naoliv@gmail.com>
6930
- 0 string Warcraft\ III\ recorded\ game %s
6931
-
6932
-
6933
- # Summary: Warcraft 3 map
6934
- # Extension: .w3m
6935
- # Created by: "Nelson A. de Oliveira" <naoliv@gmail.com>
6936
- 0 string HM3W Warcraft III map file
6937
-
6938
-
6939
- # Summary: SGF Smart Game Format
6940
- # Extension: .sgf
6941
- # Reference: http://www.red-bean.com/sgf/
6942
- # Created by: Eduardo Sabbatella <eduardo_sabbatella@yahoo.com.ar>
6943
- # Modified by (1): Abel Cheung (regex, more game format)
6944
- # FIXME: Some games don't have GM (game type)
6945
- 0 regex \\(;.*GM\\[[0-9]{1,2}\\] Smart Game Format
6946
- >2 search/0x200 GM[
6947
- >>&0 string 1] (Go)
6948
- >>&0 string 2] (Othello)
6949
- >>&0 string 3] (chess)
6950
- >>&0 string 4] (Gomoku+Renju)
6951
- >>&0 string 5] (Nine Men's Morris)
6952
- >>&0 string 6] (Backgammon)
6953
- >>&0 string 7] (Chinese chess)
6954
- >>&0 string 8] (Shogi)
6955
- >>&0 string 9] (Lines of Action)
6956
- >>&0 string 10] (Ataxx)
6957
- >>&0 string 11] (Hex)
6958
- >>&0 string 12] (Jungle)
6959
- >>&0 string 13] (Neutron)
6960
- >>&0 string 14] (Philosopher's Football)
6961
- >>&0 string 15] (Quadrature)
6962
- >>&0 string 16] (Trax)
6963
- >>&0 string 17] (Tantrix)
6964
- >>&0 string 18] (Amazons)
6965
- >>&0 string 19] (Octi)
6966
- >>&0 string 20] (Gess)
6967
- >>&0 string 21] (Twixt)
6968
- >>&0 string 22] (Zertz)
6969
- >>&0 string 23] (Plateau)
6970
- >>&0 string 24] (Yinsh)
6971
- >>&0 string 25] (Punct)
6972
- >>&0 string 26] (Gobblet)
6973
- >>&0 string 27] (hive)
6974
- >>&0 string 28] (Exxit)
6975
- >>&0 string 29] (Hnefatal)
6976
- >>&0 string 30] (Kuba)
6977
- >>&0 string 31] (Tripples)
6978
- >>&0 string 32] (Chase)
6979
- >>&0 string 33] (Tumbling Down)
6980
- >>&0 string 34] (Sahara)
6981
- >>&0 string 35] (Byte)
6982
- >>&0 string 36] (Focus)
6983
- >>&0 string 37] (Dvonn)
6984
- >>&0 string 38] (Tamsk)
6985
- >>&0 string 39] (Gipf)
6986
- >>&0 string 40] (Kropki)
6987
-
6988
-
6989
- # Summary: Civilization 4 video
6990
- # Extension: .bik
6991
- # Created by: Abel Cheung <abelcheung@gmail.com>
6992
- 0 string BIKi Civilization 4 Video
6993
-
6994
-
6995
- ##############################################
6996
- # NetImmerse/Gamebryo game engine entries
6997
-
6998
- # Summary: Gamebryo game engine file
6999
- # Extension: .nif, .kf
7000
- # Created by: Abel Cheung <abelcheung@gmail.com>
7001
- 0 string Gamebryo\ File\ Format,\ Version\ Gamebryo game engine file
7002
- >&0 regex [0-9a-z.]+ \b, version %s
7003
-
7004
- # Summary: Gamebryo game engine file
7005
- # Extension: .kfm
7006
- # Created by: Abel Cheung <abelcheung@gmail.com>
7007
- 0 string ;Gamebryo\ KFM\ File\ Version\ Gamebryo game engine animation File
7008
- >&0 regex [0-9a-z.]+ \b, version %s
7009
-
7010
- # Summary: NetImmerse game engine file
7011
- # Extension .nif
7012
- # Created by: Abel Cheung <abelcheung@gmail.com>
7013
- 0 string NetImmerse\ File\ Format,\ Versio
7014
- >&0 string n\ NetImmerse game engine file
7015
- >>&0 regex [0-9a-z.]+ \b, version %s
7016
-
7017
- # Type: SGF Smart Game Format
7018
- # URL: http://www.red-bean.com/sgf/
7019
- # From: Eduardo Sabbatella <eduardo_sabbatella@yahoo.com.ar>
7020
- 2 regex/c \\(;.*GM\\[[0-9]{1,2}\\] Smart Game Format
7021
- >2 regex/c GM\\[1\\] - Go Game
7022
- >2 regex/c GM\\[6\\] - BackGammon Game
7023
- >2 regex/c GM\\[11\\] - Hex Game
7024
- >2 regex/c GM\\[18\\] - Amazons Game
7025
- >2 regex/c GM\\[19\\] - Octi Game
7026
- >2 regex/c GM\\[20\\] - Gess Game
7027
- >2 regex/c GM\\[21\\] - twix Game
7028
-
7029
- #------------------------------------------------------------------------------
7030
- # gcc: file(1) magic for GCC special files
7031
- #
7032
- 0 string gpch GCC precompiled header
7033
-
7034
- # The version field is annoying. It's 3 characters, not zero-terminated.
7035
- >5 byte x (version %c
7036
- >6 byte x \b%c
7037
- >7 byte x \b%c)
7038
-
7039
- # 67 = 'C', 111 = 'o', 43 = '+', 79 = 'O'
7040
- >4 byte 67 for C
7041
- >4 byte 111 for Objective C
7042
- >4 byte 43 for C++
7043
- >4 byte 79 for Objective C++
7044
-
7045
- #------------------------------------------------------------------------------
7046
- # GEOS files (Vidar Madsen, vidar@gimp.org)
7047
- # semi-commonly used in embedded and handheld systems.
7048
- 0 belong 0xc745c153 GEOS
7049
- >40 byte 1 executable
7050
- >40 byte 2 VMFile
7051
- >40 byte 3 binary
7052
- >40 byte 4 directory label
7053
- >40 byte <1 unknown
7054
- >40 byte >4 unknown
7055
- >4 string >\0 \b, name "%s"
7056
- #>44 short x \b, version %d
7057
- #>46 short x \b.%d
7058
- #>48 short x \b, rev %d
7059
- #>50 short x \b.%d
7060
- #>52 short x \b, proto %d
7061
- #>54 short x \br%d
7062
- #>168 string >\0 \b, copyright "%s"
7063
- #------------------------------------------------------------------------------
7064
- # GIMP Gradient: file(1) magic for the GIMP's gradient data files
7065
- # by Federico Mena <federico@nuclecu.unam.mx>
7066
-
7067
- 0 string GIMP\ Gradient GIMP gradient data
7068
-
7069
- #------------------------------------------------------------------------------
7070
- # XCF: file(1) magic for the XCF image format used in the GIMP developed
7071
- # by Spencer Kimball and Peter Mattis
7072
- # ('Bucky' LaDieu, nega@vt.edu)
7073
-
7074
- 0 string gimp\ xcf GIMP XCF image data,
7075
- !:mime image/x-xcf
7076
- >9 string file version 0,
7077
- >9 string v version
7078
- >>10 string >\0 %s,
7079
- >14 belong x %lu x
7080
- >18 belong x %lu,
7081
- >22 belong 0 RGB Color
7082
- >22 belong 1 Greyscale
7083
- >22 belong 2 Indexed Color
7084
- >22 belong >2 Unknown Image Type.
7085
-
7086
- #------------------------------------------------------------------------------
7087
- # XCF: file(1) magic for the patterns used in the GIMP, developed
7088
- # by Spencer Kimball and Peter Mattis
7089
- # ('Bucky' LaDieu, nega@vt.edu)
7090
-
7091
- 20 string GPAT GIMP pattern data,
7092
- >24 string x %s
7093
-
7094
- #------------------------------------------------------------------------------
7095
- # XCF: file(1) magic for the brushes used in the GIMP, developed
7096
- # by Spencer Kimball and Peter Mattis
7097
- # ('Bucky' LaDieu, nega@vt.edu)
7098
-
7099
- 20 string GIMP GIMP brush data
7100
-
7101
- # GIMP Curves File
7102
- # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
7103
- 0 string #\040GIMP\040Curves\040File GIMP curve file
7104
- # GNOME keyring
7105
- # Contributed by Josh Triplett
7106
- # FIXME: Could be simplified if pstring supported two-byte counts
7107
- 0 string GnomeKeyring\n\r\0\n GNOME keyring
7108
- >&0 ubyte 0 \b, major version 0
7109
- >>&0 ubyte 0 \b, minor version 0
7110
- >>>&0 ubyte 0 \b, crypto type 0 (AEL)
7111
- >>>&0 ubyte >0 \b, crypto type %hhu (unknown)
7112
- >>>&1 ubyte 0 \b, hash type 0 (MD5)
7113
- >>>&1 ubyte >0 \b, hash type %hhu (unknown)
7114
- >>>&2 ubelong 0xFFFFFFFF \b, name NULL
7115
- >>>&2 ubelong !0xFFFFFFFF
7116
- >>>>&-4 ubelong >255 \b, name too long for file's pstring type
7117
- >>>>&-4 ubelong <256
7118
- >>>>>&-1 pstring x \b, name "%s"
7119
- >>>>>>&0 ubeqdate x \b, last modified %s
7120
- >>>>>>&8 ubeqdate x \b, created %s
7121
- >>>>>>&16 ubelong &1
7122
- >>>>>>>&0 ubelong x \b, locked if idle for %u seconds
7123
- >>>>>>&16 ubelong ^1 \b, not locked if idle
7124
- >>>>>>&24 ubelong x \b, hash iterations %u
7125
- >>>>>>&28 ubequad x \b, salt %llu
7126
- >>>>>>&52 ubelong x \b, %u item(s)
7127
- #------------------------------------------------------------------------------
7128
- # gnu: file(1) magic for various GNU tools
7129
- #
7130
- # GNU nlsutils message catalog file format
7131
- #
7132
- 0 string \336\22\4\225 GNU message catalog (little endian),
7133
- >4 lelong x revision %d,
7134
- >8 lelong x %d messages
7135
- 0 string \225\4\22\336 GNU message catalog (big endian),
7136
- >4 belong x revision %d,
7137
- >8 belong x %d messages
7138
- # message catalogs, from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
7139
- 0 string *nazgul* Nazgul style compiled message catalog
7140
- >8 lelong >0 \b, version %ld
7141
-
7142
- # GnuPG
7143
- # The format is very similar to pgp
7144
- 0 string \001gpg GPG key trust database
7145
- >4 byte x version %d
7146
- # Note: magic.mime had 0x8501 for the next line instead of 0x8502
7147
- 0 beshort 0x8502 GPG encrypted data
7148
- !:mime text/PGP # encoding: data
7149
-
7150
- # This magic is not particularly good, as the keyrings don't have true
7151
- # magic. Nevertheless, it covers many keyrings.
7152
- 0 beshort 0x9901 GPG key public ring
7153
- !:mime application/x-gnupg-keyring
7154
-
7155
- # Gnumeric spreadsheet
7156
- # This entry is only semi-helpful, as Gnumeric compresses its files, so
7157
- # they will ordinarily reported as "compressed", but at least -z helps
7158
- 39 string =<gmr:Workbook Gnumeric spreadsheet
7159
-
7160
- # From: James Youngman <jay@gnu.org>
7161
- # gnu find magic
7162
- 0 string \0LOCATE GNU findutils locate database data
7163
- >7 string >\0 \b, format %s
7164
- >7 string 02 \b (frcode)
7165
-
7166
- # Files produced by GNU gettext
7167
- 0 long 0xDE120495 GNU-format message catalog data
7168
- 0 long 0x950412DE GNU-format message catalog data
7169
-
7170
- #------------------------------------------------------------------------------
7171
- # gnumeric: file(1) magic for Gnumeric spreadsheet
7172
- # This entry is only semi-helpful, as Gnumeric compresses its files, so
7173
- # they will ordinarily reported as "compressed", but at least -z helps
7174
- 39 string =<gmr:Workbook Gnumeric spreadsheet
7175
- !:mime application/x-gnumeric
7176
-
7177
- #------------------------------------------------------------------------------
7178
- # ACE/gr and Grace type files - PLEASE DO NOT REMOVE THIS LINE
7179
- #
7180
- # ACE/gr binary
7181
- 0 string \000\000\0001\000\000\0000\000\000\0000\000\000\0002\000\000\0000\000\000\0000\000\000\0003 old ACE/gr binary file
7182
- >39 byte >0 - version %c
7183
- # ACE/gr ascii
7184
- 0 string #\ xvgr\ parameter\ file ACE/gr ascii file
7185
- 0 string #\ xmgr\ parameter\ file ACE/gr ascii file
7186
- 0 string #\ ACE/gr\ parameter\ file ACE/gr ascii file
7187
- # Grace projects
7188
- 0 string #\ Grace\ project\ file Grace project file
7189
- >23 string @version\ (version
7190
- >>32 byte >0 %c
7191
- >>33 string >\0 \b.%.2s
7192
- >>35 string >\0 \b.%.2s)
7193
- # ACE/gr fit description files
7194
- 0 string #\ ACE/gr\ fit\ description\ ACE/gr fit description file
7195
- # end of ACE/gr and Grace type files - PLEASE DO NOT REMOVE THIS LINE
7196
- #------------------------------------------------------------------------------
7197
- # graphviz: file(1) magic for http://www.graphviz.org/
7198
-
7199
- # FIXME: These patterns match too generally. For example, the first
7200
- # line matches a LaTeX file containing the word "graph" (with a {
7201
- # following later) and the second line matches this file.
7202
- #0 regex/100 [\r\n\t\ ]*graph[\r\n\t\ ]+.*\\{ graphviz graph text
7203
- #!:mime text/vnd.graphviz
7204
- #0 regex/100 [\r\n\t\ ]*digraph[\r\n\t\ ]+.*\\{ graphviz digraph text
7205
- #!:mime text/vnd.graphviz
7206
-
7207
- #------------------------------------------------------------------------------
7208
- # gringotts: file(1) magic for Gringotts
7209
- # http://devel.pluto.linux.it/projects/Gringotts/
7210
- # author: Germano Rizzo <mano@pluto.linux.it>
7211
- #GRG3????Y
7212
- 0 string GRG Gringotts data file
7213
- #file format 1
7214
- >3 string 1 v.1, MCRYPT S2K, SERPENT crypt, SHA-256 hash, ZLib lvl.9
7215
- #file format 2
7216
- >3 string 2 v.2, MCRYPT S2K,
7217
- >>8 byte&0x70 0x00 RIJNDAEL-128 crypt,
7218
- >>8 byte&0x70 0x10 SERPENT crypt,
7219
- >>8 byte&0x70 0x20 TWOFISH crypt,
7220
- >>8 byte&0x70 0x30 CAST-256 crypt,
7221
- >>8 byte&0x70 0x40 SAFER+ crypt,
7222
- >>8 byte&0x70 0x50 LOKI97 crypt,
7223
- >>8 byte&0x70 0x60 3DES crypt,
7224
- >>8 byte&0x70 0x70 RIJNDAEL-256 crypt,
7225
- >>8 byte&0x08 0x00 SHA1 hash,
7226
- >>8 byte&0x08 0x08 RIPEMD-160 hash,
7227
- >>8 byte&0x04 0x00 ZLib
7228
- >>8 byte&0x04 0x04 BZip2
7229
- >>8 byte&0x03 0x00 lvl.0
7230
- >>8 byte&0x03 0x01 lvl.3
7231
- >>8 byte&0x03 0x02 lvl.6
7232
- >>8 byte&0x03 0x03 lvl.9
7233
- #file format 3
7234
- >3 string 3 v.3, OpenPGP S2K,
7235
- >>8 byte&0x70 0x00 RIJNDAEL-128 crypt,
7236
- >>8 byte&0x70 0x10 SERPENT crypt,
7237
- >>8 byte&0x70 0x20 TWOFISH crypt,
7238
- >>8 byte&0x70 0x30 CAST-256 crypt,
7239
- >>8 byte&0x70 0x40 SAFER+ crypt,
7240
- >>8 byte&0x70 0x50 LOKI97 crypt,
7241
- >>8 byte&0x70 0x60 3DES crypt,
7242
- >>8 byte&0x70 0x70 RIJNDAEL-256 crypt,
7243
- >>8 byte&0x08 0x00 SHA1 hash,
7244
- >>8 byte&0x08 0x08 RIPEMD-160 hash,
7245
- >>8 byte&0x04 0x00 ZLib
7246
- >>8 byte&0x04 0x04 BZip2
7247
- >>8 byte&0x03 0x00 lvl.0
7248
- >>8 byte&0x03 0x01 lvl.3
7249
- >>8 byte&0x03 0x02 lvl.6
7250
- >>8 byte&0x03 0x03 lvl.9
7251
- #file format >3
7252
- >3 string >3 v.%.1s (unknown details)
7253
-
7254
- #------------------------------------------------------------------------------
7255
- # hitach-sh: file(1) magic for Hitachi Super-H
7256
- #
7257
- # Super-H COFF
7258
- #
7259
- 0 beshort 0x0500 Hitachi SH big-endian COFF
7260
- >18 beshort&0x0002 =0x0000 object
7261
- >18 beshort&0x0002 =0x0002 executable
7262
- >18 beshort&0x0008 =0x0008 \b, stripped
7263
- >18 beshort&0x0008 =0x0000 \b, not stripped
7264
- #
7265
- 0 leshort 0x0550 Hitachi SH little-endian COFF
7266
- >18 leshort&0x0002 =0x0000 object
7267
- >18 leshort&0x0002 =0x0002 executable
7268
- >18 leshort&0x0008 =0x0008 \b, stripped
7269
- >18 leshort&0x0008 =0x0000 \b, not stripped
7270
-
7271
- #------------------------------------------------------------------------------
7272
- # hp: file(1) magic for Hewlett Packard machines (see also "printer")
7273
- #
7274
- # XXX - somebody should figure out whether any byte order needs to be
7275
- # applied to the "TML" stuff; I'm assuming the Apollo stuff is
7276
- # big-endian as it was mostly 68K-based.
7277
- #
7278
- # I think the 500 series was the old stack-based machines, running a
7279
- # UNIX environment atop the "SUN kernel"; dunno whether it was
7280
- # big-endian or little-endian.
7281
- #
7282
- # Daniel Quinlan (quinlan@yggdrasil.com): hp200 machines are 68010 based;
7283
- # hp300 are 68020+68881 based; hp400 are also 68k. The following basic
7284
- # HP magic is useful for reference, but using "long" magic is a better
7285
- # practice in order to avoid collisions.
7286
- #
7287
- # Guy Harris (guy@netapp.com): some additions to this list came from
7288
- # HP-UX 10.0's "/usr/include/sys/unistd.h" (68030, 68040, PA-RISC 1.1,
7289
- # 1.2, and 2.0). The 1.2 and 2.0 stuff isn't in the HP-UX 10.0
7290
- # "/etc/magic", though, except for the "archive file relocatable library"
7291
- # stuff, and the 68030 and 68040 stuff isn't there at all - are they not
7292
- # used in executables, or have they just not yet updated "/etc/magic"
7293
- # completely?
7294
- #
7295
- # 0 beshort 200 hp200 (68010) BSD binary
7296
- # 0 beshort 300 hp300 (68020+68881) BSD binary
7297
- # 0 beshort 0x20c hp200/300 HP-UX binary
7298
- # 0 beshort 0x20d hp400 (68030) HP-UX binary
7299
- # 0 beshort 0x20e hp400 (68040?) HP-UX binary
7300
- # 0 beshort 0x20b PA-RISC1.0 HP-UX binary
7301
- # 0 beshort 0x210 PA-RISC1.1 HP-UX binary
7302
- # 0 beshort 0x211 PA-RISC1.2 HP-UX binary
7303
- # 0 beshort 0x214 PA-RISC2.0 HP-UX binary
7304
-
7305
- #
7306
- # The "misc" stuff needs a byte order; the archives look suspiciously
7307
- # like the old 177545 archives (0xff65 = 0177545).
7308
- #
7309
- #### Old Apollo stuff
7310
- 0 beshort 0627 Apollo m68k COFF executable
7311
- >18 beshort ^040000 not stripped
7312
- >22 beshort >0 - version %ld
7313
- 0 beshort 0624 apollo a88k COFF executable
7314
- >18 beshort ^040000 not stripped
7315
- >22 beshort >0 - version %ld
7316
- 0 long 01203604016 TML 0123 byte-order format
7317
- 0 long 01702407010 TML 1032 byte-order format
7318
- 0 long 01003405017 TML 2301 byte-order format
7319
- 0 long 01602007412 TML 3210 byte-order format
7320
- #### PA-RISC 1.1
7321
- 0 belong 0x02100106 PA-RISC1.1 relocatable object
7322
- 0 belong 0x02100107 PA-RISC1.1 executable
7323
- >168 belong &0x00000004 dynamically linked
7324
- >(144) belong 0x054ef630 dynamically linked
7325
- >96 belong >0 - not stripped
7326
-
7327
- 0 belong 0x02100108 PA-RISC1.1 shared executable
7328
- >168 belong&0x4 0x4 dynamically linked
7329
- >(144) belong 0x054ef630 dynamically linked
7330
- >96 belong >0 - not stripped
7331
-
7332
- 0 belong 0x0210010b PA-RISC1.1 demand-load executable
7333
- >168 belong&0x4 0x4 dynamically linked
7334
- >(144) belong 0x054ef630 dynamically linked
7335
- >96 belong >0 - not stripped
7336
-
7337
- 0 belong 0x0210010e PA-RISC1.1 shared library
7338
- >96 belong >0 - not stripped
7339
-
7340
- 0 belong 0x0210010d PA-RISC1.1 dynamic load library
7341
- >96 belong >0 - not stripped
7342
-
7343
- #### PA-RISC 2.0
7344
- 0 belong 0x02140106 PA-RISC2.0 relocatable object
7345
-
7346
- 0 belong 0x02140107 PA-RISC2.0 executable
7347
- >168 belong &0x00000004 dynamically linked
7348
- >(144) belong 0x054ef630 dynamically linked
7349
- >96 belong >0 - not stripped
7350
-
7351
- 0 belong 0x02140108 PA-RISC2.0 shared executable
7352
- >168 belong &0x00000004 dynamically linked
7353
- >(144) belong 0x054ef630 dynamically linked
7354
- >96 belong >0 - not stripped
7355
-
7356
- 0 belong 0x0214010b PA-RISC2.0 demand-load executable
7357
- >168 belong &0x00000004 dynamically linked
7358
- >(144) belong 0x054ef630 dynamically linked
7359
- >96 belong >0 - not stripped
7360
-
7361
- 0 belong 0x0214010e PA-RISC2.0 shared library
7362
- >96 belong >0 - not stripped
7363
-
7364
- 0 belong 0x0214010d PA-RISC2.0 dynamic load library
7365
- >96 belong >0 - not stripped
7366
-
7367
- #### 800
7368
- 0 belong 0x020b0106 PA-RISC1.0 relocatable object
7369
-
7370
- 0 belong 0x020b0107 PA-RISC1.0 executable
7371
- >168 belong&0x4 0x4 dynamically linked
7372
- >(144) belong 0x054ef630 dynamically linked
7373
- >96 belong >0 - not stripped
7374
-
7375
- 0 belong 0x020b0108 PA-RISC1.0 shared executable
7376
- >168 belong&0x4 0x4 dynamically linked
7377
- >(144) belong 0x054ef630 dynamically linked
7378
- >96 belong >0 - not stripped
7379
-
7380
- 0 belong 0x020b010b PA-RISC1.0 demand-load executable
7381
- >168 belong&0x4 0x4 dynamically linked
7382
- >(144) belong 0x054ef630 dynamically linked
7383
- >96 belong >0 - not stripped
7384
-
7385
- 0 belong 0x020b010e PA-RISC1.0 shared library
7386
- >96 belong >0 - not stripped
7387
-
7388
- 0 belong 0x020b010d PA-RISC1.0 dynamic load library
7389
- >96 belong >0 - not stripped
7390
-
7391
- 0 belong 0x213c6172 archive file
7392
- >68 belong 0x020b0619 - PA-RISC1.0 relocatable library
7393
- >68 belong 0x02100619 - PA-RISC1.1 relocatable library
7394
- >68 belong 0x02110619 - PA-RISC1.2 relocatable library
7395
- >68 belong 0x02140619 - PA-RISC2.0 relocatable library
7396
-
7397
- #### 500
7398
- 0 long 0x02080106 HP s500 relocatable executable
7399
- >16 long >0 - version %ld
7400
-
7401
- 0 long 0x02080107 HP s500 executable
7402
- >16 long >0 - version %ld
7403
-
7404
- 0 long 0x02080108 HP s500 pure executable
7405
- >16 long >0 - version %ld
7406
-
7407
- #### 200
7408
- 0 belong 0x020c0108 HP s200 pure executable
7409
- >4 beshort >0 - version %ld
7410
- >8 belong &0x80000000 save fp regs
7411
- >8 belong &0x40000000 dynamically linked
7412
- >8 belong &0x20000000 debuggable
7413
- >36 belong >0 not stripped
7414
-
7415
- 0 belong 0x020c0107 HP s200 executable
7416
- >4 beshort >0 - version %ld
7417
- >8 belong &0x80000000 save fp regs
7418
- >8 belong &0x40000000 dynamically linked
7419
- >8 belong &0x20000000 debuggable
7420
- >36 belong >0 not stripped
7421
-
7422
- 0 belong 0x020c010b HP s200 demand-load executable
7423
- >4 beshort >0 - version %ld
7424
- >8 belong &0x80000000 save fp regs
7425
- >8 belong &0x40000000 dynamically linked
7426
- >8 belong &0x20000000 debuggable
7427
- >36 belong >0 not stripped
7428
-
7429
- 0 belong 0x020c0106 HP s200 relocatable executable
7430
- >4 beshort >0 - version %ld
7431
- >6 beshort >0 - highwater %d
7432
- >8 belong &0x80000000 save fp regs
7433
- >8 belong &0x20000000 debuggable
7434
- >8 belong &0x10000000 PIC
7435
-
7436
- 0 belong 0x020a0108 HP s200 (2.x release) pure executable
7437
- >4 beshort >0 - version %ld
7438
- >36 belong >0 not stripped
7439
-
7440
- 0 belong 0x020a0107 HP s200 (2.x release) executable
7441
- >4 beshort >0 - version %ld
7442
- >36 belong >0 not stripped
7443
-
7444
- 0 belong 0x020c010e HP s200 shared library
7445
- >4 beshort >0 - version %ld
7446
- >6 beshort >0 - highwater %d
7447
- >36 belong >0 not stripped
7448
-
7449
- 0 belong 0x020c010d HP s200 dynamic load library
7450
- >4 beshort >0 - version %ld
7451
- >6 beshort >0 - highwater %d
7452
- >36 belong >0 not stripped
7453
-
7454
- #### MISC
7455
- 0 long 0x0000ff65 HP old archive
7456
- 0 long 0x020aff65 HP s200 old archive
7457
- 0 long 0x020cff65 HP s200 old archive
7458
- 0 long 0x0208ff65 HP s500 old archive
7459
-
7460
- 0 long 0x015821a6 HP core file
7461
-
7462
- 0 long 0x4da7eee8 HP-WINDOWS font
7463
- >8 byte >0 - version %ld
7464
- 0 string Bitmapfile HP Bitmapfile
7465
-
7466
- 0 string IMGfile CIS compimg HP Bitmapfile
7467
- # XXX - see "lif"
7468
- #0 short 0x8000 lif file
7469
- 0 long 0x020c010c compiled Lisp
7470
-
7471
- 0 string msgcat01 HP NLS message catalog,
7472
- >8 long >0 %d messages
7473
-
7474
- # Summary: HP-48/49 calculator
7475
- # Created by: phk@data.fls.dk
7476
- # Modified by (1): AMAKAWA Shuhei <sa264@cam.ac.uk>
7477
- # Modified by (2): Samuel Thibault <samuel.thibault@ens-lyon.org> (HP49 support)
7478
- 0 string HPHP HP
7479
- >4 string 48 48 binary
7480
- >4 string 49 49 binary
7481
- >7 byte >64 - Rev %c
7482
- >8 leshort 0x2911 (ADR)
7483
- >8 leshort 0x2933 (REAL)
7484
- >8 leshort 0x2955 (LREAL)
7485
- >8 leshort 0x2977 (COMPLX)
7486
- >8 leshort 0x299d (LCOMPLX)
7487
- >8 leshort 0x29bf (CHAR)
7488
- >8 leshort 0x29e8 (ARRAY)
7489
- >8 leshort 0x2a0a (LNKARRAY)
7490
- >8 leshort 0x2a2c (STRING)
7491
- >8 leshort 0x2a4e (HXS)
7492
- >8 leshort 0x2a74 (LIST)
7493
- >8 leshort 0x2a96 (DIR)
7494
- >8 leshort 0x2ab8 (ALG)
7495
- >8 leshort 0x2ada (UNIT)
7496
- >8 leshort 0x2afc (TAGGED)
7497
- >8 leshort 0x2b1e (GROB)
7498
- >8 leshort 0x2b40 (LIB)
7499
- >8 leshort 0x2b62 (BACKUP)
7500
- >8 leshort 0x2b88 (LIBDATA)
7501
- >8 leshort 0x2d9d (PROG)
7502
- >8 leshort 0x2dcc (CODE)
7503
- >8 leshort 0x2e48 (GNAME)
7504
- >8 leshort 0x2e6d (LNAME)
7505
- >8 leshort 0x2e92 (XLIB)
7506
-
7507
- 0 string %%HP: HP text
7508
- >6 string T(0) - T(0)
7509
- >6 string T(1) - T(1)
7510
- >6 string T(2) - T(2)
7511
- >6 string T(3) - T(3)
7512
- >10 string A(D) A(D)
7513
- >10 string A(R) A(R)
7514
- >10 string A(G) A(G)
7515
- >14 string F(.) F(.);
7516
- >14 string F(,) F(,);
7517
-
7518
-
7519
- # Summary: HP-38/39 calculator
7520
- # Created by: Samuel Thibault <samuel.thibault@ens-lyon.org>
7521
- 0 string HP3
7522
- >3 string 8 HP 38
7523
- >3 string 9 HP 39
7524
- >4 string Bin binary
7525
- >4 string Asc ASCII
7526
- >7 string A (Directory List)
7527
- >7 string B (Zaplet)
7528
- >7 string C (Note)
7529
- >7 string D (Program)
7530
- >7 string E (Variable)
7531
- >7 string F (List)
7532
- >7 string G (Matrix)
7533
- >7 string H (Library)
7534
- >7 string I (Target List)
7535
- >7 string J (ASCII Vector specification)
7536
- >7 string K (wildcard)
7537
-
7538
- # Summary: HP-38/39 calculator
7539
- # Created by: Samuel Thibault <samuel.thibault@ens-lyon.org>
7540
- 0 string HP3
7541
- >3 string 8 HP 38
7542
- >3 string 9 HP 39
7543
- >4 string Bin binary
7544
- >4 string Asc ASCII
7545
- >7 string A (Directory List)
7546
- >7 string B (Zaplet)
7547
- >7 string C (Note)
7548
- >7 string D (Program)
7549
- >7 string E (Variable)
7550
- >7 string F (List)
7551
- >7 string G (Matrix)
7552
- >7 string H (Library)
7553
- >7 string I (Target List)
7554
- >7 string J (ASCII Vector specification)
7555
- >7 string K (wildcard)
7556
-
7557
- # hpBSD magic numbers
7558
- 0 beshort 200 hp200 (68010) BSD
7559
- >2 beshort 0407 impure binary
7560
- >2 beshort 0410 read-only binary
7561
- >2 beshort 0413 demand paged binary
7562
- 0 beshort 300 hp300 (68020+68881) BSD
7563
- >2 beshort 0407 impure binary
7564
- >2 beshort 0410 read-only binary
7565
- >2 beshort 0413 demand paged binary
7566
- #
7567
- # From David Gero <dgero@nortelnetworks.com>
7568
- # HP-UX 10.20 core file format from /usr/include/sys/core.h
7569
- # Unfortunately, HP-UX uses corehead blocks without specifying the order
7570
- # There are four we care about:
7571
- # CORE_KERNEL, which starts with the string "HP-UX"
7572
- # CORE_EXEC, which contains the name of the command
7573
- # CORE_PROC, which contains the signal number that caused the core dump
7574
- # CORE_FORMAT, which contains the version of the core file format (== 1)
7575
- # The only observed order in real core files is KERNEL, EXEC, FORMAT, PROC
7576
- # but we include all 6 variations of the order of the first 3, and
7577
- # assume that PROC will always be last
7578
- # Order 1: KERNEL, EXEC, FORMAT, PROC
7579
- 0x10 string HP-UX
7580
- >0 belong 2
7581
- >>0xC belong 0x3C
7582
- >>>0x4C belong 0x100
7583
- >>>>0x58 belong 0x44
7584
- >>>>>0xA0 belong 1
7585
- >>>>>>0xAC belong 4
7586
- >>>>>>>0xB0 belong 1
7587
- >>>>>>>>0xB4 belong 4 core file
7588
- >>>>>>>>>0x90 string >\0 from '%s'
7589
- >>>>>>>>>0xC4 belong 3 - received SIGQUIT
7590
- >>>>>>>>>0xC4 belong 4 - received SIGILL
7591
- >>>>>>>>>0xC4 belong 5 - received SIGTRAP
7592
- >>>>>>>>>0xC4 belong 6 - received SIGABRT
7593
- >>>>>>>>>0xC4 belong 7 - received SIGEMT
7594
- >>>>>>>>>0xC4 belong 8 - received SIGFPE
7595
- >>>>>>>>>0xC4 belong 10 - received SIGBUS
7596
- >>>>>>>>>0xC4 belong 11 - received SIGSEGV
7597
- >>>>>>>>>0xC4 belong 12 - received SIGSYS
7598
- >>>>>>>>>0xC4 belong 33 - received SIGXCPU
7599
- >>>>>>>>>0xC4 belong 34 - received SIGXFSZ
7600
- # Order 2: KERNEL, FORMAT, EXEC, PROC
7601
- >>>0x4C belong 1
7602
- >>>>0x58 belong 4
7603
- >>>>>0x5C belong 1
7604
- >>>>>>0x60 belong 0x100
7605
- >>>>>>>0x6C belong 0x44
7606
- >>>>>>>>0xB4 belong 4 core file
7607
- >>>>>>>>>0xA4 string >\0 from '%s'
7608
- >>>>>>>>>0xC4 belong 3 - received SIGQUIT
7609
- >>>>>>>>>0xC4 belong 4 - received SIGILL
7610
- >>>>>>>>>0xC4 belong 5 - received SIGTRAP
7611
- >>>>>>>>>0xC4 belong 6 - received SIGABRT
7612
- >>>>>>>>>0xC4 belong 7 - received SIGEMT
7613
- >>>>>>>>>0xC4 belong 8 - received SIGFPE
7614
- >>>>>>>>>0xC4 belong 10 - received SIGBUS
7615
- >>>>>>>>>0xC4 belong 11 - received SIGSEGV
7616
- >>>>>>>>>0xC4 belong 12 - received SIGSYS
7617
- >>>>>>>>>0xC4 belong 33 - received SIGXCPU
7618
- >>>>>>>>>0xC4 belong 34 - received SIGXFSZ
7619
- # Order 3: FORMAT, KERNEL, EXEC, PROC
7620
- 0x24 string HP-UX
7621
- >0 belong 1
7622
- >>0xC belong 4
7623
- >>>0x10 belong 1
7624
- >>>>0x14 belong 2
7625
- >>>>>0x20 belong 0x3C
7626
- >>>>>>0x60 belong 0x100
7627
- >>>>>>>0x6C belong 0x44
7628
- >>>>>>>>0xB4 belong 4 core file
7629
- >>>>>>>>>0xA4 string >\0 from '%s'
7630
- >>>>>>>>>0xC4 belong 3 - received SIGQUIT
7631
- >>>>>>>>>0xC4 belong 4 - received SIGILL
7632
- >>>>>>>>>0xC4 belong 5 - received SIGTRAP
7633
- >>>>>>>>>0xC4 belong 6 - received SIGABRT
7634
- >>>>>>>>>0xC4 belong 7 - received SIGEMT
7635
- >>>>>>>>>0xC4 belong 8 - received SIGFPE
7636
- >>>>>>>>>0xC4 belong 10 - received SIGBUS
7637
- >>>>>>>>>0xC4 belong 11 - received SIGSEGV
7638
- >>>>>>>>>0xC4 belong 12 - received SIGSYS
7639
- >>>>>>>>>0xC4 belong 33 - received SIGXCPU
7640
- >>>>>>>>>0xC4 belong 34 - received SIGXFSZ
7641
- # Order 4: EXEC, KERNEL, FORMAT, PROC
7642
- 0x64 string HP-UX
7643
- >0 belong 0x100
7644
- >>0xC belong 0x44
7645
- >>>0x54 belong 2
7646
- >>>>0x60 belong 0x3C
7647
- >>>>>0xA0 belong 1
7648
- >>>>>>0xAC belong 4
7649
- >>>>>>>0xB0 belong 1
7650
- >>>>>>>>0xB4 belong 4 core file
7651
- >>>>>>>>>0x44 string >\0 from '%s'
7652
- >>>>>>>>>0xC4 belong 3 - received SIGQUIT
7653
- >>>>>>>>>0xC4 belong 4 - received SIGILL
7654
- >>>>>>>>>0xC4 belong 5 - received SIGTRAP
7655
- >>>>>>>>>0xC4 belong 6 - received SIGABRT
7656
- >>>>>>>>>0xC4 belong 7 - received SIGEMT
7657
- >>>>>>>>>0xC4 belong 8 - received SIGFPE
7658
- >>>>>>>>>0xC4 belong 10 - received SIGBUS
7659
- >>>>>>>>>0xC4 belong 11 - received SIGSEGV
7660
- >>>>>>>>>0xC4 belong 12 - received SIGSYS
7661
- >>>>>>>>>0xC4 belong 33 - received SIGXCPU
7662
- >>>>>>>>>0xC4 belong 34 - received SIGXFSZ
7663
- # Order 5: FORMAT, EXEC, KERNEL, PROC
7664
- 0x78 string HP-UX
7665
- >0 belong 1
7666
- >>0xC belong 4
7667
- >>>0x10 belong 1
7668
- >>>>0x14 belong 0x100
7669
- >>>>>0x20 belong 0x44
7670
- >>>>>>0x68 belong 2
7671
- >>>>>>>0x74 belong 0x3C
7672
- >>>>>>>>0xB4 belong 4 core file
7673
- >>>>>>>>>0x58 string >\0 from '%s'
7674
- >>>>>>>>>0xC4 belong 3 - received SIGQUIT
7675
- >>>>>>>>>0xC4 belong 4 - received SIGILL
7676
- >>>>>>>>>0xC4 belong 5 - received SIGTRAP
7677
- >>>>>>>>>0xC4 belong 6 - received SIGABRT
7678
- >>>>>>>>>0xC4 belong 7 - received SIGEMT
7679
- >>>>>>>>>0xC4 belong 8 - received SIGFPE
7680
- >>>>>>>>>0xC4 belong 10 - received SIGBUS
7681
- >>>>>>>>>0xC4 belong 11 - received SIGSEGV
7682
- >>>>>>>>>0xC4 belong 12 - received SIGSYS
7683
- >>>>>>>>>0xC4 belong 33 - received SIGXCPU
7684
- >>>>>>>>>0xC4 belong 34 - received SIGXFSZ
7685
- # Order 6: EXEC, FORMAT, KERNEL, PROC
7686
- >0 belong 0x100
7687
- >>0xC belong 0x44
7688
- >>>0x54 belong 1
7689
- >>>>0x60 belong 4
7690
- >>>>>0x64 belong 1
7691
- >>>>>>0x68 belong 2
7692
- >>>>>>>0x74 belong 0x2C
7693
- >>>>>>>>0xB4 belong 4 core file
7694
- >>>>>>>>>0x44 string >\0 from '%s'
7695
- >>>>>>>>>0xC4 belong 3 - received SIGQUIT
7696
- >>>>>>>>>0xC4 belong 4 - received SIGILL
7697
- >>>>>>>>>0xC4 belong 5 - received SIGTRAP
7698
- >>>>>>>>>0xC4 belong 6 - received SIGABRT
7699
- >>>>>>>>>0xC4 belong 7 - received SIGEMT
7700
- >>>>>>>>>0xC4 belong 8 - received SIGFPE
7701
- >>>>>>>>>0xC4 belong 10 - received SIGBUS
7702
- >>>>>>>>>0xC4 belong 11 - received SIGSEGV
7703
- >>>>>>>>>0xC4 belong 12 - received SIGSYS
7704
- >>>>>>>>>0xC4 belong 33 - received SIGXCPU
7705
- >>>>>>>>>0xC4 belong 34 - received SIGXFSZ
7706
-
7707
-
7708
-
7709
- #------------------------------------------------------------------------------
7710
- # human68k: file(1) magic for Human68k (X680x0 DOS) binary formats
7711
- # Magic too short!
7712
- #0 string HU Human68k
7713
- #>68 string LZX LZX compressed
7714
- #>>72 string >\0 (version %s)
7715
- #>(8.L+74) string LZX LZX compressed
7716
- #>>(8.L+78) string >\0 (version %s)
7717
- #>60 belong >0 binded
7718
- #>(8.L+66) string #HUPAIR hupair
7719
- #>0 string HU X executable
7720
- #>(8.L+74) string #LIBCV1 - linked PD LIBC ver 1
7721
- #>4 belong >0 - base address 0x%x
7722
- #>28 belong >0 not stripped
7723
- #>32 belong >0 with debug information
7724
- #0 beshort 0x601a Human68k Z executable
7725
- #0 beshort 0x6000 Human68k object file
7726
- #0 belong 0xd1000000 Human68k ar binary archive
7727
- #0 belong 0xd1010000 Human68k ar ascii archive
7728
- #0 beshort 0x0068 Human68k lib archive
7729
- #4 string LZX Human68k LZX compressed
7730
- #>8 string >\0 (version %s)
7731
- #>4 string LZX R executable
7732
- #2 string #HUPAIR Human68k hupair R executable
7733
-
7734
- #------------------------------------------------------------------------------
7735
- # ibm370: file(1) magic for IBM 370 and compatibles.
7736
- #
7737
- # "ibm370" said that 0x15d == 0535 was "ibm 370 pure executable".
7738
- # What the heck *is* "USS/370"?
7739
- # AIX 4.1's "/etc/magic" has
7740
- #
7741
- # 0 short 0535 370 sysV executable
7742
- # >12 long >0 not stripped
7743
- # >22 short >0 - version %d
7744
- # >30 long >0 - 5.2 format
7745
- # 0 short 0530 370 sysV pure executable
7746
- # >12 long >0 not stripped
7747
- # >22 short >0 - version %d
7748
- # >30 long >0 - 5.2 format
7749
- #
7750
- # instead of the "USS/370" versions of the same magic numbers.
7751
- #
7752
- 0 beshort 0537 370 XA sysV executable
7753
- >12 belong >0 not stripped
7754
- >22 beshort >0 - version %d
7755
- >30 belong >0 - 5.2 format
7756
- 0 beshort 0532 370 XA sysV pure executable
7757
- >12 belong >0 not stripped
7758
- >22 beshort >0 - version %d
7759
- >30 belong >0 - 5.2 format
7760
- 0 beshort 054001 370 sysV pure executable
7761
- >12 belong >0 not stripped
7762
- 0 beshort 055001 370 XA sysV pure executable
7763
- >12 belong >0 not stripped
7764
- 0 beshort 056401 370 sysV executable
7765
- >12 belong >0 not stripped
7766
- 0 beshort 057401 370 XA sysV executable
7767
- >12 belong >0 not stripped
7768
- 0 beshort 0531 SVR2 executable (Amdahl-UTS)
7769
- >12 belong >0 not stripped
7770
- >24 belong >0 - version %ld
7771
- 0 beshort 0534 SVR2 pure executable (Amdahl-UTS)
7772
- >12 belong >0 not stripped
7773
- >24 belong >0 - version %ld
7774
- 0 beshort 0530 SVR2 pure executable (USS/370)
7775
- >12 belong >0 not stripped
7776
- >24 belong >0 - version %ld
7777
- 0 beshort 0535 SVR2 executable (USS/370)
7778
- >12 belong >0 not stripped
7779
- >24 belong >0 - version %ld
7780
-
7781
- #------------------------------------------------------------------------------
7782
- # ibm6000: file(1) magic for RS/6000 and the RT PC.
7783
- #
7784
- 0 beshort 0x01df executable (RISC System/6000 V3.1) or obj module
7785
- >12 belong >0 not stripped
7786
- # Breaks sun4 statically linked execs.
7787
- #0 beshort 0x0103 executable (RT Version 2) or obj module
7788
- #>2 byte 0x50 pure
7789
- #>28 belong >0 not stripped
7790
- #>6 beshort >0 - version %ld
7791
- 0 beshort 0x0104 shared library
7792
- 0 beshort 0x0105 ctab data
7793
- 0 beshort 0xfe04 structured file
7794
- 0 string 0xabcdef AIX message catalog
7795
- 0 belong 0x000001f9 AIX compiled message catalog
7796
- 0 string \<aiaff> archive
7797
- 0 string \<bigaf> archive (big format)
7798
-
7799
-
7800
- #------------------------------------------------------------------------------
7801
- # iff: file(1) magic for Interchange File Format (see also "audio" & "images")
7802
- #
7803
- # Daniel Quinlan (quinlan@yggdrasil.com) -- IFF was designed by Electronic
7804
- # Arts for file interchange. It has also been used by Apple, SGI, and
7805
- # especially Commodore-Amiga.
7806
- #
7807
- # IFF files begin with an 8 byte FORM header, followed by a 4 character
7808
- # FORM type, which is followed by the first chunk in the FORM.
7809
-
7810
- 0 string FORM IFF data
7811
- #>4 belong x \b, FORM is %d bytes long
7812
- # audio formats
7813
- >8 string AIFF \b, AIFF audio
7814
- !:mime audio/x-aiff
7815
- >8 string AIFC \b, AIFF-C compressed audio
7816
- !:mime audio/x-aiff
7817
- >8 string 8SVX \b, 8SVX 8-bit sampled sound voice
7818
- !:mime audio/x-aiff
7819
- >8 string 16SV \b, 16SV 16-bit sampled sound voice
7820
- >8 string SAMP \b, SAMP sampled audio
7821
- >8 string MAUD \b, MAUD MacroSystem audio
7822
- >8 string SMUS \b, SMUS simple music
7823
- >8 string CMUS \b, CMUS complex music
7824
- # image formats
7825
- >8 string ILBMBMHD \b, ILBM interleaved image
7826
- >>20 beshort x \b, %d x
7827
- >>22 beshort x %d
7828
- >8 string RGBN \b, RGBN 12-bit RGB image
7829
- >8 string RGB8 \b, RGB8 24-bit RGB image
7830
- >8 string DEEP \b, DEEP TVPaint/XiPaint image
7831
- >8 string DR2D \b, DR2D 2-D object
7832
- >8 string TDDD \b, TDDD 3-D rendering
7833
- >8 string LWOB \b, LWOB 3-D object
7834
- >8 string LWO2 \b, LWO2 3-D object, v2
7835
- >8 string LWLO \b, LWLO 3-D layered object
7836
- >8 string REAL \b, REAL Real3D rendering
7837
- >8 string MC4D \b, MC4D MaxonCinema4D rendering
7838
- >8 string ANIM \b, ANIM animation
7839
- >8 string YAFA \b, YAFA animation
7840
- >8 string SSA\ \b, SSA super smooth animation
7841
- >8 string ACBM \b, ACBM continuous image
7842
- >8 string FAXX \b, FAXX fax image
7843
- # other formats
7844
- >8 string FTXT \b, FTXT formatted text
7845
- >8 string CTLG \b, CTLG message catalog
7846
- >8 string PREF \b, PREF preferences
7847
- >8 string DTYP \b, DTYP datatype description
7848
- >8 string PTCH \b, PTCH binary patch
7849
- >8 string AMFF \b, AMFF AmigaMetaFile format
7850
- >8 string WZRD \b, WZRD StormWIZARD resource
7851
- >8 string DOC\ \b, DOC desktop publishing document
7852
-
7853
- # These go at the end of the iff rules
7854
- #
7855
- # I don't see why these might collide with anything else.
7856
- #
7857
- # Interactive Fiction related formats
7858
- #
7859
- >8 string IFRS \b, Blorb Interactive Fiction
7860
- >>24 string Exec with executable chunk
7861
- >8 string IFZS \b, Z-machine or Glulx saved game file (Quetzal)
7862
- #------------------------------------------------------------------------------
7863
- # images: file(1) magic for image formats (see also "iff", and "c-lang" for
7864
- # XPM bitmaps)
7865
- #
7866
- # originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
7867
- # additions by janl@ifi.uio.no as well as others. Jan also suggested
7868
- # merging several one- and two-line files into here.
7869
- #
7870
- # little magic: PCX (first byte is 0x0a)
7871
-
7872
- # Targa - matches `povray', `ppmtotga' and `xv' outputs
7873
- # by Philippe De Muyter <phdm@macqel.be>
7874
- # at 2, byte ImgType must be 1, 2, 3, 9, 10 or 11
7875
- # at 1, byte CoMapType must be 1 if ImgType is 1 or 9, 0 otherwise
7876
- # at 3, leshort Index is 0 for povray, ppmtotga and xv outputs
7877
- # `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
7878
- # `tgatoppm' recognizes a superset (Index may be anything)
7879
- 1 belong&0xfff7ffff 0x01010000 Targa image data - Map
7880
- >2 byte&8 8 - RLE
7881
- >12 leshort >0 %hd x
7882
- >14 leshort >0 %hd
7883
- 1 belong&0xfff7ffff 0x00020000 Targa image data - RGB
7884
- >2 byte&8 8 - RLE
7885
- >12 leshort >0 %hd x
7886
- >14 leshort >0 %hd
7887
- 1 belong&0xfff7ffff 0x00030000 Targa image data - Mono
7888
- >2 byte&8 8 - RLE
7889
- >12 leshort >0 %hd x
7890
- >14 leshort >0 %hd
7891
-
7892
- # PBMPLUS images
7893
- # The next byte following the magic is always whitespace.
7894
- 0 search/1 P1 Netpbm PBM image text
7895
- !:mime image/x-portable-bitmap
7896
- 0 search/1 P2 Netpbm PGM image text
7897
- !:mime image/x-portable-greymap
7898
- 0 search/1 P3 Netpbm PPM image text
7899
- !:mime image/x-portable-pixmap
7900
- 0 string P4 Netpbm PBM "rawbits" image data
7901
- !:mime image/x-portable-bitmap
7902
- 0 string P5 Netpbm PGM "rawbits" image data
7903
- !:mime image/x-portable-greymap
7904
- 0 string P6 Netpbm PPM "rawbits" image data
7905
- !:mime image/x-portable-pixmap
7906
- 0 string P7 Netpbm PAM image file
7907
- !:mime image/x-portable-pixmap
7908
-
7909
- # From: bryanh@giraffe-data.com (Bryan Henderson)
7910
- 0 string \117\072 Solitaire Image Recorder format
7911
- >4 string \013 MGI Type 11
7912
- >4 string \021 MGI Type 17
7913
- 0 string .MDA MicroDesign data
7914
- >21 byte 48 version 2
7915
- >21 byte 51 version 3
7916
- 0 string .MDP MicroDesign page data
7917
- >21 byte 48 version 2
7918
- >21 byte 51 version 3
7919
-
7920
- # NIFF (Navy Interchange File Format, a modification of TIFF) images
7921
- # [GRR: this *must* go before TIFF]
7922
- 0 string IIN1 NIFF image data
7923
- !:mime image/x-niff
7924
-
7925
- # Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
7926
- # The second word of TIFF files is the TIFF version number, 42, which has
7927
- # never changed. The TIFF specification recommends testing for it.
7928
- 0 string MM\x00\x2a TIFF image data, big-endian
7929
- !:mime image/tiff
7930
- 0 string II\x2a\x00 TIFF image data, little-endian
7931
- !:mime image/tiff
7932
-
7933
- # PNG [Portable Network Graphics, or "PNG's Not GIF"] images
7934
- # (Greg Roelofs, newt@uchicago.edu)
7935
- # (Albert Cahalan, acahalan@cs.uml.edu)
7936
- #
7937
- # 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
7938
- #
7939
- 0 string \x89PNG\x0d\x0a\x1a\x0a PNG image
7940
- !:mime image/png
7941
- >16 belong x \b, %ld x
7942
- >20 belong x %ld,
7943
- >24 byte x %d-bit
7944
- >25 byte 0 grayscale,
7945
- >25 byte 2 \b/color RGB,
7946
- >25 byte 3 colormap,
7947
- >25 byte 4 gray+alpha,
7948
- >25 byte 6 \b/color RGBA,
7949
- #>26 byte 0 deflate/32K,
7950
- >28 byte 0 non-interlaced
7951
- >28 byte 1 interlaced
7952
-
7953
- # possible GIF replacements; none yet released!
7954
- # (Greg Roelofs, newt@uchicago.edu)
7955
- #
7956
- # GRR 950115: this was mine ("Zip GIF"):
7957
- 0 string GIF94z ZIF image (GIF+deflate alpha)
7958
- !:mime image/x-unknown
7959
- #
7960
- # GRR 950115: this is Jeremy Wohl's Free Graphics Format (better):
7961
- #
7962
- 0 string FGF95a FGF image (GIF+deflate beta)
7963
- !:mime image/x-unknown
7964
- #
7965
- # GRR 950115: this is Thomas Boutell's Portable Bitmap Format proposal
7966
- # (best; not yet implemented):
7967
- #
7968
- 0 string PBF PBF image (deflate compression)
7969
- !:mime image/x-unknown
7970
-
7971
- # GIF
7972
- 0 string GIF8 GIF image data
7973
- !:mime image/gif
7974
- !:apple 8BIMGIFf
7975
- >4 string 7a \b, version 8%s,
7976
- >4 string 9a \b, version 8%s,
7977
- >6 leshort >0 %hd x
7978
- >8 leshort >0 %hd
7979
- #>10 byte &0x80 color mapped,
7980
- #>10 byte&0x07 =0x00 2 colors
7981
- #>10 byte&0x07 =0x01 4 colors
7982
- #>10 byte&0x07 =0x02 8 colors
7983
- #>10 byte&0x07 =0x03 16 colors
7984
- #>10 byte&0x07 =0x04 32 colors
7985
- #>10 byte&0x07 =0x05 64 colors
7986
- #>10 byte&0x07 =0x06 128 colors
7987
- #>10 byte&0x07 =0x07 256 colors
7988
-
7989
- # ITC (CMU WM) raster files. It is essentially a byte-reversed Sun raster,
7990
- # 1 plane, no encoding.
7991
- 0 string \361\0\100\273 CMU window manager raster image data
7992
- >4 lelong >0 %d x
7993
- >8 lelong >0 %d,
7994
- >12 lelong >0 %d-bit
7995
-
7996
- # Magick Image File Format
7997
- 0 string id=ImageMagick MIFF image data
7998
-
7999
- # Artisan
8000
- 0 long 1123028772 Artisan image data
8001
- >4 long 1 \b, rectangular 24-bit
8002
- >4 long 2 \b, rectangular 8-bit with colormap
8003
- >4 long 3 \b, rectangular 32-bit (24-bit with matte)
8004
-
8005
- # FIG (Facility for Interactive Generation of figures), an object-based format
8006
- 0 search/1 #FIG FIG image text
8007
- >5 string x \b, version %.3s
8008
-
8009
- # PHIGS
8010
- 0 string ARF_BEGARF PHIGS clear text archive
8011
- 0 string @(#)SunPHIGS SunPHIGS
8012
- # version number follows, in the form m.n
8013
- >40 string SunBin binary
8014
- >32 string archive archive
8015
-
8016
- # GKS (Graphics Kernel System)
8017
- 0 string GKSM GKS Metafile
8018
- >24 string SunGKS \b, SunGKS
8019
-
8020
- # CGM image files
8021
- 0 string BEGMF clear text Computer Graphics Metafile
8022
-
8023
- # MGR bitmaps (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
8024
- 0 string yz MGR bitmap, modern format, 8-bit aligned
8025
- 0 string zz MGR bitmap, old format, 1-bit deep, 16-bit aligned
8026
- 0 string xz MGR bitmap, old format, 1-bit deep, 32-bit aligned
8027
- 0 string yx MGR bitmap, modern format, squeezed
8028
-
8029
- # Fuzzy Bitmap (FBM) images
8030
- 0 string %bitmap\0 FBM image data
8031
- >30 long 0x31 \b, mono
8032
- >30 long 0x33 \b, color
8033
-
8034
- # facsimile data
8035
- 1 string PC\ Research,\ Inc group 3 fax data
8036
- >29 byte 0 \b, normal resolution (204x98 DPI)
8037
- >29 byte 1 \b, fine resolution (204x196 DPI)
8038
- # From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
8039
- 0 string Sfff structured fax file
8040
-
8041
-
8042
- # PC bitmaps (OS/2, Windows BMP files) (Greg Roelofs, newt@uchicago.edu)
8043
- 0 string BM
8044
- >14 leshort 12 PC bitmap, OS/2 1.x format
8045
- !:mime image/x-ms-bmp
8046
- >>18 leshort x \b, %d x
8047
- >>20 leshort x %d
8048
- >14 leshort 64 PC bitmap, OS/2 2.x format
8049
- !:mime image/x-ms-bmp
8050
- >>18 leshort x \b, %d x
8051
- >>20 leshort x %d
8052
- >14 leshort 40 PC bitmap, Windows 3.x format
8053
- !:mime image/x-ms-bmp
8054
- >>18 lelong x \b, %d x
8055
- >>22 lelong x %d x
8056
- >>28 leshort x %d
8057
- >14 leshort 128 PC bitmap, Windows NT/2000 format
8058
- !:mime image/x-ms-bmp
8059
- >>18 lelong x \b, %d x
8060
- >>22 lelong x %d x
8061
- >>28 leshort x %d
8062
- # Too simple - MPi
8063
- #0 string IC PC icon data
8064
- #0 string PI PC pointer image data
8065
- #0 string CI PC color icon data
8066
- #0 string CP PC color pointer image data
8067
- # Conflicts with other entries [BABYL]
8068
- #0 string BA PC bitmap array data
8069
-
8070
- # XPM icons (Greg Roelofs, newt@uchicago.edu)
8071
- # note possible collision with C/REXX entry in c-lang; currently commented out
8072
- 0 search/1 /*\ XPM\ */ X pixmap image text
8073
-
8074
- # Utah Raster Toolkit RLE images (janl@ifi.uio.no)
8075
- 0 leshort 0xcc52 RLE image data,
8076
- >6 leshort x %d x
8077
- >8 leshort x %d
8078
- >2 leshort >0 \b, lower left corner: %d
8079
- >4 leshort >0 \b, lower right corner: %d
8080
- >10 byte&0x1 =0x1 \b, clear first
8081
- >10 byte&0x2 =0x2 \b, no background
8082
- >10 byte&0x4 =0x4 \b, alpha channel
8083
- >10 byte&0x8 =0x8 \b, comment
8084
- >11 byte >0 \b, %d color channels
8085
- >12 byte >0 \b, %d bits per pixel
8086
- >13 byte >0 \b, %d color map channels
8087
-
8088
- # image file format (Robert Potter, potter@cs.rochester.edu)
8089
- 0 string Imagefile\ version- iff image data
8090
- # this adds the whole header (inc. version number), informative but longish
8091
- >10 string >\0 %s
8092
-
8093
- # Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
8094
- 0 belong 0x59a66a95 Sun raster image data
8095
- >4 belong >0 \b, %d x
8096
- >8 belong >0 %d,
8097
- >12 belong >0 %d-bit,
8098
- #>16 belong >0 %d bytes long,
8099
- >20 belong 0 old format,
8100
- #>20 belong 1 standard,
8101
- >20 belong 2 compressed,
8102
- >20 belong 3 RGB,
8103
- >20 belong 4 TIFF,
8104
- >20 belong 5 IFF,
8105
- >20 belong 0xffff reserved for testing,
8106
- >24 belong 0 no colormap
8107
- >24 belong 1 RGB colormap
8108
- >24 belong 2 raw colormap
8109
- #>28 belong >0 colormap is %d bytes long
8110
-
8111
- # SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
8112
- #
8113
- # See
8114
- # http://reality.sgi.com/grafica/sgiimage.html
8115
- #
8116
- 0 beshort 474 SGI image data
8117
- #>2 byte 0 \b, verbatim
8118
- >2 byte 1 \b, RLE
8119
- #>3 byte 1 \b, normal precision
8120
- >3 byte 2 \b, high precision
8121
- >4 beshort x \b, %d-D
8122
- >6 beshort x \b, %d x
8123
- >8 beshort x %d
8124
- >10 beshort x \b, %d channel
8125
- >10 beshort !1 \bs
8126
- >80 string >0 \b, "%s"
8127
-
8128
- 0 string IT01 FIT image data
8129
- >4 belong x \b, %d x
8130
- >8 belong x %d x
8131
- >12 belong x %d
8132
- #
8133
- 0 string IT02 FIT image data
8134
- >4 belong x \b, %d x
8135
- >8 belong x %d x
8136
- >12 belong x %d
8137
- #
8138
- 2048 string PCD_IPI Kodak Photo CD image pack file
8139
- >0xe02 byte&0x03 0x00 , landscape mode
8140
- >0xe02 byte&0x03 0x01 , portrait mode
8141
- >0xe02 byte&0x03 0x02 , landscape mode
8142
- >0xe02 byte&0x03 0x03 , portrait mode
8143
- 0 string PCD_OPA Kodak Photo CD overview pack file
8144
-
8145
- # FITS format. Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
8146
- # FITS is the Flexible Image Transport System, the de facto standard for
8147
- # data and image transfer, storage, etc., for the astronomical community.
8148
- # (FITS floating point formats are big-endian.)
8149
- 0 string SIMPLE\ \ = FITS image data
8150
- >109 string 8 \b, 8-bit, character or unsigned binary integer
8151
- >108 string 16 \b, 16-bit, two's complement binary integer
8152
- >107 string \ 32 \b, 32-bit, two's complement binary integer
8153
- >107 string -32 \b, 32-bit, floating point, single precision
8154
- >107 string -64 \b, 64-bit, floating point, double precision
8155
-
8156
- # other images
8157
- 0 string This\ is\ a\ BitMap\ file Lisp Machine bit-array-file
8158
-
8159
- # From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
8160
- # stuff.
8161
- #
8162
- 0 beshort 0x1010 PEX Binary Archive
8163
-
8164
- # DICOM medical imaging data
8165
- 128 string DICM DICOM medical imaging data
8166
- !:mime application/dicom
8167
-
8168
- # XWD - X Window Dump file.
8169
- # As described in /usr/X11R6/include/X11/XWDFile.h
8170
- # used by the xwd program.
8171
- # Bradford Castalia, idaeim, 1/01
8172
- # updated by Adam Buchbinder, 2/09
8173
- # The following assumes version 7 of the format; the first long is the length
8174
- # of the header, which is at least 25 4-byte longs, and the one at offset 8
8175
- # is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
8176
- # which is a maximum of 32.
8177
- 0 belong >100
8178
- >8 belong <3
8179
- >>12 belong <33
8180
- >>>4 belong 7 XWD X Window Dump image data
8181
- !:mime image/x-xwindowdump
8182
- >>>>100 string >\0 \b, "%s"
8183
- >>>>16 belong x \b, %dx
8184
- >>>>20 belong x \b%dx
8185
- >>>>12 belong x \b%d
8186
-
8187
- # PDS - Planetary Data System
8188
- # These files use Parameter Value Language in the header section.
8189
- # Unfortunately, there is no certain magic, but the following
8190
- # strings have been found to be most likely.
8191
- 0 string NJPL1I00 PDS (JPL) image data
8192
- 2 string NJPL1I PDS (JPL) image data
8193
- 0 string CCSD3ZF PDS (CCSD) image data
8194
- 2 string CCSD3Z PDS (CCSD) image data
8195
- 0 string PDS_ PDS image data
8196
- 0 string LBLSIZE= PDS (VICAR) image data
8197
-
8198
- # pM8x: ATARI STAD compressed bitmap format
8199
- #
8200
- # from Oskar Schirmer <schirmer@scara.com> Feb 2, 2001
8201
- # p M 8 5/6 xx yy zz data...
8202
- # Atari ST STAD bitmap is always 640x400, bytewise runlength compressed.
8203
- # bytes either run horizontally (pM85) or vertically (pM86). yy is the
8204
- # most frequent byte, xx and zz are runlength escape codes, where xx is
8205
- # used for runs of yy.
8206
- #
8207
- 0 string pM85 Atari ST STAD bitmap image data (hor)
8208
- >5 byte 0x00 (white background)
8209
- >5 byte 0xFF (black background)
8210
- 0 string pM86 Atari ST STAD bitmap image data (vert)
8211
- >5 byte 0x00 (white background)
8212
- >5 byte 0xFF (black background)
8213
-
8214
- # Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
8215
- # http://www.atarimax.com/jindroush.atari.org/afmtatr.html
8216
- 0 leshort 0x0296 Atari ATR image
8217
-
8218
- # XXX:
8219
- # This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
8220
- # magic.
8221
- # SGI RICE image file <mpruett@sgi.com>
8222
- #0 beshort 0x5249 RICE image
8223
- #>2 beshort x v%d
8224
- #>4 beshort x (%d x
8225
- #>6 beshort x %d)
8226
- #>8 beshort 0 8 bit
8227
- #>8 beshort 1 10 bit
8228
- #>8 beshort 2 12 bit
8229
- #>8 beshort 3 13 bit
8230
- #>10 beshort 0 4:2:2
8231
- #>10 beshort 1 4:2:2:4
8232
- #>10 beshort 2 4:4:4
8233
- #>10 beshort 3 4:4:4:4
8234
- #>12 beshort 1 RGB
8235
- #>12 beshort 2 CCIR601
8236
- #>12 beshort 3 RP175
8237
- #>12 beshort 4 YUV
8238
-
8239
- #------------------------------------------------------------------------------
8240
- #
8241
- # Marco Schmidt (marcoschmidt@users.sourceforge.net) -- an image file format
8242
- # for the EPOC operating system, which is used with PDAs like those from Psion
8243
- #
8244
- # see http://huizen.dds.nl/~frodol/psiconv/html/Index.html for a description
8245
- # of various EPOC file formats
8246
-
8247
- 0 string \x37\x00\x00\x10\x42\x00\x00\x10\x00\x00\x00\x00\x39\x64\x39\x47 EPOC MBM image file
8248
-
8249
- # PCX image files
8250
- # From: Dan Fandrich <dan@coneharvesters.com>
8251
- 0 beshort 0x0a00 PCX ver. 2.5 image data
8252
- 0 beshort 0x0a02 PCX ver. 2.8 image data, with palette
8253
- 0 beshort 0x0a03 PCX ver. 2.8 image data, without palette
8254
- 0 beshort 0x0a04 PCX for Windows image data
8255
- 0 beshort 0x0a05 PCX ver. 3.0 image data
8256
- >4 leshort x bounding box [%hd,
8257
- >6 leshort x %hd] -
8258
- >8 leshort x [%hd,
8259
- >10 leshort x %hd],
8260
- >65 byte >1 %d planes each of
8261
- >3 byte x %hhd-bit
8262
- >68 byte 0 image,
8263
- >68 byte 1 colour,
8264
- >68 byte 2 grayscale,
8265
- >68 byte >2 image,
8266
- >68 byte <0 image,
8267
- >12 leshort >0 %hd x
8268
- >>14 leshort x %hd dpi,
8269
- >2 byte 0 uncompressed
8270
- >2 byte 1 RLE compressed
8271
-
8272
- # Adobe Photoshop
8273
- 0 string 8BPS Adobe Photoshop Image
8274
- !:mime image/vnd.adobe.photoshop
8275
-
8276
- # XV thumbnail indicator (ThMO)
8277
- 0 string P7\ 332 XV thumbnail image data
8278
-
8279
- # NITF is defined by United States MIL-STD-2500A
8280
- 0 string NITF National Imagery Transmission Format
8281
- >25 string >\0 dated %.14s
8282
-
8283
- # GEM Image: Version 1, Headerlen 8 (Wolfram Kleff)
8284
- 0 belong 0x00010008 GEM Image data
8285
- >12 beshort x %d x
8286
- >14 beshort x %d,
8287
- >4 beshort x %d planes,
8288
- >8 beshort x %d x
8289
- >10 beshort x %d pixelsize
8290
-
8291
- # GEM Metafile (Wolfram Kleff)
8292
- 0 lelong 0x0018FFFF GEM Metafile data
8293
- >4 leshort x version %d
8294
-
8295
- #
8296
- # SMJPEG. A custom Motion JPEG format used by Loki Entertainment
8297
- # Software Torbjorn Andersson <d91tan@Update.UU.SE>.
8298
- #
8299
- 0 string \0\nSMJPEG SMJPEG
8300
- >8 belong x %d.x data
8301
- # According to the specification you could find any number of _TXT
8302
- # headers here, but I can't think of any way of handling that. None of
8303
- # the SMJPEG files I tried it on used this feature. Even if such a
8304
- # file is encountered the output should still be reasonable.
8305
- >16 string _SND \b,
8306
- >>24 beshort >0 %d Hz
8307
- >>26 byte 8 8-bit
8308
- >>26 byte 16 16-bit
8309
- >>28 string NONE uncompressed
8310
- # >>28 string APCM ADPCM compressed
8311
- >>27 byte 1 mono
8312
- >>28 byte 2 stereo
8313
- # Help! Isn't there any way to avoid writing this part twice?
8314
- >>32 string _VID \b,
8315
- # >>>48 string JFIF JPEG
8316
- >>>40 belong >0 %d frames
8317
- >>>44 beshort >0 (%d x
8318
- >>>46 beshort >0 %d)
8319
- >16 string _VID \b,
8320
- # >>32 string JFIF JPEG
8321
- >>24 belong >0 %d frames
8322
- >>28 beshort >0 (%d x
8323
- >>30 beshort >0 %d)
8324
-
8325
- 0 string Paint\ Shop\ Pro\ Image\ File Paint Shop Pro Image File
8326
-
8327
- # "thumbnail file" (icon)
8328
- # descended from "xv", but in use by other applications as well (Wolfram Kleff)
8329
- 0 string P7\ 332 XV "thumbnail file" (icon) data
8330
-
8331
- # taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
8332
- 0 string KiSS KISS/GS
8333
- >4 byte 16 color
8334
- >>5 byte x %d bit
8335
- >>8 leshort x %d colors
8336
- >>10 leshort x %d groups
8337
- >4 byte 32 cell
8338
- >>5 byte x %d bit
8339
- >>8 leshort x %d x
8340
- >>10 leshort x %d
8341
- >>12 leshort x +%d
8342
- >>14 leshort x +%d
8343
-
8344
- # Webshots (www.webshots.com), by John Harrison
8345
- 0 string C\253\221g\230\0\0\0 Webshots Desktop .wbz file
8346
-
8347
- # Hercules DASD image files
8348
- # From Jan Jaeger <jj@septa.nl>
8349
- 0 string CKD_P370 Hercules CKD DASD image file
8350
- >8 long x \b, %d heads per cylinder
8351
- >12 long x \b, track size %d bytes
8352
- >16 byte x \b, device type 33%2.2X
8353
-
8354
- 0 string CKD_C370 Hercules compressed CKD DASD image file
8355
- >8 long x \b, %d heads per cylinder
8356
- >12 long x \b, track size %d bytes
8357
- >16 byte x \b, device type 33%2.2X
8358
-
8359
- 0 string CKD_S370 Hercules CKD DASD shadow file
8360
- >8 long x \b, %d heads per cylinder
8361
- >12 long x \b, track size %d bytes
8362
- >16 byte x \b, device type 33%2.2X
8363
-
8364
- # Squeak images and programs - etoffi@softhome.net
8365
- 0 string \146\031\0\0 Squeak image data
8366
- 0 search/1 'From\040Squeak Squeak program text
8367
-
8368
- # partimage: file(1) magic for PartImage files (experimental, incomplete)
8369
- # Author: Hans-Joachim Baader <hjb@pro-linux.de>
8370
- 0 string PaRtImAgE-VoLuMe PartImage
8371
- >0x0020 string 0.6.1 file version %s
8372
- >>0x0060 lelong >-1 volume %ld
8373
- #>>0x0064 8 byte identifier
8374
- #>>0x007c reserved
8375
- >>0x0200 string >\0 type %s
8376
- >>0x1400 string >\0 device %s,
8377
- >>0x1600 string >\0 original filename %s,
8378
- # Some fields omitted
8379
- >>0x2744 lelong 0 not compressed
8380
- >>0x2744 lelong 1 gzip compressed
8381
- >>0x2744 lelong 2 bzip2 compressed
8382
- >>0x2744 lelong >2 compressed with unknown algorithm
8383
- >0x0020 string >0.6.1 file version %s
8384
- >0x0020 string <0.6.1 file version %s
8385
-
8386
- # DCX is multi-page PCX, using a simple header of up to 1024
8387
- # offsets for the respective PCX components.
8388
- # From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
8389
- 0 lelong 987654321 DCX multi-page PCX image data
8390
-
8391
- # Simon Walton <simonw@matteworld.com>
8392
- # Kodak Cineon format for scanned negatives
8393
- # http://www.kodak.com/US/en/motion/support/dlad/
8394
- 0 lelong 0xd75f2a80 Cineon image data
8395
- >200 belong >0 \b, %ld x
8396
- >204 belong >0 %ld
8397
-
8398
-
8399
- # Bio-Rad .PIC is an image format used by microscope control systems
8400
- # and related image processing software used by biologists.
8401
- # From: Vebjorn Ljosa <vebjorn@ljosa.com>
8402
- 54 leshort 12345 Bio-Rad .PIC Image File
8403
- >0 leshort >0 %hd x
8404
- >2 leshort >0 %hd,
8405
- >4 leshort =1 1 image in file
8406
- >4 leshort >1 %hd images in file
8407
-
8408
- # From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
8409
- # The description of *.mrw format can be found at
8410
- # http://www.dalibor.cz/minolta/raw_file_format.htm
8411
- 0 string \000MRM Minolta Dimage camera raw image data
8412
-
8413
- # Summary: DjVu image / document
8414
- # Extension: .djvu
8415
- # Reference: http://djvu.org/docs/DjVu3Spec.djvu
8416
- # Submitted by: Stephane Loeuillet <stephane.loeuillet@tiscali.fr>
8417
- # Modified by (1): Abel Cheung <abelcheung@gmail.com>
8418
- 0 string AT&TFORM
8419
- !:mime image/vnd.djvu
8420
- >12 string DJVM DjVu multiple page document
8421
- >12 string DJVU DjVu image or single page document
8422
- >12 string DJVI DjVu shared document
8423
- >12 string THUM DjVu page thumbnails
8424
-
8425
-
8426
- # From Marc Espie
8427
- 0 lelong 20000630 OpenEXR image data
8428
-
8429
- # From: Tom Hilinski <tom.hilinski@comcast.net>
8430
- # http://www.unidata.ucar.edu/packages/netcdf/
8431
- 0 string CDF\001 NetCDF Data Format data
8432
-
8433
- #-----------------------------------------------------------------------
8434
- # Hierarchical Data Format, used to facilitate scientific data exchange
8435
- # specifications at http://hdf.ncsa.uiuc.edu/
8436
- 0 belong 0x0e031301 Hierarchical Data Format (version 4) data
8437
- !:mime application/x-hdf
8438
- 0 string \211HDF\r\n\032 Hierarchical Data Format (version 5) data
8439
- !:mime application/x-hdf
8440
-
8441
- # From: Tobias Burnus <burnus@net-b.de>
8442
- # Xara (for a while: Corel Xara) is a graphic package, see
8443
- # http://www.xara.com/ for Windows and as GPL application for Linux
8444
- 0 string XARA\243\243 Xara graphics file
8445
-
8446
- # http://www.cartesianinc.com/Tech/
8447
- 0 string CPC\262 Cartesian Perceptual Compression image
8448
- !:mime image/x-cpi
8449
-
8450
- # From Albert Cahalan <acahalan@gmail.com>
8451
- # puredigital used it for the CVS disposable camcorder
8452
- #8 lelong 4 ZBM bitmap image data
8453
- #>4 leshort x %u x
8454
- #>6 leshort x %u
8455
-
8456
- # From Albert Cahalan <acahalan@gmail.com>
8457
- # uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
8458
- 0 string C565 OLPC firmware icon image data
8459
- >4 leshort x %u x
8460
- >6 leshort x %u
8461
-
8462
- # Applied Images - Image files from Cytovision
8463
- # Gustavo Junior Alves <gjalves@gjalves.com.br>
8464
- 0 string \xce\xda\xde\xfa Cytovision Metaphases file
8465
- 0 string \xed\xad\xef\xac Cytovision Karyotype file
8466
- 0 string \x0b\x00\x03\x00 Cytovision FISH Probe file
8467
- 0 string \xed\xfe\xda\xbe Cytovision FLEX file
8468
- 0 string \xed\xab\xed\xfe Cytovision FLEX file
8469
- 0 string \xad\xfd\xea\xad Cytovision RATS file
8470
-
8471
- # Wavelet Scalar Quantization format used in gray-scale fingerprint images
8472
- # From Tano M Fotang <mfotang@quanteq.com>
8473
- 0 string \xff\xa0\xff\xa8\x00 Wavelet Scalar Quantization image data
8474
-
8475
- # JPEG 2000 Code Stream Bitmap
8476
- # From Petr Splichal <psplicha@redhat.com>
8477
- 0 string \xFF\x4F\xFF\x51\x00 JPEG-2000 Code Stream Bitmap data
8478
-
8479
- # Type: Ulead Photo Explorer5 (.pe5)
8480
- # URL: http://www.jisyo.com/cgibin/view.cgi?EXT=pe5 (Japanese)
8481
- # From: Simon Horman <horms@debian.org>
8482
- 0 string IIO2H Ulead Photo Explorer5
8483
-
8484
- # Type: X11 cursor
8485
- # URL: http://webcvs.freedesktop.org/mime/shared-mime-info/freedesktop.org.xml.in?view=markup
8486
- # From: Mathias Brodala <info@noctus.net>
8487
- 0 string Xcur X11 cursor
8488
-
8489
- #------------------------------------------------------------------------------
8490
- # inform: file(1) magic for Inform interactive fiction language
8491
-
8492
- # URL: http://www.inform-fiction.org/
8493
- # From: Reuben Thomas <rrt@sc3d.org>
8494
-
8495
- 0 search/cB/100 constant\ story Inform source text
8496
-
8497
- #------------------------------------------------------------------------------
8498
- # intel: file(1) magic for x86 Unix
8499
- #
8500
- # Various flavors of x86 UNIX executable/object (other than Xenix, which
8501
- # is in "microsoft"). DOS is in "msdos"; the ambitious soul can do
8502
- # Windows as well.
8503
- #
8504
- # Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and
8505
- # whatever comes next (HP-PA Hummingbird?). OS/2 may also go elsewhere
8506
- # as well, if, as, and when IBM makes it portable.
8507
- #
8508
- # The `versions' should be un-commented if they work for you.
8509
- # (Was the problem just one of endianness?)
8510
- #
8511
- 0 leshort 0502 basic-16 executable
8512
- >12 lelong >0 not stripped
8513
- #>22 leshort >0 - version %ld
8514
- 0 leshort 0503 basic-16 executable (TV)
8515
- >12 lelong >0 not stripped
8516
- #>22 leshort >0 - version %ld
8517
- 0 leshort 0510 x86 executable
8518
- >12 lelong >0 not stripped
8519
- 0 leshort 0511 x86 executable (TV)
8520
- >12 lelong >0 not stripped
8521
- 0 leshort =0512 iAPX 286 executable small model (COFF)
8522
- >12 lelong >0 not stripped
8523
- #>22 leshort >0 - version %ld
8524
- 0 leshort =0522 iAPX 286 executable large model (COFF)
8525
- >12 lelong >0 not stripped
8526
- #>22 leshort >0 - version %ld
8527
- # SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan
8528
- 0 leshort =0514 80386 COFF executable
8529
- >12 lelong >0 not stripped
8530
- >22 leshort >0 - version %ld
8531
-
8532
- # rom: file(1) magic for BIOS ROM Extensions found in intel machines
8533
- # mapped into memory between 0xC0000 and 0xFFFFF
8534
- # From Gürkan Sengün <gurkan@linuks.mine.nu>, www.linuks.mine.nu
8535
- 0 beshort 0x55AA BIOS (ia32) ROM Ext.
8536
- >5 string USB USB
8537
- >7 string LDR UNDI image
8538
- >30 string IBM IBM comp. Video
8539
- >26 string Adaptec Adaptec
8540
- >28 string Adaptec Adaptec
8541
- >42 string PROMISE Promise
8542
- >2 byte x (%d*512)
8543
-
8544
- #------------------------------------------------------------------------------
8545
- # interleaf: file(1) magic for InterLeaf TPS:
8546
- #
8547
- 0 string =\210OPS Interleaf saved data
8548
- 0 string =<!OPS Interleaf document text
8549
- >5 string ,\ Version\ = \b, version
8550
- >>17 string >\0 %.3s
8551
-
8552
- #------------------------------------------------------------------------------
8553
- # island: file(1) magic for IslandWite/IslandDraw, from SunOS 5.5.1
8554
- # "/etc/magic":
8555
- # From: guy@netapp.com (Guy Harris)
8556
- #
8557
- 4 string pgscriptver IslandWrite document
8558
- 13 string DrawFile IslandDraw document
8559
-
8560
-
8561
- #------------------------------------------------------------------------------
8562
- # ispell: file(1) magic for ispell
8563
- #
8564
- # Ispell 3.0 has a magic of 0x9601 and ispell 3.1 has 0x9602. This magic
8565
- # will match 0x9600 through 0x9603 in *both* little endian and big endian.
8566
- # (No other current magic entries collide.)
8567
- #
8568
- # Updated by Daniel Quinlan (quinlan@yggdrasil.com)
8569
- #
8570
- 0 leshort&0xFFFC 0x9600 little endian ispell
8571
- >0 byte 0 hash file (?),
8572
- >0 byte 1 3.0 hash file,
8573
- >0 byte 2 3.1 hash file,
8574
- >0 byte 3 hash file (?),
8575
- >2 leshort 0x00 8-bit, no capitalization, 26 flags
8576
- >2 leshort 0x01 7-bit, no capitalization, 26 flags
8577
- >2 leshort 0x02 8-bit, capitalization, 26 flags
8578
- >2 leshort 0x03 7-bit, capitalization, 26 flags
8579
- >2 leshort 0x04 8-bit, no capitalization, 52 flags
8580
- >2 leshort 0x05 7-bit, no capitalization, 52 flags
8581
- >2 leshort 0x06 8-bit, capitalization, 52 flags
8582
- >2 leshort 0x07 7-bit, capitalization, 52 flags
8583
- >2 leshort 0x08 8-bit, no capitalization, 128 flags
8584
- >2 leshort 0x09 7-bit, no capitalization, 128 flags
8585
- >2 leshort 0x0A 8-bit, capitalization, 128 flags
8586
- >2 leshort 0x0B 7-bit, capitalization, 128 flags
8587
- >2 leshort 0x0C 8-bit, no capitalization, 256 flags
8588
- >2 leshort 0x0D 7-bit, no capitalization, 256 flags
8589
- >2 leshort 0x0E 8-bit, capitalization, 256 flags
8590
- >2 leshort 0x0F 7-bit, capitalization, 256 flags
8591
- >4 leshort >0 and %d string characters
8592
- 0 beshort&0xFFFC 0x9600 big endian ispell
8593
- >1 byte 0 hash file (?),
8594
- >1 byte 1 3.0 hash file,
8595
- >1 byte 2 3.1 hash file,
8596
- >1 byte 3 hash file (?),
8597
- >2 beshort 0x00 8-bit, no capitalization, 26 flags
8598
- >2 beshort 0x01 7-bit, no capitalization, 26 flags
8599
- >2 beshort 0x02 8-bit, capitalization, 26 flags
8600
- >2 beshort 0x03 7-bit, capitalization, 26 flags
8601
- >2 beshort 0x04 8-bit, no capitalization, 52 flags
8602
- >2 beshort 0x05 7-bit, no capitalization, 52 flags
8603
- >2 beshort 0x06 8-bit, capitalization, 52 flags
8604
- >2 beshort 0x07 7-bit, capitalization, 52 flags
8605
- >2 beshort 0x08 8-bit, no capitalization, 128 flags
8606
- >2 beshort 0x09 7-bit, no capitalization, 128 flags
8607
- >2 beshort 0x0A 8-bit, capitalization, 128 flags
8608
- >2 beshort 0x0B 7-bit, capitalization, 128 flags
8609
- >2 beshort 0x0C 8-bit, no capitalization, 256 flags
8610
- >2 beshort 0x0D 7-bit, no capitalization, 256 flags
8611
- >2 beshort 0x0E 8-bit, capitalization, 256 flags
8612
- >2 beshort 0x0F 7-bit, capitalization, 256 flags
8613
- >4 beshort >0 and %d string characters
8614
- # ispell 4.0 hash files kromJx <kromJx@crosswinds.net>
8615
- # Ispell 4.0
8616
- 0 string ISPL ispell
8617
- >4 long x hash file version %d,
8618
- >8 long x lexletters %d,
8619
- >12 long x lexsize %d,
8620
- >16 long x hashsize %d,
8621
- >20 long x stblsize %d
8622
- #------------------------------------------------------------
8623
- # Java ByteCode and Mach-O binaries (e.g., Mac OS X) use the
8624
- # same magic number, 0xcafebabe, so they are both handled
8625
- # in the entry called "cafebabe".
8626
- #------------------------------------------------------------
8627
- # Java serialization
8628
- # From Martin Pool (m.pool@pharos.com.au)
8629
- 0 beshort 0xaced Java serialization data
8630
- >2 beshort >0x0004 \b, version %d
8631
-
8632
- 0 belong 0xfeedfeed Java KeyStore
8633
- !:mime application/x-java-keystore
8634
- 0 belong 0xcececece Java JCE KeyStore
8635
- !:mime application/x-java-jce-keystore
8636
-
8637
- # Dalvik .dex format. http://retrodev.com/android/dexformat.html
8638
- # From <mkf@google.com> "Mike Fleming"
8639
- 0 string dex\n
8640
- >0 regex dex\n[0-9][0-9][0-9]\0 Dalvik dex file
8641
- >4 string >000 version %s
8642
- 0 string dey\n
8643
- >0 regex dey\n[0-9][0-9][0-9]\0 Dalvik dex file (optimized for host)
8644
- >4 string >000 version %s
8645
-
8646
-
8647
- #------------------------------------------------------------------------------
8648
- # JPEG images
8649
- # SunOS 5.5.1 had
8650
- #
8651
- # 0 string \377\330\377\340 JPEG file
8652
- # 0 string \377\330\377\356 JPG file
8653
- #
8654
- # both of which turn into "JPEG image data" here.
8655
- #
8656
- 0 beshort 0xffd8 JPEG image data
8657
- !:mime image/jpeg
8658
- !:apple 8BIMJPEG
8659
- !:strength +1
8660
- >6 string JFIF \b, JFIF standard
8661
- # The following added by Erik Rossen <rossen@freesurf.ch> 1999-09-06
8662
- # in a vain attempt to add image size reporting for JFIF. Note that these
8663
- # tests are not fool-proof since some perfectly valid JPEGs are currently
8664
- # impossible to specify in magic(4) format.
8665
- # First, a little JFIF version info:
8666
- >>11 byte x \b %d.
8667
- >>12 byte x \b%02d
8668
- # Next, the resolution or aspect ratio of the image:
8669
- #>>13 byte 0 \b, aspect ratio
8670
- #>>13 byte 1 \b, resolution (DPI)
8671
- #>>13 byte 2 \b, resolution (DPCM)
8672
- #>>4 beshort x \b, segment length %d
8673
- # Next, show thumbnail info, if it exists:
8674
- >>18 byte !0 \b, thumbnail %dx
8675
- >>>19 byte x \b%d
8676
-
8677
- # EXIF moved down here to avoid reporting a bogus version number,
8678
- # and EXIF version number printing added.
8679
- # - Patrik R=E5dman <patrik+file-magic@iki.fi>
8680
- >6 string Exif \b, EXIF standard
8681
- # Look for EXIF IFD offset in IFD 0, and then look for EXIF version tag in EXIF IFD.
8682
- # All possible combinations of entries have to be enumerated, since no looping
8683
- # is possible. And both endians are possible...
8684
- # The combinations included below are from real-world JPEGs.
8685
- # Little-endian
8686
- >>12 string II
8687
- # IFD 0 Entry #5:
8688
- >>>70 leshort 0x8769
8689
- # EXIF IFD Entry #1:
8690
- >>>>(78.l+14) leshort 0x9000
8691
- >>>>>(78.l+23) byte x %c
8692
- >>>>>(78.l+24) byte x \b.%c
8693
- >>>>>(78.l+25) byte !0x30 \b%c
8694
- # IFD 0 Entry #9:
8695
- >>>118 leshort 0x8769
8696
- # EXIF IFD Entry #3:
8697
- >>>>(126.l+38) leshort 0x9000
8698
- >>>>>(126.l+47) byte x %c
8699
- >>>>>(126.l+48) byte x \b.%c
8700
- >>>>>(126.l+49) byte !0x30 \b%c
8701
- # IFD 0 Entry #10
8702
- >>>130 leshort 0x8769
8703
- # EXIF IFD Entry #3:
8704
- >>>>(138.l+38) leshort 0x9000
8705
- >>>>>(138.l+47) byte x %c
8706
- >>>>>(138.l+48) byte x \b.%c
8707
- >>>>>(138.l+49) byte !0x30 \b%c
8708
- # EXIF IFD Entry #4:
8709
- >>>>(138.l+50) leshort 0x9000
8710
- >>>>>(138.l+59) byte x %c
8711
- >>>>>(138.l+60) byte x \b.%c
8712
- >>>>>(138.l+61) byte !0x30 \b%c
8713
- # EXIF IFD Entry #5:
8714
- >>>>(138.l+62) leshort 0x9000
8715
- >>>>>(138.l+71) byte x %c
8716
- >>>>>(138.l+72) byte x \b.%c
8717
- >>>>>(138.l+73) byte !0x30 \b%c
8718
- # IFD 0 Entry #11
8719
- >>>142 leshort 0x8769
8720
- # EXIF IFD Entry #3:
8721
- >>>>(150.l+38) leshort 0x9000
8722
- >>>>>(150.l+47) byte x %c
8723
- >>>>>(150.l+48) byte x \b.%c
8724
- >>>>>(150.l+49) byte !0x30 \b%c
8725
- # EXIF IFD Entry #4:
8726
- >>>>(150.l+50) leshort 0x9000
8727
- >>>>>(150.l+59) byte x %c
8728
- >>>>>(150.l+60) byte x \b.%c
8729
- >>>>>(150.l+61) byte !0x30 \b%c
8730
- # EXIF IFD Entry #5:
8731
- >>>>(150.l+62) leshort 0x9000
8732
- >>>>>(150.l+71) byte x %c
8733
- >>>>>(150.l+72) byte x \b.%c
8734
- >>>>>(150.l+73) byte !0x30 \b%c
8735
- # Big-endian
8736
- >>12 string MM
8737
- # IFD 0 Entry #9:
8738
- >>>118 beshort 0x8769
8739
- # EXIF IFD Entry #1:
8740
- >>>>(126.L+14) beshort 0x9000
8741
- >>>>>(126.L+23) byte x %c
8742
- >>>>>(126.L+24) byte x \b.%c
8743
- >>>>>(126.L+25) byte !0x30 \b%c
8744
- # EXIF IFD Entry #3:
8745
- >>>>(126.L+38) beshort 0x9000
8746
- >>>>>(126.L+47) byte x %c
8747
- >>>>>(126.L+48) byte x \b.%c
8748
- >>>>>(126.L+49) byte !0x30 \b%c
8749
- # IFD 0 Entry #10
8750
- >>>130 beshort 0x8769
8751
- # EXIF IFD Entry #3:
8752
- >>>>(138.L+38) beshort 0x9000
8753
- >>>>>(138.L+47) byte x %c
8754
- >>>>>(138.L+48) byte x \b.%c
8755
- >>>>>(138.L+49) byte !0x30 \b%c
8756
- # EXIF IFD Entry #5:
8757
- >>>>(138.L+62) beshort 0x9000
8758
- >>>>>(138.L+71) byte x %c
8759
- >>>>>(138.L+72) byte x \b.%c
8760
- >>>>>(138.L+73) byte !0x30 \b%c
8761
- # IFD 0 Entry #11
8762
- >>>142 beshort 0x8769
8763
- # EXIF IFD Entry #4:
8764
- >>>>(150.L+50) beshort 0x9000
8765
- >>>>>(150.L+59) byte x %c
8766
- >>>>>(150.L+60) byte x \b.%c
8767
- >>>>>(150.L+61) byte !0x30 \b%c
8768
- # Here things get sticky. We can do ONE MORE marker segment with
8769
- # indirect addressing, and that's all. It would be great if we could
8770
- # do pointer arithemetic like in an assembler language. Christos?
8771
- # And if there was some sort of looping construct to do searches, plus a few
8772
- # named accumulators, it would be even more effective...
8773
- # At least we can show a comment if no other segments got inserted before:
8774
- >(4.S+5) byte 0xFE
8775
- >>(4.S+8) string >\0 \b, comment: "%s"
8776
- # FIXME: When we can do non-byte counted strings, we can use that to get
8777
- # the string's count, and fix Debian bug #283760
8778
- #>(4.S+5) byte 0xFE \b, comment
8779
- #>>(4.S+6) beshort x \b length=%d
8780
- #>>(4.S+8) string >\0 \b, "%s"
8781
- # Or, we can show the encoding type (I've included only the three most common)
8782
- # and image dimensions if we are lucky and the SOFn (image segment) is here:
8783
- >(4.S+5) byte 0xC0 \b, baseline
8784
- >>(4.S+6) byte x \b, precision %d
8785
- >>(4.S+7) beshort x \b, %dx
8786
- >>(4.S+9) beshort x \b%d
8787
- >(4.S+5) byte 0xC1 \b, extended sequential
8788
- >>(4.S+6) byte x \b, precision %d
8789
- >>(4.S+7) beshort x \b, %dx
8790
- >>(4.S+9) beshort x \b%d
8791
- >(4.S+5) byte 0xC2 \b, progressive
8792
- >>(4.S+6) byte x \b, precision %d
8793
- >>(4.S+7) beshort x \b, %dx
8794
- >>(4.S+9) beshort x \b%d
8795
- # I've commented-out quantisation table reporting. I doubt anyone cares yet.
8796
- #>(4.S+5) byte 0xDB \b, quantisation table
8797
- #>>(4.S+6) beshort x \b length=%d
8798
- #>14 beshort x \b, %d x
8799
- #>16 beshort x \b %d
8800
-
8801
- # HSI is Handmade Software's proprietary JPEG encoding scheme
8802
- 0 string hsi1 JPEG image data, HSI proprietary
8803
-
8804
- # From: David Santinoli <david@santinoli.com>
8805
- 0 string \x00\x00\x00\x0C\x6A\x50\x20\x20\x0D\x0A\x87\x0A JPEG 2000 image data
8806
-
8807
- # Type: JPEG 2000 codesream
8808
- # From: Mathieu Malaterre <mathieu.malaterre@gmail.com>
8809
- 0 belong 0xff4fff51 JPEG 2000 codestream
8810
- 45 beshort 0xff52
8811
-
8812
- #------------------------------------------------------------------------------
8813
- # karma: file(1) magic for Karma data files
8814
- #
8815
- # From <rgooch@atnf.csiro.au>
8816
-
8817
- 0 string KarmaRHD Version Karma Data Structure Version
8818
- >16 belong x %lu
8819
-
8820
- #------------------------------------------------------------------------------
8821
- # kde: file(1) magic for KDE
8822
-
8823
- 0 string [KDE\ Desktop\ Entry] KDE desktop entry
8824
- !:mime application/x-kdelnk
8825
- 0 string #\ KDE\ Config\ File KDE config file
8826
- !:mime application/x-kdelnk
8827
- 0 string #\ xmcd xmcd database file for kscd
8828
- !:mime text/x-xmcd
8829
- #------------------------------------------------------------------------------
8830
- # Type: Google KML, formerly Keyhole Markup Language
8831
- # Future development of this format has been handed
8832
- # over to the Open Geospatial Consortium.
8833
- # http://www.opengeospatial.org/standards/kml/
8834
- # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
8835
- 0 string \<?xml
8836
- >20 search/400 \ xmlns=
8837
- >>&0 regex ['"]http://earth.google.com/kml Google KML document
8838
- !:mime application/vnd.google-earth.kml+xml
8839
- >>>&1 string 2.0' \b, version 2.0
8840
- >>>&1 string 2.1' \b, version 2.1
8841
- >>>&1 string 2.2' \b, version 2.2
8842
-
8843
- #------------------------------------------------------------------------------
8844
- # Type: OpenGIS KML, formerly Keyhole Markup Language
8845
- # This standard is maintained by the
8846
- # Open Geospatial Consortium.
8847
- # http://www.opengeospatial.org/standards/kml/
8848
- # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
8849
- >>&0 regex ['"]http://www.opengis.net/kml OpenGIS KML document
8850
- !:mime application/vnd.google-earth.kml+xml
8851
- >>>&1 string 2.2 \b, version 2.2
8852
-
8853
- #------------------------------------------------------------------------------
8854
- # Type: Google KML Archive (ZIP based)
8855
- # http://code.google.com/apis/kml/documentation/kml_tut.html
8856
- # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
8857
- 0 string PK\003\004
8858
- >4 byte 0x14
8859
- >>30 string doc.kml Compressed Google KML Document, including resources.
8860
- !:mime application/vnd.google-earth.kmz
8861
- #------------------------------------------------------------------------------
8862
- # DEC SRC Virtual Paper: Lectern files
8863
- # Karl M. Hegbloom <karlheg@inetarena.com>
8864
- 0 string lect DEC SRC Virtual Paper Lectern file
8865
- #------------------------------------------------------------------------------
8866
- # lex: file(1) magic for lex
8867
- #
8868
- # derived empirically, your offsets may vary!
8869
- 0 search/100 yyprevious C program text (from lex)
8870
- >3 search/1 >\0 for %s
8871
- # C program text from GNU flex, from Daniel Quinlan <quinlan@yggdrasil.com>
8872
- 0 search/100 generated\ by\ flex C program text (from flex)
8873
- # lex description file, from Daniel Quinlan <quinlan@yggdrasil.com>
8874
- 0 search/1 %{ lex description text
8875
-
8876
- #------------------------------------------------------------------------------
8877
- # lif: file(1) magic for lif
8878
- #
8879
- # (Daniel Quinlan <quinlan@yggdrasil.com>)
8880
- #
8881
- 0 beshort 0x8000 lif file
8882
- #------------------------------------------------------------------------------
8883
- # linux: file(1) magic for Linux files
8884
- #
8885
- # Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
8886
- # The following basic Linux magic is useful for reference, but using
8887
- # "long" magic is a better practice in order to avoid collisions.
8888
- #
8889
- # 2 leshort 100 Linux/i386
8890
- # >0 leshort 0407 impure executable (OMAGIC)
8891
- # >0 leshort 0410 pure executable (NMAGIC)
8892
- # >0 leshort 0413 demand-paged executable (ZMAGIC)
8893
- # >0 leshort 0314 demand-paged executable (QMAGIC)
8894
- #
8895
- 0 lelong 0x00640107 Linux/i386 impure executable (OMAGIC)
8896
- >16 lelong 0 \b, stripped
8897
- 0 lelong 0x00640108 Linux/i386 pure executable (NMAGIC)
8898
- >16 lelong 0 \b, stripped
8899
- 0 lelong 0x0064010b Linux/i386 demand-paged executable (ZMAGIC)
8900
- >16 lelong 0 \b, stripped
8901
- 0 lelong 0x006400cc Linux/i386 demand-paged executable (QMAGIC)
8902
- >16 lelong 0 \b, stripped
8903
- #
8904
- 0 string \007\001\000 Linux/i386 object file
8905
- >20 lelong >0x1020 \b, DLL library
8906
- # Linux-8086 stuff:
8907
- 0 string \01\03\020\04 Linux-8086 impure executable
8908
- >28 long !0 not stripped
8909
- 0 string \01\03\040\04 Linux-8086 executable
8910
- >28 long !0 not stripped
8911
- #
8912
- 0 string \243\206\001\0 Linux-8086 object file
8913
- #
8914
- 0 string \01\03\020\20 Minix-386 impure executable
8915
- >28 long !0 not stripped
8916
- 0 string \01\03\040\20 Minix-386 executable
8917
- >28 long !0 not stripped
8918
- # core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
8919
- 216 lelong 0421 Linux/i386 core file
8920
- >220 string >\0 of '%s'
8921
- >200 lelong >0 (signal %d)
8922
- #
8923
- # LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
8924
- # this can be overridden by the DOS executable (COM) entry
8925
- 2 string LILO Linux/i386 LILO boot/chain loader
8926
- #
8927
- # PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
8928
- 0 leshort 0x0436 Linux/i386 PC Screen Font data,
8929
- >2 byte 0 256 characters, no directory,
8930
- >2 byte 1 512 characters, no directory,
8931
- >2 byte 2 256 characters, Unicode directory,
8932
- >2 byte 3 512 characters, Unicode directory,
8933
- >3 byte >0 8x%d
8934
- # Linux swap file, from Daniel Quinlan <quinlan@yggdrasil.com>
8935
- 4086 string SWAP-SPACE Linux/i386 swap file
8936
- # From: Jeff Bailey <jbailey@ubuntu.com>
8937
- # Linux swap file with swsusp1 image, from Jeff Bailey <jbailey@ubuntu.com>
8938
- 4076 string SWAPSPACE2S1SUSPEND Linux/i386 swap file (new style) with SWSUSP1 image
8939
- # according to man page of mkswap (8) March 1999
8940
- # volume label and UUID Russell Coker
8941
- # http://etbe.coker.com.au/2008/07/08/label-vs-uuid-vs-device/
8942
- 4086 string SWAPSPACE2 Linux/i386 swap file (new style),
8943
- >0x400 long x version %d (4K pages),
8944
- >0x404 long x size %d pages,
8945
- >1052 string \0 no label,
8946
- >1052 string >\0 LABEL=%s,
8947
- >0x40c belong x UUID=%08x
8948
- >0x410 beshort x \b-%04x
8949
- >0x412 beshort x \b-%04x
8950
- >0x414 beshort x \b-%04x
8951
- >0x416 belong x \b-%08x
8952
- >0x41a beshort x \b%04x
8953
- # ECOFF magic for OSF/1 and Linux (only tested under Linux though)
8954
- #
8955
- # from Erik Troan (ewt@redhat.com) examining od dumps, so this
8956
- # could be wrong
8957
- # updated by David Mosberger (davidm@azstarnet.com) based on
8958
- # GNU BFD and MIPS info found below.
8959
- #
8960
- 0 leshort 0x0183 ECOFF alpha
8961
- >24 leshort 0407 executable
8962
- >24 leshort 0410 pure
8963
- >24 leshort 0413 demand paged
8964
- >8 long >0 not stripped
8965
- >8 long 0 stripped
8966
- >23 leshort >0 - version %ld.
8967
- #
8968
- # Linux kernel boot images, from Albert Cahalan <acahalan@cs.uml.edu>
8969
- # and others such as Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
8970
- # and Nicol�s Lichtmaier <nick@debian.org>
8971
- # All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
8972
- # Linux kernel boot images (i386 arch) (Wolfram Kleff)
8973
- 514 string HdrS Linux kernel
8974
- >510 leshort 0xAA55 x86 boot executable
8975
- >>518 leshort >0x1ff
8976
- >>>529 byte 0 zImage,
8977
- >>>529 byte 1 bzImage,
8978
- >>>(526.s+0x200) string >\0 version %s,
8979
- >>498 leshort 1 RO-rootFS,
8980
- >>498 leshort 0 RW-rootFS,
8981
- >>508 leshort >0 root_dev 0x%X,
8982
- >>502 leshort >0 swap_dev 0x%X,
8983
- >>504 leshort >0 RAMdisksize %u KB,
8984
- >>506 leshort 0xFFFF Normal VGA
8985
- >>506 leshort 0xFFFE Extended VGA
8986
- >>506 leshort 0xFFFD Prompt for Videomode
8987
- >>506 leshort >0 Video mode %d
8988
- # This also matches new kernels, which were caught above by "HdrS".
8989
- 0 belong 0xb8c0078e Linux kernel
8990
- >0x1e3 string Loading version 1.3.79 or older
8991
- >0x1e9 string Loading from prehistoric times
8992
-
8993
- # System.map files - Nicol�s Lichtmaier <nick@debian.org>
8994
- 8 search/1 \ A\ _text Linux kernel symbol map text
8995
-
8996
- # LSM entries - Nicol�s Lichtmaier <nick@debian.org>
8997
- 0 search/1 Begin3 Linux Software Map entry text
8998
- 0 search/1 Begin4 Linux Software Map entry text (new format)
8999
-
9000
- # From Matt Zimmerman, enhanced for v3 by Matthew Palmer
9001
- 0 belong 0x4f4f4f4d User-mode Linux COW file
9002
- >4 belong <3 \b, version %d
9003
- >>8 string >\0 \b, backing file %s
9004
- >4 belong >2 \b, version %d
9005
- >>32 string >\0 \b, backing file %s
9006
-
9007
- ############################################################################
9008
- # Linux kernel versions
9009
-
9010
- 0 string \xb8\xc0\x07\x8e\xd8\xb8\x00\x90 Linux
9011
- >497 leshort 0 x86 boot sector
9012
- >>514 belong 0x8e of a kernel from the dawn of time!
9013
- >>514 belong 0x908ed8b4 version 0.99-1.1.42
9014
- >>514 belong 0x908ed8b8 for memtest86
9015
-
9016
- >497 leshort !0 x86 kernel
9017
- >>504 leshort >0 RAMdisksize=%u KB
9018
- >>502 leshort >0 swap=0x%X
9019
- >>508 leshort >0 root=0x%X
9020
- >>>498 leshort 1 \b-ro
9021
- >>>498 leshort 0 \b-rw
9022
- >>506 leshort 0xFFFF vga=normal
9023
- >>506 leshort 0xFFFE vga=extended
9024
- >>506 leshort 0xFFFD vga=ask
9025
- >>506 leshort >0 vga=%d
9026
- >>514 belong 0x908ed881 version 1.1.43-1.1.45
9027
- >>514 belong 0x15b281cd
9028
- >>>0xa8e belong 0x55AA5a5a version 1.1.46-1.2.13,1.3.0
9029
- >>>0xa99 belong 0x55AA5a5a version 1.3.1,2
9030
- >>>0xaa3 belong 0x55AA5a5a version 1.3.3-1.3.30
9031
- >>>0xaa6 belong 0x55AA5a5a version 1.3.31-1.3.41
9032
- >>>0xb2b belong 0x55AA5a5a version 1.3.42-1.3.45
9033
- >>>0xaf7 belong 0x55AA5a5a version 1.3.46-1.3.72
9034
- >>514 string HdrS
9035
- >>>518 leshort >0x1FF
9036
- >>>>529 byte 0 \b, zImage
9037
- >>>>529 byte 1 \b, bzImage
9038
- >>>>(526.s+0x200) string >\0 \b, version %s
9039
-
9040
- # Linux boot sector thefts.
9041
- 0 belong 0xb8c0078e Linux
9042
- >0x1e6 belong 0x454c4b53 ELKS Kernel
9043
- >0x1e6 belong !0x454c4b53 style boot sector
9044
-
9045
- ############################################################################
9046
- # Linux 8086 executable
9047
- 0 lelong&0xFF0000FF 0xC30000E9 Linux-Dev86 executable, headerless
9048
- >5 string .
9049
- >>4 string >\0 \b, libc version %s
9050
-
9051
- 0 lelong&0xFF00FFFF 0x4000301 Linux-8086 executable
9052
- >2 byte&0x01 !0 \b, unmapped zero page
9053
- >2 byte&0x20 0 \b, impure
9054
- >2 byte&0x20 !0
9055
- >>2 byte&0x10 !0 \b, A_EXEC
9056
- >2 byte&0x02 !0 \b, A_PAL
9057
- >2 byte&0x04 !0 \b, A_NSYM
9058
- >2 byte&0x08 !0 \b, A_STAND
9059
- >2 byte&0x40 !0 \b, A_PURE
9060
- >2 byte&0x80 !0 \b, A_TOVLY
9061
- >28 long !0 \b, not stripped
9062
- >37 string .
9063
- >>36 string >\0 \b, libc version %s
9064
-
9065
- # 0 lelong&0xFF00FFFF 0x10000301 ld86 I80386 executable
9066
- # 0 lelong&0xFF00FFFF 0xB000301 ld86 M68K executable
9067
- # 0 lelong&0xFF00FFFF 0xC000301 ld86 NS16K executable
9068
- # 0 lelong&0xFF00FFFF 0x17000301 ld86 SPARC executable
9069
-
9070
- # SYSLINUX boot logo files (from 'ppmtolss16' sources)
9071
- # http://syslinux.zytor.com/
9072
- #
9073
- 0 lelong =0x1413f33d SYSLINUX' LSS16 image data
9074
- >4 leshort x \b, width %d
9075
- >6 leshort x \b, height %d
9076
-
9077
- 0 string OOOM User-Mode-Linux's Copy-On-Write disk image
9078
- >4 belong x version %d
9079
-
9080
- # SE Linux policy database
9081
- # From: Mike Frysinger <vapier@gentoo.org>
9082
- 0 lelong 0xf97cff8c SE Linux policy
9083
- >16 lelong x v%d
9084
- >20 lelong 1 MLS
9085
- >24 lelong x %d symbols
9086
- >28 lelong x %d ocons
9087
-
9088
- # Linux Logical Volume Manager (LVM)
9089
- # Emmanuel VARAGNAT <emmanuel.varagnat@guzu.net>
9090
- #
9091
- # System ID, UUID and volume group name are 128 bytes long
9092
- # but they should never be full and initialized with zeros...
9093
- #
9094
- # LVM1
9095
- #
9096
- 0x0 string HM\001 LVM1 (Linux Logical Volume Manager), version 1
9097
- >0x12c string >\0 , System ID: %s
9098
-
9099
- 0x0 string HM\002 LVM1 (Linux Logical Volume Manager), version 2
9100
- >0x12c string >\0 , System ID: %s
9101
-
9102
- # LVM2
9103
- #
9104
- # It seems that the label header can be in one the four first sector
9105
- # of the disk... (from _find_labeller in lib/label/label.c of LVM2)
9106
- #
9107
- # 0x200 seems to be the common case
9108
-
9109
- 0x218 string LVM2\ 001 LVM2 (Linux Logical Volume Manager)
9110
- # read the offset to add to the start of the header, and the header
9111
- # start in 0x200
9112
- >(0x214.l+0x200) string >\0 , UUID: %s
9113
-
9114
- 0x018 string LVM2\ 001 LVM2 (Linux Logical Volume Manager)
9115
- >(0x014.l) string >\0 , UUID: %s
9116
-
9117
- 0x418 string LVM2\ 001 LVM2 (Linux Logical Volume Manager)
9118
- >(0x414.l+0x400) string >\0 , UUID: %s
9119
-
9120
- 0x618 string LVM2\ 001 LVM2 (Linux Logical Volume Manager)
9121
- >(0x614.l+0x600) string >\0 , UUID: %s
9122
-
9123
- # LVM snapshot
9124
- # from Jason Farrel
9125
- 0 string SnAp LVM Snapshot (CopyOnWrite store)
9126
- >4 lelong !0 - valid,
9127
- >4 lelong 0 - invalid,
9128
- >8 lelong x version %d,
9129
- >12 lelong x chunk_size %d
9130
-
9131
- # SE Linux policy database
9132
- 0 lelong 0xf97cff8c SE Linux policy
9133
- >16 lelong x v%d
9134
- >20 lelong 1 MLS
9135
- >24 lelong x %d symbols
9136
- >28 lelong x %d ocons
9137
-
9138
- # LUKS: Linux Unified Key Setup, On-Disk Format, http://luks.endorphin.org/spec
9139
- # Anthon van der Neut (anthon@mnt.org)
9140
- 0 string LUKS\xba\xbe LUKS encrypted file,
9141
- >6 beshort x ver %d
9142
- >8 string x [%s,
9143
- >40 string x %s,
9144
- >72 string x %s]
9145
- >168 string x UUID: %s
9146
-
9147
-
9148
- # Summary: Xen saved domain file
9149
- # Created by: Radek Vokal <rvokal@redhat.com>
9150
- 0 string LinuxGuestRecord Xen saved domain
9151
- >20 search/256 (name
9152
- >>&1 string x (name %s)
9153
-
9154
- # Type: Xen, the virtual machine monitor
9155
- # From: Radek Vokal <rvokal@redhat.com>
9156
- 0 string LinuxGuestRecord Xen saved domain
9157
- #>2 regex \(name\ [^)]*\) %s
9158
- >20 search/256 (name (name
9159
- >>&1 string x %s...)
9160
- #------------------------------------------------------------------------------
9161
- # lisp: file(1) magic for lisp programs
9162
- #
9163
- # various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
9164
-
9165
- # updated by Joerg Jenderek
9166
- # GRR: This lot is too weak
9167
- #0 string ;;
9168
- # windows INF files often begin with semicolon and use CRLF as line end
9169
- # lisp files are mainly created on unix system with LF as line end
9170
- #>2 search/4096 !\r Lisp/Scheme program text
9171
- #>2 search/4096 \r Windows INF file
9172
-
9173
- 0 search/4096 (if\ Lisp/Scheme program text
9174
- !:mime text/x-lisp
9175
- 0 search/4096 (setq\ Lisp/Scheme program text
9176
- !:mime text/x-lisp
9177
- 0 search/4096 (defvar\ Lisp/Scheme program text
9178
- !:mime text/x-lisp
9179
- 0 search/4096 (defparam\ Lisp/Scheme program text
9180
- !:mime text/x-lisp
9181
- 0 search/4096 (defun\ Lisp/Scheme program text
9182
- !:mime text/x-lisp
9183
- 0 search/4096 (autoload\ Lisp/Scheme program text
9184
- !:mime text/x-lisp
9185
- 0 search/4096 (custom-set-variables\ Lisp/Scheme program text
9186
- !:mime text/x-lisp
9187
-
9188
- # Emacs 18 - this is always correct, but not very magical.
9189
- 0 string \012( Emacs v18 byte-compiled Lisp data
9190
- !:mime application/x-elc
9191
- # Emacs 19+ - ver. recognition added by Ian Springer
9192
- # Also applies to XEmacs 19+ .elc files; could tell them apart with regexs
9193
- # - Chris Chittleborough <cchittleborough@yahoo.com.au>
9194
- 0 string ;ELC
9195
- >4 byte >18
9196
- >4 byte <32 Emacs/XEmacs v%d byte-compiled Lisp data
9197
- !:mime application/x-elc
9198
-
9199
- # Files produced by CLISP Common Lisp From: Bruno Haible <haible@ilog.fr>
9200
- 0 string (SYSTEM::VERSION\040' CLISP byte-compiled Lisp program (pre 2004-03-27)
9201
- 0 string (|SYSTEM|::|VERSION|\040' CLISP byte-compiled Lisp program text
9202
-
9203
- 0 long 0x70768BD2 CLISP memory image data
9204
- 0 long 0xD28B7670 CLISP memory image data, other endian
9205
-
9206
- #.com and .bin for MIT scheme
9207
- 0 string \372\372\372\372 MIT scheme (library?)
9208
-
9209
- # From: David Allouche <david@allouche.net>
9210
- 0 search/1 \<TeXmacs| TeXmacs document text
9211
- !:mime text/texmacs
9212
-
9213
- #------------------------------------------------------------------------------
9214
- # llvm: file(1) magic for LLVM byte-codes
9215
- # URL: http://llvm.org/docs/BitCodeFormat.html
9216
- # From: Al Stone <ahs3@fc.hp.com>
9217
-
9218
- 0 string llvm LLVM byte-codes, uncompressed
9219
- 0 string llvc0 LLVM byte-codes, null compression
9220
- 0 string llvc1 LLVM byte-codes, gzip compression
9221
- 0 string llvc2 LLVM byte-codes, bzip2 compression
9222
- 0 string \xde\xc0\x17\x0b LLVM bitcode, wrapper
9223
- 0 string BC\xc0\xde LLVM bitcode
9224
- #------------------------------------------------------------------------------
9225
- # lua: file(1) magic for Lua scripting language
9226
- # URL: http://www.lua.org/
9227
- # From: Reuben Thomas <rrt@sc3d.org>, Seo Sanghyeon <tinuviel@sparcs.kaist.ac.kr>
9228
-
9229
- # Lua scripts
9230
- 0 search/1/b #!\ /usr/bin/lua Lua script text executable
9231
- !:mime text/x-lua
9232
- 0 search/1/b #!\ /usr/local/bin/lua Lua script text executable
9233
- !:mime text/x-lua
9234
- 0 search/1 #!/usr/bin/env\ lua Lua script text executable
9235
- !:mime text/x-lua
9236
- 0 search/1 #!\ /usr/bin/env\ lua Lua script text executable
9237
- !:mime text/x-lua
9238
-
9239
- # Lua bytecode
9240
- 0 string \033Lua Lua bytecode,
9241
- >4 byte 0x50 version 5.0
9242
- >4 byte 0x51 version 5.1
9243
-
9244
- #------------------------------------------------------------------------------
9245
- # luks: file(1) magic for Linux Unified Key Setup
9246
- # URL: http://luks.endorphin.org/spec
9247
- # From: Anthon van der Neut <anthon@mnt.org>
9248
-
9249
- 0 string LUKS\xba\xbe LUKS encrypted file,
9250
- >6 beshort x ver %d
9251
- >8 string x [%s,
9252
- >40 string x %s,
9253
- >72 string x %s]
9254
- >168 string x UUID: %s
9255
- #------------------------------------------------------------
9256
- # Mach has two magic numbers, 0xcafebabe and 0xfeedface.
9257
- # Unfortunately the first, cafebabe, is shared with
9258
- # Java ByteCode, so they are both handled in the file "cafebabe".
9259
- # The "feedface" ones are handled herein.
9260
- #------------------------------------------------------------
9261
- 0 lelong&0xfffffffe 0xfeedface Mach-O
9262
- >0 byte 0xcf 64-bit
9263
- >12 lelong 1 object
9264
- >12 lelong 2 executable
9265
- >12 lelong 3 fixed virtual memory shared library
9266
- >12 lelong 4 core
9267
- >12 lelong 5 preload executable
9268
- >12 lelong 6 dynamically linked shared library
9269
- >12 lelong 7 dynamic linker
9270
- >12 lelong 8 bundle
9271
- >12 lelong 9 dynamically linked shared library stub
9272
- >12 lelong >9
9273
- >>12 lelong x filetype=%ld
9274
- >4 lelong <0
9275
- >>4 lelong x architecture=%ld
9276
- >4 lelong 1 vax
9277
- >4 lelong 2 romp
9278
- >4 lelong 3 architecture=3
9279
- >4 lelong 4 ns32032
9280
- >4 lelong 5 ns32332
9281
- >4 lelong 6 m68k
9282
- >4 lelong 7 i386
9283
- >4 lelong 8 mips
9284
- >4 lelong 9 ns32532
9285
- >4 lelong 10 architecture=10
9286
- >4 lelong 11 hppa
9287
- >4 lelong 12 acorn
9288
- >4 lelong 13 m88k
9289
- >4 lelong 14 sparc
9290
- >4 lelong 15 i860-big
9291
- >4 lelong 16 i860
9292
- >4 lelong 17 rs6000
9293
- >4 lelong 18 ppc
9294
- >4 lelong 16777234 ppc64
9295
- >4 lelong >16777234
9296
- >>4 lelong x architecture=%ld
9297
- #
9298
- 0 belong&0xfffffffe 0xfeedface Mach-O
9299
- >3 byte 0xcf 64-bit
9300
- >12 belong 1 object
9301
- >12 belong 2 executable
9302
- >12 belong 3 fixed virtual memory shared library
9303
- >12 belong 4 core
9304
- >12 belong 5 preload executable
9305
- >12 belong 6 dynamically linked shared library
9306
- >12 belong 7 dynamic linker
9307
- >12 belong 8 bundle
9308
- >12 belong 9 dynamically linked shared library stub
9309
- >12 belong >9
9310
- >>12 belong x filetype=%ld
9311
- >4 belong <0
9312
- >>4 belong x architecture=%ld
9313
- >4 belong 1 vax
9314
- >4 belong 2 romp
9315
- >4 belong 3 architecture=3
9316
- >4 belong 4 ns32032
9317
- >4 belong 5 ns32332
9318
- >4 belong 6 for m68k architecture
9319
- # from NeXTstep 3.0 <mach/machine.h>
9320
- # i.e. mc680x0_all, ignore
9321
- # >>8 belong 1 (mc68030)
9322
- >>8 belong 2 (mc68040)
9323
- >>8 belong 3 (mc68030 only)
9324
- >4 belong 7 i386
9325
- >4 belong 8 mips
9326
- >4 belong 9 ns32532
9327
- >4 belong 10 architecture=10
9328
- >4 belong 11 hppa
9329
- >4 belong 12 acorn
9330
- >4 belong 13 m88k
9331
- >4 belong 14 sparc
9332
- >4 belong 15 i860-big
9333
- >4 belong 16 i860
9334
- >4 belong 17 rs6000
9335
- >4 belong 18 ppc
9336
- >4 belong 16777234 ppc64
9337
- >4 belong >16777234
9338
- >>4 belong x architecture=%ld
9339
-
9340
- #------------------------------------------------------------------------------
9341
- # macintosh description
9342
- #
9343
- # BinHex is the Macintosh ASCII-encoded file format (see also "apple")
9344
- # Daniel Quinlan, quinlan@yggdrasil.com
9345
- 11 string must\ be\ converted\ with\ BinHex BinHex binary text
9346
- !:mime application/mac-binhex40
9347
- >41 string x \b, version %.3s
9348
-
9349
- # Stuffit archives are the de facto standard of compression for Macintosh
9350
- # files obtained from most archives. (franklsm@tuns.ca)
9351
- 0 string SIT! StuffIt Archive (data)
9352
- !:mime application/x-stuffit
9353
- !:apple SIT!SIT!
9354
- >2 string x : %s
9355
- 0 string SITD StuffIt Deluxe (data)
9356
- >2 string x : %s
9357
- 0 string Seg StuffIt Deluxe Segment (data)
9358
- >2 string x : %s
9359
-
9360
- # Newer StuffIt archives (grant@netbsd.org)
9361
- 0 string StuffIt StuffIt Archive
9362
- !:mime application/x-stuffit
9363
- !:apple SIT!SIT!
9364
- #>162 string >0 : %s
9365
-
9366
- # Macintosh Applications and Installation binaries (franklsm@tuns.ca)
9367
- # GRR: Too weak
9368
- #0 string APPL Macintosh Application (data)
9369
- #>2 string x \b: %s
9370
-
9371
- # Macintosh System files (franklsm@tuns.ca)
9372
- # GRR: Too weak
9373
- #0 string zsys Macintosh System File (data)
9374
- #0 string FNDR Macintosh Finder (data)
9375
- #0 string libr Macintosh Library (data)
9376
- #>2 string x : %s
9377
- #0 string shlb Macintosh Shared Library (data)
9378
- #>2 string x : %s
9379
- #0 string cdev Macintosh Control Panel (data)
9380
- #>2 string x : %s
9381
- #0 string INIT Macintosh Extension (data)
9382
- #>2 string x : %s
9383
- #0 string FFIL Macintosh Truetype Font (data)
9384
- #>2 string x : %s
9385
- #0 string LWFN Macintosh Postscript Font (data)
9386
- #>2 string x : %s
9387
-
9388
- # Additional Macintosh Files (franklsm@tuns.ca)
9389
- # GRR: Too weak
9390
- #0 string PACT Macintosh Compact Pro Archive (data)
9391
- #>2 string x : %s
9392
- #0 string ttro Macintosh TeachText File (data)
9393
- #>2 string x : %s
9394
- #0 string TEXT Macintosh TeachText File (data)
9395
- #>2 string x : %s
9396
- #0 string PDF Macintosh PDF File (data)
9397
- #>2 string x : %s
9398
-
9399
- # MacBinary format (Eric Fischer, enf@pobox.com)
9400
- #
9401
- # Unfortunately MacBinary doesn't really have a magic number prior
9402
- # to the MacBinary III format. The checksum is really the way to
9403
- # do it, but the magic file format isn't up to the challenge.
9404
- #
9405
- # 0 byte 0
9406
- # 1 byte # filename length
9407
- # 2 string # filename
9408
- # 65 string # file type
9409
- # 69 string # file creator
9410
- # 73 byte # Finder flags
9411
- # 74 byte 0
9412
- # 75 beshort # vertical posn in window
9413
- # 77 beshort # horiz posn in window
9414
- # 79 beshort # window or folder ID
9415
- # 81 byte # protected?
9416
- # 82 byte 0
9417
- # 83 belong # length of data segment
9418
- # 87 belong # length of resource segment
9419
- # 91 belong # file creation date
9420
- # 95 belong # file modification date
9421
- # 99 beshort # length of comment after resource
9422
- # 101 byte # new Finder flags
9423
- # 102 string mBIN # (only in MacBinary III)
9424
- # 106 byte # char. code of file name
9425
- # 107 byte # still more Finder flags
9426
- # 116 belong # total file length
9427
- # 120 beshort # length of add'l header
9428
- # 122 byte 129 # for MacBinary II
9429
- # 122 byte 130 # for MacBinary III
9430
- # 123 byte 129 # minimum version that can read fmt
9431
- # 124 beshort # checksum
9432
- #
9433
- # This attempts to use the version numbers as a magic number, requiring
9434
- # that the first one be 0x80, 0x81, 0x82, or 0x83, and that the second
9435
- # be 0x81. This works for the files I have, but maybe not for everyone's.
9436
-
9437
- # Unfortunately, this magic is quite weak - MPi
9438
- #122 beshort&0xFCFF 0x8081 Macintosh MacBinary data
9439
-
9440
- # MacBinary I doesn't have the version number field at all, but MacBinary II
9441
- # has been in use since 1987 so I hope there aren't many really old files
9442
- # floating around that this will miss. The original spec calls for using
9443
- # the nulls in 0, 74, and 82 as the magic number.
9444
- #
9445
- # Another possibility, that would also work for MacBinary I, is to use
9446
- # the assumption that 65-72 will all be ASCII (0x20-0x7F), that 73 will
9447
- # have bits 1 (changed), 2 (busy), 3 (bozo), and 6 (invisible) unset,
9448
- # and that 74 will be 0. So something like
9449
- #
9450
- # 71 belong&0x80804EFF 0x00000000 Macintosh MacBinary data
9451
- #
9452
- # >73 byte&0x01 0x01 \b, inited
9453
- # >73 byte&0x02 0x02 \b, changed
9454
- # >73 byte&0x04 0x04 \b, busy
9455
- # >73 byte&0x08 0x08 \b, bozo
9456
- # >73 byte&0x10 0x10 \b, system
9457
- # >73 byte&0x10 0x20 \b, bundle
9458
- # >73 byte&0x10 0x40 \b, invisible
9459
- # >73 byte&0x10 0x80 \b, locked
9460
-
9461
- #>65 string x \b, type "%4.4s"
9462
-
9463
- #>65 string 8BIM (PhotoShop)
9464
- #>65 string ALB3 (PageMaker 3)
9465
- #>65 string ALB4 (PageMaker 4)
9466
- #>65 string ALT3 (PageMaker 3)
9467
- #>65 string APPL (application)
9468
- #>65 string AWWP (AppleWorks word processor)
9469
- #>65 string CIRC (simulated circuit)
9470
- #>65 string DRWG (MacDraw)
9471
- #>65 string EPSF (Encapsulated PostScript)
9472
- #>65 string FFIL (font suitcase)
9473
- #>65 string FKEY (function key)
9474
- #>65 string FNDR (Macintosh Finder)
9475
- #>65 string GIFf (GIF image)
9476
- #>65 string Gzip (GNU gzip)
9477
- #>65 string INIT (system extension)
9478
- #>65 string LIB\ (library)
9479
- #>65 string LWFN (PostScript font)
9480
- #>65 string MSBC (Microsoft BASIC)
9481
- #>65 string PACT (Compact Pro archive)
9482
- #>65 string PDF\ (Portable Document Format)
9483
- #>65 string PICT (picture)
9484
- #>65 string PNTG (MacPaint picture)
9485
- #>65 string PREF (preferences)
9486
- #>65 string PROJ (Think C project)
9487
- #>65 string QPRJ (Think Pascal project)
9488
- #>65 string SCFL (Defender scores)
9489
- #>65 string SCRN (startup screen)
9490
- #>65 string SITD (StuffIt Deluxe)
9491
- #>65 string SPn3 (SuperPaint)
9492
- #>65 string STAK (HyperCard stack)
9493
- #>65 string Seg\ (StuffIt segment)
9494
- #>65 string TARF (Unix tar archive)
9495
- #>65 string TEXT (ASCII)
9496
- #>65 string TIFF (TIFF image)
9497
- #>65 string TOVF (Eudora table of contents)
9498
- #>65 string WDBN (Microsoft Word word processor)
9499
- #>65 string WORD (MacWrite word processor)
9500
- #>65 string XLS\ (Microsoft Excel)
9501
- #>65 string ZIVM (compress (.Z))
9502
- #>65 string ZSYS (Pre-System 7 system file)
9503
- #>65 string acf3 (Aldus FreeHand)
9504
- #>65 string cdev (control panel)
9505
- #>65 string dfil (Desk Acessory suitcase)
9506
- #>65 string libr (library)
9507
- #>65 string nX^d (WriteNow word processor)
9508
- #>65 string nX^w (WriteNow dictionary)
9509
- #>65 string rsrc (resource)
9510
- #>65 string scbk (Scrapbook)
9511
- #>65 string shlb (shared library)
9512
- #>65 string ttro (SimpleText read-only)
9513
- #>65 string zsys (system file)
9514
-
9515
- #>69 string x \b, creator "%4.4s"
9516
-
9517
- # Somewhere, Apple has a repository of registered Creator IDs. These are
9518
- # just the ones that I happened to have files from and was able to identify.
9519
-
9520
- #>69 string 8BIM (Adobe Photoshop)
9521
- #>69 string ALD3 (PageMaker 3)
9522
- #>69 string ALD4 (PageMaker 4)
9523
- #>69 string ALFA (Alpha editor)
9524
- #>69 string APLS (Apple Scanner)
9525
- #>69 string APSC (Apple Scanner)
9526
- #>69 string BRKL (Brickles)
9527
- #>69 string BTFT (BitFont)
9528
- #>69 string CCL2 (Common Lisp 2)
9529
- #>69 string CCL\ (Common Lisp)
9530
- #>69 string CDmo (The Talking Moose)
9531
- #>69 string CPCT (Compact Pro)
9532
- #>69 string CSOm (Eudora)
9533
- #>69 string DMOV (Font/DA Mover)
9534
- #>69 string DSIM (DigSim)
9535
- #>69 string EDIT (Macintosh Edit)
9536
- #>69 string ERIK (Macintosh Finder)
9537
- #>69 string EXTR (self-extracting archive)
9538
- #>69 string Gzip (GNU gzip)
9539
- #>69 string KAHL (Think C)
9540
- #>69 string LWFU (LaserWriter Utility)
9541
- #>69 string LZIV (compress)
9542
- #>69 string MACA (MacWrite)
9543
- #>69 string MACS (Macintosh operating system)
9544
- #>69 string MAcK (MacKnowledge terminal emulator)
9545
- #>69 string MLND (Defender)
9546
- #>69 string MPNT (MacPaint)
9547
- #>69 string MSBB (Microsoft BASIC (binary))
9548
- #>69 string MSWD (Microsoft Word)
9549
- #>69 string NCSA (NCSA Telnet)
9550
- #>69 string PJMM (Think Pascal)
9551
- #>69 string PSAL (Hunt the Wumpus)
9552
- #>69 string PSI2 (Apple File Exchange)
9553
- #>69 string R*ch (BBEdit)
9554
- #>69 string RMKR (Resource Maker)
9555
- #>69 string RSED (Resource Editor)
9556
- #>69 string Rich (BBEdit)
9557
- #>69 string SIT! (StuffIt)
9558
- #>69 string SPNT (SuperPaint)
9559
- #>69 string Unix (NeXT Mac filesystem)
9560
- #>69 string VIM! (Vim editor)
9561
- #>69 string WILD (HyperCard)
9562
- #>69 string XCEL (Microsoft Excel)
9563
- #>69 string aCa2 (Fontographer)
9564
- #>69 string aca3 (Aldus FreeHand)
9565
- #>69 string dosa (Macintosh MS-DOS file system)
9566
- #>69 string movr (Font/DA Mover)
9567
- #>69 string nX^n (WriteNow)
9568
- #>69 string pdos (Apple ProDOS file system)
9569
- #>69 string scbk (Scrapbook)
9570
- #>69 string ttxt (SimpleText)
9571
- #>69 string ufox (Foreign File Access)
9572
-
9573
- # Just in case...
9574
-
9575
- 102 string mBIN MacBinary III data with surprising version number
9576
-
9577
- # sas magic from Bruce Foster (bef@nwu.edu)
9578
- #
9579
- #0 string SAS SAS
9580
- #>8 string x %s
9581
- 0 string SAS SAS
9582
- >24 string DATA data file
9583
- >24 string CATALOG catalog
9584
- >24 string INDEX data file index
9585
- >24 string VIEW data view
9586
- # sas 7+ magic from Reinhold Koch (reinhold.koch@roche.com)
9587
- #
9588
- 0x54 string SAS SAS 7+
9589
- >0x9C string DATA data file
9590
- >0x9C string CATALOG catalog
9591
- >0x9C string INDEX data file index
9592
- >0x9C string VIEW data view
9593
-
9594
- # spss magic for SPSS system and portable files,
9595
- # from Bruce Foster (bef@nwu.edu).
9596
-
9597
- 0 long 0xc1e2c3c9 SPSS Portable File
9598
- >40 string x %s
9599
-
9600
- 0 string $FL2 SPSS System File
9601
- >24 string x %s
9602
-
9603
- # Macintosh filesystem data
9604
- # From "Tom N Harris" <telliamed@mac.com>
9605
- # Fixed HFS+ and Partition map magic: Ethan Benson <erbenson@alaska.net>
9606
- # The MacOS epoch begins on 1 Jan 1904 instead of 1 Jan 1970, so these
9607
- # entries depend on the data arithmetic added after v.35
9608
- # There's also some Pascal strings in here, ditto...
9609
-
9610
- # The boot block signature, according to IM:Files, is
9611
- # "for HFS volumes, this field always contains the value 0x4C4B."
9612
- # But if this is true for MFS or HFS+ volumes, I don't know.
9613
- # Alternatively, the boot block is supposed to be zeroed if it's
9614
- # unused, so a simply >0 should suffice.
9615
-
9616
- 0x400 beshort 0xD2D7 Macintosh MFS data
9617
- >0 beshort 0x4C4B (bootable)
9618
- >0x40a beshort &0x8000 (locked)
9619
- >0x402 beldate-0x7C25B080 x created: %s,
9620
- >0x406 beldate-0x7C25B080 >0 last backup: %s,
9621
- >0x414 belong x block size: %d,
9622
- >0x412 beshort x number of blocks: %d,
9623
- >0x424 pstring x volume name: %s
9624
-
9625
- # "BD" is has many false positives
9626
- #0x400 beshort 0x4244 Macintosh HFS data
9627
- #>0 beshort 0x4C4B (bootable)
9628
- #>0x40a beshort &0x8000 (locked)
9629
- #>0x40a beshort ^0x0100 (mounted)
9630
- #>0x40a beshort &0x0200 (spared blocks)
9631
- #>0x40a beshort &0x0800 (unclean)
9632
- #>0x47C beshort 0x482B (Embedded HFS+ Volume)
9633
- #>0x402 beldate-0x7C25B080 x created: %s,
9634
- #>0x406 beldate-0x7C25B080 x last modified: %s,
9635
- #>0x440 beldate-0x7C25B080 >0 last backup: %s,
9636
- #>0x414 belong x block size: %d,
9637
- #>0x412 beshort x number of blocks: %d,
9638
- #>0x424 pstring x volume name: %s
9639
-
9640
- 0x400 beshort 0x482B Macintosh HFS Extended
9641
- >&0 beshort x version %d data
9642
- >0 beshort 0x4C4B (bootable)
9643
- >0x404 belong ^0x00000100 (mounted)
9644
- >&2 belong &0x00000200 (spared blocks)
9645
- >&2 belong &0x00000800 (unclean)
9646
- >&2 belong &0x00008000 (locked)
9647
- >&6 string x last mounted by: '%.4s',
9648
- # really, that should be treated as a belong and we print a string
9649
- # based on the value. TN1150 only mentions '8.10' for "MacOS 8.1"
9650
- >&14 beldate-0x7C25B080 x created: %s,
9651
- # only the creation date is local time, all other timestamps in HFS+ are UTC.
9652
- >&18 bedate-0x7C25B080 x last modified: %s,
9653
- >&22 bedate-0x7C25B080 >0 last backup: %s,
9654
- >&26 bedate-0x7C25B080 >0 last checked: %s,
9655
- >&38 belong x block size: %d,
9656
- >&42 belong x number of blocks: %d,
9657
- >&46 belong x free blocks: %d
9658
-
9659
- # I don't think this is really necessary since it doesn't do much and
9660
- # anything with a valid driver descriptor will also have a valid
9661
- # partition map
9662
- #0 beshort 0x4552 Apple Device Driver data
9663
- #>&24 beshort =1 \b, MacOS
9664
-
9665
- # Is that the partition type a cstring or a pstring? Well, IM says "strings
9666
- # shorter than 32 bytes must be terminated with NULL" so I'll treat it as a
9667
- # cstring. Of course, partitions can contain more than four entries, but
9668
- # what're you gonna do?
9669
- # GRR: This magic is too weak, it is just "PM"
9670
- #0x200 beshort 0x504D Apple Partition data
9671
- #>0x2 beshort x (block size: %d):
9672
- #>0x230 string x first type: %s,
9673
- #>0x210 string x name: %s,
9674
- #>0x254 belong x number of blocks: %d,
9675
- #>0x400 beshort 0x504D
9676
- #>>0x430 string x second type: %s,
9677
- #>>0x410 string x name: %s,
9678
- #>>0x454 belong x number of blocks: %d,
9679
- #>>0x600 beshort 0x504D
9680
- #>>>0x630 string x third type: %s,
9681
- #>>>0x610 string x name: %s,
9682
- #>>>0x654 belong x number of blocks: %d,
9683
- #>>0x800 beshort 0x504D
9684
- #>>>0x830 string x fourth type: %s,
9685
- #>>>0x810 string x name: %s,
9686
- #>>>0x854 belong x number of blocks: %d,
9687
- #>>>0xa00 beshort 0x504D
9688
- #>>>>0xa30 string x fifth type: %s,
9689
- #>>>>0xa10 string x name: %s,
9690
- #>>>>0xa54 belong x number of blocks: %d
9691
- #>>>0xc00 beshort 0x504D
9692
- #>>>>0xc30 string x sixth type: %s,
9693
- #>>>>0xc10 string x name: %s,
9694
- #>>>>0xc54 belong x number of blocks: %d
9695
- ## AFAIK, only the signature is different
9696
- #0x200 beshort 0x5453 Apple Old Partition data
9697
- #>0x2 beshort x block size: %d,
9698
- #>0x230 string x first type: %s,
9699
- #>0x210 string x name: %s,
9700
- #>0x254 belong x number of blocks: %d,
9701
- #>0x400 beshort 0x504D
9702
- #>>0x430 string x second type: %s,
9703
- #>>0x410 string x name: %s,
9704
- #>>0x454 belong x number of blocks: %d,
9705
- #>>0x800 beshort 0x504D
9706
- #>>>0x830 string x third type: %s,
9707
- #>>>0x810 string x name: %s,
9708
- #>>>0x854 belong x number of blocks: %d,
9709
- #>>>0xa00 beshort 0x504D
9710
- #>>>>0xa30 string x fourth type: %s,
9711
- #>>>>0xa10 string x name: %s,
9712
- #>>>>0xa54 belong x number of blocks: %d
9713
-
9714
- # From: Remi Mommsen <mommsen@slac.stanford.edu>
9715
- 0 string BOMStore Mac OS X bill of materials (BOM) file
9716
-
9717
- #------------------------------------------------------------------------------
9718
- # magic: file(1) magic for magic files
9719
- #
9720
- 0 string #\ Magic magic text file for file(1) cmd
9721
- 0 lelong 0xF11E041C magic binary file for file(1) cmd
9722
- >4 lelong x (version %d) (little endian)
9723
- 0 belong 0xF11E041C magic binary file for file(1) cmd
9724
- >4 belong x (version %d) (big endian)
9725
- #------------------------------------------------------------------------------
9726
- # mail.news: file(1) magic for mail and news
9727
- #
9728
- # Unfortunately, saved netnews also has From line added in some news software.
9729
- #0 string From mail text
9730
- # There are tests to ascmagic.c to cope with mail and news.
9731
- 0 string Relay-Version: old news text
9732
- !:mime message/rfc822
9733
- 0 string #!\ rnews batched news text
9734
- !:mime message/rfc822
9735
- 0 string N#!\ rnews mailed, batched news text
9736
- !:mime message/rfc822
9737
- 0 string Forward\ to mail forwarding text
9738
- !:mime message/rfc822
9739
- 0 string Pipe\ to mail piping text
9740
- !:mime message/rfc822
9741
- 0 string Return-Path: smtp mail text
9742
- !:mime message/rfc822
9743
- 0 string Path: news text
9744
- !:mime message/news
9745
- 0 string Xref: news text
9746
- !:mime message/news
9747
- 0 string From: news or mail text
9748
- !:mime message/rfc822
9749
- 0 string Article saved news text
9750
- !:mime message/news
9751
- 0 string BABYL Emacs RMAIL text
9752
- 0 string Received: RFC 822 mail text
9753
- !:mime message/rfc822
9754
- 0 string MIME-Version: MIME entity text
9755
- #0 string Content- MIME entity text
9756
-
9757
- # TNEF files...
9758
- 0 lelong 0x223E9F78 Transport Neutral Encapsulation Format
9759
-
9760
- # From: Kevin Sullivan <ksulliva@psc.edu>
9761
- 0 string *mbx* MBX mail folder
9762
-
9763
- # From: Simon Matter <simon.matter@invoca.ch>
9764
- 0 string \241\002\213\015skiplist\ file\0\0\0 Cyrus skiplist DB
9765
-
9766
- # JAM(mbp) Fidonet message area databases
9767
- # JHR file
9768
- 0 string JAM\0 JAM message area header file
9769
- >12 leshort >0 (%d messages)
9770
-
9771
- # Squish Fidonet message area databases
9772
- # SQD file (requires at least one message in the area)
9773
- # XXX: Weak magic
9774
- #256 leshort 0xAFAE4453 Squish message area data file
9775
- #>4 leshort >0 (%d messages)
9776
-
9777
- #0 string \<!--\ MHonArc text/html; x-type=mhonarc
9778
-
9779
- #------------------------------------------------------------------------------
9780
- # maple: file(1) magic for maple files
9781
- # "H. Nanosecond" <aldomel@ix.netcom.com>
9782
- # Maple V release 4, a multi-purpose math program
9783
- #
9784
-
9785
- # maple library .lib
9786
- 0 string \000MVR4\nI MapleVr4 library
9787
-
9788
- # .ind
9789
- # no magic for these :-(
9790
- # they are compiled indexes for maple files
9791
-
9792
- # .hdb
9793
- 0 string \000\004\000\000 Maple help database
9794
-
9795
- # .mhp
9796
- # this has the form <PACKAGE=name>
9797
- 0 string \<PACKAGE= Maple help file
9798
- 0 string \<HELP\ NAME= Maple help file
9799
- 0 string \n\<HELP\ NAME= Maple help file with extra carriage return at start (yuck)
9800
- #0 string #\ Newton Maple help file, old style
9801
- 0 string #\ daub Maple help file, old style
9802
- #0 string #=========== Maple help file, old style
9803
-
9804
- # .mws
9805
- 0 string \000\000\001\044\000\221 Maple worksheet
9806
- #this is anomalous
9807
- 0 string WriteNow\000\002\000\001\000\000\000\000\100\000\000\000\000\000 Maple worksheet, but weird
9808
- # this has the form {VERSION 2 3 "IBM INTEL NT" "2.3" }\n
9809
- # that is {VERSION major_version miunor_version computer_type version_string}
9810
- 0 string {VERSION\ Maple worksheet
9811
- >9 string >\0 version %.1s.
9812
- >>>11 string >\0 %.1s
9813
-
9814
- # .mps
9815
- 0 string \0\0\001$ Maple something
9816
- # from byte 4 it is either 'nul E' or 'soh R'
9817
- # I think 'nul E' means a file that was saved as a different name
9818
- # a sort of revision marking
9819
- # 'soh R' means new
9820
- >4 string \000\105 An old revision
9821
- >4 string \001\122 The latest save
9822
-
9823
- # .mpl
9824
- # some of these are the same as .mps above
9825
- #0000000 000 000 001 044 000 105 same as .mps
9826
- #0000000 000 000 001 044 001 122 same as .mps
9827
-
9828
- 0 string #\n##\ <SHAREFILE= Maple something
9829
- 0 string \n#\n##\ <SHAREFILE= Maple something
9830
- 0 string ##\ <SHAREFILE= Maple something
9831
- 0 string #\r##\ <SHAREFILE= Maple something
9832
- 0 string \r#\r##\ <SHAREFILE= Maple something
9833
- 0 string #\ \r##\ <DESCRIBE> Maple something anomalous.
9834
-
9835
- #------------------------------------------------------------------------------
9836
- # mathcad: file(1) magic for Mathcad documents
9837
- # URL: http://www.mathsoft.com/
9838
- # From: Josh Triplett <josh@freedesktop.org>
9839
-
9840
- 0 string .MCAD\t Mathcad document
9841
- #------------------------------------------------------------------------------
9842
- # mathematica: file(1) magic for mathematica files
9843
- # "H. Nanosecond" <aldomel@ix.netcom.com>
9844
- # Mathematica a multi-purpose math program
9845
- # versions 2.2 and 3.0
9846
-
9847
- #mathematica .mb
9848
- 0 string \064\024\012\000\035\000\000\000 Mathematica version 2 notebook
9849
- 0 string \064\024\011\000\035\000\000\000 Mathematica version 2 notebook
9850
-
9851
- # .ma
9852
- # multiple possibilites:
9853
-
9854
- 0 string (*^\n\n::[\011frontEndVersion\ =\ Mathematica notebook
9855
- #>41 string >\0 %s
9856
-
9857
- #0 string (*^\n\n::[\011palette Mathematica notebook version 2.x
9858
-
9859
- #0 string (*^\n\n::[\011Information Mathematica notebook version 2.x
9860
- #>675 string >\0 %s #doesn't work well
9861
-
9862
- # there may be 'cr' instread of 'nl' in some does this matter?
9863
-
9864
- # generic:
9865
- 0 string (*^\r\r::[\011 Mathematica notebook version 2.x
9866
- 0 string (*^\r\n\r\n::[\011 Mathematica notebook version 2.x
9867
- 0 string (*^\015 Mathematica notebook version 2.x
9868
- 0 string (*^\n\r\n\r::[\011 Mathematica notebook version 2.x
9869
- 0 string (*^\r::[\011 Mathematica notebook version 2.x
9870
- 0 string (*^\r\n::[\011 Mathematica notebook version 2.x
9871
- 0 string (*^\n\n::[\011 Mathematica notebook version 2.x
9872
- 0 string (*^\n::[\011 Mathematica notebook version 2.x
9873
-
9874
-
9875
- # Mathematica .mx files
9876
-
9877
- #0 string (*This\ is\ a\ Mathematica\ binary\ dump\ file.\ It\ can\ be\ loaded\ with\ Get.*) Mathematica binary file
9878
- 0 string (*This\ is\ a\ Mathematica\ binary\ Mathematica binary file
9879
- #>71 string \000\010\010\010\010\000\000\000\000\000\000\010\100\010\000\000\000
9880
- # >71... is optional
9881
- >88 string >\0 from %s
9882
-
9883
-
9884
- # Mathematica files PBF:
9885
- # 115 115 101 120 102 106 000 001 000 000 000 203 000 001 000
9886
- 0 string MMAPBF\000\001\000\000\000\203\000\001\000 Mathematica PBF (fonts I think)
9887
-
9888
- # .ml files These are menu resources I think
9889
- # these start with "[0-9][0-9][0-9]\ A~[0-9][0-9][0-9]\
9890
- # how to put that into a magic rule?
9891
- 4 string \ A~ MAthematica .ml file
9892
-
9893
- # .nb files
9894
- #too long 0 string (***********************************************************************\n\n\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Mathematica-Compatible Notebook Mathematica 3.0 notebook
9895
- 0 string (*********************** Mathematica 3.0 notebook
9896
-
9897
- # other (* matches it is a comment start in these langs
9898
- # GRR: Too weak; also matches other languages e.g. ML
9899
- #0 string (* Mathematica, or Pascal, Modula-2 or 3 code text
9900
-
9901
- #########################
9902
- # MatLab v5
9903
- 0 string MATLAB Matlab v5 mat-file
9904
- >126 short 0x494d (big endian)
9905
- >>124 beshort x version 0x%04x
9906
- >126 short 0x4d49 (little endian)
9907
- >>124 leshort x version 0x%04x
9908
-
9909
-
9910
- #------------------------------------------------------------------------------
9911
- # matroska: file(1) magic for Matroska files
9912
- #
9913
- # See http://www.matroska.org/
9914
- #
9915
-
9916
- # EBML id:
9917
- 0 belong 0x1a45dfa3
9918
- # DocType id:
9919
- >5 beshort 0x4282
9920
- # DocType contents:
9921
- >>8 string matroska Matroska data
9922
-
9923
- #------------------------------------------------------------------------------
9924
- # Mavroyanopoulos Nikos <nmav@hellug.gr>
9925
- # mcrypt: file(1) magic for mcrypt 2.2.x;
9926
- 0 string \0m\3 mcrypt 2.5 encrypted data,
9927
- >4 string >\0 algorithm: %s,
9928
- >>&1 leshort >0 keysize: %d bytes,
9929
- >>>&0 string >\0 mode: %s,
9930
-
9931
- 0 string \0m\2 mcrypt 2.2 encrypted data,
9932
- >3 byte 0 algorithm: blowfish-448,
9933
- >3 byte 1 algorithm: DES,
9934
- >3 byte 2 algorithm: 3DES,
9935
- >3 byte 3 algorithm: 3-WAY,
9936
- >3 byte 4 algorithm: GOST,
9937
- >3 byte 6 algorithm: SAFER-SK64,
9938
- >3 byte 7 algorithm: SAFER-SK128,
9939
- >3 byte 8 algorithm: CAST-128,
9940
- >3 byte 9 algorithm: xTEA,
9941
- >3 byte 10 algorithm: TWOFISH-128,
9942
- >3 byte 11 algorithm: RC2,
9943
- >3 byte 12 algorithm: TWOFISH-192,
9944
- >3 byte 13 algorithm: TWOFISH-256,
9945
- >3 byte 14 algorithm: blowfish-128,
9946
- >3 byte 15 algorithm: blowfish-192,
9947
- >3 byte 16 algorithm: blowfish-256,
9948
- >3 byte 100 algorithm: RC6,
9949
- >3 byte 101 algorithm: IDEA,
9950
- >4 byte 0 mode: CBC,
9951
- >4 byte 1 mode: ECB,
9952
- >4 byte 2 mode: CFB,
9953
- >4 byte 3 mode: OFB,
9954
- >4 byte 4 mode: nOFB,
9955
- >5 byte 0 keymode: 8bit
9956
- >5 byte 1 keymode: 4bit
9957
- >5 byte 2 keymode: SHA-1 hash
9958
- >5 byte 3 keymode: MD5 hash
9959
-
9960
- #------------------------------------------------------------------------------
9961
- # mercurial: file(1) magic for Mercurial changeset bundles
9962
- # http://www.selenic.com/mercurial/wiki/
9963
- #
9964
- # Jesse Glick (jesse.glick@sun.com)
9965
- #
9966
-
9967
- 0 string HG10 Mercurial changeset bundle
9968
- >4 string UN (uncompressed)
9969
- >4 string GZ (gzip compressed)
9970
- >4 string BZ (bzip2 compressed)
9971
- #------------------------------------------------------------------------------
9972
- # mime: file(1) magic for MIME encoded files
9973
- #
9974
- 0 string Content-Type:\
9975
- >14 string >\0 %s
9976
- 0 string Content-Type:
9977
- >13 string >\0 %s
9978
-
9979
- #------------------------------------------------------------------------------
9980
- # mips: file(1) magic for Silicon Graphics (MIPS, IRIS, IRIX, etc.)
9981
- # Dec Ultrix (MIPS)
9982
- # all of SGI's *current* machines and OSes run in big-endian mode on the
9983
- # MIPS machines, as far as I know.
9984
- #
9985
- # XXX - what is the blank "-" line?
9986
- #
9987
- # kbd file definitions
9988
- 0 string kbd!map kbd map file
9989
- >8 byte >0 Ver %d:
9990
- >10 short >0 with %d table(s)
9991
- 0 belong 0407 old SGI 68020 executable
9992
- 0 belong 0410 old SGI 68020 pure executable
9993
- 0 beshort 0x8765 disk quotas file
9994
- 0 beshort 0x0506 IRIS Showcase file
9995
- >2 byte 0x49 -
9996
- >3 byte x - version %ld
9997
- 0 beshort 0x0226 IRIS Showcase template
9998
- >2 byte 0x63 -
9999
- >3 byte x - version %ld
10000
- 0 belong 0x5343464d IRIS Showcase file
10001
- >4 byte x - version %ld
10002
- 0 belong 0x5443464d IRIS Showcase template
10003
- >4 byte x - version %ld
10004
- 0 belong 0xdeadbabe IRIX Parallel Arena
10005
- >8 belong >0 - version %ld
10006
- #
10007
- 0 beshort 0x0160 MIPSEB ECOFF executable
10008
- >20 beshort 0407 (impure)
10009
- >20 beshort 0410 (swapped)
10010
- >20 beshort 0413 (paged)
10011
- >8 belong >0 not stripped
10012
- >8 belong 0 stripped
10013
- >22 byte x - version %ld
10014
- >23 byte x .%ld
10015
- #
10016
- 0 beshort 0x0162 MIPSEL-BE ECOFF executable
10017
- >20 beshort 0407 (impure)
10018
- >20 beshort 0410 (swapped)
10019
- >20 beshort 0413 (paged)
10020
- >8 belong >0 not stripped
10021
- >8 belong 0 stripped
10022
- >23 byte x - version %d
10023
- >22 byte x .%ld
10024
- #
10025
- 0 beshort 0x6001 MIPSEB-LE ECOFF executable
10026
- >20 beshort 03401 (impure)
10027
- >20 beshort 04001 (swapped)
10028
- >20 beshort 05401 (paged)
10029
- >8 belong >0 not stripped
10030
- >8 belong 0 stripped
10031
- >23 byte x - version %d
10032
- >22 byte x .%ld
10033
- #
10034
- 0 beshort 0x6201 MIPSEL ECOFF executable
10035
- >20 beshort 03401 (impure)
10036
- >20 beshort 04001 (swapped)
10037
- >20 beshort 05401 (paged)
10038
- >8 belong >0 not stripped
10039
- >8 belong 0 stripped
10040
- >23 byte x - version %ld
10041
- >22 byte x .%ld
10042
- #
10043
- # MIPS 2 additions
10044
- #
10045
- 0 beshort 0x0163 MIPSEB MIPS-II ECOFF executable
10046
- >20 beshort 0407 (impure)
10047
- >20 beshort 0410 (swapped)
10048
- >20 beshort 0413 (paged)
10049
- >8 belong >0 not stripped
10050
- >8 belong 0 stripped
10051
- >22 byte x - version %ld
10052
- >23 byte x .%ld
10053
- #
10054
- 0 beshort 0x0166 MIPSEL-BE MIPS-II ECOFF executable
10055
- >20 beshort 0407 (impure)
10056
- >20 beshort 0410 (swapped)
10057
- >20 beshort 0413 (paged)
10058
- >8 belong >0 not stripped
10059
- >8 belong 0 stripped
10060
- >22 byte x - version %ld
10061
- >23 byte x .%ld
10062
- #
10063
- 0 beshort 0x6301 MIPSEB-LE MIPS-II ECOFF executable
10064
- >20 beshort 03401 (impure)
10065
- >20 beshort 04001 (swapped)
10066
- >20 beshort 05401 (paged)
10067
- >8 belong >0 not stripped
10068
- >8 belong 0 stripped
10069
- >23 byte x - version %ld
10070
- >22 byte x .%ld
10071
- #
10072
- 0 beshort 0x6601 MIPSEL MIPS-II ECOFF executable
10073
- >20 beshort 03401 (impure)
10074
- >20 beshort 04001 (swapped)
10075
- >20 beshort 05401 (paged)
10076
- >8 belong >0 not stripped
10077
- >8 belong 0 stripped
10078
- >23 byte x - version %ld
10079
- >22 byte x .%ld
10080
- #
10081
- # MIPS 3 additions
10082
- #
10083
- 0 beshort 0x0140 MIPSEB MIPS-III ECOFF executable
10084
- >20 beshort 0407 (impure)
10085
- >20 beshort 0410 (swapped)
10086
- >20 beshort 0413 (paged)
10087
- >8 belong >0 not stripped
10088
- >8 belong 0 stripped
10089
- >22 byte x - version %ld
10090
- >23 byte x .%ld
10091
- #
10092
- 0 beshort 0x0142 MIPSEL-BE MIPS-III ECOFF executable
10093
- >20 beshort 0407 (impure)
10094
- >20 beshort 0410 (swapped)
10095
- >20 beshort 0413 (paged)
10096
- >8 belong >0 not stripped
10097
- >8 belong 0 stripped
10098
- >22 byte x - version %ld
10099
- >23 byte x .%ld
10100
- #
10101
- 0 beshort 0x4001 MIPSEB-LE MIPS-III ECOFF executable
10102
- >20 beshort 03401 (impure)
10103
- >20 beshort 04001 (swapped)
10104
- >20 beshort 05401 (paged)
10105
- >8 belong >0 not stripped
10106
- >8 belong 0 stripped
10107
- >23 byte x - version %ld
10108
- >22 byte x .%ld
10109
- #
10110
- 0 beshort 0x4201 MIPSEL MIPS-III ECOFF executable
10111
- >20 beshort 03401 (impure)
10112
- >20 beshort 04001 (swapped)
10113
- >20 beshort 05401 (paged)
10114
- >8 belong >0 not stripped
10115
- >8 belong 0 stripped
10116
- >23 byte x - version %ld
10117
- >22 byte x .%ld
10118
- #
10119
- 0 beshort 0x180 MIPSEB Ucode
10120
- 0 beshort 0x182 MIPSEL-BE Ucode
10121
- # 32bit core file
10122
- 0 belong 0xdeadadb0 IRIX core dump
10123
- >4 belong 1 of
10124
- >16 string >\0 '%s'
10125
- # 64bit core file
10126
- 0 belong 0xdeadad40 IRIX 64-bit core dump
10127
- >4 belong 1 of
10128
- >16 string >\0 '%s'
10129
- # N32bit core file
10130
- 0 belong 0xbabec0bb IRIX N32 core dump
10131
- >4 belong 1 of
10132
- >16 string >\0 '%s'
10133
- # New style crash dump file
10134
- 0 string \x43\x72\x73\x68\x44\x75\x6d\x70 IRIX vmcore dump of
10135
- >36 string >\0 '%s'
10136
- # Trusted IRIX info
10137
- 0 string SGIAUDIT SGI Audit file
10138
- >8 byte x - version %d
10139
- >9 byte x .%ld
10140
- #
10141
- 0 string WNGZWZSC Wingz compiled script
10142
- 0 string WNGZWZSS Wingz spreadsheet
10143
- 0 string WNGZWZHP Wingz help file
10144
- #
10145
- 0 string #Inventor V IRIS Inventor 1.0 file
10146
- 0 string #Inventor V2 Open Inventor 2.0 file
10147
- # GLF is OpenGL stream encoding
10148
- 0 string glfHeadMagic(); GLF_TEXT
10149
- 4 belong 0x7d000000 GLF_BINARY_LSB_FIRST
10150
- 4 belong 0x0000007d GLF_BINARY_MSB_FIRST
10151
- # GLS is OpenGL stream encoding; GLS is the successor of GLF
10152
- 0 string glsBeginGLS( GLS_TEXT
10153
- 4 belong 0x10000000 GLS_BINARY_LSB_FIRST
10154
- 4 belong 0x00000010 GLS_BINARY_MSB_FIRST
10155
-
10156
- #------------------------------------------------------------------------------
10157
- # mirage: file(1) magic for Mirage executables
10158
- #
10159
- # XXX - byte order?
10160
- #
10161
- 0 long 31415 Mirage Assembler m.out executable
10162
- #-----------------------------------------------------------------------------
10163
- # misctools: file(1) magic for miscellaneous UNIX tools.
10164
- #
10165
- 0 search/1 %%!! X-Post-It-Note text
10166
- 0 string/c BEGIN:VCALENDAR vCalendar calendar file
10167
- 0 string/c BEGIN:VCARD vCard visiting card
10168
- !:mime text/x-vcard
10169
-
10170
- # From: Alex Beregszaszi <alex@fsn.hu>
10171
- 4 string gtktalog GNOME Catalogue (gtktalog)
10172
- >13 string >\0 version %s
10173
-
10174
- # Summary: Libtool library file
10175
- # Extension: .la
10176
- # Submitted by: Tomasz Trojanowski <tomek@uninet.com.pl>
10177
- 0 search/80 .la\ -\ a\ libtool\ library\ file libtool library file
10178
-
10179
- # Summary: Libtool object file
10180
- # Extension: .lo
10181
- # Submitted by: Abel Cheung <abelcheung@gmail.com>
10182
- 0 search/80 .lo\ -\ a\ libtool\ object\ file libtool object file
10183
-
10184
- #------------------------------------------------------------------------------
10185
- # mkid: file(1) magic for mkid(1) databases
10186
- #
10187
- # ID is the binary tags database produced by mkid(1).
10188
- #
10189
- # XXX - byte order?
10190
- #
10191
- 0 string \311\304 ID tags data
10192
- >2 short >0 version %d
10193
-
10194
- #------------------------------------------------------------------------------
10195
- # mlssa: file(1) magic for MLSSA datafiles
10196
- #
10197
- 0 lelong 0xffffabcd MLSSA datafile,
10198
- >4 leshort x algorithm %d,
10199
- >10 lelong x %d samples
10200
-
10201
- #------------------------------------------------------------------------------
10202
- # mmdf: file(1) magic for MMDF mail files
10203
- #
10204
- 0 string \001\001\001\001 MMDF mailbox
10205
- #------------------------------------------------------------------------------
10206
- # modem: file(1) magic for modem programs
10207
- #
10208
- # From: Florian La Roche <florian@knorke.saar.de>
10209
- 1 string PC\ Research,\ Inc Digifax-G3-File
10210
- >29 byte 1 \b, fine resolution
10211
- >29 byte 0 \b, normal resolution
10212
-
10213
- 0 short 0x0100 raw G3 data, byte-padded
10214
- 0 short 0x1400 raw G3 data
10215
- #
10216
- # Magic data for vgetty voice formats
10217
- # (Martin Seine & Marc Eberhard)
10218
-
10219
- #
10220
- # raw modem data version 1
10221
- #
10222
- 0 string RMD1 raw modem data
10223
- >4 string >\0 (%s /
10224
- >20 short >0 compression type 0x%04x)
10225
-
10226
- #
10227
- # portable voice format 1
10228
- #
10229
- 0 string PVF1\n portable voice format
10230
- >5 string >\0 (binary %s)
10231
-
10232
- #
10233
- # portable voice format 2
10234
- #
10235
- 0 string PVF2\n portable voice format
10236
- >5 string >\0 (ascii %s)
10237
-
10238
-
10239
- #------------------------------------------------------------------------------
10240
- # motorola: file(1) magic for Motorola 68K and 88K binaries
10241
- #
10242
- # 68K
10243
- #
10244
- 0 beshort 0520 mc68k COFF
10245
- >18 beshort ^00000020 object
10246
- >18 beshort &00000020 executable
10247
- >12 belong >0 not stripped
10248
- >168 string .lowmem Apple toolbox
10249
- >20 beshort 0407 (impure)
10250
- >20 beshort 0410 (pure)
10251
- >20 beshort 0413 (demand paged)
10252
- >20 beshort 0421 (standalone)
10253
- 0 beshort 0521 mc68k executable (shared)
10254
- >12 belong >0 not stripped
10255
- 0 beshort 0522 mc68k executable (shared demand paged)
10256
- >12 belong >0 not stripped
10257
- #
10258
- # Motorola/UniSoft 68K Binary Compatibility Standard (BCS)
10259
- #
10260
- 0 beshort 0554 68K BCS executable
10261
- #
10262
- # 88K
10263
- #
10264
- # Motorola/88Open BCS
10265
- #
10266
- 0 beshort 0555 88K BCS executable
10267
- #
10268
- # Motorola S-Records, from Gerd Truschinski <gt@freebsd.first.gmd.de>
10269
- 0 string S0 Motorola S-Record; binary data in text format
10270
-
10271
- # ATARI ST relocatable PRG
10272
- #
10273
- # from Oskar Schirmer <schirmer@scara.com> Feb 3, 2001
10274
- # (according to Roland Waldi, Oct 21, 1987)
10275
- # besides the magic 0x601a, the text segment size is checked to be
10276
- # not larger than 1 MB (which is a lot on ST).
10277
- # The additional 0x601b distinction I took from Doug Lee's magic.
10278
- 0 belong&0xFFFFFFF0 0x601A0000 Atari ST M68K contiguous executable
10279
- >2 belong x (txt=%ld,
10280
- >6 belong x dat=%ld,
10281
- >10 belong x bss=%ld,
10282
- >14 belong x sym=%ld)
10283
- 0 belong&0xFFFFFFF0 0x601B0000 Atari ST M68K non-contig executable
10284
- >2 belong x (txt=%ld,
10285
- >6 belong x dat=%ld,
10286
- >10 belong x bss=%ld,
10287
- >14 belong x sym=%ld)
10288
-
10289
- # Atari ST/TT... program format (sent by Wolfram Kleff <kleff@cs.uni-bonn.de>)
10290
- 0 beshort 0x601A Atari 68xxx executable,
10291
- >2 belong x text len %lu,
10292
- >6 belong x data len %lu,
10293
- >10 belong x BSS len %lu,
10294
- >14 belong x symboltab len %lu,
10295
- >18 belong 0
10296
- >22 belong &0x01 fastload flag,
10297
- >22 belong &0x02 may be loaded to alternate RAM,
10298
- >22 belong &0x04 malloc may be from alternate RAM,
10299
- >22 belong x flags: 0x%lX,
10300
- >26 beshort 0 no relocation tab
10301
- >26 beshort !0 + relocation tab
10302
- >30 string SFX [Self-Extracting LZH SFX archive]
10303
- >38 string SFX [Self-Extracting LZH SFX archive]
10304
- >44 string ZIP! [Self-Extracting ZIP SFX archive]
10305
-
10306
- 0 beshort 0x0064 Atari 68xxx CPX file
10307
- >8 beshort x (version %04lx)
10308
-
10309
- #------------------------------------------------------------------------------
10310
- # mozilla: file(1) magic for Mozilla XUL fastload files
10311
- # (XUL.mfasl and XPC.mfasl)
10312
- # URL: http://www.mozilla.org/
10313
- # From: Josh Triplett <josh@freedesktop.org>
10314
-
10315
- 0 string XPCOM\nMozFASL\r\n\x1A Mozilla XUL fastload data
10316
-
10317
- #------------------------------------------------------------------------------
10318
- # msdos: file(1) magic for MS-DOS files
10319
- #
10320
-
10321
- # .BAT files (Daniel Quinlan, quinlan@yggdrasil.com)
10322
- # updated by Joerg Jenderek at Oct 2008
10323
- 0 string @
10324
- >1 string/cB \ echo\ off DOS batch file text
10325
- !:mime text/x-msdos-batch
10326
- >1 string/cB echo\ off DOS batch file text
10327
- !:mime text/x-msdos-batch
10328
- >1 string/cB rem\ DOS batch file text
10329
- !:mime text/x-msdos-batch
10330
- >1 string/cB set\ DOS batch file text
10331
- !:mime text/x-msdos-batch
10332
-
10333
-
10334
- # OS/2 batch files are REXX. the second regex is a bit generic, oh well
10335
- # the matched commands seem to be common in REXX and uncommon elsewhere
10336
- 100 search/0xffff rxfuncadd
10337
- >100 regex/c =^[\ \t]{0,10}call[\ \t]{1,10}rxfunc OS/2 REXX batch file text
10338
- 100 search/0xffff say
10339
- >100 regex/c =^[\ \t]{0,10}say\ ['"] OS/2 REXX batch file text
10340
-
10341
- 0 leshort 0x14c MS Windows COFF Intel 80386 object file
10342
- #>4 ledate x stamp %s
10343
- 0 leshort 0x166 MS Windows COFF MIPS R4000 object file
10344
- #>4 ledate x stamp %s
10345
- 0 leshort 0x184 MS Windows COFF Alpha object file
10346
- #>4 ledate x stamp %s
10347
- 0 leshort 0x268 MS Windows COFF Motorola 68000 object file
10348
- #>4 ledate x stamp %s
10349
- 0 leshort 0x1f0 MS Windows COFF PowerPC object file
10350
- #>4 ledate x stamp %s
10351
- 0 leshort 0x290 MS Windows COFF PA-RISC object file
10352
- #>4 ledate x stamp %s
10353
-
10354
- # XXX - according to Microsoft's spec, at an offset of 0x3c in a
10355
- # PE-format executable is the offset in the file of the PE header;
10356
- # unfortunately, that's a little-endian offset, and there's no way
10357
- # to specify an indirect offset with a specified byte order.
10358
- # So, for now, we assume the standard MS-DOS stub, which puts the
10359
- # PE header at 0x80 = 128.
10360
- #
10361
- # Required OS version and subsystem version were 4.0 on some NT 3.51
10362
- # executables built with Visual C++ 4.0, so it's not clear that
10363
- # they're interesting. The user version was 0.0, but there's
10364
- # probably some linker directive to set it. The linker version was
10365
- # 3.0, except for one ".exe" which had it as 4.20 (same damn linker!).
10366
- #
10367
- # many of the compressed formats were extraced from IDARC 1.23 source code
10368
- #
10369
- 0 string MZ
10370
- !:mime application/x-dosexec
10371
- >0x18 leshort <0x40 MS-DOS executable
10372
- >0 string MZ\0\0\0\0\0\0\0\0\0\0PE\0\0 \b, PE for MS Windows
10373
- >>&18 leshort&0x2000 >0 (DLL)
10374
- >>&88 leshort 0 (unknown subsystem)
10375
- >>&88 leshort 1 (native)
10376
- >>&88 leshort 2 (GUI)
10377
- >>&88 leshort 3 (console)
10378
- >>&88 leshort 7 (POSIX)
10379
- >>&0 leshort 0x0 unknown processor
10380
- >>&0 leshort 0x14c Intel 80386
10381
- >>&0 leshort 0x166 MIPS R4000
10382
- >>&0 leshort 0x184 Alpha
10383
- >>&0 leshort 0x268 Motorola 68000
10384
- >>&0 leshort 0x1f0 PowerPC
10385
- >>&0 leshort 0x290 PA-RISC
10386
- >>&18 leshort&0x0100 >0 32-bit
10387
- >>&18 leshort&0x1000 >0 system file
10388
- >>&228 lelong >0 \b, Mono/.Net assembly
10389
- >>&0xf4 search/0x140 \x0\x40\x1\x0
10390
- >>>(&0.l+(4)) string MSCF \b, WinHKI CAB self-extracting archive
10391
- >30 string Copyright\ 1989-1990\ PKWARE\ Inc. Self-extracting PKZIP archive
10392
- !:mime application/zip
10393
- # Is next line correct? One might expect "Corp." not "Copr." If it is right, add a note to that effect.
10394
- >30 string PKLITE\ Copr. Self-extracting PKZIP archive
10395
- !:mime application/zip
10396
-
10397
- >0x18 leshort >0x3f
10398
- >>(0x3c.l) string PE\0\0 PE
10399
- >>>(0x3c.l+25) byte 1 \b32 executable
10400
- >>>(0x3c.l+25) byte 2 \b32+ executable
10401
- # hooray, there's a DOS extender using the PE format, with a valid PE
10402
- # executable inside (which just prints a message and exits if run in win)
10403
- >>>(0x3c.l+92) leshort <10
10404
- >>>>(8.s*16) string 32STUB for MS-DOS, 32rtm DOS extender
10405
- >>>>(8.s*16) string !32STUB for MS Windows
10406
- >>>>>(0x3c.l+22) leshort&0x2000 >0 (DLL)
10407
- >>>>>(0x3c.l+92) leshort 0 (unknown subsystem)
10408
- >>>>>(0x3c.l+92) leshort 1 (native)
10409
- >>>>>(0x3c.l+92) leshort 2 (GUI)
10410
- >>>>>(0x3c.l+92) leshort 3 (console)
10411
- >>>>>(0x3c.l+92) leshort 7 (POSIX)
10412
- >>>(0x3c.l+92) leshort 10 (EFI application)
10413
- >>>(0x3c.l+92) leshort 11 (EFI boot service driver)
10414
- >>>(0x3c.l+92) leshort 12 (EFI runtime driver)
10415
- >>>(0x3c.l+92) leshort 13 (XBOX)
10416
- >>>(0x3c.l+4) leshort 0x0 unknown processor
10417
- >>>(0x3c.l+4) leshort 0x14c Intel 80386
10418
- >>>(0x3c.l+4) leshort 0x166 MIPS R4000
10419
- >>>(0x3c.l+4) leshort 0x184 Alpha
10420
- >>>(0x3c.l+4) leshort 0x268 Motorola 68000
10421
- >>>(0x3c.l+4) leshort 0x1f0 PowerPC
10422
- >>>(0x3c.l+4) leshort 0x290 PA-RISC
10423
- >>>(0x3c.l+4) leshort 0x200 Intel Itanium
10424
- >>>(0x3c.l+22) leshort&0x0100 >0 32-bit
10425
- >>>(0x3c.l+22) leshort&0x1000 >0 system file
10426
- >>>(0x3c.l+232) lelong >0 Mono/.Net assembly
10427
-
10428
- >>>>(0x3c.l+0xf8) string UPX0 \b, UPX compressed
10429
- >>>>(0x3c.l+0xf8) search/0x140 PEC2 \b, PECompact2 compressed
10430
- >>>>(0x3c.l+0xf8) search/0x140 UPX2
10431
- >>>>>(&0x10.l+(-4)) string PK\3\4 \b, ZIP self-extracting archive (Info-Zip)
10432
- >>>>(0x3c.l+0xf8) search/0x140 .idata
10433
- >>>>>(&0xe.l+(-4)) string PK\3\4 \b, ZIP self-extracting archive (Info-Zip)
10434
- >>>>>(&0xe.l+(-4)) string ZZ0 \b, ZZip self-extracting archive
10435
- >>>>>(&0xe.l+(-4)) string ZZ1 \b, ZZip self-extracting archive
10436
- >>>>(0x3c.l+0xf8) search/0x140 .rsrc
10437
- >>>>>(&0x0f.l+(-4)) string a\\\4\5 \b, WinHKI self-extracting archive
10438
- >>>>>(&0x0f.l+(-4)) string Rar! \b, RAR self-extracting archive
10439
- >>>>>(&0x0f.l+(-4)) search/0x3000 MSCF \b, InstallShield self-extracting archive
10440
- >>>>>(&0x0f.l+(-4)) search/32 Nullsoft \b, Nullsoft Installer self-extracting archive
10441
- >>>>(0x3c.l+0xf8) search/0x140 .data
10442
- >>>>>(&0x0f.l) string WEXTRACT \b, MS CAB-Installer self-extracting archive
10443
- >>>>(0x3c.l+0xf8) search/0x140 .petite\0 \b, Petite compressed
10444
- >>>>>(0x3c.l+0xf7) byte x
10445
- >>>>>>(&0x104.l+(-4)) string =!sfx! \b, ACE self-extracting archive
10446
- >>>>(0x3c.l+0xf8) search/0x140 .WISE \b, WISE installer self-extracting archive
10447
- >>>>(0x3c.l+0xf8) search/0x140 .dz\0\0\0 \b, Dzip self-extracting archive
10448
- >>>>(0x3c.l+0xf8) search/0x140 .reloc
10449
- >>>>>(&0xe.l+(-4)) search/0x180 PK\3\4 \b, ZIP self-extracting archive (WinZip)
10450
-
10451
- >>>>&(0x3c.l+0xf8) search/0x100 _winzip_ \b, ZIP self-extracting archive (WinZip)
10452
- >>>>&(0x3c.l+0xf8) search/0x100 SharedD \b, Microsoft Installer self-extracting archive
10453
- >>>>0x30 string Inno \b, InnoSetup self-extracting archive
10454
-
10455
- >>(0x3c.l) string !PE\0\0 MS-DOS executable
10456
-
10457
- >>(0x3c.l) string NE \b, NE
10458
- >>>(0x3c.l+0x36) byte 0 (unknown OS)
10459
- >>>(0x3c.l+0x36) byte 1 for OS/2 1.x
10460
- >>>(0x3c.l+0x36) byte 2 for MS Windows 3.x
10461
- >>>(0x3c.l+0x36) byte 3 for MS-DOS
10462
- >>>(0x3c.l+0x36) byte >3 (unknown OS)
10463
- >>>(0x3c.l+0x36) byte 0x81 for MS-DOS, Phar Lap DOS extender
10464
- >>>(0x3c.l+0x0c) leshort&0x8003 0x8002 (DLL)
10465
- >>>(0x3c.l+0x0c) leshort&0x8003 0x8001 (driver)
10466
- >>>&(&0x24.s-1) string ARJSFX \b, ARJ self-extracting archive
10467
- >>>(0x3c.l+0x70) search/0x80 WinZip(R)\ Self-Extractor \b, ZIP self-extracting archive (WinZip)
10468
-
10469
- >>(0x3c.l) string LX\0\0 \b, LX
10470
- >>>(0x3c.l+0x0a) leshort <1 (unknown OS)
10471
- >>>(0x3c.l+0x0a) leshort 1 for OS/2
10472
- >>>(0x3c.l+0x0a) leshort 2 for MS Windows
10473
- >>>(0x3c.l+0x0a) leshort 3 for DOS
10474
- >>>(0x3c.l+0x0a) leshort >3 (unknown OS)
10475
- >>>(0x3c.l+0x10) lelong&0x28000 =0x8000 (DLL)
10476
- >>>(0x3c.l+0x10) lelong&0x20000 >0 (device driver)
10477
- >>>(0x3c.l+0x10) lelong&0x300 0x300 (GUI)
10478
- >>>(0x3c.l+0x10) lelong&0x28300 <0x300 (console)
10479
- >>>(0x3c.l+0x08) leshort 1 i80286
10480
- >>>(0x3c.l+0x08) leshort 2 i80386
10481
- >>>(0x3c.l+0x08) leshort 3 i80486
10482
- >>>(8.s*16) string emx \b, emx
10483
- >>>>&1 string x %s
10484
- >>>&(&0x54.l-3) string arjsfx \b, ARJ self-extracting archive
10485
-
10486
- # MS Windows system file, supposedly a collection of LE executables
10487
- >>(0x3c.l) string W3 \b, W3 for MS Windows
10488
-
10489
- >>(0x3c.l) string LE\0\0 \b, LE executable
10490
- >>>(0x3c.l+0x0a) leshort 1
10491
- # some DOS extenders use LE files with OS/2 header
10492
- >>>>0x240 search/0x100 DOS/4G for MS-DOS, DOS4GW DOS extender
10493
- >>>>0x240 search/0x200 WATCOM\ C/C++ for MS-DOS, DOS4GW DOS extender
10494
- >>>>0x440 search/0x100 CauseWay\ DOS\ Extender for MS-DOS, CauseWay DOS extender
10495
- >>>>0x40 search/0x40 PMODE/W for MS-DOS, PMODE/W DOS extender
10496
- >>>>0x40 search/0x40 STUB/32A for MS-DOS, DOS/32A DOS extender (stub)
10497
- >>>>0x40 search/0x80 STUB/32C for MS-DOS, DOS/32A DOS extender (configurable stub)
10498
- >>>>0x40 search/0x80 DOS/32A for MS-DOS, DOS/32A DOS extender (embedded)
10499
- # this is a wild guess; hopefully it is a specific signature
10500
- >>>>&0x24 lelong <0x50
10501
- >>>>>(&0x4c.l) string \xfc\xb8WATCOM
10502
- >>>>>>&0 search/8 3\xdbf\xb9 \b, 32Lite compressed
10503
- # another wild guess: if real OS/2 LE executables exist, they probably have higher start EIP
10504
- #>>>>(0x3c.l+0x1c) lelong >0x10000 for OS/2
10505
- # fails with DOS-Extenders.
10506
- >>>(0x3c.l+0x0a) leshort 2 for MS Windows
10507
- >>>(0x3c.l+0x0a) leshort 3 for DOS
10508
- >>>(0x3c.l+0x0a) leshort 4 for MS Windows (VxD)
10509
- >>>(&0x7c.l+0x26) string UPX \b, UPX compressed
10510
- >>>&(&0x54.l-3) string UNACE \b, ACE self-extracting archive
10511
-
10512
- # looks like ASCII, probably some embedded copyright message.
10513
- # and definitely not NE/LE/LX/PE
10514
- >>0x3c lelong >0x20000000
10515
- >>>(4.s*512) leshort !0x014c \b, MZ for MS-DOS
10516
- # header data too small for extended executable
10517
- >2 long !0
10518
- >>0x18 leshort <0x40
10519
- >>>(4.s*512) leshort !0x014c
10520
-
10521
- >>>>&(2.s-514) string !LE
10522
- >>>>>&-2 string !BW \b, MZ for MS-DOS
10523
- >>>>&(2.s-514) string LE \b, LE
10524
- >>>>>0x240 search/0x100 DOS/4G for MS-DOS, DOS4GW DOS extender
10525
- # educated guess since indirection is still not capable enough for complex offset
10526
- # calculations (next embedded executable would be at &(&2*512+&0-2)
10527
- # I suspect there are only LE executables in these multi-exe files
10528
- >>>>&(2.s-514) string BW
10529
- >>>>>0x240 search/0x100 DOS/4G ,\b LE for MS-DOS, DOS4GW DOS extender (embedded)
10530
- >>>>>0x240 search/0x100 !DOS/4G ,\b BW collection for MS-DOS
10531
-
10532
- # This sequence skips to the first COFF segment, usually .text
10533
- >(4.s*512) leshort 0x014c \b, COFF
10534
- >>(8.s*16) string go32stub for MS-DOS, DJGPP go32 DOS extender
10535
- >>(8.s*16) string emx
10536
- >>>&1 string x for DOS, Win or OS/2, emx %s
10537
- >>&(&0x42.l-3) byte x
10538
- >>>&0x26 string UPX \b, UPX compressed
10539
- # and yet another guess: small .text, and after large .data is unusal, could be 32lite
10540
- >>&0x2c search/0xa0 .text
10541
- >>>&0x0b lelong <0x2000
10542
- >>>>&0 lelong >0x6000 \b, 32lite compressed
10543
-
10544
- >(8.s*16) string $WdX \b, WDos/X DOS extender
10545
-
10546
- # .EXE formats (Greg Roelofs, newt@uchicago.edu)
10547
- #
10548
- >0x35 string \x8e\xc0\xb9\x08\x00\xf3\xa5\x4a\x75\xeb\x8e\xc3\x8e\xd8\x33\xff\xbe\x30\x00\x05 \b, aPack compressed
10549
- >0xe7 string LH/2\ Self-Extract \b, %s
10550
- >0x1c string diet \b, diet compressed
10551
- >0x1c string LZ09 \b, LZEXE v0.90 compressed
10552
- >0x1c string LZ91 \b, LZEXE v0.91 compressed
10553
- >0x1c string tz \b, TinyProg compressed
10554
- >0x1e string PKLITE \b, %s compressed
10555
- >0x64 string W\ Collis\0\0 \b, Compack compressed
10556
- >0x24 string LHa's\ SFX \b, LHa self-extracting archive
10557
- !:mime application/x-lha
10558
- >0x24 string LHA's\ SFX \b, LHa self-extracting archive
10559
- !:mime application/x-lha
10560
- >0x24 string \ $ARX \b, ARX self-extracting archive
10561
- >0x24 string \ $LHarc \b, LHarc self-extracting archive
10562
- >0x20 string SFX\ by\ LARC \b, LARC self-extracting archive
10563
- >1638 string -lh5- \b, LHa self-extracting archive v2.13S
10564
- >0x17888 string Rar! \b, RAR self-extracting archive
10565
- >0x40 string aPKG \b, aPackage self-extracting archive
10566
-
10567
- >32 string AIN
10568
- >>35 string 2 \b, AIN 2.x compressed
10569
- >>35 string <2 \b, AIN 1.x compressed
10570
- >>35 string >2 \b, AIN 1.x compressed
10571
- >28 string UC2X \b, UCEXE compressed
10572
- >28 string WWP\ \b, WWPACK compressed
10573
-
10574
- # skip to the end of the exe
10575
- >(4.s*512) long x
10576
- >>&(2.s-517) byte x
10577
- >>>&0 string PK\3\4 \b, ZIP self-extracting archive
10578
- >>>&0 string Rar! \b, RAR self-extracting archive
10579
- >>>&0 string =!\x11 \b, AIN 2.x self-extracting archive
10580
- >>>&0 string =!\x12 \b, AIN 2.x self-extracting archive
10581
- >>>&0 string =!\x17 \b, AIN 1.x self-extracting archive
10582
- >>>&0 string =!\x18 \b, AIN 1.x self-extracting archive
10583
- >>>&7 search/400 **ACE** \b, ACE self-extracting archive
10584
- >>>&0 search/0x480 UC2SFX\ Header \b, UC2 self-extracting archive
10585
-
10586
- >0x1c string RJSX \b, ARJ self-extracting archive
10587
- # winarj stores a message in the stub instead of the sig in the MZ header
10588
- >0x20 search/0xe0 aRJsfX \b, ARJ self-extracting archive
10589
-
10590
- # a few unknown ZIP sfxes, no idea if they are needed or if they are
10591
- # already captured by the generic patterns above
10592
- >0x7a string Windows\ self-extracting\ ZIP \b, ZIP self-extracting archive
10593
- >(8.s*16) search/0x20 PKSFX \b, ZIP self-extracting archive (PKZIP)
10594
- # TODO: how to add this? >FileSize-34 string Windows\ Self-Installing\ Executable \b, ZIP self-extracting archive
10595
- #
10596
-
10597
- # TELVOX Teleinformatica CODEC self-extractor for OS/2:
10598
- >49801 string \x79\xff\x80\xff\x76\xff \b, CODEC archive v3.21
10599
- >>49824 leshort =1 \b, 1 file
10600
- >>49824 leshort >1 \b, %u files
10601
-
10602
- # .COM formats (Daniel Quinlan, quinlan@yggdrasil.com)
10603
- # Uncommenting only the first two lines will cover about 2/3 of COM files,
10604
- # but it isn't feasible to match all COM files since there must be at least
10605
- # two dozen different one-byte "magics".
10606
- # test too generic ?
10607
- 0 byte 0xe9 DOS executable (COM)
10608
- >0x1FE leshort 0xAA55 \b, boot code
10609
- >6 string SFX\ of\ LHarc (%s)
10610
- 0 belong 0xffffffff DOS executable (device driver)
10611
- #CMD640X2.SYS
10612
- >10 string >\x23
10613
- >>10 string !\x2e
10614
- >>>17 string <\x5B
10615
- >>>>10 string x \b, name: %.8s
10616
- #UDMA.SYS KEYB.SYS CMD640X2.SYS
10617
- >10 string <\x41
10618
- >>12 string >\x40
10619
- >>>10 string !$
10620
- >>>>12 string x \b, name: %.8s
10621
- #BTCDROM.SYS ASPICD.SYS
10622
- >22 string >\x40
10623
- >>22 string <\x5B
10624
- >>>23 string <\x5B
10625
- >>>>22 string x \b, name: %.8s
10626
- #ATAPICD.SYS
10627
- >76 string \0
10628
- >>77 string >\x40
10629
- >>>77 string <\x5B
10630
- >>>>77 string x \b, name: %.8s
10631
- # test too generic ?
10632
- 0 byte 0x8c DOS executable (COM)
10633
- # updated by Joerg Jenderek at Oct 2008
10634
- 0 ulelong 0xffff10eb DR-DOS executable (COM)
10635
- # byte 0xeb conflicts with "sequent" magic leshort 0xn2eb
10636
- 0 ubeshort&0xeb8d >0xeb00
10637
- # DR-DOS STACKER.COM SCREATE.SYS missed
10638
- >0 byte 0xeb DOS executable (COM)
10639
- >>0x1FE leshort 0xAA55 \b, boot code
10640
- >>85 string UPX \b, UPX compressed
10641
- >>4 string \ $ARX \b, ARX self-extracting archive
10642
- >>4 string \ $LHarc \b, LHarc self-extracting archive
10643
- >>0x20e string SFX\ by\ LARC \b, LARC self-extracting archive
10644
- # updated by Joerg Jenderek at Oct 2008
10645
- #0 byte 0xb8 COM executable
10646
- 0 uleshort&0x80ff 0x00b8
10647
- # modified by Joerg Jenderek
10648
- >1 lelong !0x21cd4cff COM executable for DOS
10649
- # http://syslinux.zytor.com/comboot.php
10650
- # (32-bit COMBOOT) programs *.C32 contain 32-bit code and run in flat-memory 32-bit protected mode
10651
- # start with assembler instructions mov eax,21cd4cffh
10652
- 0 uleshort&0xc0ff 0xc0b8
10653
- >1 lelong 0x21cd4cff COM executable (32-bit COMBOOT)
10654
- 0 string \x81\xfc
10655
- >4 string \x77\x02\xcd\x20\xb9
10656
- >>36 string UPX! FREE-DOS executable (COM), UPX compressed
10657
- 252 string Must\ have\ DOS\ version DR-DOS executable (COM)
10658
- # added by Joerg Jenderek at Oct 2008
10659
- # GRR search is not working
10660
- #34 search/2 UPX! FREE-DOS executable (COM), UPX compressed
10661
- 34 string UPX! FREE-DOS executable (COM), UPX compressed
10662
- 35 string UPX! FREE-DOS executable (COM), UPX compressed
10663
- # GRR search is not working
10664
- #2 search/28 \xcd\x21 COM executable for MS-DOS
10665
- #WHICHFAT.cOM
10666
- 2 string \xcd\x21 COM executable for DOS
10667
- #DELTREE.cOM DELTREE2.cOM
10668
- 4 string \xcd\x21 COM executable for DOS
10669
- #IFMEMDSK.cOM ASSIGN.cOM COMP.cOM
10670
- 5 string \xcd\x21 COM executable for DOS
10671
- #DELTMP.COm HASFAT32.cOM
10672
- 7 string \xcd\x21
10673
- >0 byte !0xb8 COM executable for DOS
10674
- #COMP.cOM MORE.COm
10675
- 10 string \xcd\x21
10676
- >5 string !\xcd\x21 COM executable for DOS
10677
- #comecho.com
10678
- 13 string \xcd\x21 COM executable for DOS
10679
- #HELP.COm EDIT.coM
10680
- 18 string \xcd\x21 COM executable for MS-DOS
10681
- #NWRPLTRM.COm
10682
- 23 string \xcd\x21 COM executable for MS-DOS
10683
- #LOADFIX.cOm LOADFIX.cOm
10684
- 30 string \xcd\x21 COM executable for MS-DOS
10685
- #syslinux.com 3.11
10686
- 70 string \xcd\x21 COM executable for DOS
10687
- # many compressed/converted COMs start with a copy loop instead of a jump
10688
- 0x6 search/0xa \xfc\x57\xf3\xa5\xc3 COM executable for MS-DOS
10689
- 0x6 search/0xa \xfc\x57\xf3\xa4\xc3 COM executable for DOS
10690
- >0x18 search/0x10 \x50\xa4\xff\xd5\x73 \b, aPack compressed
10691
- 0x3c string W\ Collis\0\0 COM executable for MS-DOS, Compack compressed
10692
- # FIXME: missing diet .com compression
10693
-
10694
- # miscellaneous formats
10695
- 0 string LZ MS-DOS executable (built-in)
10696
- #0 byte 0xf0 MS-DOS program library data
10697
- #
10698
-
10699
- # AAF files:
10700
- # <stuartc@rd.bbc.co.uk> Stuart Cunningham
10701
- 0 string \320\317\021\340\241\261\032\341AAFB\015\000OM\006\016\053\064\001\001\001\377 AAF legacy file using MS Structured Storage
10702
- >30 byte 9 (512B sectors)
10703
- >30 byte 12 (4kB sectors)
10704
- 0 string \320\317\021\340\241\261\032\341\001\002\001\015\000\002\000\000\006\016\053\064\003\002\001\001 AAF file using MS Structured Storage
10705
- >30 byte 9 (512B sectors)
10706
- >30 byte 12 (4kB sectors)
10707
-
10708
- # Popular applications
10709
- 2080 string Microsoft\ Word\ 6.0\ Document %s
10710
- !:mime application/msword
10711
- 2080 string Documento\ Microsoft\ Word\ 6 Spanish Microsoft Word 6 document data
10712
- !:mime application/msword
10713
- # Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Word)
10714
- 2112 string MSWordDoc Microsoft Word document data
10715
- !:mime application/msword
10716
- #
10717
- 0 belong 0x31be0000 Microsoft Word Document
10718
- !:mime application/msword
10719
- #
10720
- 0 string PO^Q` Microsoft Word 6.0 Document
10721
- !:mime application/msword
10722
- #
10723
- 0 string \376\067\0\043 Microsoft Office Document
10724
- !:mime application/msword
10725
- 0 string \333\245-\0\0\0 Microsoft Office Document
10726
- !:mime application/msword
10727
- 512 string \354\245\301 Microsoft Word Document
10728
- !:mime application/msword
10729
- #
10730
- 2080 string Microsoft\ Excel\ 5.0\ Worksheet %s
10731
- !:mime application/vnd.ms-excel
10732
-
10733
- 2080 string Foglio\ di\ lavoro\ Microsoft\ Exce %s
10734
- !:mime application/vnd.ms-excel
10735
- #
10736
- # Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Excel)
10737
- 2114 string Biff5 Microsoft Excel 5.0 Worksheet
10738
- !:mime application/vnd.ms-excel
10739
- # Italian MS-Excel
10740
- 2121 string Biff5 Microsoft Excel 5.0 Worksheet
10741
- !:mime application/vnd.ms-excel
10742
- 0 string \x09\x04\x06\x00\x00\x00\x10\x00 Microsoft Excel Worksheet
10743
- !:mime application/vnd.ms-excel
10744
- #
10745
- 0 belong 0x00001a00 Lotus 1-2-3
10746
- !:mime application/x-123
10747
- >4 belong 0x00100400 wk3 document data
10748
- >4 belong 0x02100400 wk4 document data
10749
- >4 belong 0x07800100 fm3 or fmb document data
10750
- >4 belong 0x07800000 fm3 or fmb document data
10751
- #
10752
- 0 belong 0x00000200 Lotus 1-2-3
10753
- !:mime application/x-123
10754
- >4 belong 0x06040600 wk1 document data
10755
- >4 belong 0x06800200 fmt document data
10756
- 0 string WordPro\0 Lotus WordPro
10757
- !:mime application/vnd.lotus-wordpro
10758
- 0 string WordPro\r\373 Lotus WordPro
10759
- !:mime application/vnd.lotus-wordpro
10760
-
10761
-
10762
- # Summary: Script used by InstallScield to uninstall applications
10763
- # Extension: .isu
10764
- # Submitted by: unknown
10765
- # Modified by (1): Abel Cheung <abelcheung@gmail.com> (replace useless entry)
10766
- 0 string \x71\xa8\x00\x00\x01\x02
10767
- >12 string Stirling\ Technologies, InstallShield Uninstall Script
10768
-
10769
- # Winamp .avs
10770
- #0 string Nullsoft\ AVS\ Preset\ \060\056\061\032 A plug in for Winamp ms-windows Freeware media player
10771
- 0 string Nullsoft\ AVS\ Preset\ Winamp plug in
10772
-
10773
- # Windows Metafont .WMF
10774
- 0 string \327\315\306\232 ms-windows metafont .wmf
10775
- 0 string \002\000\011\000 ms-windows metafont .wmf
10776
- 0 string \001\000\011\000 ms-windows metafont .wmf
10777
-
10778
- #tz3 files whatever that is (MS Works files)
10779
- 0 string \003\001\001\004\070\001\000\000 tz3 ms-works file
10780
- 0 string \003\002\001\004\070\001\000\000 tz3 ms-works file
10781
- 0 string \003\003\001\004\070\001\000\000 tz3 ms-works file
10782
-
10783
- # PGP sig files .sig
10784
- #0 string \211\000\077\003\005\000\063\237\127 065 to \027\266\151\064\005\045\101\233\021\002 PGP sig
10785
- 0 string \211\000\077\003\005\000\063\237\127\065\027\266\151\064\005\045\101\233\021\002 PGP sig
10786
- 0 string \211\000\077\003\005\000\063\237\127\066\027\266\151\064\005\045\101\233\021\002 PGP sig
10787
- 0 string \211\000\077\003\005\000\063\237\127\067\027\266\151\064\005\045\101\233\021\002 PGP sig
10788
- 0 string \211\000\077\003\005\000\063\237\127\070\027\266\151\064\005\045\101\233\021\002 PGP sig
10789
- 0 string \211\000\077\003\005\000\063\237\127\071\027\266\151\064\005\045\101\233\021\002 PGP sig
10790
- 0 string \211\000\225\003\005\000\062\122\207\304\100\345\042 PGP sig
10791
-
10792
- # windows zips files .dmf
10793
- 0 string MDIF\032\000\010\000\000\000\372\046\100\175\001\000\001\036\001\000 MS Windows special zipped file
10794
-
10795
-
10796
- #ico files
10797
- 0 string \102\101\050\000\000\000\056\000\000\000\000\000\000\000 Icon for MS Windows
10798
-
10799
- # Windows icons (Ian Springer <ips@fpk.hp.com>)
10800
- 0 string \000\000\001\000 MS Windows icon resource
10801
- !:mime image/x-ico
10802
- >4 byte 1 - 1 icon
10803
- >4 byte >1 - %d icons
10804
- >>6 byte >0 \b, %dx
10805
- >>>7 byte >0 \b%d
10806
- >>8 byte 0 \b, 256-colors
10807
- >>8 byte >0 \b, %d-colors
10808
-
10809
-
10810
- # .chr files
10811
- 0 string PK\010\010BGI Borland font
10812
- >4 string >\0 %s
10813
- # then there is a copyright notice
10814
-
10815
-
10816
- # .bgi files
10817
- 0 string pk\010\010BGI Borland device
10818
- >4 string >\0 %s
10819
- # then there is a copyright notice
10820
-
10821
-
10822
- # Windows Recycle Bin record file (named INFO2)
10823
- # By Abel Cheung (abelcheung AT gmail dot com)
10824
- # Version 4 always has 280 bytes (0x118) per record, version 5 has 800 bytes
10825
- # Since Vista uses another structure, INFO2 structure probably won't change
10826
- # anymore. Detailed analysis in:
10827
- # http://www.cybersecurityinstitute.biz/downloads/INFO2.pdf
10828
- 0 lelong 0x00000004
10829
- >12 lelong 0x00000118 Windows Recycle Bin INFO2 file (Win98 or below)
10830
-
10831
- 0 lelong 0x00000005
10832
- >12 lelong 0x00000320 Windows Recycle Bin INFO2 file (Win2k - WinXP)
10833
-
10834
-
10835
- ##### put in Either Magic/font or Magic/news
10836
- # Acroread or something files wrongly identified as G3 .pfm
10837
- # these have the form \000 \001 any? \002 \000 \000
10838
- # or \000 \001 any? \022 \000 \000
10839
- 0 belong&0xffff00ff 0x00010012 PFM data
10840
- >4 string \000\000
10841
- >6 string >\060 - %s
10842
-
10843
- 0 belong&0xffff00ff 0x00010002 PFM data
10844
- >4 string \000\000
10845
- >6 string >\060 - %s
10846
- #0 string \000\001 pfm?
10847
- #>3 string \022\000\000Copyright\ yes
10848
- #>3 string \002\000\000Copyright\ yes
10849
- #>3 string >\0 oops, not a font file. Cancel that.
10850
- #it clashes with ttf files so put it lower down.
10851
-
10852
- # From Doug Lee via a FreeBSD pr
10853
- 9 string GERBILDOC First Choice document
10854
- 9 string GERBILDB First Choice database
10855
- 9 string GERBILCLIP First Choice database
10856
- 0 string GERBIL First Choice device file
10857
- 9 string RABBITGRAPH RabbitGraph file
10858
- 0 string DCU1 Borland Delphi .DCU file
10859
- 0 string =!<spell> MKS Spell hash list (old format)
10860
- 0 string =!<spell2> MKS Spell hash list
10861
- # Too simple - MPi
10862
- #0 string AH Halo(TM) bitmapped font file
10863
- 0 lelong 0x08086b70 TurboC BGI file
10864
- 0 lelong 0x08084b50 TurboC Font file
10865
-
10866
- # WARNING: below line conflicts with Infocom game data Z-machine 3
10867
- 0 byte 0x03 DBase 3 data file
10868
- >0x04 lelong 0 (no records)
10869
- >0x04 lelong >0 (%ld records)
10870
- 0 byte 0x83 DBase 3 data file with memo(s)
10871
- >0x04 lelong 0 (no records)
10872
- >0x04 lelong >0 (%ld records)
10873
- 0 leshort 0x0006 DBase 3 index file
10874
- 0 string PMCC Windows 3.x .GRP file
10875
- 1 string RDC-meg MegaDots
10876
- >8 byte >0x2F version %c
10877
- >9 byte >0x2F \b.%c file
10878
- 0 lelong 0x4C
10879
- >4 lelong 0x00021401 Windows shortcut file
10880
-
10881
- # DOS EPS Binary File Header
10882
- # From: Ed Sznyter <ews@Black.Market.NET>
10883
- 0 belong 0xC5D0D3C6 DOS EPS Binary File
10884
- >4 long >0 Postscript starts at byte %d
10885
- >>8 long >0 length %d
10886
- >>>12 long >0 Metafile starts at byte %d
10887
- >>>>16 long >0 length %d
10888
- >>>20 long >0 TIFF starts at byte %d
10889
- >>>>24 long >0 length %d
10890
-
10891
- # TNEF magic From "Joomy" <joomy@se-ed.net>
10892
- # Microsoft Outlook's Transport Neutral Encapsulation Format (TNEF)
10893
- 0 leshort 0x223e9f78 TNEF
10894
- !:mime application/vnd.ms-tnef
10895
-
10896
- # HtmlHelp files (.chm)
10897
- 0 string ITSF\003\000\000\000\x60\000\000\000\001\000\000\000 MS Windows HtmlHelp Data
10898
-
10899
- # GFA-BASIC (Wolfram Kleff)
10900
- 2 string GFA-BASIC3 GFA-BASIC 3 data
10901
-
10902
- #------------------------------------------------------------------------------
10903
- # From Stuart Caie <kyzer@4u.net> (developer of cabextract)
10904
- # Microsoft Cabinet files
10905
- 0 string MSCF\0\0\0\0 Microsoft Cabinet archive data
10906
- !:mime application/vnd.ms-cab-compressed
10907
- >8 lelong x \b, %u bytes
10908
- >28 leshort 1 \b, 1 file
10909
- >28 leshort >1 \b, %u files
10910
-
10911
- # InstallShield Cabinet files
10912
- 0 string ISc( InstallShield Cabinet archive data
10913
- >5 byte&0xf0 =0x60 version 6,
10914
- >5 byte&0xf0 !0x60 version 4/5,
10915
- >(12.l+40) lelong x %u files
10916
-
10917
- # Windows CE package files
10918
- 0 string MSCE\0\0\0\0 Microsoft WinCE install header
10919
- >20 lelong 0 \b, architecture-independent
10920
- >20 lelong 103 \b, Hitachi SH3
10921
- >20 lelong 104 \b, Hitachi SH4
10922
- >20 lelong 0xA11 \b, StrongARM
10923
- >20 lelong 4000 \b, MIPS R4000
10924
- >20 lelong 10003 \b, Hitachi SH3
10925
- >20 lelong 10004 \b, Hitachi SH3E
10926
- >20 lelong 10005 \b, Hitachi SH4
10927
- >20 lelong 70001 \b, ARM 7TDMI
10928
- >52 leshort 1 \b, 1 file
10929
- >52 leshort >1 \b, %u files
10930
- >56 leshort 1 \b, 1 registry entry
10931
- >56 leshort >1 \b, %u registry entries
10932
-
10933
-
10934
- # Windows Enhanced Metafile (EMF)
10935
- # See msdn.microsoft.com/archive/en-us/dnargdi/html/msdn_enhmeta.asp
10936
- # for further information.
10937
- 0 ulelong 1
10938
- >40 string \ EMF Windows Enhanced Metafile (EMF) image data
10939
- >>44 ulelong x version 0x%x
10940
-
10941
- # From: Alex Beregszaszi <alex@fsn.hu>
10942
- 0 string COWD VMWare3
10943
- >4 byte 3 disk image
10944
- >>32 lelong x (%d/
10945
- >>36 lelong x \b%d/
10946
- >>40 lelong x \b%d)
10947
- >4 byte 2 undoable disk image
10948
- >>32 string >\0 (%s)
10949
-
10950
- 0 string VMDK VMware4 disk image
10951
- 0 string KDMV VMware4 disk image
10952
-
10953
- #--------------------------------------------------------------------
10954
- # Qemu Emulator Images
10955
- # Lines written by Friedrich Schwittay (f.schwittay@yousable.de)
10956
- # Made by reading sources and doing trial and error on existing
10957
- # qcow files
10958
- 0 string QFI Qemu Image, Format: Qcow
10959
-
10960
- # Uncomment the following line to display Magic (only used for debugging
10961
- # this magic number)
10962
- #>0 string x , Magic: %s
10963
-
10964
- # There are currently 2 Versions: "1" and "2"
10965
- # I do not use Version 2 and therefor branch here
10966
- # but can assure: it works (tested on both versions)
10967
- # Also my Qemu 0.9.0 which uses this Version 2 refuses
10968
- # to start in its bios
10969
- >0x04 belong 2 , Version: 2
10970
- >0x04 belong 1 , Version: 1
10971
-
10972
- # Using the existence of the Backing File Offset to Branch or not
10973
- # to read Backing File Information
10974
- >>0xc belong >0 , Backing File( Offset: %lu
10975
- >>>(0xc.L) string >\0 , Path: %s
10976
-
10977
- # Didn't get the trick here how qemu stores the "Size" at this Position
10978
- # There is actually something stored but nothing makes sense
10979
- # The header in the sources talks about it
10980
- #>>>16 lelong x , Size: %lu
10981
-
10982
- # Modification time of the Backing File
10983
- # Really useful if you want to know if your backing
10984
- # file is still usable together with this image
10985
- >>>20 bedate x , Mtime: %s )
10986
-
10987
- # Don't know how to calculate in Magicfiles
10988
- # Also: this Information is not reliably
10989
- # stored in image-files
10990
- >>24 lelong x , Disk Size could be: %d * 256 bytes
10991
-
10992
- 0 string QEVM QEMU's suspend to disk image
10993
-
10994
- 0 string Bochs\ Virtual\ HD\ Image Bochs disk image,
10995
- >32 string x type %s,
10996
- >48 string x subtype %s
10997
-
10998
- 0 lelong 0x02468ace Bochs Sparse disk image
10999
-
11000
- # from http://filext.com by Derek M Jones <derek@knosof.co.uk>
11001
- # False positive with PPT (also currently this string is too long)
11002
- #0 string \xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF\x09\x00\x06 Microsoft Installer
11003
- 0 string \320\317\021\340\241\261\032\341 Microsoft Office Document
11004
- #>48 byte 0x1B Excel Document
11005
- #!:mime application/vnd.ms-excel
11006
- >546 string bjbj Microsoft Word Document
11007
- !:mime application/msword
11008
- >546 string jbjb Microsoft Word Document
11009
- !:mime application/msword
11010
-
11011
- 0 string \224\246\056 Microsoft Word Document
11012
- !:mime application/msword
11013
-
11014
- 512 string R\0o\0o\0t\0\ \0E\0n\0t\0r\0y Microsoft Word Document
11015
- !:mime application/msword
11016
-
11017
- # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
11018
- # Magic type for Dell's BIOS .hdr files
11019
- # Dell's .hdr
11020
- 0 string $RBU
11021
- >23 string Dell %s system BIOS
11022
- >48 string x version %.3s
11023
-
11024
- # Type: Microsoft DirectDraw Surface
11025
- # URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
11026
- # From: Morten Hustveit <morten@debian.org>
11027
- 0 string DDS\040\174\000\000\000 Microsoft DirectDraw Surface (DDS),
11028
- >16 lelong >0 %hd x
11029
- >12 lelong >0 %hd,
11030
- >84 string x %.4s
11031
-
11032
- # Type: Microsoft Document Imaging Format (.mdi)
11033
- # URL: http://en.wikipedia.org/wiki/Microsoft_Document_Imaging_Format
11034
- # From: Daniele Sempione <scrows@oziosi.org>
11035
- 0 short 0x5045 Microsoft Document Imaging Format
11036
-
11037
- # MS eBook format (.lit)
11038
- 0 string ITOLITLS Microsoft Reader eBook Data
11039
- >8 lelong x \b, version %u
11040
- !:mime application/x-ms-reader
11041
-
11042
- #------------------------------------------------------------------------------
11043
- # msvc: file(1) magic for msvc
11044
- # "H. Nanosecond" <aldomel@ix.netcom.com>
11045
- # Microsoft visual C
11046
- #
11047
- # I have version 1.0
11048
-
11049
- # .aps
11050
- 0 string HWB\000\377\001\000\000\000 Microsoft Visual C .APS file
11051
-
11052
- # .ide
11053
- #too long 0 string \102\157\162\154\141\156\144\040\103\053\053\040\120\162\157\152\145\143\164\040\106\151\154\145\012\000\032\000\002\000\262\000\272\276\372\316 MSVC .ide
11054
- 0 string \102\157\162\154\141\156\144\040\103\053\053\040\120\162\157 MSVC .ide
11055
-
11056
- # .res
11057
- 0 string \000\000\000\000\040\000\000\000\377 MSVC .res
11058
- 0 string \377\003\000\377\001\000\020\020\350 MSVC .res
11059
- 0 string \377\003\000\377\001\000\060\020\350 MSVC .res
11060
-
11061
- #.lib
11062
- 0 string \360\015\000\000 Microsoft Visual C library
11063
- 0 string \360\075\000\000 Microsoft Visual C library
11064
- 0 string \360\175\000\000 Microsoft Visual C library
11065
-
11066
- #.pch
11067
- 0 string DTJPCH0\000\022\103\006\200 Microsoft Visual C .pch
11068
-
11069
- # .pdb
11070
- # too long 0 string Microsoft\ C/C++\ program\ database\
11071
- 0 string Microsoft\ C/C++\ MSVC program database
11072
- >18 string program\ database\
11073
- >33 string >\0 ver %s
11074
-
11075
- #.sbr
11076
- 0 string \000\002\000\007\000 MSVC .sbr
11077
- >5 string >\0 %s
11078
-
11079
- #.bsc
11080
- 0 string \002\000\002\001 MSVC .bsc
11081
-
11082
- #.wsp
11083
- 0 string 1.00\ .0000.0000\000\003 MSVC .wsp version 1.0000.0000
11084
- # these seem to start with the version and contain menus
11085
- # ------------------------------------------------------------------------
11086
- # mup: file(1) magic for Mup (Music Publisher) input file.
11087
- #
11088
- # From: Abel Cheung <abel (@) oaka.org>
11089
- #
11090
- # NOTE: This header is mainly proposed in the Arkkra mailing list,
11091
- # and is not a mandatory header because of old mup input file
11092
- # compatibility. Noteedit also use mup format, but is not forcing
11093
- # user to use any header as well.
11094
- #
11095
- 0 search/1 //!Mup Mup music publication program input text
11096
- >6 string -Arkkra (Arkkra)
11097
- >>13 string -
11098
- >>>16 string .
11099
- >>>>14 string x \b, need V%.4s
11100
- >>>15 string .
11101
- >>>>14 string x \b, need V%.3s
11102
- >6 string -
11103
- >>9 string .
11104
- >>>7 string x \b, need V%.4s
11105
- >>8 string .
11106
- >>>7 string x \b, need V%.3s
11107
-
11108
- #-----------------------------------------------------------------------------
11109
- # natinst: file(1) magic for National Instruments Code Files
11110
-
11111
- #
11112
- # From <egamez@fcfm.buap.mx> Enrique G�mez-Flores
11113
- # version 1
11114
- # Many formats still missing, we use, for the moment LabVIEW
11115
- # We guess VXI format file. VISA, LabWindowsCVI, BridgeVIEW, etc, are missing
11116
- #
11117
- 0 string RSRC National Instruments,
11118
- # Check if it's a LabVIEW File
11119
- >8 string LV LabVIEW File,
11120
- # Check wich kind of file is
11121
- >>10 string SB Code Resource File, data
11122
- >>10 string IN Virtual Instrument Program, data
11123
- >>10 string AR VI Library, data
11124
- # This is for Menu Libraries
11125
- >8 string LMNULBVW Portable File Names, data
11126
- # This is for General Resources
11127
- >8 string rsc Resources File, data
11128
- # This is for VXI Package
11129
- 0 string VMAP National Instruments, VXI File, data
11130
-
11131
- #------------------------------------------------------------------------------
11132
- # ncr: file(1) magic for NCR Tower objects
11133
- #
11134
- # contributed by
11135
- # Michael R. Wayne *** TMC & Associates *** INTERNET: wayne@ford-vax.arpa
11136
- # uucp: {philabs | pyramid} !fmsrl7!wayne OR wayne@fmsrl7.UUCP
11137
- #
11138
- 0 beshort 000610 Tower/XP rel 2 object
11139
- >12 belong >0 not stripped
11140
- >20 beshort 0407 executable
11141
- >20 beshort 0410 pure executable
11142
- >22 beshort >0 - version %ld
11143
- 0 beshort 000615 Tower/XP rel 2 object
11144
- >12 belong >0 not stripped
11145
- >20 beshort 0407 executable
11146
- >20 beshort 0410 pure executable
11147
- >22 beshort >0 - version %ld
11148
- 0 beshort 000620 Tower/XP rel 3 object
11149
- >12 belong >0 not stripped
11150
- >20 beshort 0407 executable
11151
- >20 beshort 0410 pure executable
11152
- >22 beshort >0 - version %ld
11153
- 0 beshort 000625 Tower/XP rel 3 object
11154
- >12 belong >0 not stripped
11155
- >20 beshort 0407 executable
11156
- >20 beshort 0410 pure executable
11157
- >22 beshort >0 - version %ld
11158
- 0 beshort 000630 Tower32/600/400 68020 object
11159
- >12 belong >0 not stripped
11160
- >20 beshort 0407 executable
11161
- >20 beshort 0410 pure executable
11162
- >22 beshort >0 - version %ld
11163
- 0 beshort 000640 Tower32/800 68020
11164
- >18 beshort &020000 w/68881 object
11165
- >18 beshort &040000 compatible object
11166
- >18 beshort &060000 object
11167
- >20 beshort 0407 executable
11168
- >20 beshort 0413 pure executable
11169
- >12 belong >0 not stripped
11170
- >22 beshort >0 - version %ld
11171
- 0 beshort 000645 Tower32/800 68010
11172
- >18 beshort &040000 compatible object
11173
- >18 beshort &060000 object
11174
- >20 beshort 0407 executable
11175
- >20 beshort 0413 pure executable
11176
- >12 belong >0 not stripped
11177
- >22 beshort >0 - version %ld
11178
-
11179
- #------------------------------------------------------------------------------
11180
- # netbsd: file(1) magic for NetBSD objects
11181
- #
11182
- # All new-style magic numbers are in network byte order.
11183
- #
11184
-
11185
- 0 lelong 000000407 a.out NetBSD little-endian object file
11186
- >16 lelong >0 not stripped
11187
- 0 belong 000000407 a.out NetBSD big-endian object file
11188
- >16 belong >0 not stripped
11189
-
11190
- 0 belong&0377777777 041400413 a.out NetBSD/i386 demand paged
11191
- >0 byte &0x80
11192
- >>20 lelong <4096 shared library
11193
- >>20 lelong =4096 dynamically linked executable
11194
- >>20 lelong >4096 dynamically linked executable
11195
- >0 byte ^0x80 executable
11196
- >16 lelong >0 not stripped
11197
- 0 belong&0377777777 041400410 a.out NetBSD/i386 pure
11198
- >0 byte &0x80 dynamically linked executable
11199
- >0 byte ^0x80 executable
11200
- >16 lelong >0 not stripped
11201
- 0 belong&0377777777 041400407 a.out NetBSD/i386
11202
- >0 byte &0x80 dynamically linked executable
11203
- >0 byte ^0x80
11204
- >>0 byte &0x40 position independent
11205
- >>20 lelong !0 executable
11206
- >>20 lelong =0 object file
11207
- >16 lelong >0 not stripped
11208
- 0 belong&0377777777 041400507 a.out NetBSD/i386 core
11209
- >12 string >\0 from '%s'
11210
- >32 lelong !0 (signal %d)
11211
-
11212
- 0 belong&0377777777 041600413 a.out NetBSD/m68k demand paged
11213
- >0 byte &0x80
11214
- >>20 belong <8192 shared library
11215
- >>20 belong =8192 dynamically linked executable
11216
- >>20 belong >8192 dynamically linked executable
11217
- >0 byte ^0x80 executable
11218
- >16 belong >0 not stripped
11219
- 0 belong&0377777777 041600410 a.out NetBSD/m68k pure
11220
- >0 byte &0x80 dynamically linked executable
11221
- >0 byte ^0x80 executable
11222
- >16 belong >0 not stripped
11223
- 0 belong&0377777777 041600407 a.out NetBSD/m68k
11224
- >0 byte &0x80 dynamically linked executable
11225
- >0 byte ^0x80
11226
- >>0 byte &0x40 position independent
11227
- >>20 belong !0 executable
11228
- >>20 belong =0 object file
11229
- >16 belong >0 not stripped
11230
- 0 belong&0377777777 041600507 a.out NetBSD/m68k core
11231
- >12 string >\0 from '%s'
11232
- >32 belong !0 (signal %d)
11233
-
11234
- 0 belong&0377777777 042000413 a.out NetBSD/m68k4k demand paged
11235
- >0 byte &0x80
11236
- >>20 belong <4096 shared library
11237
- >>20 belong =4096 dynamically linked executable
11238
- >>20 belong >4096 dynamically linked executable
11239
- >0 byte ^0x80 executable
11240
- >16 belong >0 not stripped
11241
- 0 belong&0377777777 042000410 a.out NetBSD/m68k4k pure
11242
- >0 byte &0x80 dynamically linked executable
11243
- >0 byte ^0x80 executable
11244
- >16 belong >0 not stripped
11245
- 0 belong&0377777777 042000407 a.out NetBSD/m68k4k
11246
- >0 byte &0x80 dynamically linked executable
11247
- >0 byte ^0x80
11248
- >>0 byte &0x40 position independent
11249
- >>20 belong !0 executable
11250
- >>20 belong =0 object file
11251
- >16 belong >0 not stripped
11252
- 0 belong&0377777777 042000507 a.out NetBSD/m68k4k core
11253
- >12 string >\0 from '%s'
11254
- >32 belong !0 (signal %d)
11255
-
11256
- 0 belong&0377777777 042200413 a.out NetBSD/ns32532 demand paged
11257
- >0 byte &0x80
11258
- >>20 lelong <4096 shared library
11259
- >>20 lelong =4096 dynamically linked executable
11260
- >>20 lelong >4096 dynamically linked executable
11261
- >0 byte ^0x80 executable
11262
- >16 lelong >0 not stripped
11263
- 0 belong&0377777777 042200410 a.out NetBSD/ns32532 pure
11264
- >0 byte &0x80 dynamically linked executable
11265
- >0 byte ^0x80 executable
11266
- >16 lelong >0 not stripped
11267
- 0 belong&0377777777 042200407 a.out NetBSD/ns32532
11268
- >0 byte &0x80 dynamically linked executable
11269
- >0 byte ^0x80
11270
- >>0 byte &0x40 position independent
11271
- >>20 lelong !0 executable
11272
- >>20 lelong =0 object file
11273
- >16 lelong >0 not stripped
11274
- 0 belong&0377777777 042200507 a.out NetBSD/ns32532 core
11275
- >12 string >\0 from '%s'
11276
- >32 lelong !0 (signal %d)
11277
-
11278
- 0 belong&0377777777 045200507 a.out NetBSD/powerpc core
11279
- >12 string >\0 from '%s'
11280
-
11281
- 0 belong&0377777777 042400413 a.out NetBSD/sparc demand paged
11282
- >0 byte &0x80
11283
- >>20 belong <8192 shared library
11284
- >>20 belong =8192 dynamically linked executable
11285
- >>20 belong >8192 dynamically linked executable
11286
- >0 byte ^0x80 executable
11287
- >16 belong >0 not stripped
11288
- 0 belong&0377777777 042400410 a.out NetBSD/sparc pure
11289
- >0 byte &0x80 dynamically linked executable
11290
- >0 byte ^0x80 executable
11291
- >16 belong >0 not stripped
11292
- 0 belong&0377777777 042400407 a.out NetBSD/sparc
11293
- >0 byte &0x80 dynamically linked executable
11294
- >0 byte ^0x80
11295
- >>0 byte &0x40 position independent
11296
- >>20 belong !0 executable
11297
- >>20 belong =0 object file
11298
- >16 belong >0 not stripped
11299
- 0 belong&0377777777 042400507 a.out NetBSD/sparc core
11300
- >12 string >\0 from '%s'
11301
- >32 belong !0 (signal %d)
11302
-
11303
- 0 belong&0377777777 042600413 a.out NetBSD/pmax demand paged
11304
- >0 byte &0x80
11305
- >>20 lelong <4096 shared library
11306
- >>20 lelong =4096 dynamically linked executable
11307
- >>20 lelong >4096 dynamically linked executable
11308
- >0 byte ^0x80 executable
11309
- >16 lelong >0 not stripped
11310
- 0 belong&0377777777 042600410 a.out NetBSD/pmax pure
11311
- >0 byte &0x80 dynamically linked executable
11312
- >0 byte ^0x80 executable
11313
- >16 lelong >0 not stripped
11314
- 0 belong&0377777777 042600407 a.out NetBSD/pmax
11315
- >0 byte &0x80 dynamically linked executable
11316
- >0 byte ^0x80
11317
- >>0 byte &0x40 position independent
11318
- >>20 lelong !0 executable
11319
- >>20 lelong =0 object file
11320
- >16 lelong >0 not stripped
11321
- 0 belong&0377777777 042600507 a.out NetBSD/pmax core
11322
- >12 string >\0 from '%s'
11323
- >32 lelong !0 (signal %d)
11324
-
11325
- 0 belong&0377777777 043000413 a.out NetBSD/vax 1k demand paged
11326
- >0 byte &0x80
11327
- >>20 lelong <4096 shared library
11328
- >>20 lelong =4096 dynamically linked executable
11329
- >>20 lelong >4096 dynamically linked executable
11330
- >0 byte ^0x80 executable
11331
- >16 lelong >0 not stripped
11332
- 0 belong&0377777777 043000410 a.out NetBSD/vax 1k pure
11333
- >0 byte &0x80 dynamically linked executable
11334
- >0 byte ^0x80 executable
11335
- >16 lelong >0 not stripped
11336
- 0 belong&0377777777 043000407 a.out NetBSD/vax 1k
11337
- >0 byte &0x80 dynamically linked executable
11338
- >0 byte ^0x80
11339
- >>0 byte &0x40 position independent
11340
- >>20 lelong !0 executable
11341
- >>20 lelong =0 object file
11342
- >16 lelong >0 not stripped
11343
- 0 belong&0377777777 043000507 a.out NetBSD/vax 1k core
11344
- >12 string >\0 from '%s'
11345
- >32 lelong !0 (signal %d)
11346
-
11347
- 0 belong&0377777777 045400413 a.out NetBSD/vax 4k demand paged
11348
- >0 byte &0x80
11349
- >>20 lelong <4096 shared library
11350
- >>20 lelong =4096 dynamically linked executable
11351
- >>20 lelong >4096 dynamically linked executable
11352
- >0 byte ^0x80 executable
11353
- >16 lelong >0 not stripped
11354
- 0 belong&0377777777 045400410 a.out NetBSD/vax 4k pure
11355
- >0 byte &0x80 dynamically linked executable
11356
- >0 byte ^0x80 executable
11357
- >16 lelong >0 not stripped
11358
- 0 belong&0377777777 045400407 a.out NetBSD/vax 4k
11359
- >0 byte &0x80 dynamically linked executable
11360
- >0 byte ^0x80
11361
- >>0 byte &0x40 position independent
11362
- >>20 lelong !0 executable
11363
- >>20 lelong =0 object file
11364
- >16 lelong >0 not stripped
11365
- 0 belong&0377777777 045400507 a.out NetBSD/vax 4k core
11366
- >12 string >\0 from '%s'
11367
- >32 lelong !0 (signal %d)
11368
-
11369
- # NetBSD/alpha does not support (and has never supported) a.out objects,
11370
- # so no rules are provided for them. NetBSD/alpha ELF objects are
11371
- # dealt with in "elf".
11372
- 0 lelong 0x00070185 ECOFF NetBSD/alpha binary
11373
- >10 leshort 0x0001 not stripped
11374
- >10 leshort 0x0000 stripped
11375
- 0 belong&0377777777 043200507 a.out NetBSD/alpha core
11376
- >12 string >\0 from '%s'
11377
- >32 lelong !0 (signal %d)
11378
-
11379
- 0 belong&0377777777 043400413 a.out NetBSD/mips demand paged
11380
- >0 byte &0x80
11381
- >>20 belong <8192 shared library
11382
- >>20 belong =8192 dynamically linked executable
11383
- >>20 belong >8192 dynamically linked executable
11384
- >0 byte ^0x80 executable
11385
- >16 belong >0 not stripped
11386
- 0 belong&0377777777 043400410 a.out NetBSD/mips pure
11387
- >0 byte &0x80 dynamically linked executable
11388
- >0 byte ^0x80 executable
11389
- >16 belong >0 not stripped
11390
- 0 belong&0377777777 043400407 a.out NetBSD/mips
11391
- >0 byte &0x80 dynamically linked executable
11392
- >0 byte ^0x80
11393
- >>0 byte &0x40 position independent
11394
- >>20 belong !0 executable
11395
- >>20 belong =0 object file
11396
- >16 belong >0 not stripped
11397
- 0 belong&0377777777 043400507 a.out NetBSD/mips core
11398
- >12 string >\0 from '%s'
11399
- >32 belong !0 (signal %d)
11400
-
11401
- 0 belong&0377777777 043600413 a.out NetBSD/arm32 demand paged
11402
- >0 byte &0x80
11403
- >>20 lelong <4096 shared library
11404
- >>20 lelong =4096 dynamically linked executable
11405
- >>20 lelong >4096 dynamically linked executable
11406
- >0 byte ^0x80 executable
11407
- >16 lelong >0 not stripped
11408
- 0 belong&0377777777 043600410 a.out NetBSD/arm32 pure
11409
- >0 byte &0x80 dynamically linked executable
11410
- >0 byte ^0x80 executable
11411
- >16 lelong >0 not stripped
11412
- 0 belong&0377777777 043600407 a.out NetBSD/arm32
11413
- >0 byte &0x80 dynamically linked executable
11414
- >0 byte ^0x80
11415
- >>0 byte &0x40 position independent
11416
- >>20 lelong !0 executable
11417
- >>20 lelong =0 object file
11418
- >16 lelong >0 not stripped
11419
- # NetBSD/arm26 has always used ELF objects, but it shares a core file
11420
- # format with NetBSD/arm32.
11421
- 0 belong&0377777777 043600507 a.out NetBSD/arm core
11422
- >12 string >\0 from '%s'
11423
- >32 lelong !0 (signal %d)
11424
-
11425
- #------------------------------------------------------------------------------
11426
- # netscape: file(1) magic for Netscape files
11427
- # "H. Nanosecond" <aldomel@ix.netcom.com>
11428
- # version 3 and 4 I think
11429
- #
11430
-
11431
- # Netscape Address book .nab
11432
- 0 string \000\017\102\104\000\000\000\000\000\000\001\000\000\000\000\002\000\000\000\002\000\000\004\000 Netscape Address book
11433
-
11434
- # Netscape Communicator address book
11435
- 0 string \000\017\102\111 Netscape Communicator address book
11436
-
11437
- # .snm Caches
11438
- 0 string #\ Netscape\ folder\ cache Netscape folder cache
11439
- 0 string \000\036\204\220\000 Netscape folder cache
11440
- # .n2p
11441
- # Net 2 Phone
11442
- #0 string 123\130\071\066\061\071\071\071\060\070\061\060\061\063\060
11443
- 0 string SX961999 Net2phone
11444
-
11445
- #
11446
- #This is files ending in .art, FIXME add more rules
11447
- 0 string JG\004\016\0\0\0\0 ART
11448
-
11449
- #------------------------------------------------------------------------------
11450
- # netware: file(1) magic for NetWare Loadable Modules (NLMs)
11451
- # From: Mads Martin Joergensen <mmj@suse.de>
11452
-
11453
- 0 string NetWare\ Loadable\ Module NetWare Loadable Module
11454
-
11455
- #------------------------------------------------------------------------------
11456
- # news: file(1) magic for SunOS NeWS fonts (not "news" as in "netnews")
11457
- #
11458
- 0 string StartFontMetrics ASCII font metrics
11459
- 0 string StartFont ASCII font bits
11460
- 0 belong 0x137A2944 NeWS bitmap font
11461
- 0 belong 0x137A2947 NeWS font family
11462
- 0 belong 0x137A2950 scalable OpenFont binary
11463
- 0 belong 0x137A2951 encrypted scalable OpenFont binary
11464
- 8 belong 0x137A2B45 X11/NeWS bitmap font
11465
- 8 belong 0x137A2B48 X11/NeWS font family
11466
- #------------------------------------------------------------------------------
11467
- # nitpicker: file(1) magic for Flowfiles.
11468
- # From: Christian Jachmann <C.Jachmann@gmx.net> http://www.nitpicker.de
11469
- 0 string NPFF NItpicker Flow File
11470
- >4 byte x V%d.
11471
- >5 byte x %d
11472
- >6 bedate x started: %s
11473
- >10 bedate x stopped: %s
11474
- >14 belong x Bytes: %u
11475
- >18 belong x Bytes1: %u
11476
- >22 belong x Flows: %u
11477
- >26 belong x Pkts: %u
11478
-
11479
- #------------------------------------------------------------------------------
11480
- # ocaml: file(1) magic for Objective Caml files.
11481
- 0 string Caml1999 OCaml
11482
- >8 string X exec file
11483
- >8 string I interface file (.cmi)
11484
- >8 string O object file (.cmo)
11485
- >8 string A library file (.cma)
11486
- >8 string Y native object file (.cmx)
11487
- >8 string Z native library file (.cmxa)
11488
- >8 string M abstract syntax tree implementation file
11489
- >8 string N abstract syntax tree interface file
11490
- >9 string >\0 (Version %3.3s)
11491
- #------------------------------------------------------------------------------
11492
- # octave binary data file(1) magic, from Dirk Eddelbuettel <edd@debian.org>
11493
- 0 string Octave-1-L Octave binary data (little endian)
11494
- 0 string Octave-1-B Octave binary data (big endian)
11495
-
11496
- #------------------------------------------------------------------------------
11497
- # Microsoft OLE 2 Compound Documents : file(1) magic for Microsoft Structured
11498
- # storage (http://en.wikipedia.org/wiki/Structured_Storage)
11499
- # Additional tests for OLE 2 Compound Documents should be under this recipe.
11500
-
11501
- 0 string \320\317\021\340\241\261\032\341 OLE 2 Compound Document
11502
- # - Microstation V8 DGN files (www.bentley.com)
11503
- # Last update on 10/23/2006 by Lester Hightower
11504
- > 0x480 string D\000g\000n\000~\000H : Microstation V8 DGN
11505
- # - Visio documents
11506
- # Last update on 10/23/2006 by Lester Hightower
11507
- > 0x480 string V\000i\000s\000i\000o\000D\000o\000c : Visio Document
11508
-
11509
- #------------------------------------------------------------------------------
11510
- # olf: file(1) magic for OLF executables
11511
- #
11512
- # We have to check the byte order flag to see what byte order all the
11513
- # other stuff in the header is in.
11514
- #
11515
- # MIPS R3000 may also be for MIPS R2000.
11516
- # What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
11517
- #
11518
- # Created by Erik Theisen <etheisen@openbsd.org>
11519
- # Based on elf from Daniel Quinlan <quinlan@yggdrasil.com>
11520
- 0 string \177OLF OLF
11521
- >4 byte 0 invalid class
11522
- >4 byte 1 32-bit
11523
- >4 byte 2 64-bit
11524
- >7 byte 0 invalid os
11525
- >7 byte 1 OpenBSD
11526
- >7 byte 2 NetBSD
11527
- >7 byte 3 FreeBSD
11528
- >7 byte 4 4.4BSD
11529
- >7 byte 5 Linux
11530
- >7 byte 6 SVR4
11531
- >7 byte 7 esix
11532
- >7 byte 8 Solaris
11533
- >7 byte 9 Irix
11534
- >7 byte 10 SCO
11535
- >7 byte 11 Dell
11536
- >7 byte 12 NCR
11537
- >5 byte 0 invalid byte order
11538
- >5 byte 1 LSB
11539
- >>16 leshort 0 no file type,
11540
- >>16 leshort 1 relocatable,
11541
- >>16 leshort 2 executable,
11542
- >>16 leshort 3 shared object,
11543
- # Core handling from Peter Tobias <tobias@server.et-inf.fho-emden.de>
11544
- # corrections by Christian 'Dr. Disk' Hechelmann <drdisk@ds9.au.s.shuttle.de>
11545
- >>16 leshort 4 core file
11546
- >>>(0x38+0xcc) string >\0 of '%s'
11547
- >>>(0x38+0x10) lelong >0 (signal %d),
11548
- >>16 leshort &0xff00 processor-specific,
11549
- >>18 leshort 0 no machine,
11550
- >>18 leshort 1 AT&T WE32100 - invalid byte order,
11551
- >>18 leshort 2 SPARC - invalid byte order,
11552
- >>18 leshort 3 Intel 80386,
11553
- >>18 leshort 4 Motorola 68000 - invalid byte order,
11554
- >>18 leshort 5 Motorola 88000 - invalid byte order,
11555
- >>18 leshort 6 Intel 80486,
11556
- >>18 leshort 7 Intel 80860,
11557
- >>18 leshort 8 MIPS R3000_BE - invalid byte order,
11558
- >>18 leshort 9 Amdahl - invalid byte order,
11559
- >>18 leshort 10 MIPS R3000_LE,
11560
- >>18 leshort 11 RS6000 - invalid byte order,
11561
- >>18 leshort 15 PA-RISC - invalid byte order,
11562
- >>18 leshort 16 nCUBE,
11563
- >>18 leshort 17 VPP500,
11564
- >>18 leshort 18 SPARC32PLUS,
11565
- >>18 leshort 20 PowerPC,
11566
- >>18 leshort 0x9026 Alpha,
11567
- >>20 lelong 0 invalid version
11568
- >>20 lelong 1 version 1
11569
- >>36 lelong 1 MathCoPro/FPU/MAU Required
11570
- >8 string >\0 (%s)
11571
- >5 byte 2 MSB
11572
- >>16 beshort 0 no file type,
11573
- >>16 beshort 1 relocatable,
11574
- >>16 beshort 2 executable,
11575
- >>16 beshort 3 shared object,
11576
- >>16 beshort 4 core file,
11577
- >>>(0x38+0xcc) string >\0 of '%s'
11578
- >>>(0x38+0x10) belong >0 (signal %d),
11579
- >>16 beshort &0xff00 processor-specific,
11580
- >>18 beshort 0 no machine,
11581
- >>18 beshort 1 AT&T WE32100,
11582
- >>18 beshort 2 SPARC,
11583
- >>18 beshort 3 Intel 80386 - invalid byte order,
11584
- >>18 beshort 4 Motorola 68000,
11585
- >>18 beshort 5 Motorola 88000,
11586
- >>18 beshort 6 Intel 80486 - invalid byte order,
11587
- >>18 beshort 7 Intel 80860,
11588
- >>18 beshort 8 MIPS R3000_BE,
11589
- >>18 beshort 9 Amdahl,
11590
- >>18 beshort 10 MIPS R3000_LE - invalid byte order,
11591
- >>18 beshort 11 RS6000,
11592
- >>18 beshort 15 PA-RISC,
11593
- >>18 beshort 16 nCUBE,
11594
- >>18 beshort 17 VPP500,
11595
- >>18 beshort 18 SPARC32PLUS,
11596
- >>18 beshort 20 PowerPC or cisco 4500,
11597
- >>18 beshort 21 cisco 7500,
11598
- >>18 beshort 24 cisco SVIP,
11599
- >>18 beshort 25 cisco 7200,
11600
- >>18 beshort 36 cisco 12000,
11601
- >>18 beshort 0x9026 Alpha,
11602
- >>20 belong 0 invalid version
11603
- >>20 belong 1 version 1
11604
- >>36 belong 1 MathCoPro/FPU/MAU Required
11605
- #------------------------------------------------------------------------------
11606
- # os2: file(1) magic for OS/2 files
11607
- #
11608
-
11609
- # Provided 1998/08/22 by
11610
- # David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
11611
- 1 search/1 InternetShortcut MS Windows 95 Internet shortcut text
11612
- >24 search/1 >\ (URL=<%s>)
11613
-
11614
- # OS/2 URL objects
11615
- # Provided 1998/08/22 by
11616
- # David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
11617
- #0 string http: OS/2 URL object text
11618
- #>5 string >\ (WWW) <http:%s>
11619
- #0 string mailto: OS/2 URL object text
11620
- #>7 string >\ (email) <%s>
11621
- #0 string news: OS/2 URL object text
11622
- #>5 string >\ (Usenet) <%s>
11623
- #0 string ftp: OS/2 URL object text
11624
- #>4 string >\ (FTP) <ftp:%s>
11625
- #0 string file: OS/2 URL object text
11626
- #>5 string >\ (Local file) <%s>
11627
-
11628
- # >>>>> OS/2 INF/HLP <<<<< (source: Daniel Dissett ddissett@netcom.com)
11629
- # Carl Hauser (chauser.parc@xerox.com) and
11630
- # Marcus Groeber (marcusg@ph-cip.uni-koeln.de)
11631
- # list the following header format in inf02a.doc:
11632
- #
11633
- # int16 ID; // ID magic word (5348h = "HS")
11634
- # int8 unknown1; // unknown purpose, could be third letter of ID
11635
- # int8 flags; // probably a flag word...
11636
- # // bit 0: set if INF style file
11637
- # // bit 4: set if HLP style file
11638
- # // patching this byte allows reading HLP files
11639
- # // using the VIEW command, while help files
11640
- # // seem to work with INF settings here as well.
11641
- # int16 hdrsize; // total size of header
11642
- # int16 unknown2; // unknown purpose
11643
- #
11644
- 0 string HSP\x01\x9b\x00 OS/2 INF
11645
- >107 string >0 (%s)
11646
- 0 string HSP\x10\x9b\x00 OS/2 HLP
11647
- >107 string >0 (%s)
11648
-
11649
- # OS/2 INI (this is a guess)
11650
- 0 string \xff\xff\xff\xff\x14\0\0\0 OS/2 INI
11651
- #------------------------------------------------------------------------------
11652
- # os400: file(1) magic for IBM OS/400 files
11653
- #
11654
- # IBM OS/400 (i5/OS) Save file (SAVF) - gerardo.cacciari@gmail.com
11655
- # In spite of its quite variable format (due to internal memory page
11656
- # length differences between CISC and RISC versions of the OS) the
11657
- # SAVF structure hasn't suitable offsets to identify the catalog
11658
- # header in the first descriptor where there are some useful infos,
11659
- # so we must search in a somewhat large area for a particular string
11660
- # that represents the EBCDIC encoding of 'QSRDSSPC' (save/restore
11661
- # descriptor space) preceded by a two byte constant.
11662
- #
11663
- 1090 search/7393 \x19\xDB\xD8\xE2\xD9\xC4\xE2\xE2\xD7\xC3 IBM OS/400 save file data
11664
- >&212 byte 0x01 \b, created with SAVOBJ
11665
- >&212 byte 0x02 \b, created with SAVLIB
11666
- >&212 byte 0x07 \b, created with SAVCFG
11667
- >&212 byte 0x08 \b, created with SAVSECDTA
11668
- >&212 byte 0x0A \b, created with SAVSECDTA
11669
- >&212 byte 0x0B \b, created with SAVDLO
11670
- >&212 byte 0x0D \b, created with SAVLICPGM
11671
- >&212 byte 0x11 \b, created with SAVCHGOBJ
11672
- >&213 byte 0x44 \b, at least V5R4 to open
11673
- >&213 byte 0x43 \b, at least V5R3 to open
11674
- >&213 byte 0x42 \b, at least V5R2 to open
11675
- >&213 byte 0x41 \b, at least V5R1 to open
11676
- >&213 byte 0x40 \b, at least V4R5 to open
11677
- >&213 byte 0x3F \b, at least V4R4 to open
11678
- >&213 byte 0x3E \b, at least V4R3 to open
11679
- >&213 byte 0x3C \b, at least V4R2 to open
11680
- >&213 byte 0x3D \b, at least V4R1M4 to open
11681
- >&213 byte 0x3B \b, at least V4R1 to open
11682
- >&213 byte 0x3A \b, at least V3R7 to open
11683
- >&213 byte 0x35 \b, at least V3R6 to open
11684
- >&213 byte 0x36 \b, at least V3R2 to open
11685
- >&213 byte 0x34 \b, at least V3R1 to open
11686
- >&213 byte 0x31 \b, at least V3R0M5 to open
11687
- >&213 byte 0x30 \b, at least V2R3 to open
11688
- #
11689
- # Copyright (c) 1996 Ignatios Souvatzis. All rights reserved.
11690
- #
11691
- # Redistribution and use in source and binary forms, with or without
11692
- # modification, are permitted provided that the following conditions
11693
- # are met:
11694
- # 1. Redistributions of source code must retain the above copyright
11695
- # notice, this list of conditions and the following disclaimer.
11696
- # 2. Redistributions in binary form must reproduce the above copyright
11697
- # notice, this list of conditions and the following disclaimer in the
11698
- # documentation and/or other materials provided with the distribution.
11699
- # 3. All advertising materials mentioning features or use of this software
11700
- # must display the following acknowledgement:
11701
- # This product includes software developed by Ignatios Souvatzis for
11702
- # the NetBSD project.
11703
- # 4. The name of the author may not be used to endorse or promote products
11704
- # derived from this software without specific prior written permission.
11705
- #
11706
- #
11707
- # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
11708
- # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
11709
- # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11710
- # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
11711
- # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
11712
- # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
11713
- # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
11714
- # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
11715
- # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
11716
- # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11717
- #
11718
- #
11719
- #
11720
- # OS9/6809 module descriptions:
11721
- #
11722
- 0 beshort 0x87CD OS9/6809 module:
11723
- #
11724
- >6 byte&0x0f 0x00 non-executable
11725
- >6 byte&0x0f 0x01 machine language
11726
- >6 byte&0x0f 0x02 BASIC I-code
11727
- >6 byte&0x0f 0x03 Pascal P-code
11728
- >6 byte&0x0f 0x04 C I-code
11729
- >6 byte&0x0f 0x05 COBOL I-code
11730
- >6 byte&0x0f 0x06 Fortran I-code
11731
- #
11732
- >6 byte&0xf0 0x10 program executable
11733
- >6 byte&0xf0 0x20 subroutine
11734
- >6 byte&0xf0 0x30 multi-module
11735
- >6 byte&0xf0 0x40 data module
11736
- #
11737
- >6 byte&0xf0 0xC0 system module
11738
- >6 byte&0xf0 0xD0 file manager
11739
- >6 byte&0xf0 0xE0 device driver
11740
- >6 byte&0xf0 0xF0 device descriptor
11741
- #
11742
- # OS9/m68k stuff (to be continued)
11743
- #
11744
- 0 beshort 0x4AFC OS9/68K module:
11745
- #
11746
- # attr
11747
- >0x14 byte&0x80 0x80 re-entrant
11748
- >0x14 byte&0x40 0x40 ghost
11749
- >0x14 byte&0x20 0x20 system-state
11750
- #
11751
- # lang:
11752
- #
11753
- >0x13 byte 1 machine language
11754
- >0x13 byte 2 BASIC I-code
11755
- >0x13 byte 3 Pascal P-code
11756
- >0x13 byte 4 C I-code
11757
- >0x13 byte 5 COBOL I-code
11758
- >0x13 byte 6 Fortran I-code
11759
- #
11760
- #
11761
- # type:
11762
- #
11763
- >0x12 byte 1 program executable
11764
- >0x12 byte 2 subroutine
11765
- >0x12 byte 3 multi-module
11766
- >0x12 byte 4 data module
11767
- >0x12 byte 11 trap library
11768
- >0x12 byte 12 system module
11769
- >0x12 byte 13 file manager
11770
- >0x12 byte 14 device driver
11771
- >0x12 byte 15 device descriptor
11772
- #
11773
- # Mach magic number info
11774
- #
11775
- 0 long 0xefbe OSF/Rose object
11776
- # I386 magic number info
11777
- #
11778
- 0 short 0565 i386 COFF object
11779
-
11780
- #------------------------------------------------------------------------------
11781
- # palm: file(1) magic for PalmOS {.prc,.pdb}: applications, docfiles, and hacks
11782
- #
11783
- # Brian Lalor <blalor@hcirisc.cs.binghamton.edu>
11784
-
11785
- # appl
11786
- 60 belong 0x6170706c PalmOS application
11787
- >0 string >\0 "%s"
11788
- # TEXt
11789
- 60 belong 0x54455874 AportisDoc file
11790
- >0 string >\0 "%s"
11791
- # HACK
11792
- 60 belong 0x4841434b HackMaster hack
11793
- >0 string >\0 "%s"
11794
-
11795
- # Variety of PalmOS document types
11796
- # Michael-John Turner <mj@debian.org>
11797
- # Thanks to Hasan Umit Ezerce <humit@tr-net.net.tr> for his DocType
11798
- 60 string BVokBDIC BDicty PalmOS document
11799
- >0 string >\0 "%s"
11800
- 60 string DB99DBOS DB PalmOS document
11801
- >0 string >\0 "%s"
11802
- 60 string vIMGView FireViewer/ImageViewer PalmOS document
11803
- >0 string >\0 "%s"
11804
- 60 string PmDBPmDB HanDBase PalmOS document
11805
- >0 string >\0 "%s"
11806
- 60 string InfoINDB InfoView PalmOS document
11807
- >0 string >\0 "%s"
11808
- 60 string ToGoToGo iSilo PalmOS document
11809
- >0 string >\0 "%s"
11810
- 60 string JfDbJBas JFile PalmOS document
11811
- >0 string >\0 "%s"
11812
- 60 string JfDbJFil JFile Pro PalmOS document
11813
- >0 string >\0 "%s"
11814
- 60 string DATALSdb List PalmOS document
11815
- >0 string >\0 "%s"
11816
- 60 string Mdb1Mdb1 MobileDB PalmOS document
11817
- >0 string >\0 "%s"
11818
- 60 string PNRdPPrs PeanutPress PalmOS document
11819
- >0 string >\0 "%s"
11820
- 60 string DataPlkr Plucker PalmOS document
11821
- >0 string >\0 "%s"
11822
- 60 string DataSprd QuickSheet PalmOS document
11823
- >0 string >\0 "%s"
11824
- 60 string SM01SMem SuperMemo PalmOS document
11825
- >0 string >\0 "%s"
11826
- 60 string TEXtTlDc TealDoc PalmOS document
11827
- >0 string >\0 "%s"
11828
- 60 string InfoTlIf TealInfo PalmOS document
11829
- >0 string >\0 "%s"
11830
- 60 string DataTlMl TealMeal PalmOS document
11831
- >0 string >\0 "%s"
11832
- 60 string DataTlPt TealPaint PalmOS document
11833
- >0 string >\0 "%s"
11834
- 60 string dataTDBP ThinkDB PalmOS document
11835
- >0 string >\0 "%s"
11836
- 60 string TdatTide Tides PalmOS document
11837
- >0 string >\0 "%s"
11838
- 60 string ToRaTRPW TomeRaider PalmOS document
11839
- >0 string >\0 "%s"
11840
-
11841
- # A GutenPalm zTXT etext for use on Palm Pilots (http://gutenpalm.sf.net)
11842
- # For version 1.xx zTXTs, outputs version and numbers of bookmarks and
11843
- # annotations.
11844
- # For other versions, just outputs version.
11845
- #
11846
- 60 string zTXT A GutenPalm zTXT e-book
11847
- >0 string >\0 "%s"
11848
- >(0x4E.L) byte 0
11849
- >>(0x4E.L+1) byte x (v0.%02d)
11850
- >(0x4E.L) byte 1
11851
- >>(0x4E.L+1) byte x (v1.%02d)
11852
- >>>(0x4E.L+10) beshort >0
11853
- >>>>(0x4E.L+10) beshort <2 - 1 bookmark
11854
- >>>>(0x4E.L+10) beshort >1 - %d bookmarks
11855
- >>>(0x4E.L+14) beshort >0
11856
- >>>>(0x4E.L+14) beshort <2 - 1 annotation
11857
- >>>>(0x4E.L+14) beshort >1 - %d annotations
11858
- >(0x4E.L) byte >1 (v%d.
11859
- >>(0x4E.L+1) byte x %02d)
11860
-
11861
- # Palm OS .prc file types
11862
- 60 string libr Palm OS dynamic library data
11863
- >0 string >\0 "%s"
11864
- 60 string ptch Palm OS operating system patch data
11865
- >0 string >\0 "%s"
11866
-
11867
- # Mobipocket (www.mobipocket.com), donated by Carl Witty
11868
- 60 string BOOKMOBI Mobipocket E-book
11869
- >0 string >\0 "%s"
11870
-
11871
- #------------------------------------------------------------------------------
11872
- #
11873
- # Parix COFF executables
11874
- # From: Ignatios Souvatzis <ignatios@cs.uni-bonn.de>
11875
- #
11876
- 0 beshort&0xfff 0xACE PARIX
11877
- >0 byte&0xf0 0x80 T800
11878
- >0 byte&0xf0 0x90 T9000
11879
- >19 byte&0x02 0x02 executable
11880
- >19 byte&0x02 0x00 object
11881
- >19 byte&0x0c 0x00 not stripped
11882
-
11883
- #------------------------------------------------------------------------------
11884
- # pbm: file(1) magic for Portable Bitmap files
11885
- #
11886
- # XXX - byte order?
11887
- #
11888
- 0 short 0x2a17 "compact bitmap" format (Poskanzer)
11889
- #------------------------------------------------------------------------------
11890
- # pdf: file(1) magic for Portable Document Format
11891
- #
11892
-
11893
- 0 string %PDF- PDF document
11894
- !:mime application/pdf
11895
- >5 byte x \b, version %c
11896
- >7 byte x \b.%c
11897
-
11898
- # From: Nick Schmalenberger <nick@schmalenberger.us>
11899
- # Forms Data Format
11900
- 0 string %FDF- FDF document
11901
- >5 byte x \b, version %c
11902
- >7 byte x \b.%c
11903
-
11904
- #------------------------------------------------------------------------------
11905
- # pdp: file(1) magic for PDP-11 executable/object and APL workspace
11906
- #
11907
- 0 lelong 0101555 PDP-11 single precision APL workspace
11908
- 0 lelong 0101554 PDP-11 double precision APL workspace
11909
- #
11910
- # PDP-11 a.out
11911
- #
11912
- 0 leshort 0407 PDP-11 executable
11913
- >8 leshort >0 not stripped
11914
- >15 byte >0 - version %ld
11915
-
11916
- 0 leshort 0401 PDP-11 UNIX/RT ldp
11917
- 0 leshort 0405 PDP-11 old overlay
11918
-
11919
- 0 leshort 0410 PDP-11 pure executable
11920
- >8 leshort >0 not stripped
11921
- >15 byte >0 - version %ld
11922
-
11923
- 0 leshort 0411 PDP-11 separate I&D executable
11924
- >8 leshort >0 not stripped
11925
- >15 byte >0 - version %ld
11926
-
11927
- 0 leshort 0437 PDP-11 kernel overlay
11928
-
11929
- # These last three are derived from 2.11BSD file(1)
11930
- 0 leshort 0413 PDP-11 demand-paged pure executable
11931
- >8 leshort >0 not stripped
11932
-
11933
- 0 leshort 0430 PDP-11 overlaid pure executable
11934
- >8 leshort >0 not stripped
11935
-
11936
- 0 leshort 0431 PDP-11 overlaid separate executable
11937
- >8 leshort >0 not stripped
11938
- #------------------------------------------------------------------------------
11939
- # perl: file(1) magic for Larry Wall's perl language.
11940
- #
11941
- # The `eval' lines recognizes an outrageously clever hack.
11942
- # Keith Waclena <keith@cerberus.uchicago.edu>
11943
- # Send additions to <perl5-porters@perl.org>
11944
- 0 search/1/b #!\ /bin/perl Perl script text executable
11945
- !:mime text/x-perl
11946
- 0 search/1 eval\ "exec\ /bin/perl Perl script text
11947
- !:mime text/x-perl
11948
- 0 search/1/b #!\ /usr/bin/perl Perl script text executable
11949
- !:mime text/x-perl
11950
- 0 search/1 eval\ "exec\ /usr/bin/perl Perl script text
11951
- !:mime text/x-perl
11952
- 0 search/1/b #!\ /usr/local/bin/perl Perl script text executable
11953
- !:mime text/x-perl
11954
- 0 search/1 eval\ "exec\ /usr/local/bin/perl Perl script text
11955
- !:mime text/x-perl
11956
- 0 search/1 eval\ '(exit\ $?0)'\ &&\ eval\ 'exec Perl script text
11957
- !:mime text/x-perl
11958
-
11959
-
11960
- # by Dmitry V. Levin and Alexey Tourbin
11961
- # check the first line
11962
- 0 search/1 package
11963
- >0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *; Perl5 module source text
11964
- # not 'p', check other lines
11965
- 0 search/1 !p
11966
- >0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *;
11967
- >>0 regex \^1\ *;|\^(use|sub|my)\ .*[(;{=] Perl5 module source text
11968
-
11969
-
11970
-
11971
- # Perl POD documents
11972
- # From: Tom Hukins <tom@eborcom.com>
11973
- 0 search/1/B \=pod\n Perl POD document text
11974
- 0 search/1/B \n\=pod\n Perl POD document text
11975
- 0 search/1/B \=head1\ Perl POD document text
11976
- 0 search/1/B \n\=head1\ Perl POD document text
11977
- 0 search/1/B \=head2\ Perl POD document text
11978
- 0 search/1/B \n\=head2\ Perl POD document text
11979
-
11980
- # Perl Storable data files.
11981
- 0 string perl-store perl Storable (v0.6) data
11982
- >4 byte >0 (net-order %d)
11983
- >>4 byte &01 (network-ordered)
11984
- >>4 byte =3 (major 1)
11985
- >>4 byte =2 (major 1)
11986
-
11987
- 0 string pst0 perl Storable (v0.7) data
11988
- >4 byte >0
11989
- >>4 byte &01 (network-ordered)
11990
- >>4 byte =5 (major 2)
11991
- >>4 byte =4 (major 2)
11992
- >>5 byte >0 (minor %d)
11993
-
11994
- #------------------------------------------------------------------------------
11995
- # pgp: file(1) magic for Pretty Good Privacy
11996
- # see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
11997
- #
11998
- 0 beshort 0x9900 PGP key public ring
11999
- !:mime application/x-pgp-keyring
12000
- 0 beshort 0x9501 PGP key security ring
12001
- !:mime application/x-pgp-keyring
12002
- 0 beshort 0x9500 PGP key security ring
12003
- !:mime application/x-pgp-keyring
12004
- 0 beshort 0xa600 PGP encrypted data
12005
- #!:mime application/pgp-encrypted
12006
- #0 string -----BEGIN\040PGP text/PGP armored data
12007
- !:mime text/PGP # encoding: armored data
12008
- #>15 string PUBLIC\040KEY\040BLOCK- public key block
12009
- #>15 string MESSAGE- message
12010
- #>15 string SIGNED\040MESSAGE- signed message
12011
- #>15 string PGP\040SIGNATURE- signature
12012
-
12013
- 2 string ---BEGIN\ PGP\ PUBLIC\ KEY\ BLOCK- PGP public key block
12014
- !:mime application/pgp-keys
12015
- 0 string -----BEGIN\040PGP\40MESSAGE- PGP message
12016
- !:mime application/pgp
12017
- 0 string -----BEGIN\040PGP\40SIGNATURE- PGP signature
12018
- !:mime application/pgp-signature
12019
-
12020
- #------------------------------------------------------------------------------
12021
- # pkgadd: file(1) magic for SysV R4 PKG Datastreams
12022
- #
12023
- 0 string #\ PaCkAgE\ DaTaStReAm pkg Datastream (SVR4)
12024
- !:mime application/x-svr4-package
12025
-
12026
- #------------------------------------------------------------------------------
12027
- # plan9: file(1) magic for AT&T Bell Labs' Plan 9 executables
12028
- # From: "Stefan A. Haubenthal" <polluks@web.de>
12029
- #
12030
- 0 belong 0x00000107 Plan 9 executable, Motorola 68k
12031
- 0 belong 0x000001EB Plan 9 executable, Intel 386
12032
- 0 belong 0x00000247 Plan 9 executable, Intel 960
12033
- 0 belong 0x000002AB Plan 9 executable, SPARC
12034
- 0 belong 0x00000407 Plan 9 executable, MIPS R3000
12035
- 0 belong 0x0000048B Plan 9 executable, AT&T DSP 3210
12036
- 0 belong 0x00000517 Plan 9 executable, MIPS R4000 BE
12037
- 0 belong 0x000005AB Plan 9 executable, AMD 29000
12038
- 0 belong 0x00000647 Plan 9 executable, ARM 7-something
12039
- 0 belong 0x000006EB Plan 9 executable, PowerPC
12040
- 0 belong 0x00000797 Plan 9 executable, MIPS R4000 LE
12041
- 0 belong 0x0000084B Plan 9 executable, DEC Alpha
12042
-
12043
- #------------------------------------------------------------------------------
12044
- # plus5: file(1) magic for Plus Five's UNIX MUMPS
12045
- #
12046
- # XXX - byte order? Paging Hokey....
12047
- #
12048
- 0 short 0x259 mumps avl global
12049
- >2 byte >0 (V%d)
12050
- >6 byte >0 with %d byte name
12051
- >7 byte >0 and %d byte data cells
12052
- 0 short 0x25a mumps blt global
12053
- >2 byte >0 (V%d)
12054
- >8 short >0 - %d byte blocks
12055
- >15 byte 0x00 - P/D format
12056
- >15 byte 0x01 - P/K/D format
12057
- >15 byte 0x02 - K/D format
12058
- >15 byte >0x02 - Bad Flags
12059
-
12060
- #------------------------------------------------------------------------------
12061
- # printer: file(1) magic for printer-formatted files
12062
- #
12063
-
12064
- # PostScript, updated by Daniel Quinlan (quinlan@yggdrasil.com)
12065
- 0 string %! PostScript document text
12066
- !:mime application/postscript
12067
- !:apple ASPSTEXT
12068
- >2 string PS-Adobe- conforming
12069
- >>11 string >\0 DSC level %.3s
12070
- >>>15 string EPS \b, type %s
12071
- >>>15 string Query \b, type %s
12072
- >>>15 string ExitServer \b, type %s
12073
- >>>15 search/1000 %%LanguageLevel:\
12074
- >>>>&0 string >\0 \b, Level %s
12075
- # Some PCs have the annoying habit of adding a ^D as a document separator
12076
- 0 string \004%! PostScript document text
12077
- !:mime application/postscript
12078
- !:apple ASPSTEXT
12079
- >3 string PS-Adobe- conforming
12080
- >>12 string >\0 DSC level %.3s
12081
- >>>16 string EPS \b, type %s
12082
- >>>16 string Query \b, type %s
12083
- >>>16 string ExitServer \b, type %s
12084
- >>>16 search/1000 %%LanguageLevel:\
12085
- >>>>&0 string >\0 \b, Level %s
12086
- 0 string \033%-12345X%!PS PostScript document
12087
-
12088
- # DOS EPS Binary File Header
12089
- # From: Ed Sznyter <ews@Black.Market.NET>
12090
- 0 belong 0xC5D0D3C6 DOS EPS Binary File
12091
- >4 long >0 Postscript starts at byte %d
12092
- >>8 long >0 length %d
12093
- >>>12 long >0 Metafile starts at byte %d
12094
- >>>>16 long >0 length %d
12095
- >>>20 long >0 TIFF starts at byte %d
12096
- >>>>24 long >0 length %d
12097
-
12098
- # Summary: Adobe's PostScript Printer Description File
12099
- # Extension: .ppd
12100
- # Reference: http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf, Section 3.8
12101
- # Submitted by: Yves Arrouye <arrouye@marin.fdn.fr>
12102
- #
12103
- 0 string *PPD-Adobe:\x20 PPD file
12104
- >&0 string x \b, version %s
12105
-
12106
- # HP Printer Job Language
12107
- 0 string \033%-12345X@PJL HP Printer Job Language data
12108
- # HP Printer Job Language
12109
- # The header found on Win95 HP plot files is the "Silliest Thing possible"
12110
- # (TM)
12111
- # Every driver puts the language at some random position, with random case
12112
- # (LANGUAGE and Language)
12113
- # For example the LaserJet 5L driver puts the "PJL ENTER LANGUAGE" in line 10
12114
- # From: Uwe Bonnes <bon@elektron.ikp.physik.th-darmstadt.de>
12115
- #
12116
- 0 string \033%-12345X@PJL HP Printer Job Language data
12117
- >&0 string >\0 %s
12118
- >>&0 string >\0 %s
12119
- >>>&0 string >\0 %s
12120
- >>>>&0 string >\0 %s
12121
- #>15 string \ ENTER\ LANGUAGE\ =
12122
- #>31 string PostScript PostScript
12123
-
12124
- # HP Printer Control Language, Daniel Quinlan (quinlan@yggdrasil.com)
12125
- 0 string \033E\033 HP PCL printer data
12126
- >3 string \&l0A - default page size
12127
- >3 string \&l1A - US executive page size
12128
- >3 string \&l2A - US letter page size
12129
- >3 string \&l3A - US legal page size
12130
- >3 string \&l26A - A4 page size
12131
- >3 string \&l80A - Monarch envelope size
12132
- >3 string \&l81A - No. 10 envelope size
12133
- >3 string \&l90A - Intl. DL envelope size
12134
- >3 string \&l91A - Intl. C5 envelope size
12135
- >3 string \&l100A - Intl. B5 envelope size
12136
- >3 string \&l-81A - No. 10 envelope size (landscape)
12137
- >3 string \&l-90A - Intl. DL envelope size (landscape)
12138
-
12139
- # IMAGEN printer-ready files:
12140
- 0 string @document( Imagen printer
12141
- # this only works if "language xxx" is first item in Imagen header.
12142
- >10 string language\ impress (imPRESS data)
12143
- >10 string language\ daisy (daisywheel text)
12144
- >10 string language\ diablo (daisywheel text)
12145
- >10 string language\ printer (line printer emulation)
12146
- >10 string language\ tektronix (Tektronix 4014 emulation)
12147
- # Add any other languages that your Imagen uses - remember
12148
- # to keep the word `text' if the file is human-readable.
12149
- # [GRR 950115: missing "postscript" or "ultrascript" (whatever it was called)]
12150
- #
12151
- # Now magic for IMAGEN font files...
12152
- 0 string Rast RST-format raster font data
12153
- >45 string >0 face %s
12154
- # From Jukka Ukkonen
12155
- 0 string \033[K\002\0\0\017\033(a\001\0\001\033(g Canon Bubble Jet BJC formatted data
12156
-
12157
- # From <mike@flyn.org>
12158
- # These are the /etc/magic entries to decode data sent to an Epson printer.
12159
- 0 string \x1B\x40\x1B\x28\x52\x08\x00\x00REMOTE1P Epson Stylus Color 460 data
12160
-
12161
-
12162
- #------------------------------------------------------------------------------
12163
- # zenographics: file(1) magic for Zenographics ZjStream printer data
12164
- # Rick Richardson rickr@mn.rr.com
12165
- 0 string JZJZ
12166
- >0x12 string ZZ Zenographics ZjStream printer data (big-endian)
12167
- 0 string ZJZJ
12168
- >0x12 string ZZ Zenographics ZjStream printer data (little-endian)
12169
-
12170
-
12171
- #------------------------------------------------------------------------------
12172
- # Oak Technologies printer stream
12173
- # Rick Richardson <rickr@mn.rr.com>
12174
- 0 string OAK
12175
- >0x07 byte 0
12176
- >0x0b byte 0 Oak Technologies printer stream
12177
-
12178
- # This would otherwise be recognized as PostScript - nick@debian.org
12179
- 0 string %!VMF SunClock's Vector Map Format data
12180
-
12181
- #------------------------------------------------------------------------------
12182
- # HP LaserJet 1000 series downloadable firmware file
12183
- 0 string \xbe\xefABCDEFGH HP LaserJet 1000 series downloadable firmware
12184
-
12185
- # From: Paolo <oopla@users.sf.net>
12186
- # Epson ESC/Page, ESC/PageColor
12187
- 0 string \x1b\x01@EJL Epson ESC/Page language printer data
12188
-
12189
- #------------------------------------------------------------------------------
12190
- # project: file(1) magic for Project management
12191
- #
12192
- # Magic strings for ftnchek project files. Alexander Mai
12193
- 0 string FTNCHEK_\ P project file for ftnchek
12194
- >10 string 1 version 2.7
12195
- >10 string 2 version 2.8 to 2.10
12196
- >10 string 3 version 2.11 or later
12197
-
12198
- #------------------------------------------------------------------------------
12199
- # psdbms: file(1) magic for psdatabase
12200
- #
12201
- 0 belong&0xff00ffff 0x56000000 ps database
12202
- >1 string >\0 version %s
12203
- >4 string >\0 from kernel %s
12204
- #------------------------------------------------------------------------------
12205
- # psion: file(1) magic for Psion handhelds data
12206
- # from: Peter Breitenlohner <peb@mppmu.mpg.de>
12207
- #
12208
- 0 lelong 0x10000037 Psion Series 5
12209
- >4 lelong 0x10000039 font file
12210
- >4 lelong 0x1000003A printer driver
12211
- >4 lelong 0x1000003B clipboard
12212
- >4 lelong 0x10000042 multi-bitmap image
12213
- >4 lelong 0x1000006A application information file
12214
- >4 lelong 0x1000006D
12215
- >>8 lelong 0x1000007D sketch image
12216
- !:mime image/x-psion-sketch
12217
- >>8 lelong 0x1000007E voice note
12218
- >>8 lelong 0x1000007F word file
12219
- >>8 lelong 0x10000085 OPL program
12220
- >>8 lelong 0x10000088 sheet file
12221
- >>8 lelong 0x100001C4 EasyFax initialisation file
12222
- >4 lelong 0x10000073 OPO module
12223
- >4 lelong 0x10000074 OPL application
12224
- >4 lelong 0x1000008A exported multi-bitmap image
12225
-
12226
- 0 lelong 0x10000041 Psion Series 5 ROM multi-bitmap image
12227
-
12228
- 0 lelong 0x10000050 Psion Series 5
12229
- >4 lelong 0x1000006D database
12230
- >4 lelong 0x100000E4 ini file
12231
-
12232
- 0 lelong 0x10000079 Psion Series 5 binary:
12233
- >4 lelong 0x00000000 DLL
12234
- >4 lelong 0x10000049 comms hardware library
12235
- >4 lelong 0x1000004A comms protocol library
12236
- >4 lelong 0x1000005D OPX
12237
- >4 lelong 0x1000006C application
12238
- >4 lelong 0x1000008D DLL
12239
- >4 lelong 0x100000AC logical device driver
12240
- >4 lelong 0x100000AD physical device driver
12241
- >4 lelong 0x100000E5 file transfer protocol
12242
- >4 lelong 0x100000E5 file transfer protocol
12243
- >4 lelong 0x10000140 printer definition
12244
- >4 lelong 0x10000141 printer definition
12245
-
12246
- 0 lelong 0x1000007A Psion Series 5 executable
12247
-
12248
- #------------------------------------------------------------------------------
12249
- # pulsar: file(1) magic for Pulsar POP3 daemon binary files
12250
- #
12251
- # http://pulsar.sourceforge.net
12252
- # mailto:rok.papez@lugos.si
12253
- #
12254
-
12255
- 0 belong 0x1ee7f11e Pulsar POP3 daemon mailbox cache file.
12256
- >4 ubelong x Version: %d.
12257
- >8 ubelong x \b%d
12258
-
12259
-
12260
- #------------------------------------------------------------------------------
12261
- # pyramid: file(1) magic for Pyramids
12262
- #
12263
- # XXX - byte order?
12264
- #
12265
- 0 long 0x50900107 Pyramid 90x family executable
12266
- 0 long 0x50900108 Pyramid 90x family pure executable
12267
- >16 long >0 not stripped
12268
- 0 long 0x5090010b Pyramid 90x family demand paged pure executable
12269
- >16 long >0 not stripped
12270
-
12271
- #------------------------------------------------------------------------------
12272
- # python: file(1) magic for python
12273
- #
12274
- # From: David Necas <yeti@physics.muni.cz>
12275
- # often the module starts with a multiline string
12276
- 0 string """ a python script text executable
12277
- # MAGIC as specified in Python/import.c (1.5 to 2.3.0a)
12278
- # 20121 ( YEAR - 1995 ) + MONTH + DAY (little endian followed by "\r\n"
12279
- 0 belong 0x994e0d0a python 1.5/1.6 byte-compiled
12280
- 0 belong 0x87c60d0a python 2.0 byte-compiled
12281
- 0 belong 0x2aeb0d0a python 2.1 byte-compiled
12282
- 0 belong 0x2ded0d0a python 2.2 byte-compiled
12283
- 0 belong 0x3bf20d0a python 2.3 byte-compiled
12284
- 0 belong 0x6df20d0a python 2.4 byte-compiled
12285
- 0 belong 0xb3f20d0a python 2.5 byte-compiled
12286
- 0 belong 0xd1f20d0a python 2.6 byte-compiled
12287
-
12288
-
12289
- 0 string/b #!\ /usr/bin/python python script text executable
12290
-
12291
-
12292
- #------------------------------------------------------------------------------
12293
- # file(1) magic for revision control files
12294
- # From Hendrik Scholz <hendrik@scholz.net>
12295
- 0 string /1\ :pserver: cvs password text file
12296
-
12297
- # Conary changesets
12298
- # From: Jonathan Smith <smithj@rpath.com>
12299
- 0 belong 0xea3f81bb Conary changeset data
12300
-
12301
- # Type: Git bundles (git-bundle)
12302
- # From: Josh Triplett <josh@freedesktop.org>
12303
- 0 string #\ v2\ git\ bundle\n Git bundle
12304
-
12305
- # Type: Git pack
12306
- # From: Adam Buchbinder <adam.buchbinder@gmail.com>
12307
- # The actual magic is 'PACK', but that clashes with Doom/Quake packs. However,
12308
- # those have a little-endian offset immediately following the magic 'PACK',
12309
- # the first byte of which is never 0, while the first byte of the Git pack
12310
- # version, since it's a tiny number stored in big-endian format, is always 0.
12311
- 0 string PACK\0 Git pack
12312
- >4 belong >0 \b, version %d
12313
- >>8 belong >0 \b, %d objects
12314
-
12315
- # Type: Git pack index
12316
- # From: Adam Buchbinder <adam.buchbinder@gmail.com>
12317
- 0 string \377tOc Git pack index
12318
- >4 belong =2 \b, version 2
12319
-
12320
- # Type: Mercurial bundles
12321
- # From: Seo Sanghyeon <tinuviel@sparcs.kaist.ac.kr>
12322
- 0 string HG10 Mercurial bundle,
12323
- >4 string UN uncompressed
12324
- >4 string BZ bzip2 compressed
12325
-
12326
- # Type: Subversion (SVN) dumps
12327
- # From: Uwe Zeisberger <zeisberg@informatik.uni-freiburg.de>
12328
- 0 string SVN-fs-dump-format-version: Subversion dumpfile
12329
- >28 string >\0 (version: %s)
12330
-
12331
- # Type: Bazaar revision bundles and merge requests
12332
- # URL: http://www.bazaar-vcs.org/
12333
- # From: Jelmer Vernooij <jelmer@samba.org>
12334
- 0 string #\ Bazaar\ revision\ bundle\ v Bazaar Bundle
12335
- 0 string #\ Bazaar\ merge\ directive\ format Bazaar merge directive
12336
-
12337
- #------------------------------------------------------------------------------
12338
- # riff: file(1) magic for RIFF format
12339
- # See
12340
- #
12341
- # http://www.seanet.com/users/matts/riffmci/riffmci.htm
12342
- #
12343
- # AVI section extended by Patrik R�dman <patrik+file-magic@iki.fi>
12344
- #
12345
- 0 string RIFF RIFF (little-endian) data
12346
- # RIFF Palette format
12347
- >8 string PAL \b, palette
12348
- >>16 leshort x \b, version %d
12349
- >>18 leshort x \b, %d entries
12350
- # RIFF Device Independent Bitmap format
12351
- >8 string RDIB \b, device-independent bitmap
12352
- >>16 string BM
12353
- >>>30 leshort 12 \b, OS/2 1.x format
12354
- >>>>34 leshort x \b, %d x
12355
- >>>>36 leshort x %d
12356
- >>>30 leshort 64 \b, OS/2 2.x format
12357
- >>>>34 leshort x \b, %d x
12358
- >>>>36 leshort x %d
12359
- >>>30 leshort 40 \b, Windows 3.x format
12360
- >>>>34 lelong x \b, %d x
12361
- >>>>38 lelong x %d x
12362
- >>>>44 leshort x %d
12363
- # RIFF MIDI format
12364
- >8 string RMID \b, MIDI
12365
- # RIFF Multimedia Movie File format
12366
- >8 string RMMP \b, multimedia movie
12367
- # RIFF wrapper for MP3
12368
- >8 string RMP3 \b, MPEG Layer 3 audio
12369
- # Microsoft WAVE format (*.wav)
12370
- >8 string WAVE \b, WAVE audio
12371
- !:mime audio/x-wav
12372
- >>20 leshort 1 \b, Microsoft PCM
12373
- >>>34 leshort >0 \b, %d bit
12374
- >>20 leshort 2 \b, Microsoft ADPCM
12375
- >>20 leshort 6 \b, ITU G.711 A-law
12376
- >>20 leshort 7 \b, ITU G.711 mu-law
12377
- >>20 leshort 8 \b, Microsoft DTS
12378
- >>20 leshort 17 \b, IMA ADPCM
12379
- >>20 leshort 20 \b, ITU G.723 ADPCM (Yamaha)
12380
- >>20 leshort 49 \b, GSM 6.10
12381
- >>20 leshort 64 \b, ITU G.721 ADPCM
12382
- >>20 leshort 80 \b, MPEG
12383
- >>20 leshort 85 \b, MPEG Layer 3
12384
- >>20 leshort 0x2001 \b, DTS
12385
- >>22 leshort =1 \b, mono
12386
- >>22 leshort =2 \b, stereo
12387
- >>22 leshort >2 \b, %d channels
12388
- >>24 lelong >0 %d Hz
12389
- # Corel Draw Picture
12390
- >8 string CDRA \b, Corel Draw Picture
12391
- !:mime image/x-coreldraw
12392
- # AVI == Audio Video Interleave
12393
- >8 string AVI\040 \b, AVI
12394
- !:mime video/x-msvideo
12395
- >>12 string LIST
12396
- >>>20 string hdrlavih
12397
- >>>>&36 lelong x \b, %lu x
12398
- >>>>&40 lelong x %lu,
12399
- >>>>&4 lelong >1000000 <1 fps,
12400
- >>>>&4 lelong 1000000 1.00 fps,
12401
- >>>>&4 lelong 500000 2.00 fps,
12402
- >>>>&4 lelong 333333 3.00 fps,
12403
- >>>>&4 lelong 250000 4.00 fps,
12404
- >>>>&4 lelong 200000 5.00 fps,
12405
- >>>>&4 lelong 166667 6.00 fps,
12406
- >>>>&4 lelong 142857 7.00 fps,
12407
- >>>>&4 lelong 125000 8.00 fps,
12408
- >>>>&4 lelong 111111 9.00 fps,
12409
- >>>>&4 lelong 100000 10.00 fps,
12410
- # ]9.9,10.1[
12411
- >>>>&4 lelong <101010
12412
- >>>>>&-4 lelong >99010
12413
- >>>>>>&-4 lelong !100000 ~10 fps,
12414
- >>>>&4 lelong 83333 12.00 fps,
12415
- # ]11.9,12.1[
12416
- >>>>&4 lelong <84034
12417
- >>>>>&-4 lelong >82645
12418
- >>>>>>&-4 lelong !83333 ~12 fps,
12419
- >>>>&4 lelong 66667 15.00 fps,
12420
- # ]14.9,15.1[
12421
- >>>>&4 lelong <67114
12422
- >>>>>&-4 lelong >66225
12423
- >>>>>>&-4 lelong !66667 ~15 fps,
12424
- >>>>&4 lelong 50000 20.00 fps,
12425
- >>>>&4 lelong 41708 23.98 fps,
12426
- >>>>&4 lelong 41667 24.00 fps,
12427
- # ]23.9,24.1[
12428
- >>>>&4 lelong <41841
12429
- >>>>>&-4 lelong >41494
12430
- >>>>>>&-4 lelong !41708
12431
- >>>>>>>&-4 lelong !41667 ~24 fps,
12432
- >>>>&4 lelong 40000 25.00 fps,
12433
- # ]24.9,25.1[
12434
- >>>>&4 lelong <40161
12435
- >>>>>&-4 lelong >39841
12436
- >>>>>>&-4 lelong !40000 ~25 fps,
12437
- >>>>&4 lelong 33367 29.97 fps,
12438
- >>>>&4 lelong 33333 30.00 fps,
12439
- # ]29.9,30.1[
12440
- >>>>&4 lelong <33445
12441
- >>>>>&-4 lelong >33223
12442
- >>>>>>&-4 lelong !33367
12443
- >>>>>>>&-4 lelong !33333 ~30 fps,
12444
- >>>>&4 lelong <32224 >30 fps,
12445
- ##>>>>&4 lelong x (%lu)
12446
- ##>>>>&20 lelong x %lu frames,
12447
- # Note: The tests below assume that the AVI has 1 or 2 streams,
12448
- # "vids" optionally followed by "auds".
12449
- # (Should cover 99.9% of all AVIs.)
12450
- # assuming avih length = 56
12451
- >>>88 string LIST
12452
- >>>>96 string strlstrh
12453
- >>>>>108 string vids video:
12454
- >>>>>>&0 lelong 0 uncompressed
12455
- # skip past vids strh
12456
- >>>>>>(104.l+108) string strf
12457
- >>>>>>>(104.l+132) lelong 1 RLE 8bpp
12458
- >>>>>>>(104.l+132) string/c cvid Cinepak
12459
- >>>>>>>(104.l+132) string/c i263 Intel I.263
12460
- >>>>>>>(104.l+132) string/c iv32 Indeo 3.2
12461
- >>>>>>>(104.l+132) string/c iv41 Indeo 4.1
12462
- >>>>>>>(104.l+132) string/c iv50 Indeo 5.0
12463
- >>>>>>>(104.l+132) string/c mp42 Microsoft MPEG-4 v2
12464
- >>>>>>>(104.l+132) string/c mp43 Microsoft MPEG-4 v3
12465
- >>>>>>>(104.l+132) string/c fmp4 FFMpeg MPEG-4
12466
- >>>>>>>(104.l+132) string/c mjpg Motion JPEG
12467
- >>>>>>>(104.l+132) string/c div3 DivX 3
12468
- >>>>>>>>112 string/c div3 Low-Motion
12469
- >>>>>>>>112 string/c div4 Fast-Motion
12470
- >>>>>>>(104.l+132) string/c divx DivX 4
12471
- >>>>>>>(104.l+132) string/c dx50 DivX 5
12472
- >>>>>>>(104.l+132) string/c xvid XviD
12473
- >>>>>>>(104.l+132) string/c h264 H.264
12474
- >>>>>>>(104.l+132) string/c wmv3 Windows Media Video 9
12475
- >>>>>>>(104.l+132) string/c h264 X.264 or H.264
12476
- >>>>>>>(104.l+132) lelong 0
12477
- ##>>>>>>>(104.l+132) string x (%.4s)
12478
- # skip past first (video) LIST
12479
- >>>>(92.l+96) string LIST
12480
- >>>>>(92.l+104) string strlstrh
12481
- >>>>>>(92.l+116) string auds \b, audio:
12482
- # auds strh length = 56:
12483
- >>>>>>>(92.l+172) string strf
12484
- >>>>>>>>(92.l+180) leshort 0x0001 uncompressed PCM
12485
- >>>>>>>>(92.l+180) leshort 0x0002 ADPCM
12486
- >>>>>>>>(92.l+180) leshort 0x0006 aLaw
12487
- >>>>>>>>(92.l+180) leshort 0x0007 uLaw
12488
- >>>>>>>>(92.l+180) leshort 0x0050 MPEG-1 Layer 1 or 2
12489
- >>>>>>>>(92.l+180) leshort 0x0055 MPEG-1 Layer 3
12490
- >>>>>>>>(92.l+180) leshort 0x2000 Dolby AC3
12491
- >>>>>>>>(92.l+180) leshort 0x0161 DivX
12492
- ##>>>>>>>>(92.l+180) leshort x (0x%.4x)
12493
- >>>>>>>>(92.l+182) leshort 1 (mono,
12494
- >>>>>>>>(92.l+182) leshort 2 (stereo,
12495
- >>>>>>>>(92.l+182) leshort >2 (%d channels,
12496
- >>>>>>>>(92.l+184) lelong x %d Hz)
12497
- # auds strh length = 64:
12498
- >>>>>>>(92.l+180) string strf
12499
- >>>>>>>>(92.l+188) leshort 0x0001 uncompressed PCM
12500
- >>>>>>>>(92.l+188) leshort 0x0002 ADPCM
12501
- >>>>>>>>(92.l+188) leshort 0x0055 MPEG-1 Layer 3
12502
- >>>>>>>>(92.l+188) leshort 0x2000 Dolby AC3
12503
- >>>>>>>>(92.l+188) leshort 0x0161 DivX
12504
- ##>>>>>>>>(92.l+188) leshort x (0x%.4x)
12505
- >>>>>>>>(92.l+190) leshort 1 (mono,
12506
- >>>>>>>>(92.l+190) leshort 2 (stereo,
12507
- >>>>>>>>(92.l+190) leshort >2 (%d channels,
12508
- >>>>>>>>(92.l+192) lelong x %d Hz)
12509
- # Animated Cursor format
12510
- >8 string ACON \b, animated cursor
12511
- # SoundFont 2 <mpruett@sgi.com>
12512
- >8 string sfbk SoundFont/Bank
12513
- # MPEG-1 wrapped in a RIFF, apparently
12514
- >8 string CDXA \b, wrapped MPEG-1 (CDXA)
12515
- >8 string 4XMV \b, 4X Movie file
12516
-
12517
- #
12518
- # XXX - some of the below may only appear in little-endian form.
12519
- #
12520
- # Also "MV93" appears to be for one form of Macromedia Director
12521
- # files, and "GDMF" appears to be another multimedia format.
12522
- #
12523
- 0 string RIFX RIFF (big-endian) data
12524
- # RIFF Palette format
12525
- >8 string PAL \b, palette
12526
- >>16 beshort x \b, version %d
12527
- >>18 beshort x \b, %d entries
12528
- # RIFF Device Independent Bitmap format
12529
- >8 string RDIB \b, device-independent bitmap
12530
- >>16 string BM
12531
- >>>30 beshort 12 \b, OS/2 1.x format
12532
- >>>>34 beshort x \b, %d x
12533
- >>>>36 beshort x %d
12534
- >>>30 beshort 64 \b, OS/2 2.x format
12535
- >>>>34 beshort x \b, %d x
12536
- >>>>36 beshort x %d
12537
- >>>30 beshort 40 \b, Windows 3.x format
12538
- >>>>34 belong x \b, %d x
12539
- >>>>38 belong x %d x
12540
- >>>>44 beshort x %d
12541
- # RIFF MIDI format
12542
- >8 string RMID \b, MIDI
12543
- # RIFF Multimedia Movie File format
12544
- >8 string RMMP \b, multimedia movie
12545
- # Microsoft WAVE format (*.wav)
12546
- >8 string WAVE \b, WAVE audio
12547
- >>20 leshort 1 \b, Microsoft PCM
12548
- >>>34 leshort >0 \b, %d bit
12549
- >>22 beshort =1 \b, mono
12550
- >>22 beshort =2 \b, stereo
12551
- >>22 beshort >2 \b, %d channels
12552
- >>24 belong >0 %d Hz
12553
- # Corel Draw Picture
12554
- >8 string CDRA \b, Corel Draw Picture
12555
- # AVI == Audio Video Interleave
12556
- >8 string AVI\040 \b, AVI
12557
- # Animated Cursor format
12558
- >8 string ACON \b, animated cursor
12559
- # Notation Interchange File Format (big-endian only)
12560
- >8 string NIFF \b, Notation Interchange File Format
12561
- # SoundFont 2 <mpruett@sgi.com>
12562
- >8 string sfbk SoundFont/Bank
12563
- #------------------------------------------------------------------------------
12564
- #
12565
- # RPM: file(1) magic for Red Hat Packages Erik Troan (ewt@redhat.com)
12566
- #
12567
- 0 beshort 0xedab
12568
- >2 beshort 0xeedb RPM
12569
- !:mime application/x-rpm
12570
- >>4 byte x v%d
12571
- >>6 beshort 0 bin
12572
- >>6 beshort 1 src
12573
- >>8 beshort 1 i386
12574
- >>8 beshort 2 Alpha
12575
- >>8 beshort 3 Sparc
12576
- >>8 beshort 4 MIPS
12577
- >>8 beshort 5 PowerPC
12578
- >>8 beshort 6 68000
12579
- >>8 beshort 7 SGI
12580
- >>8 beshort 8 RS6000
12581
- >>8 beshort 9 IA64
12582
- >>8 beshort 10 Sparc64
12583
- >>8 beshort 11 MIPSel
12584
- >>8 beshort 12 ARM
12585
- >>10 string x %s
12586
-
12587
- #------------------------------------------------------------------------------
12588
- # rtf: file(1) magic for Rich Text Format (RTF)
12589
- #
12590
- # Duncan P. Simpson, D.P.Simpson@dcs.warwick.ac.uk
12591
- #
12592
- 0 string {\\rtf Rich Text Format data,
12593
- !:mime text/rtf
12594
- >5 string 1 version 1,
12595
- >>6 string \\ansi ANSI
12596
- >>6 string \\mac Apple Macintosh
12597
- >>6 string \\pc IBM PC, code page 437
12598
- >>6 string \\pca IBM PS/2, code page 850
12599
- >>6 default x unknown character set
12600
- >5 default x unknown version
12601
- #------------------------------------------------------------------------------
12602
- # ruby: file(1) magic for Lua scripting language
12603
- # URL: http://www.ruby-lang.org/
12604
- # From: Reuben Thomas <rrt@sc3d.org>
12605
-
12606
- # Ruby scripts
12607
- 0 search/1/b #!\ /usr/bin/ruby Ruby script text executable
12608
- !:mime application/x-ruby
12609
- 0 search/1/b #!\ /usr/local/bin/ruby Ruby script text executable
12610
- !:mime application/x-ruby
12611
- 0 search/1 #!/usr/bin/env\ ruby Ruby script text executable
12612
- !:mime application/x-ruby
12613
- 0 search/1 #!\ /usr/bin/env\ ruby Ruby script text executable
12614
- !:mime application/x-ruby
12615
-
12616
- #------------------------------------------------------------------------------
12617
- # sc: file(1) magic for "sc" spreadsheet
12618
- #
12619
- 38 string Spreadsheet sc spreadsheet file
12620
- !:mime application/x-sc
12621
-
12622
- #------------------------------------------------------------------------------
12623
- # sccs: file(1) magic for SCCS archives
12624
- #
12625
- # SCCS archive structure:
12626
- # \001h01207
12627
- # \001s 00276/00000/00000
12628
- # \001d D 1.1 87/09/23 08:09:20 ian 1 0
12629
- # \001c date and time created 87/09/23 08:09:20 by ian
12630
- # \001e
12631
- # \001u
12632
- # \001U
12633
- # ... etc.
12634
- # Now '\001h' happens to be the same as the 3B20's a.out magic number (0550).
12635
- # *Sigh*. And these both came from various parts of the USG.
12636
- # Maybe we should just switch everybody from SCCS to RCS!
12637
- # Further, you can't just say '\001h0', because the five-digit number
12638
- # is a checksum that could (presumably) have any leading digit,
12639
- # and we don't have regular expression matching yet.
12640
- # Hence the following official kludge:
12641
- 8 string \001s\ SCCS archive data
12642
- #------------------------------------------------------------------------------
12643
- # scientific: file(1) magic for scientific formats
12644
- #
12645
- # From: Joe Krahn <krahn@niehs.nih.gov>
12646
-
12647
- ########################################################
12648
- # CCP4 data and plot files:
12649
- 0 string MTZ\040 MTZ reflection file
12650
-
12651
- 92 string PLOT%%84 Plot84 plotting file
12652
- >52 byte 1 , Little-endian
12653
- >55 byte 1 , Big-endian
12654
-
12655
- ########################################################
12656
- # Electron density MAP/MASK formats
12657
-
12658
- 0 string EZD_MAP NEWEZD Electron Density Map
12659
- 109 string MAP\040( Old EZD Electron Density Map
12660
-
12661
- 0 string/c :-)\040Origin BRIX Electron Density Map
12662
- >170 string >0 , Sigma:%.12s
12663
- #>4 string >0 %.178s
12664
- #>4 addr x %.178s
12665
-
12666
- 7 string 18\040!NTITLE XPLOR ASCII Electron Density Map
12667
- 9 string \040!NTITLE\012\040REMARK CNS ASCII electron density map
12668
-
12669
- 208 string MAP\040 CCP4 Electron Density Map
12670
- # Assumes same stamp for float and double (normal case)
12671
- >212 byte 17 \b, Big-endian
12672
- >212 byte 34 \b, VAX format
12673
- >212 byte 68 \b, Little-endian
12674
- >212 byte 85 \b, Convex native
12675
-
12676
- ############################################################
12677
- # X-Ray Area Detector images
12678
- 0 string R-AXIS4\ \ \ R-Axis Area Detector Image:
12679
- >796 lelong <20 Little-endian, IP #%d,
12680
- >>768 lelong >0 Size=%dx
12681
- >>772 lelong >0 \b%d
12682
- >796 belong <20 Big-endian, IP #%d,
12683
- >>768 belong >0 Size=%dx
12684
- >>772 belong >0 \b%d
12685
-
12686
- 0 string RAXIS\ \ \ \ \ R-Axis Area Detector Image, Win32:
12687
- >796 lelong <20 Little-endian, IP #%d,
12688
- >>768 lelong >0 Size=%dx
12689
- >>772 lelong >0 \b%d
12690
- >796 belong <20 Big-endian, IP #%d,
12691
- >>768 belong >0 Size=%dx
12692
- >>772 belong >0 \b%d
12693
-
12694
-
12695
- 1028 string MMX\000\000\000\000\000\000\000\000\000\000\000\000\000 MAR Area Detector Image,
12696
- >1072 ulong >1 Compressed(%d),
12697
- >1100 ulong >1 %d headers,
12698
- >1104 ulong >0 %d x
12699
- >1108 ulong >0 %d,
12700
- >1120 ulong >0 %d bits/pixel
12701
-
12702
- # Type: GEDCOM genealogical (family history) data
12703
- # From: Giuseppe Bilotta
12704
- 0 search/1/c 0\ HEAD GEDCOM genealogy text
12705
- >&0 search 1\ GEDC
12706
- >>&0 search 2\ VERS version
12707
- >>>&1 search/1 >\0 %s
12708
- # From: Phil Endecott <phil05@chezphil.org>
12709
- 0 string \000\060\000\040\000\110\000\105\000\101\000\104 GEDCOM data
12710
- 0 string \060\000\040\000\110\000\105\000\101\000\104\000 GEDCOM data
12711
- 0 string \376\377\000\060\000\040\000\110\000\105\000\101\000\104 GEDCOM data
12712
- 0 string \377\376\060\000\040\000\110\000\105\000\101\000\104\000 GEDCOM data
12713
- 0 search/1 -----BEGIN\ CERTIFICATE------ RFC1421 Security Certificate text
12714
- 0 search/1 -----BEGIN\ NEW\ CERTIFICATE RFC1421 Security Certificate Signing Request text
12715
- 0 belong 0xedfeedfe Sun 'jks' Java Keystore File data
12716
- # Type: SE Linux policy modules *.pp reference policy
12717
- # for Fedora 5 to 9, RHEL5, and Debian Etch and Lenny.
12718
- # URL: http://doc.coker.com.au/computers/selinux-magic
12719
- # From: Russell Coker <russell@coker.com.au>
12720
-
12721
- 0 lelong 0xf97cff8f SE Linux modular policy
12722
- >4 lelong x version %d,
12723
- >8 lelong x %d sections,
12724
- >>(12.l) lelong 0xf97cff8d
12725
- >>>(12.l+27) lelong x mod version %d,
12726
- >>>(12.l+31) lelong 0 Not MLS,
12727
- >>>(12.l+31) lelong 1 MLS,
12728
- >>>(12.l+23) lelong 2
12729
- >>>>(12.l+47) string >\0 module name %s
12730
- >>>(12.l+23) lelong 1 base
12731
-
12732
- 1 string policy_module( SE Linux policy module source
12733
- 2 string policy_module( SE Linux policy module source
12734
-
12735
- 0 string ##\ <summary> SE Linux policy interface source
12736
-
12737
- #0 search gen_context( SE Linux policy file contexts
12738
-
12739
- #0 search gen_sens( SE Linux policy MLS constraints source
12740
-
12741
- #------------------------------------------------------------------------------
12742
- # sendmail: file(1) magic for sendmail config files
12743
- #
12744
- # XXX - byte order?
12745
- #
12746
- 0 byte 046 Sendmail frozen configuration
12747
- >16 string >\0 - version %s
12748
- 0 short 0x271c Sendmail frozen configuration
12749
- >16 string >\0 - version %s
12750
-
12751
- #------------------------------------------------------------------------------
12752
- # sendmail: file(1) magic for sendmail m4(1) files
12753
- #
12754
- # From Hendrik Scholz <hendrik@scholz.net>
12755
- # i.e. files in /usr/share/sendmail/cf/
12756
- #
12757
- 0 string divert(-1)\n sendmail m4 text file
12758
-
12759
-
12760
- #------------------------------------------------------------------------------
12761
- # sequent: file(1) magic for Sequent machines
12762
- #
12763
- # Sequent information updated by Don Dwiggins <atsun!dwiggins>.
12764
- # For Sequent's multiprocessor systems (incomplete).
12765
- 0 lelong 0x00ea BALANCE NS32000 .o
12766
- >16 lelong >0 not stripped
12767
- >124 lelong >0 version %ld
12768
- 0 lelong 0x10ea BALANCE NS32000 executable (0 @ 0)
12769
- >16 lelong >0 not stripped
12770
- >124 lelong >0 version %ld
12771
- 0 lelong 0x20ea BALANCE NS32000 executable (invalid @ 0)
12772
- >16 lelong >0 not stripped
12773
- >124 lelong >0 version %ld
12774
- 0 lelong 0x30ea BALANCE NS32000 standalone executable
12775
- >16 lelong >0 not stripped
12776
- >124 lelong >0 version %ld
12777
- #
12778
- # Symmetry information added by Jason Merrill <jason@jarthur.claremont.edu>.
12779
- # Symmetry magic nums will not be reached if DOS COM comes before them;
12780
- # byte 0xeb is matched before these get a chance.
12781
- 0 leshort 0x12eb SYMMETRY i386 .o
12782
- >16 lelong >0 not stripped
12783
- >124 lelong >0 version %ld
12784
- 0 leshort 0x22eb SYMMETRY i386 executable (0 @ 0)
12785
- >16 lelong >0 not stripped
12786
- >124 lelong >0 version %ld
12787
- 0 leshort 0x32eb SYMMETRY i386 executable (invalid @ 0)
12788
- >16 lelong >0 not stripped
12789
- >124 lelong >0 version %ld
12790
- 0 leshort 0x42eb SYMMETRY i386 standalone executable
12791
- >16 lelong >0 not stripped
12792
- >124 lelong >0 version %ld
12793
-
12794
- #------------------------------------------------------------------------------
12795
- # sgi: file(1) magic for Silicon Graphics applications
12796
-
12797
- #
12798
- #
12799
- # Performance Co-Pilot file types
12800
- 0 string PmNs PCP compiled namespace (V.0)
12801
- 0 string PmN PCP compiled namespace
12802
- >3 string >\0 (V.%1.1s)
12803
- #3 lelong 0x84500526 PCP archive
12804
- 3 belong 0x84500526 PCP archive
12805
- >7 byte x (V.%d)
12806
- #>20 lelong -2 temporal index
12807
- #>20 lelong -1 metadata
12808
- #>20 lelong 0 log volume #0
12809
- #>20 lelong >0 log volume #%ld
12810
- >20 belong -2 temporal index
12811
- >20 belong -1 metadata
12812
- >20 belong 0 log volume #0
12813
- >20 belong >0 log volume #%ld
12814
- >24 string >\0 host: %s
12815
- 0 string PCPFolio PCP
12816
- >9 string Version: Archive Folio
12817
- >18 string >\0 (V.%s)
12818
- 0 string #pmchart PCP pmchart view
12819
- >9 string Version
12820
- >17 string >\0 (V%-3.3s)
12821
- 0 string #kmchart PCP kmchart view
12822
- >9 string Version
12823
- >17 string >\0 (V.%s)
12824
- 0 string pmview PCP pmview config
12825
- >7 string Version
12826
- >15 string >\0 (V%-3.3s)
12827
- 0 string #pmlogger PCP pmlogger config
12828
- >10 string Version
12829
- >18 string >\0 (V%1.1s)
12830
- 0 string #pmdahotproc PCP pmdahotproc config
12831
- >13 string Version
12832
- >21 string >\0 (V%-3.3s)
12833
- 0 string PcPh PCP Help
12834
- >4 string 1 Index
12835
- >4 string 2 Text
12836
- >5 string >\0 (V.%1.1s)
12837
- 0 string #pmieconf-rules PCP pmieconf rules
12838
- >16 string >\0 (V.%1.1s)
12839
- 3 string pmieconf-pmie PCP pmie config
12840
- >17 string >\0 (V.%1.1s)
12841
-
12842
- # SpeedShop data files
12843
- 0 lelong 0x13130303 SpeedShop data file
12844
-
12845
- # mdbm files
12846
- 0 lelong 0x01023962 mdbm file, version 0 (obsolete)
12847
- 0 string mdbm mdbm file,
12848
- >5 byte x version %d,
12849
- >6 byte x 2^%d pages,
12850
- >7 byte x pagesize 2^%d,
12851
- >17 byte x hash %d,
12852
- >11 byte x dataformat %d
12853
-
12854
- # Alias Maya files
12855
- 0 string //Maya ASCII Alias Maya Ascii File,
12856
- >13 string >\0 version %s
12857
- 8 string MAYAFOR4 Alias Maya Binary File,
12858
- >32 string >\0 version %s scene
12859
- 8 string MayaFOR4 Alias Maya Binary File,
12860
- >32 string >\0 version %s scene
12861
- 8 string CIMG Alias Maya Image File
12862
- 8 string DEEP Alias Maya Image File
12863
- #------------------------------------------------------------------------------
12864
- # Type: SVG Vectorial Graphics
12865
- # From: Noel Torres <tecnico@ejerciciosresueltos.com>
12866
- 0 string \<?xml\ version="
12867
- >15 string >\0
12868
- >>23 search/400 \<svg SVG Scalable Vector Graphics image
12869
- !:mime image/svg+xml
12870
- >>23 search/400 \<gnc-v2 GnuCash file
12871
- !:mime application/x-gnucash
12872
-
12873
- # Sitemap file
12874
- 0 string \<?xml\ version="
12875
- >15 string >\0
12876
- >>23 search/400 \<urlset XML Sitemap document text
12877
- !:mime application/xml-sitemap
12878
-
12879
- #------------------------------------------------------------------------------
12880
- # sgml: file(1) magic for Standard Generalized Markup Language
12881
- # HyperText Markup Language (HTML) is an SGML document type,
12882
- # from Daniel Quinlan (quinlan@yggdrasil.com)
12883
- # adapted to string extenstions by Anthon van der Neut <anthon@mnt.org)
12884
- 0 search/1/cB \<!doctype\ html HTML document text
12885
- !:mime text/html
12886
- 0 search/1/cb \<head HTML document text
12887
- !:mime text/html
12888
- 0 search/1/cb \<title HTML document text
12889
- !:mime text/html
12890
- 0 search/1/cb \<html HTML document text
12891
- !:mime text/html
12892
-
12893
- # Extensible markup language (XML), a subset of SGML
12894
- # from Marc Prud'hommeaux (marc@apocalypse.org)
12895
- 0 search/1/cb \<?xml XML document text
12896
- !:mime application/xml
12897
- 0 string \<?xml\ version\ " XML
12898
- !:mime application/xml
12899
- 0 string \<?xml\ version=" XML
12900
- !:mime application/xml
12901
- >15 search/1 >\0 %.3s document text
12902
- >>23 search/1 \<xsl:stylesheet (XSL stylesheet)
12903
- >>24 search/1 \<xsl:stylesheet (XSL stylesheet)
12904
- 0 string \<?xml\ version=' XML
12905
- !:mime application/xml
12906
- >15 search/1 >\0 %.3s document text
12907
- >>23 search/1 \<xsl:stylesheet (XSL stylesheet)
12908
- >>24 search/1 \<xsl:stylesheet (XSL stylesheet)
12909
- 0 search/1/b \<?xml XML document text
12910
- !:mime application/xml
12911
- 0 search/1/b \<?XML broken XML document text
12912
- !:mime application/xml
12913
-
12914
-
12915
- # SGML, mostly from rph@sq
12916
- 0 search/1/cb \<!doctype exported SGML document text
12917
- 0 search/1/cb \<!subdoc exported SGML subdocument text
12918
- 0 search/1/cb \<!-- exported SGML document text
12919
-
12920
- # Web browser cookie files
12921
- # (Mozilla, Galeon, Netscape 4, Konqueror..)
12922
- # Ulf Harnhammar <ulfh@update.uu.se>
12923
- 0 search/1 #\ HTTP\ Cookie\ File Web browser cookie text
12924
- 0 search/1 #\ Netscape\ HTTP\ Cookie\ File Netscape cookie text
12925
- 0 search/1 #\ KDE\ Cookie\ File Konqueror cookie text
12926
-
12927
- #------------------------------------------------------------------------
12928
- # file(1) magic for sharc files
12929
- #
12930
- # SHARC DSP, MIDI SysEx and RiscOS filetype definitions added by
12931
- # FutureGroove Music (dsp@futuregroove.de)
12932
-
12933
- #------------------------------------------------------------------------
12934
- #0 string Draw RiscOS Drawfile
12935
- #0 string PACK RiscOS PackdDir archive
12936
-
12937
- #------------------------------------------------------------------------
12938
- # SHARC DSP stuff (based on the FGM SHARC DSP SDK)
12939
-
12940
- #0 string =! Assembler source
12941
- #0 string Analog ADi asm listing file
12942
- 0 string .SYSTEM SHARC architecture file
12943
- 0 string .system SHARC architecture file
12944
-
12945
- 0 leshort 0x521C SHARC COFF binary
12946
- >2 leshort >1 , %hd sections
12947
- >>12 lelong >0 , not stripped
12948
-
12949
- #------------------------------------------------------------------------------
12950
- # sinclair: file(1) sinclair QL
12951
-
12952
- # additions to /etc/magic by Thomas M. Ott (ThMO)
12953
-
12954
- # Sinclair QL floppy disk formats (ThMO)
12955
- 0 string =QL5 QL disk dump data,
12956
- >3 string =A 720 KB,
12957
- >3 string =B 1.44 MB,
12958
- >3 string =C 3.2 MB,
12959
- >4 string >\0 label:%.10s
12960
-
12961
- # Sinclair QL OS dump (ThMO)
12962
- # (NOTE: if `file' would be able to use indirect references in a endian format
12963
- # differing from the natural host format, this could be written more
12964
- # reliably and faster...)
12965
- #
12966
- # we *can't* lookup QL OS code dumps, because `file' is UNABLE to read more
12967
- # than the first 8K of a file... #-(
12968
- #
12969
- #0 belong =0x30000
12970
- #>49124 belong <47104
12971
- #>>49128 belong <47104
12972
- #>>>49132 belong <47104
12973
- #>>>>49136 belong <47104 QL OS dump data,
12974
- #>>>>>49148 string >\0 type %.3s,
12975
- #>>>>>49142 string >\0 version %.4s
12976
-
12977
- # Sinclair QL firmware executables (ThMO)
12978
- 0 string NqNqNq`\004 QL firmware executable (BCPL)
12979
-
12980
- # Sinclair QL libraries (was ThMO)
12981
- 0 beshort 0xFB01 QDOS object
12982
- >2 pstring x '%s'
12983
-
12984
- # Sinclair QL executables (was ThMO)
12985
- 4 belong 0x4AFB QDOS executable
12986
- >9 pstring x '%s'
12987
-
12988
- # Sinclair QL ROM (ThMO)
12989
- 0 belong =0x4AFB0001 QL plugin-ROM data,
12990
- >9 pstring =\0 un-named
12991
- >9 pstring >\0 named: %s
12992
- # Type: SiSU Markup Language
12993
- # URL: http://www.sisudoc.org/
12994
- # From: Ralph Amissah <ralph.amissah@gmail.com>
12995
-
12996
- 0 regex \^%?[\ \t]*SiSU[\ \t]+insert SiSU text insert
12997
- >5 regex [0-9.]+ %s
12998
-
12999
- 0 regex \^%[\ \t]+SiSU[\ \t]+master SiSU text master
13000
- >5 regex [0-9.]+ %s
13001
-
13002
- 0 regex \^%?[\ \t]*SiSU[\ \t]+text SiSU text
13003
- >5 regex [0-9.]+ %s
13004
-
13005
- 0 regex \^%?[\ \t]*SiSU[\ \t][0-9.]+ SiSU text
13006
- >5 regex [0-9.]+ %s
13007
-
13008
- 0 regex \^%*[\ \t]*sisu-[0-9.]+ SiSU text
13009
- >5 regex [0-9.]+ %s
13010
- #------------------------------------------------------------------------------
13011
- # Sketch Drawings: http://sketch.sourceforge.net/
13012
- # From: Edwin Mons <e@ik.nu>
13013
- 0 search/1 ##Sketch Sketch document text
13014
-
13015
- #-----------------------------------------------
13016
- # GNU Smalltalk image, starting at version 1.6.2
13017
- # From: catull_us@yahoo.com
13018
- #
13019
- 0 string GSTIm\0\0 GNU SmallTalk
13020
- # little-endian
13021
- >7 byte&1 =0 LE image version
13022
- >>10 byte x %d.
13023
- >>9 byte x \b%d.
13024
- >>8 byte x \b%d
13025
- #>>12 lelong x , data: %ld
13026
- #>>16 lelong x , table: %ld
13027
- #>>20 lelong x , memory: %ld
13028
- # big-endian
13029
- >7 byte&1 =1 BE image version
13030
- >>8 byte x %d.
13031
- >>9 byte x \b%d.
13032
- >>10 byte x \b%d
13033
- #>>12 belong x , data: %ld
13034
- #>>16 belong x , table: %ld
13035
- #>>20 belong x , memory: %ld
13036
-
13037
-
13038
-
13039
- #------------------------------------------------------------------------------
13040
- # sniffer: file(1) magic for packet capture files
13041
- #
13042
- # From: guy@alum.mit.edu (Guy Harris)
13043
- #
13044
-
13045
- #
13046
- # Microsoft Network Monitor 1.x capture files.
13047
- #
13048
- 0 string RTSS NetMon capture file
13049
- >5 byte x - version %d
13050
- >4 byte x \b.%d
13051
- >6 leshort 0 (Unknown)
13052
- >6 leshort 1 (Ethernet)
13053
- >6 leshort 2 (Token Ring)
13054
- >6 leshort 3 (FDDI)
13055
- >6 leshort 4 (ATM)
13056
-
13057
- #
13058
- # Microsoft Network Monitor 2.x capture files.
13059
- #
13060
- 0 string GMBU NetMon capture file
13061
- >5 byte x - version %d
13062
- >4 byte x \b.%d
13063
- >6 leshort 0 (Unknown)
13064
- >6 leshort 1 (Ethernet)
13065
- >6 leshort 2 (Token Ring)
13066
- >6 leshort 3 (FDDI)
13067
- >6 leshort 4 (ATM)
13068
-
13069
- #
13070
- # Network General Sniffer capture files.
13071
- # Sorry, make that "Network Associates Sniffer capture files."
13072
- # Sorry, make that "Network General old DOS Sniffer capture files."
13073
- #
13074
- 0 string TRSNIFF\ data\ \ \ \ \032 Sniffer capture file
13075
- >33 byte 2 (compressed)
13076
- >23 leshort x - version %d
13077
- >25 leshort x \b.%d
13078
- >32 byte 0 (Token Ring)
13079
- >32 byte 1 (Ethernet)
13080
- >32 byte 2 (ARCNET)
13081
- >32 byte 3 (StarLAN)
13082
- >32 byte 4 (PC Network broadband)
13083
- >32 byte 5 (LocalTalk)
13084
- >32 byte 6 (Znet)
13085
- >32 byte 7 (Internetwork Analyzer)
13086
- >32 byte 9 (FDDI)
13087
- >32 byte 10 (ATM)
13088
-
13089
- #
13090
- # Cinco Networks NetXRay capture files.
13091
- # Sorry, make that "Network General Sniffer Basic capture files."
13092
- # Sorry, make that "Network Associates Sniffer Basic capture files."
13093
- # Sorry, make that "Network Associates Sniffer Basic, and Windows
13094
- # Sniffer Pro", capture files."
13095
- # Sorry, make that "Network General Sniffer capture files."
13096
- #
13097
- 0 string XCP\0 NetXRay capture file
13098
- >4 string >\0 - version %s
13099
- >44 leshort 0 (Ethernet)
13100
- >44 leshort 1 (Token Ring)
13101
- >44 leshort 2 (FDDI)
13102
- >44 leshort 3 (WAN)
13103
- >44 leshort 8 (ATM)
13104
- >44 leshort 9 (802.11)
13105
-
13106
- #
13107
- # "libpcap" capture files.
13108
- # (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
13109
- # the main program that uses that format, but there are other programs
13110
- # that use "libpcap", or that use the same capture file format.)
13111
- #
13112
- 0 ubelong 0xa1b2c3d4 tcpdump capture file (big-endian)
13113
- >4 beshort x - version %d
13114
- >6 beshort x \b.%d
13115
- >20 belong 0 (No link-layer encapsulation
13116
- >20 belong 1 (Ethernet
13117
- >20 belong 2 (3Mb Ethernet
13118
- >20 belong 3 (AX.25
13119
- >20 belong 4 (ProNET
13120
- >20 belong 5 (CHAOS
13121
- >20 belong 6 (Token Ring
13122
- >20 belong 7 (BSD ARCNET
13123
- >20 belong 8 (SLIP
13124
- >20 belong 9 (PPP
13125
- >20 belong 10 (FDDI
13126
- >20 belong 11 (RFC 1483 ATM
13127
- >20 belong 12 (raw IP
13128
- >20 belong 13 (BSD/OS SLIP
13129
- >20 belong 14 (BSD/OS PPP
13130
- >20 belong 19 (Linux ATM Classical IP
13131
- >20 belong 50 (PPP or Cisco HDLC
13132
- >20 belong 51 (PPP-over-Ethernet
13133
- >20 belong 99 (Symantec Enterprise Firewall
13134
- >20 belong 100 (RFC 1483 ATM
13135
- >20 belong 101 (raw IP
13136
- >20 belong 102 (BSD/OS SLIP
13137
- >20 belong 103 (BSD/OS PPP
13138
- >20 belong 104 (BSD/OS Cisco HDLC
13139
- >20 belong 105 (802.11
13140
- >20 belong 106 (Linux Classical IP over ATM
13141
- >20 belong 107 (Frame Relay
13142
- >20 belong 108 (OpenBSD loopback
13143
- >20 belong 109 (OpenBSD IPsec encrypted
13144
- >20 belong 112 (Cisco HDLC
13145
- >20 belong 113 (Linux "cooked"
13146
- >20 belong 114 (LocalTalk
13147
- >20 belong 117 (OpenBSD PFLOG
13148
- >20 belong 119 (802.11 with Prism header
13149
- >20 belong 122 (RFC 2625 IP over Fibre Channel
13150
- >20 belong 123 (SunATM
13151
- >20 belong 127 (802.11 with radiotap header
13152
- >20 belong 129 (Linux ARCNET
13153
- >20 belong 138 (Apple IP over IEEE 1394
13154
- >20 belong 140 (MTP2
13155
- >20 belong 141 (MTP3
13156
- >20 belong 143 (DOCSIS
13157
- >20 belong 144 (IrDA
13158
- >20 belong 147 (Private use 0
13159
- >20 belong 148 (Private use 1
13160
- >20 belong 149 (Private use 2
13161
- >20 belong 150 (Private use 3
13162
- >20 belong 151 (Private use 4
13163
- >20 belong 152 (Private use 5
13164
- >20 belong 153 (Private use 6
13165
- >20 belong 154 (Private use 7
13166
- >20 belong 155 (Private use 8
13167
- >20 belong 156 (Private use 9
13168
- >20 belong 157 (Private use 10
13169
- >20 belong 158 (Private use 11
13170
- >20 belong 159 (Private use 12
13171
- >20 belong 160 (Private use 13
13172
- >20 belong 161 (Private use 14
13173
- >20 belong 162 (Private use 15
13174
- >20 belong 163 (802.11 with AVS header
13175
- >16 belong x \b, capture length %d)
13176
- 0 ulelong 0xa1b2c3d4 tcpdump capture file (little-endian)
13177
- >4 leshort x - version %d
13178
- >6 leshort x \b.%d
13179
- >20 lelong 0 (No link-layer encapsulation
13180
- >20 lelong 1 (Ethernet
13181
- >20 lelong 2 (3Mb Ethernet
13182
- >20 lelong 3 (AX.25
13183
- >20 lelong 4 (ProNET
13184
- >20 lelong 5 (CHAOS
13185
- >20 lelong 6 (Token Ring
13186
- >20 lelong 7 (ARCNET
13187
- >20 lelong 8 (SLIP
13188
- >20 lelong 9 (PPP
13189
- >20 lelong 10 (FDDI
13190
- >20 lelong 11 (RFC 1483 ATM
13191
- >20 lelong 12 (raw IP
13192
- >20 lelong 13 (BSD/OS SLIP
13193
- >20 lelong 14 (BSD/OS PPP
13194
- >20 lelong 19 (Linux ATM Classical IP
13195
- >20 lelong 50 (PPP or Cisco HDLC
13196
- >20 lelong 51 (PPP-over-Ethernet
13197
- >20 lelong 99 (Symantec Enterprise Firewall
13198
- >20 lelong 100 (RFC 1483 ATM
13199
- >20 lelong 101 (raw IP
13200
- >20 lelong 102 (BSD/OS SLIP
13201
- >20 lelong 103 (BSD/OS PPP
13202
- >20 lelong 104 (BSD/OS Cisco HDLC
13203
- >20 lelong 105 (802.11
13204
- >20 lelong 106 (Linux Classical IP over ATM
13205
- >20 lelong 107 (Frame Relay
13206
- >20 lelong 108 (OpenBSD loopback
13207
- >20 lelong 109 (OpenBSD IPsec encrypted
13208
- >20 lelong 112 (Cisco HDLC
13209
- >20 lelong 113 (Linux "cooked"
13210
- >20 lelong 114 (LocalTalk
13211
- >20 lelong 117 (OpenBSD PFLOG
13212
- >20 lelong 119 (802.11 with Prism header
13213
- >20 lelong 122 (RFC 2625 IP over Fibre Channel
13214
- >20 lelong 123 (SunATM
13215
- >20 lelong 127 (802.11 with radiotap header
13216
- >20 lelong 129 (Linux ARCNET
13217
- >20 lelong 138 (Apple IP over IEEE 1394
13218
- >20 lelong 140 (MTP2
13219
- >20 lelong 141 (MTP3
13220
- >20 lelong 143 (DOCSIS
13221
- >20 lelong 144 (IrDA
13222
- >20 lelong 147 (Private use 0
13223
- >20 lelong 148 (Private use 1
13224
- >20 lelong 149 (Private use 2
13225
- >20 lelong 150 (Private use 3
13226
- >20 lelong 151 (Private use 4
13227
- >20 lelong 152 (Private use 5
13228
- >20 lelong 153 (Private use 6
13229
- >20 lelong 154 (Private use 7
13230
- >20 lelong 155 (Private use 8
13231
- >20 lelong 156 (Private use 9
13232
- >20 lelong 157 (Private use 10
13233
- >20 lelong 158 (Private use 11
13234
- >20 lelong 159 (Private use 12
13235
- >20 lelong 160 (Private use 13
13236
- >20 lelong 161 (Private use 14
13237
- >20 lelong 162 (Private use 15
13238
- >20 lelong 163 (802.11 with AVS header
13239
- >16 lelong x \b, capture length %d)
13240
-
13241
- #
13242
- # "libpcap"-with-Alexey-Kuznetsov's-patches capture files.
13243
- # (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
13244
- # the main program that uses that format, but there are other programs
13245
- # that use "libpcap", or that use the same capture file format.)
13246
- #
13247
- 0 ubelong 0xa1b2cd34 extended tcpdump capture file (big-endian)
13248
- >4 beshort x - version %d
13249
- >6 beshort x \b.%d
13250
- >20 belong 0 (No link-layer encapsulation
13251
- >20 belong 1 (Ethernet
13252
- >20 belong 2 (3Mb Ethernet
13253
- >20 belong 3 (AX.25
13254
- >20 belong 4 (ProNET
13255
- >20 belong 5 (CHAOS
13256
- >20 belong 6 (Token Ring
13257
- >20 belong 7 (ARCNET
13258
- >20 belong 8 (SLIP
13259
- >20 belong 9 (PPP
13260
- >20 belong 10 (FDDI
13261
- >20 belong 11 (RFC 1483 ATM
13262
- >20 belong 12 (raw IP
13263
- >20 belong 13 (BSD/OS SLIP
13264
- >20 belong 14 (BSD/OS PPP
13265
- >16 belong x \b, capture length %d)
13266
- 0 ulelong 0xa1b2cd34 extended tcpdump capture file (little-endian)
13267
- >4 leshort x - version %d
13268
- >6 leshort x \b.%d
13269
- >20 lelong 0 (No link-layer encapsulation
13270
- >20 lelong 1 (Ethernet
13271
- >20 lelong 2 (3Mb Ethernet
13272
- >20 lelong 3 (AX.25
13273
- >20 lelong 4 (ProNET
13274
- >20 lelong 5 (CHAOS
13275
- >20 lelong 6 (Token Ring
13276
- >20 lelong 7 (ARCNET
13277
- >20 lelong 8 (SLIP
13278
- >20 lelong 9 (PPP
13279
- >20 lelong 10 (FDDI
13280
- >20 lelong 11 (RFC 1483 ATM
13281
- >20 lelong 12 (raw IP
13282
- >20 lelong 13 (BSD/OS SLIP
13283
- >20 lelong 14 (BSD/OS PPP
13284
- >16 lelong x \b, capture length %d)
13285
-
13286
- #
13287
- # AIX "iptrace" capture files.
13288
- #
13289
- 0 string iptrace\ 1.0 "iptrace" capture file
13290
- 0 string iptrace\ 2.0 "iptrace" capture file
13291
-
13292
- #
13293
- # Novell LANalyzer capture files.
13294
- #
13295
- 0 leshort 0x1001 LANalyzer capture file
13296
- 0 leshort 0x1007 LANalyzer capture file
13297
-
13298
- #
13299
- # HP-UX "nettl" capture files.
13300
- #
13301
- 0 string \x54\x52\x00\x64\x00 "nettl" capture file
13302
-
13303
- #
13304
- # RADCOM WAN/LAN Analyzer capture files.
13305
- #
13306
- 0 string \x42\xd2\x00\x34\x12\x66\x22\x88 RADCOM WAN/LAN Analyzer capture file
13307
-
13308
- #
13309
- # NetStumbler log files. Not really packets, per se, but about as
13310
- # close as you can get. These are log files from NetStumbler, a
13311
- # Windows program, that scans for 802.11b networks.
13312
- #
13313
- 0 string NetS NetStumbler log file
13314
- >8 lelong x \b, %d stations found
13315
-
13316
- #
13317
- # EtherPeek/AiroPeek "version 9" capture files.
13318
- #
13319
- 0 string \177ver EtherPeek/AiroPeek capture file
13320
-
13321
- #
13322
- # Visual Networks traffic capture files.
13323
- #
13324
- 0 string \x05VNF Visual Networks traffic capture file
13325
-
13326
- #
13327
- # Network Instruments Observer capture files.
13328
- #
13329
- 0 string ObserverPktBuffe Network Instruments Observer capture file
13330
-
13331
- #
13332
- # Files from Accellent Group's 5View products.
13333
- #
13334
- 0 string \xaa\xaa\xaa\xaa 5View capture file
13335
- #------------------------------------------------------------------------------
13336
- # softquad: file(1) magic for SoftQuad Publishing Software
13337
- #
13338
- # Author/Editor and RulesBuilder
13339
- #
13340
- # XXX - byte order?
13341
- #
13342
- 0 string \<!SQ\ DTD> Compiled SGML rules file
13343
- >9 string >\0 Type %s
13344
- 0 string \<!SQ\ A/E> A/E SGML Document binary
13345
- >9 string >\0 Type %s
13346
- 0 string \<!SQ\ STS> A/E SGML binary styles file
13347
- >9 string >\0 Type %s
13348
- 0 short 0xc0de Compiled PSI (v1) data
13349
- 0 short 0xc0da Compiled PSI (v2) data
13350
- >3 string >\0 (%s)
13351
- # Binary sqtroff font/desc files...
13352
- 0 short 0125252 SoftQuad DESC or font file binary
13353
- >2 short >0 - version %d
13354
- # Bitmaps...
13355
- 0 search/1 SQ\ BITMAP1 SoftQuad Raster Format text
13356
- #0 string SQ\ BITMAP2 SoftQuad Raster Format data
13357
- # sqtroff intermediate language (replacement for ditroff int. lang.)
13358
- 0 string X\ SoftQuad troff Context intermediate
13359
- >2 string 495 for AT&T 495 laser printer
13360
- >2 string hp for Hewlett-Packard LaserJet
13361
- >2 string impr for IMAGEN imPRESS
13362
- >2 string ps for PostScript
13363
-
13364
- # From: Michael Piefel <piefel@debian.org>
13365
- # sqtroff intermediate language (replacement for ditroff int. lang.)
13366
- 0 string X\ 495 SoftQuad troff Context intermediate for AT&T 495 laser printer
13367
- 0 string X\ hp SoftQuad troff Context intermediate for HP LaserJet
13368
- 0 string X\ impr SoftQuad troff Context intermediate for IMAGEN imPRESS
13369
- 0 string X\ ps SoftQuad troff Context intermediate for PostScript
13370
-
13371
- #------------------------------------------------------------------------------
13372
- # spec: file(1) magic for SPEC raw results (*.raw, *.rsf)
13373
- #
13374
- # Cloyce D. Spradling <cloyce@headgear.org>
13375
-
13376
- 0 string spec SPEC
13377
- >4 string .cpu CPU
13378
- >>8 string <: \b%.4s
13379
- >>12 string . raw result text
13380
-
13381
- 17 string version=SPECjbb SPECjbb
13382
- >32 string <: \b%.4s
13383
- >>37 string <: v%.4s raw result text
13384
-
13385
- 0 string BEGIN\040SPECWEB SPECweb
13386
- >13 string <: \b%.2s
13387
- >>15 string _SSL \b_SSL
13388
- >>>20 string <: v%.4s raw result text
13389
- >>16 string <: v%.4s raw result text
13390
-
13391
- #------------------------------------------------------------------------------
13392
- # spectrum: file(1) magic for Spectrum emulator files.
13393
- #
13394
- # John Elliott <jce@seasip.demon.co.uk>
13395
-
13396
- #
13397
- # Spectrum +3DOS header
13398
- #
13399
- 0 string PLUS3DOS\032 Spectrum +3 data
13400
- >15 byte 0 - BASIC program
13401
- >15 byte 1 - number array
13402
- >15 byte 2 - character array
13403
- >15 byte 3 - memory block
13404
- >>16 belong 0x001B0040 (screen)
13405
- >15 byte 4 - Tasword document
13406
- >15 string TAPEFILE - ZXT tapefile
13407
- #
13408
- # Tape file. This assumes the .TAP starts with a Spectrum-format header,
13409
- # which nearly all will.
13410
- #
13411
- # Update: Sanity-check string contents to be printable.
13412
- # -Adam Buchbinder <adam.buchbinder@gmail.com>
13413
- #
13414
- 0 string \023\000\000
13415
- >4 string >\0
13416
- >>4 string <\177 Spectrum .TAP data "%-10.10s"
13417
- >>>3 byte 0 - BASIC program
13418
- >>>3 byte 1 - number array
13419
- >>>3 byte 2 - character array
13420
- >>>3 byte 3 - memory block
13421
- >>>>14 belong 0x001B0040 (screen)
13422
-
13423
- # The following three blocks are from pak21-spectrum@srcf.ucam.org
13424
- # TZX tape images
13425
- 0 string ZXTape!\x1a Spectrum .TZX data
13426
- >8 byte x version %d
13427
- >9 byte x \b.%d
13428
-
13429
- # RZX input recording files
13430
- 0 string RZX! Spectrum .RZX data
13431
- >4 byte x version %d
13432
- >5 byte x \b.%d
13433
-
13434
- # Floppy disk images
13435
- 0 string MV\ -\ CPCEMU\ Disk-Fil Amstrad/Spectrum .DSK data
13436
- 0 string MV\ -\ CPC\ format\ Dis Amstrad/Spectrum DU54 .DSK data
13437
- 0 string EXTENDED\ CPC\ DSK\ Fil Amstrad/Spectrum Extended .DSK data
13438
- 0 string SINCLAIR Spectrum .SCL Betadisk image
13439
-
13440
- # Hard disk images
13441
- 0 string RS-IDE\x1a Spectrum .HDF hard disk image
13442
- >7 byte x \b, version 0x%02x
13443
-
13444
- #------------------------------------------------------------------------------
13445
- # sql: file(1) magic for SQL files
13446
- #
13447
- # From: "Marty Leisner" <mleisner@eng.mc.xerox.com>
13448
- # Recognize some MySQL files.
13449
- #
13450
- 0 beshort 0xfe01 MySQL table definition file
13451
- >2 byte x Version %d
13452
- 0 belong&0xffffff00 0xfefe0300 MySQL MISAM index file
13453
- >3 byte x Version %d
13454
- 0 belong&0xffffff00 0xfefe0700 MySQL MISAM compressed data file
13455
- >3 byte x Version %d
13456
- 0 belong&0xffffff00 0xfefe0500 MySQL ISAM index file
13457
- >3 byte x Version %d
13458
- 0 belong&0xffffff00 0xfefe0600 MySQL ISAM compressed data file
13459
- >3 byte x Version %d
13460
- 0 string \376bin MySQL replication log
13461
-
13462
- #------------------------------------------------------------------------------
13463
- # iRiver H Series database file
13464
- # From Ken Guest <ken@linux.ie>
13465
- # As observed from iRivNavi.iDB and unencoded firmware
13466
- #
13467
- 0 string iRivDB iRiver Database file
13468
- >11 string >\0 Version %s
13469
- >39 string iHP-100 [H Series]
13470
-
13471
- #------------------------------------------------------------------------------
13472
- # SQLite database files
13473
- # Ken Guest <ken@linux.ie>, Ty Sarna, Zack Weinberg
13474
- #
13475
- # Version 1 used GDBM internally; its files cannot be distinguished
13476
- # from other GDBM files.
13477
- #
13478
- # Version 2 used this format:
13479
- 0 string **\ This\ file\ contains\ an\ SQLite SQLite 2.x database
13480
-
13481
- # Version 3 of SQLite allows applications to embed their own "user version"
13482
- # number in the database. Detect this and distinguish those files.
13483
-
13484
- 0 string SQLite\ format\ 3
13485
- >60 string _MTN Monotone source repository
13486
- >60 belong !0 SQLite 3.x database, user version %u
13487
- >60 belong 0 SQLite 3.x database
13488
- # Type: OpenSSH key files
13489
- # From: Nicolas Collignon <tsointsoin@gmail.com>
13490
-
13491
- 0 string SSH\ PRIVATE\ KEY OpenSSH RSA1 private key,
13492
- >28 string >\0 version %s
13493
-
13494
- 0 string ssh-dss\ OpenSSH DSA public key
13495
- 0 string ssh-rsa\ OpenSSH RSA public key
13496
- # Type: OpenSSL certificates/key files
13497
- # From: Nicolas Collignon <tsointsoin@gmail.com>
13498
-
13499
- 0 string -----BEGIN\ CERTIFICATE----- PEM certificate
13500
- 0 string -----BEGIN\ CERTIFICATE\ REQ PEM certificate request
13501
- 0 string -----BEGIN\ RSA\ PRIVATE PEM RSA private key
13502
- 0 string -----BEGIN\ DSA\ PRIVATE PEM DSA private key
13503
-
13504
- #------------------------------------------------------------------------------
13505
- # sun: file(1) magic for Sun machines
13506
- #
13507
- # Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x
13508
- # releases. (5.x uses ELF.)
13509
- #
13510
- 0 belong&077777777 0600413 sparc demand paged
13511
- >0 byte &0x80
13512
- >>20 belong <4096 shared library
13513
- >>20 belong =4096 dynamically linked executable
13514
- >>20 belong >4096 dynamically linked executable
13515
- >0 byte ^0x80 executable
13516
- >16 belong >0 not stripped
13517
-
13518
- 0 belong&077777777 0600410 sparc pure
13519
- >0 byte &0x80 dynamically linked executable
13520
- >0 byte ^0x80 executable
13521
- >16 belong >0 not stripped
13522
-
13523
- 0 belong&077777777 0600407 sparc
13524
- >0 byte &0x80 dynamically linked executable
13525
- >0 byte ^0x80 executable
13526
- >16 belong >0 not stripped
13527
-
13528
- 0 belong&077777777 0400413 mc68020 demand paged
13529
- >0 byte &0x80
13530
- >>20 belong <4096 shared library
13531
- >>20 belong =4096 dynamically linked executable
13532
- >>20 belong >4096 dynamically linked executable
13533
- >0 byte ^0x80 executable
13534
- >16 belong >0 not stripped
13535
-
13536
- 0 belong&077777777 0400410 mc68020 pure
13537
- >0 byte &0x80 dynamically linked executable
13538
- >0 byte ^0x80 executable
13539
- >16 belong >0 not stripped
13540
-
13541
- 0 belong&077777777 0400407 mc68020
13542
- >0 byte &0x80 dynamically linked executable
13543
- >0 byte ^0x80 executable
13544
- >16 belong >0 not stripped
13545
-
13546
- 0 belong&077777777 0200413 mc68010 demand paged
13547
- >0 byte &0x80
13548
- >>20 belong <4096 shared library
13549
- >>20 belong =4096 dynamically linked executable
13550
- >>20 belong >4096 dynamically linked executable
13551
- >0 byte ^0x80 executable
13552
- >16 belong >0 not stripped
13553
-
13554
- 0 belong&077777777 0200410 mc68010 pure
13555
- >0 byte &0x80 dynamically linked executable
13556
- >0 byte ^0x80 executable
13557
- >16 belong >0 not stripped
13558
-
13559
- 0 belong&077777777 0200407 mc68010
13560
- >0 byte &0x80 dynamically linked executable
13561
- >0 byte ^0x80 executable
13562
- >16 belong >0 not stripped
13563
-
13564
- # reworked these to avoid anything beginning with zero becoming "old sun-2"
13565
- 0 belong 0407 old sun-2 executable
13566
- >16 belong >0 not stripped
13567
- 0 belong 0410 old sun-2 pure executable
13568
- >16 belong >0 not stripped
13569
- 0 belong 0413 old sun-2 demand paged executable
13570
- >16 belong >0 not stripped
13571
-
13572
- #
13573
- # Core files. "SPARC 4.x BCP" means "core file from a SunOS 4.x SPARC
13574
- # binary executed in compatibility mode under SunOS 5.x".
13575
- #
13576
- 0 belong 0x080456 SunOS core file
13577
- >4 belong 432 (SPARC)
13578
- >>132 string >\0 from '%s'
13579
- >>116 belong =3 (quit)
13580
- >>116 belong =4 (illegal instruction)
13581
- >>116 belong =5 (trace trap)
13582
- >>116 belong =6 (abort)
13583
- >>116 belong =7 (emulator trap)
13584
- >>116 belong =8 (arithmetic exception)
13585
- >>116 belong =9 (kill)
13586
- >>116 belong =10 (bus error)
13587
- >>116 belong =11 (segmentation violation)
13588
- >>116 belong =12 (bad argument to system call)
13589
- >>116 belong =29 (resource lost)
13590
- >>120 belong x (T=%dK,
13591
- >>124 belong x D=%dK,
13592
- >>128 belong x S=%dK)
13593
- >4 belong 826 (68K)
13594
- >>128 string >\0 from '%s'
13595
- >4 belong 456 (SPARC 4.x BCP)
13596
- >>152 string >\0 from '%s'
13597
- # Sun SunPC
13598
- 0 long 0xfa33c08e SunPC 4.0 Hard Disk
13599
- 0 string #SUNPC_CONFIG SunPC 4.0 Properties Values
13600
- # Sun snoop (see RFC 1761, which describes the capture file format).
13601
- #
13602
- 0 string snoop Snoop capture file
13603
- >8 belong >0 - version %ld
13604
- >12 belong 0 (IEEE 802.3)
13605
- >12 belong 1 (IEEE 802.4)
13606
- >12 belong 2 (IEEE 802.5)
13607
- >12 belong 3 (IEEE 802.6)
13608
- >12 belong 4 (Ethernet)
13609
- >12 belong 5 (HDLC)
13610
- >12 belong 6 (Character synchronous)
13611
- >12 belong 7 (IBM channel-to-channel adapter)
13612
- >12 belong 8 (FDDI)
13613
- >12 belong 9 (Unknown)
13614
-
13615
- # Microsoft ICM color profile
13616
- 36 string acspMSFT Microsoft ICM Color Profile
13617
- # Sun KCMS
13618
- 36 string acsp Kodak Color Management System, ICC Profile
13619
-
13620
- #---------------------------------------------------------------------------
13621
- # The following entries have been tested by Duncan Laurie <duncan@sun.com> (a
13622
- # lead Sun/Cobalt developer) who agrees that they are good and worthy of
13623
- # inclusion.
13624
-
13625
- # Boot ROM images for Sun/Cobalt Linux server appliances
13626
- 0 string Cobalt\ Networks\ Inc.\nFirmware\ v Paged COBALT boot rom
13627
- >38 string x V%.4s
13628
-
13629
- # New format for Sun/Cobalt boot ROMs is annoying, it stores the version code
13630
- # at the very end where file(1) can't get it.
13631
- 0 string CRfs COBALT boot rom data (Flat boot rom or file system)
13632
-
13633
-
13634
- #------------------------------------------------------------------------
13635
- # sysex: file(1) magic for MIDI sysex files
13636
- #
13637
- #
13638
- 0 byte 0xF0 SysEx File -
13639
-
13640
- # North American Group
13641
- >1 byte 0x01 Sequential
13642
- >1 byte 0x02 IDP
13643
- >1 byte 0x03 OctavePlateau
13644
- >1 byte 0x04 Moog
13645
- >1 byte 0x05 Passport
13646
- >1 byte 0x06 Lexicon
13647
- >1 byte 0x07 Kurzweil/Future Retro
13648
- >>3 byte 0x77 777
13649
- >>4 byte 0x00 Bank
13650
- >>4 byte 0x01 Song
13651
- >>5 byte 0x0f 16
13652
- >>5 byte 0x0e 15
13653
- >>5 byte 0x0d 14
13654
- >>5 byte 0x0c 13
13655
- >>5 byte 0x0b 12
13656
- >>5 byte 0x0a 11
13657
- >>5 byte 0x09 10
13658
- >>5 byte 0x08 9
13659
- >>5 byte 0x07 8
13660
- >>5 byte 0x06 7
13661
- >>5 byte 0x05 6
13662
- >>5 byte 0x04 5
13663
- >>5 byte 0x03 4
13664
- >>5 byte 0x02 3
13665
- >>5 byte 0x01 2
13666
- >>5 byte 0x00 1
13667
- >>5 byte 0x10 (ALL)
13668
- >>2 byte x \b, Channel %d
13669
- >1 byte 0x08 Fender
13670
- >1 byte 0x09 Gulbransen
13671
- >1 byte 0x0a AKG
13672
- >1 byte 0x0b Voyce
13673
- >1 byte 0x0c Waveframe
13674
- >1 byte 0x0d ADA
13675
- >1 byte 0x0e Garfield
13676
- >1 byte 0x0f Ensoniq
13677
- >1 byte 0x10 Oberheim
13678
- >>2 byte 0x06 Matrix 6 series
13679
- >>3 byte 0x0A Dump (All)
13680
- >>3 byte 0x01 Dump (Bank)
13681
- >>4 belong 0x0002040E Matrix 1000
13682
- >>>11 byte <2 User bank %d
13683
- >>>11 byte >1 Preset bank %d
13684
- >1 byte 0x11 Apple
13685
- >1 byte 0x12 GreyMatter
13686
- >1 byte 0x14 PalmTree
13687
- >1 byte 0x15 JLCooper
13688
- >1 byte 0x16 Lowrey
13689
- >1 byte 0x17 AdamsSmith
13690
- >1 byte 0x18 E-mu
13691
- >1 byte 0x19 Harmony
13692
- >1 byte 0x1a ART
13693
- >1 byte 0x1b Baldwin
13694
- >1 byte 0x1c Eventide
13695
- >1 byte 0x1d Inventronics
13696
- >1 byte 0x1f Clarity
13697
-
13698
- # European Group
13699
- >1 byte 0x21 SIEL
13700
- >1 byte 0x22 Synthaxe
13701
- >1 byte 0x24 Hohner
13702
- >1 byte 0x25 Twister
13703
- >1 byte 0x26 Solton
13704
- >1 byte 0x27 Jellinghaus
13705
- >1 byte 0x28 Southworth
13706
- >1 byte 0x29 PPG
13707
- >1 byte 0x2a JEN
13708
- >1 byte 0x2b SSL
13709
- >1 byte 0x2c AudioVertrieb
13710
-
13711
- >1 byte 0x2f ELKA
13712
- >>3 byte 0x09 EK-44
13713
-
13714
- >1 byte 0x30 Dynacord
13715
- >1 byte 0x31 Jomox
13716
- >1 byte 0x33 Clavia
13717
- >1 byte 0x39 Soundcraft
13718
- # Some Waldorf info from http://Stromeko.Synth.net/Downloads#WaldorfDocs
13719
- >1 byte 0x3e Waldorf
13720
- >>2 byte 0x00 microWave
13721
- >>2 byte 0x0E microwave2 / XT
13722
- >>2 byte 0x0F Q / Q+
13723
- >>3 byte =0 (default id)
13724
- >>3 byte >0 (
13725
- >>>3 byte <0x7F \bdevice %d)
13726
- >>>3 byte =0x7F \bbroadcast id)
13727
- >>3 byte 0x7f Microwave I
13728
- >>>4 byte 0x00 SNDR (Sound Request)
13729
- >>>4 byte 0x10 SNDD (Sound Dump)
13730
- >>>4 byte 0x20 SNDP (Sound Parameter Change)
13731
- >>>4 byte 0x30 SNDQ (Sound Parameter Inquiry)
13732
- >>>4 byte 0x70 BOOT (Sound Reserved)
13733
- >>>4 byte 0x01 MULR (Multi Request)
13734
- >>>4 byte 0x11 MULD (Multi Dump)
13735
- >>>4 byte 0x21 MULP (Multi Parameter Change)
13736
- >>>4 byte 0x31 MULQ (Multi Parameter Inquiry)
13737
- >>>4 byte 0x71 OS (Multi Reserved)
13738
- >>>4 byte 0x02 DRMR (Drum Map Request)
13739
- >>>4 byte 0x12 DRMD (Drum Map Dump)
13740
- >>>4 byte 0x22 DRMP (Drum Map Parameter Change)
13741
- >>>4 byte 0x32 DRMQ (Drum Map Parameter Inquiry)
13742
- >>>4 byte 0x72 BIN (Drum Map Reserved)
13743
- >>>4 byte 0x03 PATR (Sequencer Pattern Request)
13744
- >>>4 byte 0x13 PATD (Sequencer Pattern Dump)
13745
- >>>4 byte 0x23 PATP (Sequencer Pattern Parameter Change)
13746
- >>>4 byte 0x33 PATQ (Sequencer Pattern Parameter Inquiry)
13747
- >>>4 byte 0x73 AFM (Sequencer Pattern Reserved)
13748
- >>>4 byte 0x04 GLBR (Global Parameter Request)
13749
- >>>4 byte 0x14 GLBD (Global Parameter Dump)
13750
- >>>4 byte 0x24 GLBP (Global Parameter Parameter Change)
13751
- >>>4 byte 0x34 GLBQ (Global Parameter Parameter Inquiry)
13752
- >>>4 byte 0x07 MODR (Mode Parameter Request)
13753
- >>>4 byte 0x17 MODD (Mode Parameter Dump)
13754
- >>>4 byte 0x27 MODP (Mode Parameter Parameter Change)
13755
- >>>4 byte 0x37 MODQ (Mode Parameter Parameter Inquiry)
13756
- >>2 byte 0x10 microQ
13757
- >>>4 byte 0x00 SNDR (Sound Request)
13758
- >>>4 byte 0x10 SNDD (Sound Dump)
13759
- >>>4 byte 0x20 SNDP (Sound Parameter Change)
13760
- >>>4 byte 0x30 SNDQ (Sound Parameter Inquiry)
13761
- >>>4 byte 0x70 (Sound Reserved)
13762
- >>>4 byte 0x01 MULR (Multi Request)
13763
- >>>4 byte 0x11 MULD (Multi Dump)
13764
- >>>4 byte 0x21 MULP (Multi Parameter Change)
13765
- >>>4 byte 0x31 MULQ (Multi Parameter Inquiry)
13766
- >>>4 byte 0x71 OS (Multi Reserved)
13767
- >>>4 byte 0x02 DRMR (Drum Map Request)
13768
- >>>4 byte 0x12 DRMD (Drum Map Dump)
13769
- >>>4 byte 0x22 DRMP (Drum Map Parameter Change)
13770
- >>>4 byte 0x32 DRMQ (Drum Map Parameter Inquiry)
13771
- >>>4 byte 0x72 BIN (Drum Map Reserved)
13772
- >>>4 byte 0x04 GLBR (Global Parameter Request)
13773
- >>>4 byte 0x14 GLBD (Global Parameter Dump)
13774
- >>>4 byte 0x24 GLBP (Global Parameter Parameter Change)
13775
- >>>4 byte 0x34 GLBQ (Global Parameter Parameter Inquiry)
13776
- >>2 byte 0x11 rackAttack
13777
- >>>4 byte 0x00 SNDR (Sound Parameter Request)
13778
- >>>4 byte 0x10 SNDD (Sound Parameter Dump)
13779
- >>>4 byte 0x20 SNDP (Sound Parameter Parameter Change)
13780
- >>>4 byte 0x30 SNDQ (Sound Parameter Parameter Inquiry)
13781
- >>>4 byte 0x01 PRGR (Program Parameter Request)
13782
- >>>4 byte 0x11 PRGD (Program Parameter Dump)
13783
- >>>4 byte 0x21 PRGP (Program Parameter Parameter Change)
13784
- >>>4 byte 0x31 PRGQ (Program Parameter Parameter Inquiry)
13785
- >>>4 byte 0x71 OS (Program Parameter Reserved)
13786
- >>>4 byte 0x03 PATR (Pattern Parameter Request)
13787
- >>>4 byte 0x13 PATD (Pattern Parameter Dump)
13788
- >>>4 byte 0x23 PATP (Pattern Parameter Parameter Change)
13789
- >>>4 byte 0x33 PATQ (Pattern Parameter Parameter Inquiry)
13790
- >>>4 byte 0x04 GLBR (Global Parameter Request)
13791
- >>>4 byte 0x14 GLBD (Global Parameter Dump)
13792
- >>>4 byte 0x24 GLBP (Global Parameter Parameter Change)
13793
- >>>4 byte 0x34 GLBQ (Global Parameter Parameter Inquiry)
13794
- >>>4 byte 0x05 EFXR (FX Parameter Request)
13795
- >>>4 byte 0x15 EFXD (FX Parameter Dump)
13796
- >>>4 byte 0x25 EFXP (FX Parameter Parameter Change)
13797
- >>>4 byte 0x35 EFXQ (FX Parameter Parameter Inquiry)
13798
- >>>4 byte 0x07 MODR (Mode Command Request)
13799
- >>>4 byte 0x17 MODD (Mode Command Dump)
13800
- >>>4 byte 0x27 MODP (Mode Command Parameter Change)
13801
- >>>4 byte 0x37 MODQ (Mode Command Parameter Inquiry)
13802
- >>2 byte 0x03 Wave
13803
- >>>4 byte 0x00 SBPR (Soundprogram)
13804
- >>>4 byte 0x01 SAPR (Performance)
13805
- >>>4 byte 0x02 SWAVE (Wave)
13806
- >>>4 byte 0x03 SWTBL (Wave control table)
13807
- >>>4 byte 0x04 SVT (Velocity Curve)
13808
- >>>4 byte 0x05 STT (Tuning Table)
13809
- >>>4 byte 0x06 SGLB (Global Parameters)
13810
- >>>4 byte 0x07 SARRMAP (Performance Program Change Map)
13811
- >>>4 byte 0x08 SBPRMAP (Sound Program Change Map)
13812
- >>>4 byte 0x09 SBPRPAR (Sound Parameter)
13813
- >>>4 byte 0x0A SARRPAR (Performance Parameter)
13814
- >>>4 byte 0x0B SINSPAR (Instrument/External Parameter)
13815
- >>>4 byte 0x0F SBULK (Bulk Switch on/off)
13816
-
13817
- # Japanese Group
13818
- >1 byte 0x40 Kawai
13819
- >>3 byte 0x20 K1
13820
- >>3 byte 0x22 K4
13821
-
13822
- >1 byte 0x41 Roland
13823
- >>3 byte 0x14 D-50
13824
- >>3 byte 0x2b U-220
13825
- >>3 byte 0x02 TR-707
13826
-
13827
- >1 byte 0x42 Korg
13828
- >>3 byte 0x19 M1
13829
-
13830
- >1 byte 0x43 Yamaha
13831
- >1 byte 0x44 Casio
13832
- >1 byte 0x46 Kamiya
13833
- >1 byte 0x47 Akai
13834
- >1 byte 0x48 Victor
13835
- >1 byte 0x49 Mesosha
13836
- >1 byte 0x4b Fujitsu
13837
- >1 byte 0x4c Sony
13838
- >1 byte 0x4e Teac
13839
- >1 byte 0x50 Matsushita
13840
- >1 byte 0x51 Fostex
13841
- >1 byte 0x52 Zoom
13842
- >1 byte 0x54 Matsushita
13843
- >1 byte 0x57 Acoustic tech. lab.
13844
-
13845
- >1 belong&0xffffff00 0x00007400 Ta Horng
13846
- >1 belong&0xffffff00 0x00007500 e-Tek
13847
- >1 belong&0xffffff00 0x00007600 E-Voice
13848
- >1 belong&0xffffff00 0x00007700 Midisoft
13849
- >1 belong&0xffffff00 0x00007800 Q-Sound
13850
- >1 belong&0xffffff00 0x00007900 Westrex
13851
- >1 belong&0xffffff00 0x00007a00 Nvidia*
13852
- >1 belong&0xffffff00 0x00007b00 ESS
13853
- >1 belong&0xffffff00 0x00007c00 Mediatrix
13854
- >1 belong&0xffffff00 0x00007d00 Brooktree
13855
- >1 belong&0xffffff00 0x00007e00 Otari
13856
- >1 belong&0xffffff00 0x00007f00 Key Electronics
13857
- >1 belong&0xffffff00 0x00010000 Shure
13858
- >1 belong&0xffffff00 0x00010100 AuraSound
13859
- >1 belong&0xffffff00 0x00010200 Crystal
13860
- >1 belong&0xffffff00 0x00010300 Rockwell
13861
- >1 belong&0xffffff00 0x00010400 Silicon Graphics
13862
- >1 belong&0xffffff00 0x00010500 Midiman
13863
- >1 belong&0xffffff00 0x00010600 PreSonus
13864
- >1 belong&0xffffff00 0x00010800 Topaz
13865
- >1 belong&0xffffff00 0x00010900 Cast Lightning
13866
- >1 belong&0xffffff00 0x00010a00 Microsoft
13867
- >1 belong&0xffffff00 0x00010b00 Sonic Foundry
13868
- >1 belong&0xffffff00 0x00010c00 Line 6
13869
- >1 belong&0xffffff00 0x00010d00 Beatnik Inc.
13870
- >1 belong&0xffffff00 0x00010e00 Van Koerving
13871
- >1 belong&0xffffff00 0x00010f00 Altech Systems
13872
- >1 belong&0xffffff00 0x00011000 S & S Research
13873
- >1 belong&0xffffff00 0x00011100 VLSI Technology
13874
- >1 belong&0xffffff00 0x00011200 Chromatic
13875
- >1 belong&0xffffff00 0x00011300 Sapphire
13876
- >1 belong&0xffffff00 0x00011400 IDRC
13877
- >1 belong&0xffffff00 0x00011500 Justonic Tuning
13878
- >1 belong&0xffffff00 0x00011600 TorComp
13879
- >1 belong&0xffffff00 0x00011700 Newtek Inc.
13880
- >1 belong&0xffffff00 0x00011800 Sound Sculpture
13881
- >1 belong&0xffffff00 0x00011900 Walker Technical
13882
- >1 belong&0xffffff00 0x00011a00 Digital Harmony
13883
- >1 belong&0xffffff00 0x00011b00 InVision
13884
- >1 belong&0xffffff00 0x00011c00 T-Square
13885
- >1 belong&0xffffff00 0x00011d00 Nemesys
13886
- >1 belong&0xffffff00 0x00011e00 DBX
13887
- >1 belong&0xffffff00 0x00011f00 Syndyne
13888
- >1 belong&0xffffff00 0x00012000 Bitheadz
13889
- >1 belong&0xffffff00 0x00012100 Cakewalk
13890
- >1 belong&0xffffff00 0x00012200 Staccato
13891
- >1 belong&0xffffff00 0x00012300 National Semicon.
13892
- >1 belong&0xffffff00 0x00012400 Boom Theory
13893
- >1 belong&0xffffff00 0x00012500 Virtual DSP Corp
13894
- >1 belong&0xffffff00 0x00012600 Antares
13895
- >1 belong&0xffffff00 0x00012700 Angel Software
13896
- >1 belong&0xffffff00 0x00012800 St Louis Music
13897
- >1 belong&0xffffff00 0x00012900 Lyrrus dba G-VOX
13898
- >1 belong&0xffffff00 0x00012a00 Ashley Audio
13899
- >1 belong&0xffffff00 0x00012b00 Vari-Lite
13900
- >1 belong&0xffffff00 0x00012c00 Summit Audio
13901
- >1 belong&0xffffff00 0x00012d00 Aureal Semicon.
13902
- >1 belong&0xffffff00 0x00012e00 SeaSound
13903
- >1 belong&0xffffff00 0x00012f00 U.S. Robotics
13904
- >1 belong&0xffffff00 0x00013000 Aurisis
13905
- >1 belong&0xffffff00 0x00013100 Nearfield Multimedia
13906
- >1 belong&0xffffff00 0x00013200 FM7 Inc.
13907
- >1 belong&0xffffff00 0x00013300 Swivel Systems
13908
- >1 belong&0xffffff00 0x00013400 Hyperactive
13909
- >1 belong&0xffffff00 0x00013500 MidiLite
13910
- >1 belong&0xffffff00 0x00013600 Radical
13911
- >1 belong&0xffffff00 0x00013700 Roger Linn
13912
- >1 belong&0xffffff00 0x00013800 Helicon
13913
- >1 belong&0xffffff00 0x00013900 Event
13914
- >1 belong&0xffffff00 0x00013a00 Sonic Network
13915
- >1 belong&0xffffff00 0x00013b00 Realtime Music
13916
- >1 belong&0xffffff00 0x00013c00 Apogee Digital
13917
-
13918
- >1 belong&0xffffff00 0x00202b00 Medeli Electronics
13919
- >1 belong&0xffffff00 0x00202c00 Charlie Lab
13920
- >1 belong&0xffffff00 0x00202d00 Blue Chip Music
13921
- >1 belong&0xffffff00 0x00202e00 BEE OH Corp
13922
- >1 belong&0xffffff00 0x00202f00 LG Semicon America
13923
- >1 belong&0xffffff00 0x00203000 TESI
13924
- >1 belong&0xffffff00 0x00203100 EMAGIC
13925
- >1 belong&0xffffff00 0x00203200 Behringer
13926
- >1 belong&0xffffff00 0x00203300 Access Music
13927
- >1 belong&0xffffff00 0x00203400 Synoptic
13928
- >1 belong&0xffffff00 0x00203500 Hanmesoft Corp
13929
- >1 belong&0xffffff00 0x00203600 Terratec
13930
- >1 belong&0xffffff00 0x00203700 Proel SpA
13931
- >1 belong&0xffffff00 0x00203800 IBK MIDI
13932
- >1 belong&0xffffff00 0x00203900 IRCAM
13933
- >1 belong&0xffffff00 0x00203a00 Propellerhead Software
13934
- >1 belong&0xffffff00 0x00203b00 Red Sound Systems
13935
- >1 belong&0xffffff00 0x00203c00 Electron ESI AB
13936
- >1 belong&0xffffff00 0x00203d00 Sintefex Audio
13937
- >1 belong&0xffffff00 0x00203e00 Music and More
13938
- >1 belong&0xffffff00 0x00203f00 Amsaro
13939
- >1 belong&0xffffff00 0x00204000 CDS Advanced Technology
13940
- >1 belong&0xffffff00 0x00204100 Touched by Sound
13941
- >1 belong&0xffffff00 0x00204200 DSP Arts
13942
- >1 belong&0xffffff00 0x00204300 Phil Rees Music
13943
- >1 belong&0xffffff00 0x00204400 Stamer Musikanlagen GmbH
13944
- >1 belong&0xffffff00 0x00204500 Soundart
13945
- >1 belong&0xffffff00 0x00204600 C-Mexx Software
13946
- >1 belong&0xffffff00 0x00204700 Klavis Tech.
13947
- >1 belong&0xffffff00 0x00204800 Noteheads AB
13948
-
13949
- 0 string T707 Roland TR-707 Data
13950
- #------------------------------------------------------------------------------
13951
- # teapot: file(1) magic for "teapot" spreadsheet
13952
- #
13953
- 0 string #!teapot\012xdr teapot work sheet (XDR format)
13954
-
13955
- #------------------------------------------------------------------------------
13956
- # terminfo: file(1) magic for terminfo
13957
- #
13958
- # XXX - byte order for screen images?
13959
- #
13960
- 0 string \032\001 Compiled terminfo entry
13961
- 0 short 0433 Curses screen image
13962
- 0 short 0434 Curses screen image
13963
- #------------------------------------------------------------------------------
13964
- # tex: file(1) magic for TeX files
13965
- #
13966
- # XXX - needs byte-endian stuff (big-endian and little-endian DVI?)
13967
- #
13968
- # From <conklin@talisman.kaleida.com>
13969
-
13970
- # Although we may know the offset of certain text fields in TeX DVI
13971
- # and font files, we can't use them reliably because they are not
13972
- # zero terminated. [but we do anyway, christos]
13973
- 0 string \367\002 TeX DVI file
13974
- !:mime application/x-dvi
13975
- >16 string >\0 (%s)
13976
- 0 string \367\203 TeX generic font data
13977
- 0 string \367\131 TeX packed font data
13978
- >3 string >\0 (%s)
13979
- 0 string \367\312 TeX virtual font data
13980
- 0 search/1 This\ is\ TeX, TeX transcript text
13981
- 0 search/1 This\ is\ METAFONT, METAFONT transcript text
13982
-
13983
- # There is no way to detect TeX Font Metric (*.tfm) files without
13984
- # breaking them apart and reading the data. The following patterns
13985
- # match most *.tfm files generated by METAFONT or afm2tfm.
13986
- 2 string \000\021 TeX font metric data
13987
- !:mime application/x-tex-tfm
13988
- >33 string >\0 (%s)
13989
- 2 string \000\022 TeX font metric data
13990
- !:mime application/x-tex-tfm
13991
- >33 string >\0 (%s)
13992
-
13993
- # Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
13994
- 0 search/1 \\input\ texinfo Texinfo source text
13995
- !:mime text/x-texinfo
13996
- 0 search/1 This\ is\ Info\ file GNU Info text
13997
- !:mime text/x-info
13998
-
13999
- # TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com)
14000
- 0 search/400 \\input TeX document text
14001
- !:mime text/x-tex
14002
- 0 search/400 \\section LaTeX document text
14003
- !:mime text/x-tex
14004
- 0 search/400 \\setlength LaTeX document text
14005
- !:mime text/x-tex
14006
- 0 search/400 \\documentstyle LaTeX document text
14007
- !:mime text/x-tex
14008
- 0 search/400 \\chapter LaTeX document text
14009
- !:mime text/x-tex
14010
- 0 search/400 \\documentclass LaTeX 2e document text
14011
- !:mime text/x-tex
14012
- 0 search/400 \\relax LaTeX auxiliary file
14013
- !:mime text/x-tex
14014
- 0 search/400 \\contentsline LaTeX table of contents
14015
- !:mime text/x-tex
14016
- 0 search/400 %\ -*-latex-*- LaTeX document text
14017
- !:mime text/x-tex
14018
-
14019
- # Tex document, from Hendrik Scholz <hendrik@scholz.net>
14020
- 0 search/1 \\ifx TeX document text
14021
-
14022
- # Index and glossary files
14023
- 0 search/400 \\indexentry LaTeX raw index file
14024
- 0 search/400 \\begin{theindex} LaTeX sorted index
14025
- 0 search/400 \\glossaryentry LaTeX raw glossary
14026
- 0 search/400 \\begin{theglossary} LaTeX sorted glossary
14027
- 0 search/400 This\ is\ makeindex Makeindex log file
14028
-
14029
- # End of TeX
14030
-
14031
- #------------------------------------------------------------------------------
14032
- # file(1) magic for BibTex text files
14033
- # From Hendrik Scholz <hendrik@scholz.net>
14034
-
14035
- 0 search/1/c @article{ BibTeX text file
14036
- 0 search/1/c @book{ BibTeX text file
14037
- 0 search/1/c @inbook{ BibTeX text file
14038
- 0 search/1/c @incollection{ BibTeX text file
14039
- 0 search/1/c @inproceedings{ BibTeX text file
14040
- 0 search/1/c @manual{ BibTeX text file
14041
- 0 search/1/c @misc{ BibTeX text file
14042
- 0 search/1/c @preamble{ BibTeX text file
14043
- 0 search/1/c @phdthesis{ BibTeX text file
14044
- 0 search/1/c @techreport{ BibTeX text file
14045
- 0 search/1/c @unpublished{ BibTeX text file
14046
-
14047
- 73 search/1 %%%\ \ BibTeX-file{ BibTex text file (with full header)
14048
-
14049
- 73 search/1 %%%\ \ @BibTeX-style-file{ BibTeX style text file (with full header)
14050
-
14051
- 0 search/1 %\ BibTeX\ standard\ bibliography\ BibTeX standard bibliography style text file
14052
-
14053
- 0 search/1 %\ BibTeX\ ` BibTeX custom bibliography style text file
14054
-
14055
- 0 search/1 @c\ @mapfile{ TeX font aliases text file
14056
- #------------------------------------------------------------------------------
14057
- # file(1) magic for tgif(1) files
14058
- # From Hendrik Scholz <hendrik@scholz.net>
14059
-
14060
- 0 string %TGIF\ x Tgif file version %s
14061
-
14062
- # ------------------------------------------------------------------------
14063
- # ti-8x: file(1) magic for the TI-8x and TI-9x Graphing Calculators.
14064
- #
14065
- # From: Ryan McGuire (rmcguire@freenet.columbus.oh.us).
14066
- #
14067
- # Update: Romain Lievin (roms@lpg.ticalc.org).
14068
- #
14069
- # NOTE: This list is not complete.
14070
- # Files for the TI-80 and TI-81 are pretty rare. I'm not going to put the
14071
- # program/group magic numbers in here because I cannot find any.
14072
- 0 string **TI80** TI-80 Graphing Calculator File.
14073
- 0 string **TI81** TI-81 Graphing Calculator File.
14074
- #
14075
- # Magic Numbers for the TI-73
14076
- #
14077
- 0 string **TI73** TI-73 Graphing Calculator
14078
- >0x00003B byte 0x00 (real number)
14079
- >0x00003B byte 0x01 (list)
14080
- >0x00003B byte 0x02 (matrix)
14081
- >0x00003B byte 0x03 (equation)
14082
- >0x00003B byte 0x04 (string)
14083
- >0x00003B byte 0x05 (program)
14084
- >0x00003B byte 0x06 (assembly program)
14085
- >0x00003B byte 0x07 (picture)
14086
- >0x00003B byte 0x08 (gdb)
14087
- >0x00003B byte 0x0C (complex number)
14088
- >0x00003B byte 0x0F (window settings)
14089
- >0x00003B byte 0x10 (zoom)
14090
- >0x00003B byte 0x11 (table setup)
14091
- >0x00003B byte 0x13 (backup)
14092
-
14093
- # Magic Numbers for the TI-82
14094
- #
14095
- 0 string **TI82** TI-82 Graphing Calculator
14096
- >0x00003B byte 0x00 (real)
14097
- >0x00003B byte 0x01 (list)
14098
- >0x00003B byte 0x02 (matrix)
14099
- >0x00003B byte 0x03 (Y-variable)
14100
- >0x00003B byte 0x05 (program)
14101
- >0x00003B byte 0x06 (protected prgm)
14102
- >0x00003B byte 0x07 (picture)
14103
- >0x00003B byte 0x08 (gdb)
14104
- >0x00003B byte 0x0B (window settings)
14105
- >0x00003B byte 0x0C (window settings)
14106
- >0x00003B byte 0x0D (table setup)
14107
- >0x00003B byte 0x0E (screenshot)
14108
- >0x00003B byte 0x0F (backup)
14109
- #
14110
- # Magic Numbers for the TI-83
14111
- #
14112
- 0 string **TI83** TI-83 Graphing Calculator
14113
- >0x00003B byte 0x00 (real)
14114
- >0x00003B byte 0x01 (list)
14115
- >0x00003B byte 0x02 (matrix)
14116
- >0x00003B byte 0x03 (Y-variable)
14117
- >0x00003B byte 0x04 (string)
14118
- >0x00003B byte 0x05 (program)
14119
- >0x00003B byte 0x06 (protected prgm)
14120
- >0x00003B byte 0x07 (picture)
14121
- >0x00003B byte 0x08 (gdb)
14122
- >0x00003B byte 0x0B (window settings)
14123
- >0x00003B byte 0x0C (window settings)
14124
- >0x00003B byte 0x0D (table setup)
14125
- >0x00003B byte 0x0E (screenshot)
14126
- >0x00003B byte 0x13 (backup)
14127
- #
14128
- # Magic Numbers for the TI-83+
14129
- #
14130
- 0 string **TI83F* TI-83+ Graphing Calculator
14131
- >0x00003B byte 0x00 (real number)
14132
- >0x00003B byte 0x01 (list)
14133
- >0x00003B byte 0x02 (matrix)
14134
- >0x00003B byte 0x03 (equation)
14135
- >0x00003B byte 0x04 (string)
14136
- >0x00003B byte 0x05 (program)
14137
- >0x00003B byte 0x06 (assembly program)
14138
- >0x00003B byte 0x07 (picture)
14139
- >0x00003B byte 0x08 (gdb)
14140
- >0x00003B byte 0x0C (complex number)
14141
- >0x00003B byte 0x0F (window settings)
14142
- >0x00003B byte 0x10 (zoom)
14143
- >0x00003B byte 0x11 (table setup)
14144
- >0x00003B byte 0x13 (backup)
14145
- >0x00003B byte 0x15 (application variable)
14146
- >0x00003B byte 0x17 (group of variable)
14147
-
14148
- #
14149
- # Magic Numbers for the TI-85
14150
- #
14151
- 0 string **TI85** TI-85 Graphing Calculator
14152
- >0x00003B byte 0x00 (real number)
14153
- >0x00003B byte 0x01 (complex number)
14154
- >0x00003B byte 0x02 (real vector)
14155
- >0x00003B byte 0x03 (complex vector)
14156
- >0x00003B byte 0x04 (real list)
14157
- >0x00003B byte 0x05 (complex list)
14158
- >0x00003B byte 0x06 (real matrix)
14159
- >0x00003B byte 0x07 (complex matrix)
14160
- >0x00003B byte 0x08 (real constant)
14161
- >0x00003B byte 0x09 (complex constant)
14162
- >0x00003B byte 0x0A (equation)
14163
- >0x00003B byte 0x0C (string)
14164
- >0x00003B byte 0x0D (function GDB)
14165
- >0x00003B byte 0x0E (polar GDB)
14166
- >0x00003B byte 0x0F (parametric GDB)
14167
- >0x00003B byte 0x10 (diffeq GDB)
14168
- >0x00003B byte 0x11 (picture)
14169
- >0x00003B byte 0x12 (program)
14170
- >0x00003B byte 0x13 (range)
14171
- >0x00003B byte 0x17 (window settings)
14172
- >0x00003B byte 0x18 (window settings)
14173
- >0x00003B byte 0x19 (window settings)
14174
- >0x00003B byte 0x1A (window settings)
14175
- >0x00003B byte 0x1B (zoom)
14176
- >0x00003B byte 0x1D (backup)
14177
- >0x00003B byte 0x1E (unknown)
14178
- >0x00003B byte 0x2A (equation)
14179
- >0x000032 string ZS4 - ZShell Version 4 File.
14180
- >0x000032 string ZS3 - ZShell Version 3 File.
14181
- #
14182
- # Magic Numbers for the TI-86
14183
- #
14184
- 0 string **TI86** TI-86 Graphing Calculator
14185
- >0x00003B byte 0x00 (real number)
14186
- >0x00003B byte 0x01 (complex number)
14187
- >0x00003B byte 0x02 (real vector)
14188
- >0x00003B byte 0x03 (complex vector)
14189
- >0x00003B byte 0x04 (real list)
14190
- >0x00003B byte 0x05 (complex list)
14191
- >0x00003B byte 0x06 (real matrix)
14192
- >0x00003B byte 0x07 (complex matrix)
14193
- >0x00003B byte 0x08 (real constant)
14194
- >0x00003B byte 0x09 (complex constant)
14195
- >0x00003B byte 0x0A (equation)
14196
- >0x00003B byte 0x0C (string)
14197
- >0x00003B byte 0x0D (function GDB)
14198
- >0x00003B byte 0x0E (polar GDB)
14199
- >0x00003B byte 0x0F (parametric GDB)
14200
- >0x00003B byte 0x10 (diffeq GDB)
14201
- >0x00003B byte 0x11 (picture)
14202
- >0x00003B byte 0x12 (program)
14203
- >0x00003B byte 0x13 (range)
14204
- >0x00003B byte 0x17 (window settings)
14205
- >0x00003B byte 0x18 (window settings)
14206
- >0x00003B byte 0x19 (window settings)
14207
- >0x00003B byte 0x1A (window settings)
14208
- >0x00003B byte 0x1B (zoom)
14209
- >0x00003B byte 0x1D (backup)
14210
- >0x00003B byte 0x1E (unknown)
14211
- >0x00003B byte 0x2A (equation)
14212
- #
14213
- # Magic Numbers for the TI-89
14214
- #
14215
- 0 string **TI89** TI-89 Graphing Calculator
14216
- >0x000048 byte 0x00 (expression)
14217
- >0x000048 byte 0x04 (list)
14218
- >0x000048 byte 0x06 (matrix)
14219
- >0x000048 byte 0x0A (data)
14220
- >0x000048 byte 0x0B (text)
14221
- >0x000048 byte 0x0C (string)
14222
- >0x000048 byte 0x0D (graphic data base)
14223
- >0x000048 byte 0x0E (figure)
14224
- >0x000048 byte 0x10 (picture)
14225
- >0x000048 byte 0x12 (program)
14226
- >0x000048 byte 0x13 (function)
14227
- >0x000048 byte 0x14 (macro)
14228
- >0x000048 byte 0x1C (zipped)
14229
- >0x000048 byte 0x21 (assembler)
14230
- #
14231
- # Magic Numbers for the TI-92
14232
- #
14233
- 0 string **TI92** TI-92 Graphing Calculator
14234
- >0x000048 byte 0x00 (expression)
14235
- >0x000048 byte 0x04 (list)
14236
- >0x000048 byte 0x06 (matrix)
14237
- >0x000048 byte 0x0A (data)
14238
- >0x000048 byte 0x0B (text)
14239
- >0x000048 byte 0x0C (string)
14240
- >0x000048 byte 0x0D (graphic data base)
14241
- >0x000048 byte 0x0E (figure)
14242
- >0x000048 byte 0x10 (picture)
14243
- >0x000048 byte 0x12 (program)
14244
- >0x000048 byte 0x13 (function)
14245
- >0x000048 byte 0x14 (macro)
14246
- >0x000048 byte 0x1D (backup)
14247
- #
14248
- # Magic Numbers for the TI-92+/V200
14249
- #
14250
- 0 string **TI92P* TI-92+/V200 Graphing Calculator
14251
- >0x000048 byte 0x00 (expression)
14252
- >0x000048 byte 0x04 (list)
14253
- >0x000048 byte 0x06 (matrix)
14254
- >0x000048 byte 0x0A (data)
14255
- >0x000048 byte 0x0B (text)
14256
- >0x000048 byte 0x0C (string)
14257
- >0x000048 byte 0x0D (graphic data base)
14258
- >0x000048 byte 0x0E (figure)
14259
- >0x000048 byte 0x10 (picture)
14260
- >0x000048 byte 0x12 (program)
14261
- >0x000048 byte 0x13 (function)
14262
- >0x000048 byte 0x14 (macro)
14263
- >0x000048 byte 0x1C (zipped)
14264
- >0x000048 byte 0x21 (assembler)
14265
- #
14266
- # Magic Numbers for the TI-73/83+/89/92+/V200 FLASH upgrades
14267
- #
14268
- 0x0000016 string Advanced TI-XX Graphing Calculator (FLASH)
14269
- 0 string **TIFL** TI-XX Graphing Calculator (FLASH)
14270
- >8 byte >0 - Revision %d
14271
- >>9 byte x \b.%d,
14272
- >12 byte >0 Revision date %02x
14273
- >>13 byte x \b/%02x
14274
- >>14 beshort x \b/%04x,
14275
- >17 string >/0 name: '%s',
14276
- >48 byte 0x74 device: TI-73,
14277
- >48 byte 0x73 device: TI-83+,
14278
- >48 byte 0x98 device: TI-89,
14279
- >48 byte 0x88 device: TI-92+,
14280
- >49 byte 0x23 type: OS upgrade,
14281
- >49 byte 0x24 type: application,
14282
- >49 byte 0x25 type: certificate,
14283
- >49 byte 0x3e type: license,
14284
- >74 lelong >0 size: %ld bytes
14285
-
14286
- # VTi & TiEmu skins (TI Graphing Calculators).
14287
- # From: Romain Lievin (roms@lpg.ticalc.org).
14288
- # Magic Numbers for the VTi skins
14289
- 0 string VTI Virtual TI skin
14290
- >3 string v - Version
14291
- >>4 byte >0 \b %c
14292
- >>6 byte x \b.%c
14293
- # Magic Numbers for the TiEmu skins
14294
- 0 string TiEmu TiEmu skin
14295
- >6 string v - Version
14296
- >>7 byte >0 \b %c
14297
- >>9 byte x \b.%c
14298
- >>10 byte x \b%c
14299
-
14300
- #------------------------------------------------------------------------------
14301
- # timezone: file(1) magic for timezone data
14302
- #
14303
- # from Daniel Quinlan (quinlan@yggdrasil.com)
14304
- # this should work on Linux, SunOS, and maybe others
14305
- # Added new official magic number for recent versions of the Olson code
14306
- 0 string TZif timezone data
14307
- >4 byte 0 \b, old version
14308
- >4 byte >0 \b, version %c
14309
- >20 belong 0 \b, no gmt time flags
14310
- >20 belong 1 \b, 1 gmt time flag
14311
- >20 belong >1 \b, %d gmt time flags
14312
- >24 belong 0 \b, no std time flags
14313
- >20 belong 1 \b, 1 std time flag
14314
- >24 belong >1 \b, %d std time flags
14315
- >28 belong 0 \b, no leap seconds
14316
- >28 belong 1 \b, 1 leap second
14317
- >28 belong >1 \b, %d leap seconds
14318
- >32 belong 0 \b, no transition times
14319
- >32 belong 1 \b, 1 transition time
14320
- >32 belong >1 \b, %d transition times
14321
- >36 belong 0 \b, no abbreviation chars
14322
- >36 belong 1 \b, 1 abbreviation char
14323
- >36 belong >1 \b, %d abbreviation chars
14324
- 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0 old timezone data
14325
- 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0 old timezone data
14326
- 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0 old timezone data
14327
- 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0 old timezone data
14328
- 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0 old timezone data
14329
- 0 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\6\0 old timezone data
14330
- #------------------------------------------------------------------------------
14331
- # troff: file(1) magic for *roff
14332
- #
14333
- # updated by Daniel Quinlan (quinlan@yggdrasil.com)
14334
-
14335
- # troff input
14336
- 0 search/1 .\\" troff or preprocessor input text
14337
- !:mime text/troff
14338
- 0 search/1 '\\" troff or preprocessor input text
14339
- !:mime text/troff
14340
- 0 search/1 '.\\" troff or preprocessor input text
14341
- !:mime text/troff
14342
- 0 search/1 \\" troff or preprocessor input text
14343
- !:mime text/troff
14344
- 0 search/1 ''' troff or preprocessor input text
14345
- !:mime text/troff
14346
- 0 regex/20 \^\\.[A-Za-z0-9][A-Za-z0-9][\ \t] troff or preprocessor input text
14347
- !:mime text/troff
14348
- 0 regex/20 \^\\.[A-Za-z0-9][A-Za-z0-9]$ troff or preprocessor input text
14349
- !:mime text/troff
14350
-
14351
- # ditroff intermediate output text
14352
- 0 search/1 x\ T ditroff output text
14353
- >4 search/1 cat for the C/A/T phototypesetter
14354
- >4 search/1 ps for PostScript
14355
- >4 search/1 dvi for DVI
14356
- >4 search/1 ascii for ASCII
14357
- >4 search/1 lj4 for LaserJet 4
14358
- >4 search/1 latin1 for ISO 8859-1 (Latin 1)
14359
- >4 search/1 X75 for xditview at 75dpi
14360
- >>7 search/1 -12 (12pt)
14361
- >4 search/1 X100 for xditview at 100dpi
14362
- >>8 search/1 -12 (12pt)
14363
-
14364
- # output data formats
14365
- 0 string \100\357 very old (C/A/T) troff output data
14366
- #
14367
- #------------------------------------------------------------------------------
14368
- # tuxedo: file(1) magic for BEA TUXEDO data files
14369
- #
14370
- # from Ian Springer <ispringer@hotmail.com>
14371
- #
14372
- 0 string \0\0\1\236\0\0\0\0\0\0\0\0\0\0\0\0 BEA TUXEDO DES mask data
14373
-
14374
- #------------------------------------------------------------------------------
14375
- # typeset: file(1) magic for other typesetting
14376
- #
14377
- 0 string Interpress/Xerox Xerox InterPress data
14378
- >16 string / (version
14379
- >>17 string >\0 %s)
14380
- #---------------------------------------------------------------------------
14381
- # Unicode: BOM prefixed text files - Adrian Havill <havill@turbolinux.co.jp>
14382
- # GRR: These types should be recognised in file_ascmagic so these
14383
- # encodings can be treated by text patterns.
14384
- # Missing types are already dealt with internally.
14385
- #
14386
- 0 string +/v8 Unicode text, UTF-7
14387
- 0 string +/v9 Unicode text, UTF-7
14388
- 0 string +/v+ Unicode text, UTF-7
14389
- 0 string +/v/ Unicode text, UTF-7
14390
- 0 string \335\163\146\163 Unicode text, UTF-8-EBCDIC
14391
- 0 string \000\000\376\377 Unicode text, UTF-32, big-endian
14392
- 0 string \377\376\000\000 Unicode text, UTF-32, little-endian
14393
- 0 string \016\376\377 Unicode text, SCSU (Standard Compression Scheme for Unicode)
14394
-
14395
- #------------------------------------------------------------------------------
14396
- # unknown: file(1) magic for unknown machines
14397
- #
14398
- # XXX - this probably should be pruned, as it'll match PDP-11 and
14399
- # VAX image formats.
14400
- #
14401
- # 0x107 is 0407; 0x108 is 0410; both are PDP-11 (executable and pure,
14402
- # respectively).
14403
- #
14404
- # 0x109 is 0411; that's PDP-11 split I&D, but the PDP-11 version doesn't
14405
- # have the "version %ld", which may be a bogus COFFism (I don't think
14406
- # there ever was COFF for the PDP-11).
14407
- #
14408
- # 0x10B is 0413; that's VAX demand-paged, but this is a short, not a
14409
- # long, as it would be on a VAX.
14410
- #
14411
- # 0x10C is 0414 and 0x10E is 416; those *are* unknown.
14412
- #
14413
- 0 short 0x107 unknown machine executable
14414
- >8 short >0 not stripped
14415
- >15 byte >0 - version %ld
14416
- 0 short 0x108 unknown pure executable
14417
- >8 short >0 not stripped
14418
- >15 byte >0 - version %ld
14419
- 0 short 0x109 PDP-11 separate I&D
14420
- >8 short >0 not stripped
14421
- >15 byte >0 - version %ld
14422
- 0 short 0x10b unknown pure executable
14423
- >8 short >0 not stripped
14424
- >15 byte >0 - version %ld
14425
- 0 long 0x10c unknown demand paged pure executable
14426
- >16 long >0 not stripped
14427
- 0 long 0x10e unknown readable demand paged pure executable
14428
- #------------------------------------------------------------------------------
14429
- # uuencode: file(1) magic for ASCII-encoded files
14430
- #
14431
-
14432
- # GRR: the first line of xxencoded files is identical to that in uuencoded
14433
- # files, but the first character in most subsequent lines is 'h' instead of
14434
- # 'M'. (xxencoding uses lowercase letters in place of most of uuencode's
14435
- # punctuation and survives BITNET gateways better.) If regular expressions
14436
- # were supported, this entry could possibly be split into two with
14437
- # "begin\040\.\*\012M" or "begin\040\.\*\012h" (where \. and \* are REs).
14438
- 0 search/1 begin\ uuencoded or xxencoded text
14439
-
14440
- # btoa(1) is an alternative to uuencode that requires less space.
14441
- 0 search/1 xbtoa\ Begin btoa'd text
14442
-
14443
- # ship(1) is another, much cooler alternative to uuencode.
14444
- # Greg Roelofs, newt@uchicago.edu
14445
- 0 search/1 $\012ship ship'd binary text
14446
-
14447
- # bencode(8) is used to encode compressed news batches (Bnews/Cnews only?)
14448
- # Greg Roelofs, newt@uchicago.edu
14449
- 0 search/1 Decode\ the\ following\ with\ bdeco bencoded News text
14450
-
14451
- # BinHex is the Macintosh ASCII-encoded file format (see also "apple")
14452
- # Daniel Quinlan, quinlan@yggdrasil.com
14453
- 11 search/1 must\ be\ converted\ with\ BinHex BinHex binary text
14454
- >41 search/1 x \b, version %.3s
14455
-
14456
- # GRR: handle BASE64
14457
-
14458
- #------------------------------------------------------------------------------
14459
- # varied.out: file(1) magic for various USG systems
14460
- #
14461
- # Herewith many of the object file formats used by USG systems.
14462
- # Most have been moved to files for a particular processor,
14463
- # and deleted if they duplicate other entries.
14464
- #
14465
- 0 short 0610 Perkin-Elmer executable
14466
- # AMD 29K
14467
- 0 beshort 0572 amd 29k coff noprebar executable
14468
- 0 beshort 01572 amd 29k coff prebar executable
14469
- 0 beshort 0160007 amd 29k coff archive
14470
- # Cray
14471
- 6 beshort 0407 unicos (cray) executable
14472
- # Ultrix 4.3
14473
- 596 string \130\337\377\377 Ultrix core file
14474
- >600 string >\0 from '%s'
14475
- # BeOS and MAcOS PEF executables
14476
- # From: hplus@zilker.net (Jon Watte)
14477
- 0 string Joy!peffpwpc header for PowerPC PEF executable
14478
- #
14479
- # ava assembler/linker Uros Platise <uros.platise@ijs.si>
14480
- 0 string avaobj AVR assembler object code
14481
- >7 string >\0 version '%s'
14482
- # gnu gmon magic From: Eugen Dedu <dedu@ese-metz.fr>
14483
- 0 string gmon GNU prof performance data
14484
- >4 long x - version %ld
14485
- # From: Dave Pearson <davep@davep.org>
14486
- # Harbour <URL:http://www.harbour-project.org/> HRB files.
14487
- 0 string \xc0HRB Harbour HRB file
14488
- >4 short x version %d
14489
-
14490
- # From: Alex Beregszaszi <alex@fsn.hu>
14491
- # 0 string exec BugOS executable
14492
- # 0 string pack BugOS archive
14493
-
14494
- # From: Jason Spence <jspence@lightconsulting.com>
14495
- # Generated by the "examples" in STM's ST40 devkit, and derived code.
14496
- 0 lelong 0x13a9f17e ST40 component image format
14497
- >4 string >\0 \b, name '%s'
14498
-
14499
- #------------------------------------------------------------------------------
14500
- # varied.script: file(1) magic for various interpreter scripts
14501
-
14502
- 0 string #!\ / a
14503
- >3 string >\0 %s script text executable
14504
- 0 string #!\t/ a
14505
- >3 string >\0 %s script text executable
14506
- 0 string #!/ a
14507
- >2 string >\0 %s script text executable
14508
- 0 string #!\ script text executable
14509
- >3 string >\0 for %s
14510
-
14511
- # From: arno <arenevier@fdn.fr>
14512
- # mozilla xpconnect typelib
14513
- # see http://www.mozilla.org/scriptable/typelib_file.html
14514
- 0 string XPCOM\nTypeLib\r\n\032 XPConnect Typelib
14515
- >0x10 byte x version %d
14516
- >>0x11 byte x \b.%d
14517
-
14518
- #------------------------------------------------------------------------------
14519
- # vax: file(1) magic for VAX executable/object and APL workspace
14520
- #
14521
- 0 lelong 0101557 VAX single precision APL workspace
14522
- 0 lelong 0101556 VAX double precision APL workspace
14523
-
14524
- #
14525
- # VAX a.out (32V, BSD)
14526
- #
14527
- 0 lelong 0407 VAX executable
14528
- >16 lelong >0 not stripped
14529
-
14530
- 0 lelong 0410 VAX pure executable
14531
- >16 lelong >0 not stripped
14532
-
14533
- 0 lelong 0413 VAX demand paged pure executable
14534
- >16 lelong >0 not stripped
14535
-
14536
- 0 lelong 0420 VAX demand paged (first page unmapped) pure executable
14537
- >16 lelong >0 not stripped
14538
-
14539
- #
14540
- # VAX COFF
14541
- #
14542
- # The `versions' should be un-commented if they work for you.
14543
- # (Was the problem just one of endianness?)
14544
- #
14545
- 0 leshort 0570 VAX COFF executable
14546
- >12 lelong >0 not stripped
14547
- >22 leshort >0 - version %ld
14548
- 0 leshort 0575 VAX COFF pure executable
14549
- >12 lelong >0 not stripped
14550
- >22 leshort >0 - version %ld
14551
-
14552
- #------------------------------------------------------------------------------
14553
- # vicar: file(1) magic for VICAR files.
14554
- #
14555
- # From: Ossama Othman <othman@astrosun.tn.cornell.edu
14556
- # VICAR is JPL's in-house spacecraft image processing program
14557
- # VICAR image
14558
- 0 string LBLSIZE= VICAR image data
14559
- >32 string BYTE \b, 8 bits = VAX byte
14560
- >32 string HALF \b, 16 bits = VAX word = Fortran INTEGER*2
14561
- >32 string FULL \b, 32 bits = VAX longword = Fortran INTEGER*4
14562
- >32 string REAL \b, 32 bits = VAX longword = Fortran REAL*4
14563
- >32 string DOUB \b, 64 bits = VAX quadword = Fortran REAL*8
14564
- >32 string COMPLEX \b, 64 bits = VAX quadword = Fortran COMPLEX*8
14565
- # VICAR label file
14566
- 43 string SFDU_LABEL VICAR label file
14567
- #------------------------------------------------------------------------------
14568
- # Virtutech Compressed Random Access File Format
14569
- #
14570
- # From <gustav@virtutech.com>
14571
- 0 string \211\277\036\203 Virtutech CRAFF
14572
- >4 belong x v%d
14573
- >20 belong 0 uncompressed
14574
- >20 belong 1 bzipp2ed
14575
- >20 belong 2 gzipped
14576
- >24 belong 0 not clean
14577
-
14578
- #------------------------------------------------------------------------------
14579
- # visx: file(1) magic for Visx format files
14580
- #
14581
- 0 short 0x5555 VISX image file
14582
- >2 byte 0 (zero)
14583
- >2 byte 1 (unsigned char)
14584
- >2 byte 2 (short integer)
14585
- >2 byte 3 (float 32)
14586
- >2 byte 4 (float 64)
14587
- >2 byte 5 (signed char)
14588
- >2 byte 6 (bit-plane)
14589
- >2 byte 7 (classes)
14590
- >2 byte 8 (statistics)
14591
- >2 byte 10 (ascii text)
14592
- >2 byte 15 (image segments)
14593
- >2 byte 100 (image set)
14594
- >2 byte 101 (unsigned char vector)
14595
- >2 byte 102 (short integer vector)
14596
- >2 byte 103 (float 32 vector)
14597
- >2 byte 104 (float 64 vector)
14598
- >2 byte 105 (signed char vector)
14599
- >2 byte 106 (bit plane vector)
14600
- >2 byte 121 (feature vector)
14601
- >2 byte 122 (feature vector library)
14602
- >2 byte 124 (chain code)
14603
- >2 byte 126 (bit vector)
14604
- >2 byte 130 (graph)
14605
- >2 byte 131 (adjacency graph)
14606
- >2 byte 132 (adjacency graph library)
14607
- >2 string .VISIX (ascii text)
14608
-
14609
- #------------------------------------------------------------------------------
14610
- # vms: file(1) magic for VMS executables (experimental)
14611
- #
14612
- # VMS .exe formats, both VAX and AXP (Greg Roelofs, newt@uchicago.edu)
14613
-
14614
- # GRR 950122: I'm just guessing on these, based on inspection of the headers
14615
- # of three executables each for Alpha and VAX architectures. The VAX files
14616
- # all had headers similar to this:
14617
- #
14618
- # 00000 b0 00 30 00 44 00 60 00 00 00 00 00 30 32 30 35 ..0.D.`.....0205
14619
- # 00010 01 01 00 00 ff ff ff ff ff ff ff ff 00 00 00 00 ................
14620
- #
14621
- 0 string \xb0\0\x30\0 VMS VAX executable
14622
- >44032 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption
14623
- #
14624
- # The AXP files all looked like this, except that the byte at offset 0x22
14625
- # was 06 in some of them and 07 in others:
14626
- #
14627
- # 00000 03 00 00 00 00 00 00 00 ec 02 00 00 10 01 00 00 ................
14628
- # 00010 68 00 00 00 98 00 00 00 b8 00 00 00 00 00 00 00 h...............
14629
- # 00020 00 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
14630
- # 00030 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 ................
14631
- # 00040 00 00 00 00 ff ff ff ff ff ff ff ff 02 00 00 00 ................
14632
- #
14633
- 0 belong 0x03000000 VMS Alpha executable
14634
- >75264 string PK\003\004 \b, Info-ZIP SFX archive v5.12 w/decryption
14635
-
14636
- # -----------------------------------------------------------
14637
- # VMware specific files (deducted from version 1.1 and log file entries)
14638
- # Anthon van der Neut (anthon@mnt.org)
14639
- 0 belong 0x4d52564e VMware nvram
14640
-
14641
- #------------------------------------------------------------------------------
14642
- # vorbis: file(1) magic for Ogg/Vorbis files
14643
- #
14644
- # From Felix von Leitner <leitner@fefe.de>
14645
- # Extended by Beni Cherniavsky <cben@crosswinds.net>
14646
- # Further extended by Greg Wooledge <greg@wooledge.org>
14647
- #
14648
- # Most (everything but the number of channels and bitrate) is commented
14649
- # out with `##' as it's not interesting to the average user. The most
14650
- # probable things advanced users would want to uncomment are probably
14651
- # the number of comments and the encoder version.
14652
- #
14653
- # FIXME: The first match has been made a search, so that it can skip
14654
- # over prepended ID3 tags. This will work for MIME type detection, but
14655
- # won't work for detecting other properties of the file (they all need
14656
- # to be made relative to the search). In any case, if the file has ID3
14657
- # tags, the ID3 information will be printed, not the Ogg information,
14658
- # so until that's fixed, this doesn't matter.
14659
- # FIXME[2]: Disable the above for now, since search assumes text mode.
14660
- #
14661
- # --- Ogg Framing ---
14662
- #0 search/1000 OggS Ogg data
14663
- 0 string OggS Ogg data
14664
- !:mime application/ogg
14665
- >4 byte !0 UNKNOWN REVISION %u
14666
- ##>4 byte 0 revision 0
14667
- >4 byte 0
14668
- ##>>14 lelong x (Serial %lX)
14669
- # non-Vorbis content: FLAC (Free Lossless Audio Codec, http://flac.sourceforge.net)
14670
- >>28 string \x7fFLAC \b, FLAC audio
14671
- # non-Vorbis content: Theora
14672
- >>28 string \x80theora \b, Theora video
14673
- # non-Vorbis content: Kate
14674
- >>28 string \x80kate\0\0\0\0 \b, Kate
14675
- >>>37 ubyte x v%u
14676
- >>>38 ubyte x \b.%u,
14677
- >>>40 byte 0 utf8 encoding,
14678
- >>>40 byte !0 unknown character encoding,
14679
- >>>60 string >\0 language %s,
14680
- >>>60 string \0 no language set,
14681
- >>>76 string >\0 category %s
14682
- >>>76 string \0 no category set
14683
- # non-Vorbis content: Skeleton
14684
- >>28 string fishead\0 \b, Skeleton
14685
- >>>36 short x v%u
14686
- >>>40 short x \b.%u
14687
- # non-Vorbis content: Speex
14688
- >>28 string Speex\ \ \ \b, Speex audio
14689
- # non-Vorbis content: OGM
14690
- >>28 string \x01video\0\0\0 \b, OGM video
14691
- >>>37 string/c div3 (DivX 3)
14692
- >>>37 string/c divx (DivX 4)
14693
- >>>37 string/c dx50 (DivX 5)
14694
- >>>37 string/c xvid (XviD)
14695
- # --- First vorbis packet - general header ---
14696
- >>28 string \x01vorbis \b, Vorbis audio,
14697
- >>>35 lelong !0 UNKNOWN VERSION %lu,
14698
- ##>>>35 lelong 0 version 0,
14699
- >>>35 lelong 0
14700
- >>>>39 ubyte 1 mono,
14701
- >>>>39 ubyte 2 stereo,
14702
- >>>>39 ubyte >2 %u channels,
14703
- >>>>40 lelong x %lu Hz
14704
- # Minimal, nominal and maximal bitrates specified when encoding
14705
- >>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff \b,
14706
- # The above tests if at least one of these is specified:
14707
- >>>>>52 lelong !-1
14708
- # Vorbis RC2 has a bug which puts -1000 in the min/max bitrate fields
14709
- # instead of -1.
14710
- # Vorbis 1.0 uses 0 instead of -1.
14711
- >>>>>>52 lelong !0
14712
- >>>>>>>52 lelong !-1000
14713
- >>>>>>>>52 lelong x <%lu
14714
- >>>>>48 lelong !-1
14715
- >>>>>>48 lelong x ~%lu
14716
- >>>>>44 lelong !-1
14717
- >>>>>>44 lelong !-1000
14718
- >>>>>>>44 lelong !0
14719
- >>>>>>>>44 lelong x >%lu
14720
- >>>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff bps
14721
- # -- Second vorbis header packet - the comments
14722
- # A kludge to read the vendor string. It's a counted string, not a
14723
- # zero-terminated one, so file(1) can't read it in a generic way.
14724
- # libVorbis is the only one existing currently, so I detect specifically
14725
- # it. The interesting value is the cvs date (8 digits decimal).
14726
- # Post-RC1 Ogg files have the second header packet (and thus the version)
14727
- # in a different place, so we must use an indirect offset.
14728
- >>>(84.b+85) string \x03vorbis
14729
- >>>>(84.b+96) string/c Xiphophorus\ libVorbis\ I \b, created by: Xiphophorus libVorbis I
14730
- >>>>>(84.b+120) string >00000000
14731
- # Map to beta version numbers:
14732
- >>>>>>(84.b+120) string <20000508 (<beta1, prepublic)
14733
- >>>>>>(84.b+120) string 20000508 (1.0 beta 1 or beta 2)
14734
- >>>>>>(84.b+120) string >20000508
14735
- >>>>>>>(84.b+120) string <20001031 (beta2-3)
14736
- >>>>>>(84.b+120) string 20001031 (1.0 beta 3)
14737
- >>>>>>(84.b+120) string >20001031
14738
- >>>>>>>(84.b+120) string <20010225 (beta3-4)
14739
- >>>>>>(84.b+120) string 20010225 (1.0 beta 4)
14740
- >>>>>>(84.b+120) string >20010225
14741
- >>>>>>>(84.b+120) string <20010615 (beta4-RC1)
14742
- >>>>>>(84.b+120) string 20010615 (1.0 RC1)
14743
- >>>>>>(84.b+120) string 20010813 (1.0 RC2)
14744
- >>>>>>(84.b+120) string 20010816 (RC2 - Garf tuned v1)
14745
- >>>>>>(84.b+120) string 20011014 (RC2 - Garf tuned v2)
14746
- >>>>>>(84.b+120) string 20011217 (1.0 RC3)
14747
- >>>>>>(84.b+120) string 20011231 (1.0 RC3)
14748
- # Some pre-1.0 CVS snapshots still had "Xiphphorus"...
14749
- >>>>>>(84.b+120) string >20011231 (pre-1.0 CVS)
14750
- # For the 1.0 release, Xiphophorus is replaced by Xiph.Org
14751
- >>>>(84.b+96) string/c Xiph.Org\ libVorbis\ I \b, created by: Xiph.Org libVorbis I
14752
- >>>>>(84.b+117) string >00000000
14753
- >>>>>>(84.b+117) string <20020717 (pre-1.0 CVS)
14754
- >>>>>>(84.b+117) string 20020717 (1.0)
14755
- >>>>>>(84.b+117) string 20030909 (1.0.1)
14756
- >>>>>>(84.b+117) string 20040629 (1.1.0 RC1)
14757
-
14758
- #------------------------------------------------------------------------------
14759
- # VXL: file(1) magic for VXL binary IO data files
14760
- #
14761
- # from Ian Scott <scottim@sf.net>
14762
- #
14763
- # VXL is a collection of C++ libraries for Computer Vision.
14764
- # See the vsl chapter in the VXL Book for more info
14765
- # http://www.isbe.man.ac.uk/public_vxl_doc/books/vxl/book.html
14766
- # http:/vxl.sf.net
14767
-
14768
- 2 lelong 0x472b2c4e VXL data file,
14769
- >0 leshort >0 schema version no %d
14770
-
14771
- #------------------------------------------------------------------------------
14772
- # warc: file(1) magic for WARC files
14773
-
14774
- 0 string WARC/ WARC Archive
14775
- >5 string x version %.4s
14776
- #------------------------------------------------------------------------------
14777
- # weak: file(1) magic for very weak magic entries, disabled by default
14778
- #
14779
- # These entries are so weak that they might interfere identification of
14780
- # other formats. Example include:
14781
- # - Only identify for 1 or 2 bytes
14782
- # - Match against very wide range of values
14783
- # - Match against generic word in some spoken languages (e.g. English)
14784
-
14785
- # Summary: Computer Graphics Metafile
14786
- # Extension: .cgm
14787
- #0 beshort&0xffe0 0x0020 binary Computer Graphics Metafile
14788
- #0 beshort 0x3020 character Computer Graphics Metafile
14789
-
14790
- #0 string =!! Bennet Yee's "face" format
14791
-
14792
- #------------------------------------------------------------------------------
14793
- # windows: file(1) magic for Microsoft Windows
14794
- #
14795
- # This file is mainly reserved for files where programs
14796
- # using them are run almost always on MS Windows 3.x or
14797
- # above, or files only used exclusively in Windows OS,
14798
- # where there is no better category to allocate for.
14799
- # For example, even though WinZIP almost run on Windows
14800
- # only, it is better to treat them as "archive" instead.
14801
- # For format usable in DOS, such as generic executable
14802
- # format, please specify under "msdos" file.
14803
- #
14804
-
14805
-
14806
- # Summary: Outlook Express DBX file
14807
- # Extension: .dbx
14808
- # Created by: Christophe Monniez
14809
- 0 string \xCF\xAD\x12\xFE MS Outlook Express DBX file
14810
- >4 byte =0xC5 \b, message database
14811
- >4 byte =0xC6 \b, folder database
14812
- >4 byte =0xC7 \b, account information
14813
- >4 byte =0x30 \b, offline database
14814
-
14815
-
14816
- # Summary: Windows crash dump
14817
- # Extension: .dmp
14818
- # Created by: Andreas Schuster (http://computer.forensikblog.de/)
14819
- # Reference (1): http://computer.forensikblog.de/en/2008/02/64bit_magic.html
14820
- # Modified by (1): Abel Cheung (Avoid match with first 4 bytes only)
14821
- 0 string PAGE
14822
- >4 string DUMP MS Windows 32bit crash dump
14823
- >>0x05c byte 0 \b, no PAE
14824
- >>0x05c byte 1 \b, PAE
14825
- >>0xf88 lelong 1 \b, full dump
14826
- >>0xf88 lelong 2 \b, kernel dump
14827
- >>0xf88 lelong 3 \b, small dump
14828
- >>0x068 lelong x \b, %ld pages
14829
- >4 string DU64 MS Windows 64bit crash dump
14830
- >>0xf98 lelong 1 \b, full dump
14831
- >>0xf98 lelong 2 \b, kernel dump
14832
- >>0xf98 lelong 3 \b, small dump
14833
- >>0x090 lequad x \b, %lld pages
14834
-
14835
-
14836
- # Summary: Vista Event Log
14837
- # Extension: .evtx
14838
- # Created by: Andreas Schuster (http://computer.forensikblog.de/)
14839
- # Reference (1): http://computer.forensikblog.de/en/2007/05/some_magic.html
14840
- 0 string ElfFile\0 MS Windows Vista Event Log
14841
- >0x2a leshort x \b, %d chunks
14842
- >>0x10 lelong x \b (no. %d in use)
14843
- >0x18 lelong >1 \b, next record no. %d
14844
- >0x18 lelong =1 \b, empty
14845
- >0x78 lelong &1 \b, DIRTY
14846
- >0x78 lelong &2 \b, FULL
14847
-
14848
-
14849
- # Summary: Windows 3.1 group files
14850
- # Extension: .grp
14851
- # Created by: unknown
14852
- 0 string \120\115\103\103 MS Windows 3.1 group files
14853
-
14854
-
14855
- # Summary: Old format help files
14856
- # Extension: .hlp
14857
- # Created by: Dirk Jagdmann <doj@cubic.org>
14858
- 0 lelong 0x00035f3f MS Windows 3.x help file
14859
-
14860
-
14861
- # Summary: Hyper terminal
14862
- # Extension: .ht
14863
- # Created by: unknown
14864
- 0 string HyperTerminal\
14865
- >15 string 1.0\ --\ HyperTerminal\ data\ file MS Windows HyperTerminal profile
14866
-
14867
-
14868
- # Summary: Windows shortcut
14869
- # Extension: .lnk
14870
- # Created by: unknown
14871
- 0 string \114\0\0\0\001\024\002\0\0\0\0\0\300\0\0\0\0\0\0\106 MS Windows shortcut
14872
-
14873
-
14874
- # Summary: Outlook Personal Folders
14875
- # Created by: unknown
14876
- 0 lelong 0x4E444221 Microsoft Outlook email folder
14877
- >10 leshort 0x0e (<=2002)
14878
- >10 leshort 0x17 (>=2003)
14879
-
14880
-
14881
- # Summary: Windows help cache
14882
- # Created by: unknown
14883
- 0 string \164\146\115\122\012\000\000\000\001\000\000\000 MS Windows help cache
14884
-
14885
-
14886
- # Summary: IE cache file
14887
- # Created by: Christophe Monniez
14888
- 0 string Client\ UrlCache\ MMF Internet Explorer cache file
14889
- >20 string >\0 version %s
14890
-
14891
-
14892
- # Summary: Registry files
14893
- # Created by: unknown
14894
- # Modified by (1): Joerg Jenderek
14895
- 0 string regf MS Windows registry file, NT/2000 or above
14896
- 0 string CREG MS Windows 95/98/ME registry file
14897
- 0 string SHCC3 MS Windows 3.1 registry file
14898
-
14899
-
14900
- # Summary: Windows Registry text
14901
- # Extension: .reg
14902
- # Submitted by: Abel Cheung <abelcheung@gmail.com>
14903
- 0 string REGEDIT4\r\n\r\n Windows Registry text (Win95 or above)
14904
- 0 string Windows\ Registry\ Editor\
14905
- >&0 string Version\ 5.00\r\n\r\n Windows Registry text (Win2K or above)
14906
-
14907
-
14908
- # From: Pal Tamas <folti@balabit.hu>
14909
- # Autorun File
14910
- 0 string/c [autorun]\r\n Microsoft Windows Autorun file.
14911
- !:mime application/x-setupscript.
14912
- #------------------------------------------------------------------------------
14913
- # wireless-regdb: file(1) magic for CRDA wireless-regdb file format
14914
- #
14915
- 0 string RGDB CRDA wireless regulatory database file
14916
- >4 belong 19 (Version 1)
14917
- #------------------------------------------------------------------------------
14918
- # wordprocessors: file(1) magic fo word processors.
14919
- #
14920
- ####### PWP file format used on Smith Corona Personal Word Processors:
14921
- 2 string \040\040\040\040\040\040\040\040\040\040\040ML4D\040'92 Smith Corona PWP
14922
- >24 byte 2 \b, single spaced
14923
- >24 byte 3 \b, 1.5 spaced
14924
- >24 byte 4 \b, double spaced
14925
- >25 byte 0x42 \b, letter
14926
- >25 byte 0x54 \b, legal
14927
- >26 byte 0x46 \b, A4
14928
-
14929
- #WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
14930
- 0 string \377WPC\020\000\000\000\022\012\001\001\000\000\000\000 (WP) loadable file
14931
- >15 byte 0 Optimized for Intel
14932
- >15 byte 1 Optimized for Non-Intel
14933
- 1 string WPC (Corel/WP)
14934
- >8 short 257 WordPerfect macro
14935
- >8 short 258 WordPerfect help file
14936
- >8 short 259 WordPerfect keyboard file
14937
- >8 short 266 WordPerfect document
14938
- >8 short 267 WordPerfect dictionary
14939
- >8 short 268 WordPerfect thesaurus
14940
- >8 short 269 WordPerfect block
14941
- >8 short 270 WordPerfect rectangular block
14942
- >8 short 271 WordPerfect column block
14943
- >8 short 272 WordPerfect printer data
14944
- >8 short 275 WordPerfect printer data
14945
- >8 short 276 WordPerfect driver resource data
14946
- >8 short 279 WordPerfect hyphenation code
14947
- >8 short 280 WordPerfect hyphenation data
14948
- >8 short 281 WordPerfect macro resource data
14949
- >8 short 283 WordPerfect hyphenation lex
14950
- >8 short 285 WordPerfect wordlist
14951
- >8 short 286 WordPerfect equation resource data
14952
- >8 short 289 WordPerfect spell rules
14953
- >8 short 290 WordPerfect dictionary rules
14954
- >8 short 295 WordPerfect spell rules (Microlytics)
14955
- >8 short 299 WordPerfect settings file
14956
- >8 short 301 WordPerfect 4.2 document
14957
- >8 short 325 WordPerfect dialog file
14958
- >8 short 332 WordPerfect button bar
14959
- >8 short 513 Shell macro
14960
- >8 short 522 Shell definition
14961
- >8 short 769 Notebook macro
14962
- >8 short 770 Notebook help file
14963
- >8 short 771 Notebook keyboard file
14964
- >8 short 778 Notebook definition
14965
- >8 short 1026 Calculator help file
14966
- >8 short 1538 Calendar help file
14967
- >8 short 1546 Calendar data file
14968
- >8 short 1793 Editor macro
14969
- >8 short 1794 Editor help file
14970
- >8 short 1795 Editor keyboard file
14971
- >8 short 1817 Editor macro resource file
14972
- >8 short 2049 Macro editor macro
14973
- >8 short 2050 Macro editor help file
14974
- >8 short 2051 Macro editor keyboard file
14975
- >8 short 2305 PlanPerfect macro
14976
- >8 short 2306 PlanPerfect help file
14977
- >8 short 2307 PlanPerfect keyboard file
14978
- >8 short 2314 PlanPerfect worksheet
14979
- >8 short 2319 PlanPerfect printer definition
14980
- >8 short 2322 PlanPerfect graphic definition
14981
- >8 short 2323 PlanPerfect data
14982
- >8 short 2324 PlanPerfect temporary printer
14983
- >8 short 2329 PlanPerfect macro resource data
14984
- >8 byte 11 Mail
14985
- >8 short 2818 help file
14986
- >8 short 2821 distribution list
14987
- >8 short 2826 out box
14988
- >8 short 2827 in box
14989
- >8 short 2836 users archived mailbox
14990
- >8 short 2837 archived message database
14991
- >8 short 2838 archived attachments
14992
- >8 short 3083 Printer temporary file
14993
- >8 short 3330 Scheduler help file
14994
- >8 short 3338 Scheduler in file
14995
- >8 short 3339 Scheduler out file
14996
- >8 short 3594 GroupWise settings file
14997
- >8 short 3601 GroupWise directory services
14998
- >8 short 3627 GroupWise settings file
14999
- >8 short 4362 Terminal resource data
15000
- >8 short 4363 Terminal resource data
15001
- >8 short 4395 Terminal resource data
15002
- >8 short 4619 GUI loadable text
15003
- >8 short 4620 graphics resource data
15004
- >8 short 4621 printer settings file
15005
- >8 short 4622 port definition file
15006
- >8 short 4623 print queue parameters
15007
- >8 short 4624 compressed file
15008
- >8 short 5130 Network service msg file
15009
- >8 short 5131 Network service msg file
15010
- >8 short 5132 Async gateway login msg
15011
- >8 short 5134 GroupWise message file
15012
- >8 short 7956 GroupWise admin domain database
15013
- >8 short 7957 GroupWise admin host database
15014
- >8 short 7959 GroupWise admin remote host database
15015
- >8 short 7960 GroupWise admin ADS deferment data file
15016
- >8 short 8458 IntelliTAG (SGML) compiled DTD
15017
- >8 long 18219264 WordPerfect graphic image (1.0)
15018
- >8 long 18219520 WordPerfect graphic image (2.0)
15019
- #end of WordPerfect type files Version 1.6 - PLEASE DO NOT REMOVE THIS LINE
15020
-
15021
- # Hangul (Korean) Word Processor File
15022
- 0 string HWP\ Document\ File Hangul (Korean) Word Processor File 3.0
15023
- # From: Won-Kyu Park <wkpark@kldp.org>
15024
- 512 string R\0o\0o\0t\0 Hangul (Korean) Word Processor File 2000
15025
- !:mime application/x-hwp
15026
-
15027
- # CosmicBook, from Beno�t Rouits
15028
- 0 string CSBK Ted Neslson's CosmicBook hypertext file
15029
-
15030
- 2 string EYWR AmigaWriter file
15031
-
15032
- # chi: file(1) magic for ChiWriter files
15033
- 0 string \\1cw\ ChiWriter file
15034
- >5 string >\0 version %s
15035
- 0 string \\1cw ChiWriter file
15036
-
15037
- # Quark Express from http://www.garykessler.net/library/file_sigs.html
15038
- 2 string IIXPR3 Intel Quark Express Document (English)
15039
- 2 string IIXPRa Intel Quark Express Document (Korean)
15040
- 2 string MMXPR3 Motorola Quark Express Document (English)
15041
- !:mime application/x-quark-xpress-3
15042
- 2 string MMXPRa Motorola Quark Express Document (Korean)
15043
-
15044
- # adobe indesign (document, whatever...) from querkan
15045
- 0 belong 0x0606edf5 Adobe InDesign
15046
- >16 string DOCUMENT Document
15047
-
15048
- #------------------------------------------------------------------------------
15049
- # ichitaro456: file(1) magic for Just System Word Processor Ichitaro
15050
- #
15051
- # Contributor kenzo-:
15052
- # Reversed-engineered JS Ichitaro magic numbers
15053
- #
15054
-
15055
- 0 string DOC
15056
- >43 byte 0x14 Just System Word Processor Ichitaro v4
15057
- !:mime application/x-ichitaro4
15058
- >144 string JDASH application/x-ichitaro4
15059
-
15060
- 0 string DOC
15061
- >43 byte 0x15 Just System Word Processor Ichitaro v5
15062
- !:mime application/x-ichitaro5
15063
-
15064
- 0 string DOC
15065
- >43 byte 0x16 Just System Word Processor Ichitaro v6
15066
- !:mime application/x-ichitaro6
15067
-
15068
- # Type: Freemind mindmap documents
15069
- # From: Jamie Thompson <debian-bugs@jamie-thompson.co.uk>
15070
- 0 string/cB \<map\ version Freemind document
15071
- !:mime application/x-freemind
15072
-
15073
- # Type: Scribus
15074
- # From: Werner Fink <werner@suse.de>
15075
- 0 string \<SCRIBUSUTF8\ Version Scribus Document
15076
- 0 string \<SCRIBUSUTF8NEW\ Version Scribus Document
15077
- !:mime application/x-scribus
15078
-
15079
- #------------------------------------------------------------------------------
15080
- # file(1) magic(5) data for xdelta Josh MacDonald <jmacd@CS.Berkeley.EDU>
15081
- #
15082
- 0 string %XDELTA% XDelta binary patch file 0.14
15083
- 0 string %XDZ000% XDelta binary patch file 0.18
15084
- 0 string %XDZ001% XDelta binary patch file 0.20
15085
- 0 string %XDZ002% XDelta binary patch file 1.0
15086
- 0 string %XDZ003% XDelta binary patch file 1.0.4
15087
- 0 string %XDZ004% XDelta binary patch file 1.1
15088
-
15089
- #------------------------------------------------------------------------------
15090
- # xenix: file(1) magic for Microsoft Xenix
15091
- #
15092
- # "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small
15093
- # model" lifted from "magic.xenix", with comment "derived empirically;
15094
- # treat as folklore until proven"
15095
- #
15096
- # "small model", "large model", "huge model" stuff lifted from XXX
15097
- #
15098
- # XXX - "x.out" collides with PDP-11 archives
15099
- #
15100
- 0 string core core file (Xenix)
15101
- 0 byte 0x80 8086 relocatable (Microsoft)
15102
- 0 leshort 0xff65 x.out
15103
- >2 string __.SYMDEF randomized
15104
- >0 byte x archive
15105
- 0 leshort 0x206 Microsoft a.out
15106
- >8 leshort 1 Middle model
15107
- >0x1e leshort &0x10 overlay
15108
- >0x1e leshort &0x2 separate
15109
- >0x1e leshort &0x4 pure
15110
- >0x1e leshort &0x800 segmented
15111
- >0x1e leshort &0x400 standalone
15112
- >0x1e leshort &0x8 fixed-stack
15113
- >0x1c byte &0x80 byte-swapped
15114
- >0x1c byte &0x40 word-swapped
15115
- >0x10 lelong >0 not-stripped
15116
- >0x1e leshort ^0xc000 pre-SysV
15117
- >0x1e leshort &0x4000 V2.3
15118
- >0x1e leshort &0x8000 V3.0
15119
- >0x1c byte &0x4 86
15120
- >0x1c byte &0xb 186
15121
- >0x1c byte &0x9 286
15122
- >0x1c byte &0xa 386
15123
- >0x1f byte <0x040 small model
15124
- >0x1f byte =0x048 large model
15125
- >0x1f byte =0x049 huge model
15126
- >0x1e leshort &0x1 executable
15127
- >0x1e leshort ^0x1 object file
15128
- >0x1e leshort &0x40 Large Text
15129
- >0x1e leshort &0x20 Large Data
15130
- >0x1e leshort &0x120 Huge Objects Enabled
15131
- >0x10 lelong >0 not stripped
15132
-
15133
- 0 leshort 0x140 old Microsoft 8086 x.out
15134
- >0x3 byte &0x4 separate
15135
- >0x3 byte &0x2 pure
15136
- >0 byte &0x1 executable
15137
- >0 byte ^0x1 relocatable
15138
- >0x14 lelong >0 not stripped
15139
-
15140
- 0 lelong 0x206 b.out
15141
- >0x1e leshort &0x10 overlay
15142
- >0x1e leshort &0x2 separate
15143
- >0x1e leshort &0x4 pure
15144
- >0x1e leshort &0x800 segmented
15145
- >0x1e leshort &0x400 standalone
15146
- >0x1e leshort &0x1 executable
15147
- >0x1e leshort ^0x1 object file
15148
- >0x1e leshort &0x4000 V2.3
15149
- >0x1e leshort &0x8000 V3.0
15150
- >0x1c byte &0x4 86
15151
- >0x1c byte &0xb 186
15152
- >0x1c byte &0x9 286
15153
- >0x1c byte &0x29 286
15154
- >0x1c byte &0xa 386
15155
- >0x1e leshort &0x4 Large Text
15156
- >0x1e leshort &0x2 Large Data
15157
- >0x1e leshort &0x102 Huge Objects Enabled
15158
-
15159
- 0 leshort 0x580 XENIX 8086 relocatable or 80286 small model
15160
-
15161
- #------------------------------------------------------------------------------
15162
- # This is Aaron's attempt at a MAGIC file for Xilinx .bit files.
15163
- # Xilinx-Magic@RevRagnarok.com
15164
- # Got the info from FPGA-FAQ 0026
15165
- #
15166
- # First there is the sync header and its length
15167
- 0 beshort 0x0009
15168
- >2 belong =0x0ff00ff0
15169
- >>&0 belong =0x0ff00ff0
15170
- >>>&0 beshort =0x0000
15171
- >>>>&0 pstring a Xilinx BIT data
15172
- # Next is a Pascal-style string with the NCD name. We want to capture that.
15173
- >>>>0x0F pstring x - from %s
15174
- # It is followed by a NUL
15175
- >>>>>&1 byte 0x00
15176
- # And then 'b'
15177
- >>>>>&2 string b
15178
- # With the part number:
15179
- #>>>>>&5 string 4v (Virtex4)
15180
- #>>>>>&5 string 2v (Virtex II
15181
- #>>>>>>&0 string !p \b)
15182
- #>>>>>>&0 string p Pro)
15183
- >>>>>&4 pstring x - for %s
15184
- # And then NUL / 'c' / Build Data / NUL / 'd' / Date / NUL / 'e' / Data Length
15185
- >>>>>>&1 byte 0x00
15186
- >>>>>>&2 string c
15187
- >>>>>>&4 pstring x - built %s
15188
- >>>>>>>&1 byte 0x00
15189
- >>>>>>>&2 string d
15190
- >>>>>>>&4 pstring x \b(%s)
15191
- >>>>>>>>&1 byte 0x00
15192
- >>>>>>>>&2 string e
15193
- >>>>>>>>&4 belong x - data length 0x%lx
15194
-
15195
- #------------------------------------------------------------------------------
15196
- # xo65 object files
15197
- # From: "Ullrich von Bassewitz" <uz@cc65.org>
15198
- #
15199
- 0 string \x55\x7A\x6E\x61 xo65 object,
15200
- >4 leshort x version %d,
15201
- >6 leshort&0x0001 =0x0001 with debug info
15202
- >6 leshort&0x0001 =0x0000 no debug info
15203
-
15204
- # xo65 library files
15205
- 0 string \x6E\x61\x55\x7A xo65 library,
15206
- >4 leshort x version %d
15207
-
15208
- # o65 object files
15209
- 0 string \x01\x00\x6F\x36\x35 o65
15210
- >6 leshort&0x1000 =0x0000 executable,
15211
- >6 leshort&0x1000 =0x1000 object,
15212
- >5 byte x version %d,
15213
- >6 leshort&0x8000 =0x8000 65816,
15214
- >6 leshort&0x8000 =0x0000 6502,
15215
- >6 leshort&0x2000 =0x2000 32 bit,
15216
- >6 leshort&0x2000 =0x0000 16 bit,
15217
- >6 leshort&0x4000 =0x4000 page reloc,
15218
- >6 leshort&0x4000 =0x0000 byte reloc,
15219
- >6 leshort&0x0003 =0x0000 alignment 1
15220
- >6 leshort&0x0003 =0x0001 alignment 2
15221
- >6 leshort&0x0003 =0x0002 alignment 4
15222
- >6 leshort&0x0003 =0x0003 alignment 256
15223
-
15224
- #------------------------------------------------------------------------------
15225
- # xwindows: file(1) magic for various X/Window system file formats.
15226
-
15227
- # Compiled X Keymap
15228
- # XKM (compiled X keymap) files (including version and byte ordering)
15229
- 1 string mkx Compiled XKB Keymap: lsb,
15230
- >0 byte >0 version %d
15231
- >0 byte =0 obsolete
15232
- 0 string xkm Compiled XKB Keymap: msb,
15233
- >3 byte >0 version %d
15234
- >0 byte =0 obsolete
15235
-
15236
- # xfsdump archive
15237
- 0 string xFSdump0 xfsdump archive
15238
- >8 belong x (version %d)
15239
-
15240
- # Jaleo XFS files
15241
- 0 long 395726 Jaleo XFS file
15242
- >4 long x - version %ld
15243
- >8 long x - [%ld -
15244
- >20 long x %ldx
15245
- >24 long x %ldx
15246
- >28 long 1008 YUV422]
15247
- >28 long 1000 RGB24]
15248
-
15249
- # Xcursor data
15250
- # X11 mouse cursor format defined in libXcursor, see
15251
- # http://www.x.org/archive/X11R6.8.1/doc/Xcursor.3.html
15252
- # http://cgit.freedesktop.org/xorg/lib/libXcursor/tree/include/X11/Xcursor/Xcursor.h
15253
- 0 string Xcur Xcursor data
15254
- !:mime image/x-xcursor
15255
- >10 leshort x version %hd
15256
- >>8 leshort x \b.%hd
15257
-
15258
- #------------------------------------------------------------------------------
15259
- # zilog: file(1) magic for Zilog Z8000.
15260
- #
15261
- # Was it big-endian or little-endian? My Product Specification doesn't
15262
- # say.
15263
- #
15264
- 0 long 0xe807 object file (z8000 a.out)
15265
- 0 long 0xe808 pure object file (z8000 a.out)
15266
- 0 long 0xe809 separate object file (z8000 a.out)
15267
- 0 long 0xe805 overlay object file (z8000 a.out)
15268
-
15269
- #------------------------------------------------------------------------------
15270
- # zyxel: file(1) magic for ZyXEL modems
15271
- #
15272
- # From <rob@pe1chl.ampr.org>
15273
- # These are the /etc/magic entries to decode datafiles as used for the
15274
- # ZyXEL U-1496E DATA/FAX/VOICE modems. (This header conforms to a
15275
- # ZyXEL-defined standard)
15276
-
15277
- 0 string ZyXEL\002 ZyXEL voice data
15278
- >10 byte 0 - CELP encoding
15279
- >10 byte&0x0B 1 - ADPCM2 encoding
15280
- >10 byte&0x0B 2 - ADPCM3 encoding
15281
- >10 byte&0x0B 3 - ADPCM4 encoding
15282
- >10 byte&0x0B 8 - New ADPCM3 encoding
15283
- >10 byte&0x04 4 with resync
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/libs/rackspace/share/magic.mgc DELETED
Binary file
app/libs/rackspace/share/magic.mime DELETED
@@ -1,1027 +0,0 @@
1
- # Magic data for KMimeMagic (originally for file(1) command)
2
- #
3
- # Note on adding additional MIME types:
4
- #
5
- # [RFC2045,RFC2046] specifies that Content Types, Content Subtypes, Character
6
- # Sets, Access Types, and conversion values for MIME mail will be assigned and
7
- # listed by the IANA.
8
- # http://www.iana.org/assignments/media-types/
9
- #
10
- # Any unregistered file type should be listed with a preceding x-, as in
11
- # application/x-foo (RFC2045 5.1), or a x., as in application/x.foo (RFC4288
12
- # 4.3). Any non x-prefixed type should be registered with IANA and listed at
13
- # the above address. Any other behavior is a MIME standards violation!
14
- #
15
- # It is preferred that when a registered MIME type exists, that
16
- # the registered Content-Type and Subtype be used to refer to a file of
17
- # that type, so don't use application/x-zip when application/zip is
18
- # registered.
19
- #
20
- # If an active RFC suggests that a MIME registration for a new type is in
21
- # progress, make a note of it pointing to that RFC.
22
- #
23
- # The format is 4-5 columns:
24
- # Column #1: byte number to begin checking from, ">" indicates continuation
25
- # Column #2: type of data to match
26
- # Column #3: contents of data to match
27
- # Column #4: MIME type of result
28
- # Column #5: MIME encoding of result (optional)
29
-
30
- #------------------------------------------------------------------------------
31
- # Localstuff: file(1) magic for locally observed files
32
- # Add any locally observed files here.
33
-
34
- # Real Audio (Magic .ra\0375)
35
- 0 belong 0x2e7261fd audio/x-pn-realaudio
36
- 0 string .RMF application/vnd.rn-realmedia
37
-
38
- #video/x-pn-realvideo
39
- #video/vnd.rn-realvideo
40
- #application/vnd.rn-realmedia
41
- # sigh, there are many mimes for that but the above are the most common.
42
-
43
- # Taken from magic, converted to magic.mime
44
- # mime types according to http://www.geocities.com/nevilo/mod.htm:
45
- # audio/it .it
46
- # audio/x-zipped-it .itz
47
- # audio/xm fasttracker modules
48
- # audio/x-s3m screamtracker modules
49
- # audio/s3m screamtracker modules
50
- # audio/x-zipped-mod mdz
51
- # audio/mod mod
52
- # audio/x-mod All modules (mod, s3m, 669, mtm, med, xm, it, mdz, stm, itz, xmz, s3z)
53
-
54
- # Taken from loader code from mikmod version 2.14
55
- # by Steve McIntyre (stevem@chiark.greenend.org.uk)
56
- # <doj@cubic.org> added title printing on 2003-06-24
57
- 0 string MAS_UTrack_V00
58
- >14 string >/0 audio/x-mod
59
- #audio/x-tracker-module
60
-
61
- #0 string UN05 MikMod UNI format module sound data
62
-
63
- 0 string Extended\ Module: audio/x-mod
64
- #audio/x-tracker-module
65
- ##>17 string >\0 Title: "%s"
66
-
67
- 21 string/c \!SCREAM! audio/x-mod
68
- #audio/x-screamtracker-module
69
- 21 string BMOD2STM audio/x-mod
70
- #audio/x-screamtracker-module
71
- 1080 string M.K. audio/x-mod
72
- #audio/x-protracker-module
73
- #>0 string >\0 Title: "%s"
74
- 1080 string M!K! audio/x-mod
75
- #audio/x-protracker-module
76
- #>0 string >\0 Title: "%s"
77
- 1080 string FLT4 audio/x-mod
78
- #audio/x-startracker-module
79
- #>0 string >\0 Title: "%s"
80
- 1080 string FLT8 audio/x-mod
81
- #audio/x-startracker-module
82
- #>0 string >\0 Title: "%s"
83
- 1080 string 4CHN audio/x-mod
84
- #audio/x-fasttracker-module
85
- #>0 string >\0 Title: "%s"
86
- 1080 string 6CHN audio/x-mod
87
- #audio/x-fasttracker-module
88
- #>0 string >\0 Title: "%s"
89
- 1080 string 8CHN audio/x-mod
90
- #audio/x-fasttracker-module
91
- #>0 string >\0 Title: "%s"
92
- 1080 string CD81 audio/x-mod
93
- #audio/x-oktalyzer-tracker-module
94
- #>0 string >\0 Title: "%s"
95
- 1080 string OKTA audio/x-mod
96
- #audio/x-oktalyzer-tracker-module
97
- #>0 string >\0 Title: "%s"
98
- # Not good enough.
99
- #1082 string CH
100
- #>1080 string >/0 %.2s-channel Fasttracker "oktalyzer" module sound data
101
- 1080 string 16CN audio/x-mod
102
- #audio/x-taketracker-module
103
- #>0 string >\0 Title: "%s"
104
- 1080 string 32CN audio/x-mod
105
- #audio/x-taketracker-module
106
- #>0 string >\0 Title: "%s"
107
-
108
- # Impuse tracker module (it)
109
- 0 string IMPM audio/x-mod
110
- #>4 string >\0 "%s"
111
- #>40 leshort !0 compatible w/ITv%x
112
- #>42 leshort !0 created w/ITv%x
113
-
114
- #------------------------------------------------------------------------------
115
- # end local stuff
116
- #------------------------------------------------------------------------------
117
-
118
- # xml based formats!
119
-
120
- # svg
121
-
122
- 38 string \<\!DOCTYPE\040svg image/svg+xml
123
-
124
- 0 belong 0xfeedfeed application/x-java-keystore
125
-
126
- 0 belong 0xcececece application/x-java-jce-keystore
127
-
128
-
129
- # xml
130
- 0 string \<?xml text/xml
131
-
132
-
133
- #------------------------------------------------------------------------------
134
- # Java
135
-
136
- 0 beshort 0xcafe
137
- >2 beshort 0xbabe application/x-java-applet
138
- >2 beshort 0xd00d application/x-java-pack200
139
-
140
- #------------------------------------------------------------------------------
141
- # audio: file(1) magic for sound formats
142
- #
143
- # from Jan Nicolai Langfeldt <janl@ifi.uio.no>,
144
- #
145
-
146
- # Sun/NeXT audio data
147
- 0 string .snd
148
- >12 belong 1 audio/basic
149
- >12 belong 2 audio/basic
150
- >12 belong 3 audio/basic
151
- >12 belong 4 audio/basic
152
- >12 belong 5 audio/basic
153
- >12 belong 6 audio/basic
154
- >12 belong 7 audio/basic
155
-
156
- >12 belong 23 audio/x-adpcm
157
-
158
- # DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
159
- # that uses little-endian encoding and has a different magic number
160
- # (0x0064732E in little-endian encoding).
161
- 0 lelong 0x0064732E
162
- >12 lelong 1 audio/x-dec-basic
163
- >12 lelong 2 audio/x-dec-basic
164
- >12 lelong 3 audio/x-dec-basic
165
- >12 lelong 4 audio/x-dec-basic
166
- >12 lelong 5 audio/x-dec-basic
167
- >12 lelong 6 audio/x-dec-basic
168
- >12 lelong 7 audio/x-dec-basic
169
- # compressed (G.721 ADPCM)
170
- >12 lelong 23 audio/x-dec-adpcm
171
-
172
- # Bytes 0-3 of AIFF, AIFF-C, & 8SVX audio files are "FORM"
173
- # AIFF audio data
174
- 8 string AIFF audio/x-aiff
175
- # AIFF-C audio data
176
- 8 string AIFC audio/x-aiff
177
- # IFF/8SVX audio data
178
- 8 string 8SVX audio/x-aiff
179
-
180
-
181
-
182
- # Creative Labs AUDIO stuff
183
- # Standard MIDI data
184
- 0 string MThd audio/x-midi
185
- #>9 byte >0 (format %d)
186
- #>11 byte >1 using %d channels
187
- 0 string MThd audio/midi
188
- # Creative Music (CMF) data
189
- 0 string CTMF audio/x-unknown
190
- # SoundBlaster instrument data
191
- 0 string SBI audio/x-unknown
192
- # Creative Labs voice data
193
- 0 string Creative\ Voice\ File audio/x-unknown
194
- ## is this next line right? it came this way...
195
- #>19 byte 0x1A
196
- #>23 byte >0 - version %d
197
- #>22 byte >0 \b.%d
198
-
199
- # [GRR 950115: is this also Creative Labs? Guessing that first line
200
- # should be string instead of unknown-endian long...]
201
- #0 long 0x4e54524b MultiTrack sound data
202
- #0 string NTRK MultiTrack sound data
203
- #>4 long x - version %ld
204
-
205
- # Microsoft WAVE format (*.wav)
206
- # [GRR 950115: probably all of the shorts and longs should be leshort/lelong]
207
- # Microsoft RIFF
208
- 0 string RIFF
209
- # - WAVE format
210
- >8 string WAVE audio/x-wav
211
- >8 string/B AVI video/x-msvideo
212
- #
213
- >8 string CDRA image/x-coreldraw
214
-
215
- # AAC (aka MPEG-2 NBC)
216
- 0 beshort&0xfff6 0xfff0 audio/X-HX-AAC-ADTS
217
- 0 string ADIF audio/X-HX-AAC-ADIF
218
- 0 beshort&0xffe0 0x56e0 audio/MP4A-LATM
219
- 0 beshort 0x4De1 audio/MP4A-LATM
220
-
221
- # MPEG Layer 3 sound files
222
- # modified by Joerg Jenderek
223
- # GRR the original test are too common for many DOS files
224
- # so test 1 <= kbits nibble <= E
225
- 0 beshort &0xffe0
226
- >2 ubyte&0xF0 >0x0F
227
- >>2 ubyte&0xF0 <0xE1 audio/mpeg
228
- #MP3 with ID3 tag
229
- 0 string ID3 audio/mpeg
230
- # Ogg/Vorbis
231
- 0 string OggS application/ogg
232
-
233
- #------------------------------------------------------------------------------
234
- # c-lang: file(1) magic for C programs or various scripts
235
- #
236
-
237
- # XPM icons (Greg Roelofs, newt@uchicago.edu)
238
- # ideally should go into "images", but entries below would tag XPM as C source
239
- 0 string /*\ XPM image/x-xpmi
240
-
241
- # 3DS (3d Studio files) Conflicts with diff output 0x3d '='
242
- #16 beshort 0x3d3d image/x-3ds
243
-
244
- # this first will upset you if you're a PL/1 shop... (are there any left?)
245
- # in which case rm it; ascmagic will catch real C programs
246
- # C or REXX program text
247
- #0 string /* text/x-c
248
- # C++ program text
249
- #0 string // text/x-c++
250
-
251
- #------------------------------------------------------------------------------
252
- # commands: file(1) magic for various shells and interpreters
253
- #
254
- #0 string :\ shell archive or commands for antique kernel text
255
- 0 string #!/bin/sh application/x-shellscript
256
- 0 string #!\ /bin/sh application/x-shellscript
257
- 0 string #!/bin/csh application/x-shellscript
258
- 0 string #!\ /bin/csh application/x-shellscript
259
- # korn shell magic, sent by George Wu, gwu@clyde.att.com
260
- 0 string #!/bin/ksh application/x-shellscript
261
- 0 string #!\ /bin/ksh application/x-shellscript
262
- 0 string #!/bin/tcsh application/x-shellscript
263
- 0 string #!\ /bin/tcsh application/x-shellscript
264
- 0 string #!/usr/local/tcsh application/x-shellscript
265
- 0 string #!\ /usr/local/tcsh application/x-shellscript
266
- 0 string #!/usr/local/bin/tcsh application/x-shellscript
267
- 0 string #!\ /usr/local/bin/tcsh application/x-shellscript
268
- # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
269
- 0 string #!/bin/bash application/x-shellscript
270
- 0 string #!\ /bin/bash application/x-shellscript
271
- 0 string #!/usr/local/bin/bash application/x-shellscript
272
- 0 string #!\ /usr/local/bin/bash application/x-shellscript
273
-
274
- #
275
- # zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
276
- 0 string #!/bin/zsh application/x-shellscript
277
- 0 string #!/usr/bin/zsh application/x-shellscript
278
- 0 string #!/usr/local/bin/zsh application/x-shellscript
279
- 0 string #!\ /usr/local/bin/zsh application/x-shellscript
280
- 0 string #!/usr/local/bin/ash application/x-shellscript
281
- 0 string #!\ /usr/local/bin/ash application/x-shellscript
282
- #0 string #!/usr/local/bin/ae Neil Brown's ae
283
- #0 string #!\ /usr/local/bin/ae Neil Brown's ae
284
- 0 string #!/bin/nawk application/x-nawk
285
- 0 string #!\ /bin/nawk application/x-nawk
286
- 0 string #!/usr/bin/nawk application/x-nawk
287
- 0 string #!\ /usr/bin/nawk application/x-nawk
288
- 0 string #!/usr/local/bin/nawk application/x-nawk
289
- 0 string #!\ /usr/local/bin/nawk application/x-nawk
290
- 0 string #!/bin/gawk application/x-gawk
291
- 0 string #!\ /bin/gawk application/x-gawk
292
- 0 string #!/usr/bin/gawk application/x-gawk
293
- 0 string #!\ /usr/bin/gawk application/x-gawk
294
- 0 string #!/usr/local/bin/gawk application/x-gawk
295
- 0 string #!\ /usr/local/bin/gawk application/x-gawk
296
- #
297
- 0 string #!/bin/awk application/x-awk
298
- 0 string #!\ /bin/awk application/x-awk
299
- 0 string #!/usr/bin/awk application/x-awk
300
- 0 string #!\ /usr/bin/awk application/x-awk
301
- # update to distinguish from *.vcf files by Joerg Jenderek: joerg dot jenderek at web dot de
302
- # Too general, \EBEGIN matches in postscript
303
- #0 regex BEGIN[[:space:]]*[{] application/x-awk
304
-
305
- # For Larry Wall's perl language. The ``eval'' line recognizes an
306
- # outrageously clever hack for USG systems.
307
- # Keith Waclena <keith@cerberus.uchicago.edu>
308
- 0 string #!/bin/perl application/x-perl
309
- 0 string #!\ /bin/perl application/x-perl
310
- 0 string eval\ "exec\ /bin/perl application/x-perl
311
- 0 string #!/usr/bin/perl application/x-perl
312
- 0 string #!\ /usr/bin/perl application/x-perl
313
- 0 string eval\ "exec\ /usr/bin/perl application/x-perl
314
- 0 string #!/usr/local/bin/perl application/x-perl
315
- 0 string #!\ /usr/local/bin/perl application/x-perl
316
- 0 string eval\ "exec\ /usr/local/bin/perl application/x-perl
317
-
318
- # Type: Lua scripting language
319
- # URL: http://www.lua.org/
320
- # From: Reuben Thomas <rrt@sc3d.org>
321
- 0 string/B #!\ /usr/bin/lua application/x-lua
322
- 0 string/B #!\ /usr/local/bin/lua application/x-lua
323
- 0 string #!/usr/bin/env\ lua application/x-lua
324
- 0 string #!\ /usr/bin/env\ lua application/x-lua
325
-
326
- #------------------------------------------------------------------------------
327
- # compress: file(1) magic for pure-compression formats (no archives)
328
- #
329
- # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, whap, etc.
330
- #
331
- # Formats for various forms of compressed data
332
- # Formats for "compress" proper have been moved into "compress.c",
333
- # because it tries to uncompress it to figure out what's inside.
334
-
335
- # standard unix compress
336
- #0 string \037\235 application/x-compress
337
-
338
- # gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver)
339
- 0 string \037\213 application/x-gzip
340
-
341
- 0 string PK\003\004 application/zip
342
-
343
- # RAR archiver (Greg Roelofs, newt@uchicago.edu)
344
- 0 string Rar! application/x-rar
345
-
346
- # According to gzip.h, this is the correct byte order for packed data.
347
- 0 string \037\036 application/octet-stream
348
- #
349
- # This magic number is byte-order-independent.
350
- #
351
- 0 short 017437 application/octet-stream
352
-
353
- # XXX - why *two* entries for "compacted data", one of which is
354
- # byte-order independent, and one of which is byte-order dependent?
355
- #
356
- # compacted data
357
- 0 short 0x1fff application/octet-stream
358
- 0 string \377\037 application/octet-stream
359
- # huf output
360
- 0 short 0145405 application/octet-stream
361
-
362
- # Squeeze and Crunch...
363
- # These numbers were gleaned from the Unix versions of the programs to
364
- # handle these formats. Note that I can only uncrunch, not crunch, and
365
- # I didn't have a crunched file handy, so the crunch number is untested.
366
- # Keith Waclena <keith@cerberus.uchicago.edu>
367
- #0 leshort 0x76FF squeezed data (CP/M, DOS)
368
- #0 leshort 0x76FE crunched data (CP/M, DOS)
369
-
370
- # Freeze
371
- #0 string \037\237 Frozen file 2.1
372
- #0 string \037\236 Frozen file 1.0 (or gzip 0.5)
373
-
374
- # lzh?
375
- #0 string \037\240 LZH compressed data
376
-
377
- 257 string ustar\0 application/x-tar posix
378
- 257 string ustar\040\040\0 application/x-tar gnu
379
-
380
- 0 short 070707 application/x-cpio
381
- 0 short 0143561 application/x-cpio swapped
382
-
383
- 0 string =<ar> application/x-archive
384
- 0 string \!<arch> application/x-archive
385
- >8 string debian application/x-debian-package
386
-
387
- #------------------------------------------------------------------------------
388
- #
389
- # RPM: file(1) magic for Red Hat Packages Erik Troan (ewt@redhat.com)
390
- #
391
- 0 beshort 0xedab
392
- >2 beshort 0xeedb application/x-rpm
393
-
394
- 0 lelong&0x8080ffff 0x0000081a application/x-arc lzw
395
- 0 lelong&0x8080ffff 0x0000091a application/x-arc squashed
396
- 0 lelong&0x8080ffff 0x0000021a application/x-arc uncompressed
397
- 0 lelong&0x8080ffff 0x0000031a application/x-arc packed
398
- 0 lelong&0x8080ffff 0x0000041a application/x-arc squeezed
399
- 0 lelong&0x8080ffff 0x0000061a application/x-arc crunched
400
-
401
- 0 leshort 0xea60 application/x-arj
402
-
403
- # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
404
- 2 string -lh0- application/x-lharc lh0
405
- 2 string -lh1- application/x-lharc lh1
406
- 2 string -lz4- application/x-lharc lz4
407
- 2 string -lz5- application/x-lharc lz5
408
- # [never seen any but the last; -lh4- reported in comp.compression:]
409
- 2 string -lzs- application/x-lha lzs
410
- 2 string -lh\ - application/x-lha lh
411
- 2 string -lhd- application/x-lha lhd
412
- 2 string -lh2- application/x-lha lh2
413
- 2 string -lh3- application/x-lha lh3
414
- 2 string -lh4- application/x-lha lh4
415
- 2 string -lh5- application/x-lha lh5
416
- 2 string -lh6- application/x-lha lh6
417
- 2 string -lh7- application/x-lha lh7
418
- # Shell archives
419
- 10 string #\ This\ is\ a\ shell\ archive application/octet-stream x-shell
420
-
421
- #------------------------------------------------------------------------------
422
- # frame: file(1) magic for FrameMaker files
423
- #
424
- # This stuff came on a FrameMaker demo tape, most of which is
425
- # copyright, but this file is "published" as witness the following:
426
- #
427
- # Note that this is the Framemaker Maker Interchange Format, not the
428
- # Normal format which would be application/vnd.framemaker.
429
- #
430
- 0 string \<MakerFile application/x-mif
431
- 0 string \<MIFFile application/x-mif
432
- 0 string \<MakerDictionary application/x-mif
433
- 0 string \<MakerScreenFon application/x-mif
434
- 0 string \<MML application/x-mif
435
- 0 string \<Book application/x-mif
436
- 0 string \<Maker application/x-mif
437
-
438
- #------------------------------------------------------------------------------
439
- # html: file(1) magic for HTML (HyperText Markup Language) docs
440
- #
441
- # from Michael Piefel <piefel@debian.org>
442
- #
443
- 0 string/cB \<!DOCTYPE\ html text/html
444
- 0 string/cb \<head text/html
445
- 0 string/cb \<title text/html
446
- 0 string/bc \<html text/html
447
- 0 string \<!-- text/html
448
- 0 string/c \<h1 text/html
449
-
450
- #------------------------------------------------------------------------------
451
- # images: file(1) magic for image formats (see also "c-lang" for XPM bitmaps)
452
- #
453
- # originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
454
- # additions by janl@ifi.uio.no as well as others. Jan also suggested
455
- # merging several one- and two-line files into here.
456
- #
457
- # XXX - byte order for GIF and TIFF fields?
458
- # [GRR: TIFF allows both byte orders; GIF is probably little-endian]
459
- #
460
-
461
- # [GRR: what the hell is this doing in here?]
462
- #0 string xbtoa btoa'd file
463
-
464
- # PBMPLUS
465
- # PBM file
466
- 0 string P1 image/x-portable-bitmap
467
- # PGM file
468
- 0 string P2 image/x-portable-greymap
469
- # PPM file
470
- 0 string P3 image/x-portable-pixmap
471
- # PBM "rawbits" file
472
- 0 string P4 image/x-portable-bitmap
473
- # PGM "rawbits" file
474
- 0 string P5 image/x-portable-greymap
475
- # PPM "rawbits" file
476
- 0 string P6 image/x-portable-pixmap
477
-
478
- # NIFF (Navy Interchange File Format, a modification of TIFF)
479
- # [GRR: this *must* go before TIFF]
480
- 0 string IIN1 image/x-niff
481
-
482
- # TIFF and friends
483
- # TIFF file, big-endian
484
- 0 string MM image/tiff
485
- # TIFF file, little-endian
486
- 0 string II image/tiff
487
-
488
- # possible GIF replacements; none yet released!
489
- # (Greg Roelofs, newt@uchicago.edu)
490
- #
491
- # GRR 950115: this was mine ("Zip GIF"):
492
- # ZIF image (GIF+deflate alpha)
493
- 0 string GIF94z image/x-unknown
494
- #
495
- # GRR 950115: this is Jeremy Wohl's Free Graphics Format (better):
496
- # FGF image (GIF+deflate beta)
497
- 0 string FGF95a image/x-unknown
498
- #
499
- # GRR 950115: this is Thomas Boutell's Portable Bitmap Format proposal
500
- # (best; not yet implemented):
501
- # PBF image (deflate compression)
502
- 0 string PBF image/x-unknown
503
-
504
- # GIF
505
- 0 string GIF image/gif
506
-
507
- # JPEG images
508
- 0 beshort 0xffd8 image/jpeg
509
-
510
- # PC bitmaps (OS/2, Windoze BMP files) (Greg Roelofs, newt@uchicago.edu)
511
- 0 string BM image/x-ms-bmp
512
- #>14 byte 12 (OS/2 1.x format)
513
- #>14 byte 64 (OS/2 2.x format)
514
- #>14 byte 40 (Windows 3.x format)
515
- #0 string IC icon
516
- #0 string PI pointer
517
- #0 string CI color icon
518
- #0 string CP color pointer
519
- #0 string BA bitmap array
520
-
521
- # CDROM Filesystems
522
- 32769 string CD001 application/x-iso9660-image
523
-
524
- # Newer StuffIt archives (grant@netbsd.org)
525
- 0 string StuffIt application/x-stuffit
526
- #>162 string >0 : %s
527
-
528
- # BinHex is the Macintosh ASCII-encoded file format (see also "apple")
529
- # Daniel Quinlan, quinlan@yggdrasil.com
530
- 11 string must\ be\ converted\ with\ BinHex\ 4 application/mac-binhex40
531
- ##>41 string x \b, version %.3s
532
-
533
-
534
- #------------------------------------------------------------------------------
535
- # lisp: file(1) magic for lisp programs
536
- #
537
- # various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
538
- 0 string ;; text/plain
539
- # Emacs 18 - this is always correct, but not very magical.
540
- 0 string \012( application/x-elc
541
- # Emacs 19
542
- 0 string ;ELC\023\000\000\000 application/x-elc
543
-
544
- #------------------------------------------------------------------------------
545
- # mail.news: file(1) magic for mail and news
546
- #
547
- # There are tests to ascmagic.c to cope with mail and news.
548
- 0 string Relay-Version: message/rfc822
549
- 0 string #!\ rnews message/rfc822
550
- 0 string N#!\ rnews message/rfc822
551
- 0 string Forward\ to message/rfc822
552
- 0 string Pipe\ to message/rfc822
553
- 0 string Return-Path: message/rfc822
554
- 0 string Received: message/rfc822
555
- 0 string Path: message/news
556
- 0 string Xref: message/news
557
- 0 string From: message/rfc822
558
- 0 string Article message/news
559
- #------------------------------------------------------------------------------
560
- # msword: file(1) magic for MS Word files
561
- #
562
- # Contributor claims:
563
- # Reversed-engineered MS Word magic numbers
564
- #
565
-
566
- 0 string \376\067\0\043 application/msword
567
- # disable this one because it applies also to other
568
- # Office/OLE documents for which msword is not correct. See PR#2608.
569
- # from magic file of the apache
570
- #0 string \320\317\021\340\241\261 application/msword
571
- 512 string \354\245\301 application/msword
572
- 0 string \333\245-\0\0\0 application/msword
573
-
574
-
575
-
576
- #------------------------------------------------------------------------------
577
- # printer: file(1) magic for printer-formatted files
578
- #
579
-
580
- # PostScript
581
- 0 string %! application/postscript
582
- 0 string \004%! application/postscript
583
-
584
- # Acrobat
585
- # (due to clamen@cs.cmu.edu)
586
- 0 string %PDF- application/pdf
587
-
588
- #------------------------------------------------------------------------------
589
- # sc: file(1) magic for "sc" spreadsheet
590
- #
591
- 38 string Spreadsheet application/x-sc
592
-
593
- #------------------------------------------------------------------------------
594
- # tex: file(1) magic for TeX files
595
- #
596
- # XXX - needs byte-endian stuff (big-endian and little-endian DVI?)
597
- #
598
- # From <conklin@talisman.kaleida.com>
599
-
600
- # Although we may know the offset of certain text fields in TeX DVI
601
- # and font files, we can't use them reliably because they are not
602
- # zero terminated. [but we do anyway, christos]
603
- 0 string \367\002 application/x-dvi
604
- #0 string \367\203 TeX generic font data
605
- #0 string \367\131 TeX packed font data
606
- #0 string \367\312 TeX virtual font data
607
- #0 string This\ is\ TeX, TeX transcript text
608
- #0 string This\ is\ METAFONT, METAFONT transcript text
609
-
610
- # There is no way to detect TeX Font Metric (*.tfm) files without
611
- # breaking them apart and reading the data. The following patterns
612
- # match most *.tfm files generated by METAFONT or afm2tfm.
613
- 2 string \000\021 application/x-tex-tfm
614
- 2 string \000\022 application/x-tex-tfm
615
- #>34 string >\0 (%s)
616
-
617
- # Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
618
- 0 string \\input\ texinfo text/x-texinfo
619
- 0 string This\ is\ Info\ file text/x-info
620
-
621
- # correct TeX magic for Linux (and maybe more)
622
- # from Peter Tobias (tobias@server.et-inf.fho-emden.de)
623
- #
624
- 0 leshort 0x02f7 application/x-dvi
625
-
626
- # RTF - Rich Text Format
627
- 0 string {\\rtf text/rtf
628
-
629
- # TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com)
630
- 0 search/400 \\input text/x-tex
631
- 0 search/400 \\section text/x-tex
632
- 0 search/400 \\setlength text/x-tex
633
- 0 search/400 \\documentstyle text/x-tex
634
- 0 search/400 \\chapter text/x-tex
635
- 0 search/400 \\documentclass text/x-tex
636
-
637
- # Type: Inform interactive fiction language
638
- # URL: http://www.inform-fiction.org/
639
- # From: Reuben Thomas <rrt@sc3d.org>
640
- 0 regex [Cc]onstant[[:space:]]+[Ss]tory text/x-inform
641
-
642
- #------------------------------------------------------------------------------
643
- # animation: file(1) magic for animation/movie formats
644
- #
645
- # animation formats, originally from vax@ccwf.cc.utexas.edu (VaX#n8)
646
- # MPEG file
647
- # MPEG sequences
648
- 0 belong 0x000001BA
649
- >4 byte &0x40 video/mp2p
650
- >4 byte ^0x40 video/mpeg
651
- 0 belong 0x000001BB video/mpeg
652
- 0 belong 0x000001B0 video/mp4v-es
653
- 0 belong 0x000001B5 video/mp4v-es
654
- 0 belong 0x000001B3 video/mpv
655
- 0 belong&0xFF5FFF1F 0x47400010 video/mp2t
656
- 0 belong 0x00000001
657
- >4 byte&0x1F 0x07 video/h264
658
-
659
- # FLI animation format
660
- 0 leshort 0xAF11 video/x-fli
661
- # FLC animation format
662
- 0 leshort 0xAF12 video/x-flc
663
- #
664
- # SGI and Apple formats
665
- # Added ISO mimes
666
- 0 string MOVI video/x-sgi-movie
667
- 4 string moov video/quicktime
668
- 4 string mdat video/quicktime
669
- 4 string wide video/quicktime
670
- 4 string skip video/quicktime
671
- 4 string free video/quicktime
672
- 4 string idsc image/x-quicktime
673
- 4 string idat image/x-quicktime
674
- 4 string pckg application/x-quicktime-player
675
- 4 string/B jP image/jp2
676
- 4 string ftyp
677
- >8 string isom video/mp4
678
- >8 string mp41 video/mp4
679
- >8 string mp42 video/mp4
680
- >8 string/B jp2 image/jp2
681
- >8 string 3gp video/3gpp
682
- >8 string avc1 video/3gpp
683
- >8 string mmp4 video/mp4
684
- >8 string/B M4A audio/mp4
685
- >8 string/B M4V video/mp4
686
- >8 string/B qt video/quicktime
687
- # The contributor claims:
688
- # I couldn't find a real magic number for these, however, this
689
- # -appears- to work. Note that it might catch other files, too,
690
- # so BE CAREFUL!
691
- #
692
- # Note that title and author appear in the two 20-byte chunks
693
- # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
694
- # 255 (hex FF)! DL format SUCKS BIG ROCKS.
695
- #
696
- # DL file version 1 , medium format (160x100, 4 images/screen)
697
- 0 byte 1 video/x-unknown
698
- 0 byte 2 video/x-unknown
699
- #
700
- # Databases
701
- #
702
- # GDBM magic numbers
703
- # Will be maintained as part of the GDBM distribution in the future.
704
- # <downsj@teeny.org>
705
- 0 belong 0x13579ace application/x-gdbm
706
- 0 lelong 0x13579ace application/x-gdbm
707
- 0 string GDBM application/x-gdbm
708
- #
709
- 0 belong 0x061561 application/x-dbm
710
- #
711
- # Executables
712
- #
713
- 0 string \177ELF
714
- >16 leshort 0 application/octet-stream
715
- >16 leshort 1 application/x-object
716
- >16 leshort 2 application/x-executable
717
- >16 leshort 3 application/x-sharedlib
718
- >16 leshort 4 application/x-coredump
719
- >16 beshort 0 application/octet-stream
720
- >16 beshort 1 application/x-object
721
- >16 beshort 2 application/x-executable
722
- >16 beshort 3 application/x-sharedlib
723
- >16 beshort 4 application/x-coredump
724
- #
725
- # DOS
726
- 0 string MZ application/x-dosexec
727
- #
728
- # KDE
729
- 0 string [KDE\ Desktop\ Entry] application/x-kdelnk
730
- 0 string #\ KDE\ Config\ File application/x-kdelnk
731
- # xmcd database file for kscd
732
- 0 string #\ xmcd text/x-xmcd
733
-
734
- #------------------------------------------------------------------------------
735
- # pkgadd: file(1) magic for SysV R4 PKG Datastreams
736
- #
737
- 0 string #\ PaCkAgE\ DaTaStReAm application/x-svr4-package
738
-
739
- #PNG Image Format
740
- 0 string \x89PNG image/png
741
-
742
- # MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
743
- 0 string \x8aMNG video/x-mng
744
- 0 string \x8aJNG video/x-jng
745
-
746
- #------------------------------------------------------------------------------
747
- # Hierarchical Data Format, used to facilitate scientific data exchange
748
- # specifications at http://hdf.ncsa.uiuc.edu/
749
- #Hierarchical Data Format (version 4) data
750
- 0 belong 0x0e031301 application/x-hdf
751
- #Hierarchical Data Format (version 5) data
752
- 0 string \211HDF\r\n\032 application/x-hdf
753
-
754
- # Adobe Photoshop
755
- 0 string 8BPS image/vnd.adobe.photoshop
756
-
757
- # Felix von Leitner <felix-file@fefe.de>
758
- 0 string d8:announce application/x-bittorrent
759
-
760
-
761
- # lotus 1-2-3 document
762
- 0 belong 0x00001a00 application/x-123
763
- 0 belong 0x00000200 application/x-123
764
-
765
- # MS Access database
766
- 4 string Standard\ Jet\ DB application/x-msaccess
767
-
768
- ## magic for XBase files
769
- #0 byte 0x02
770
- #>8 leshort >0
771
- #>>12 leshort 0 application/x-dbf
772
- #
773
- #0 byte 0x03
774
- #>8 leshort >0
775
- #>>12 leshort 0 application/x-dbf
776
- #
777
- #0 byte 0x04
778
- #>8 leshort >0
779
- #>>12 leshort 0 application/x-dbf
780
- #
781
- #0 byte 0x05
782
- #>8 leshort >0
783
- #>>12 leshort 0 application/x-dbf
784
- #
785
- #0 byte 0x30
786
- #>8 leshort >0
787
- #>>12 leshort 0 application/x-dbf
788
- #
789
- #0 byte 0x43
790
- #>8 leshort >0
791
- #>>12 leshort 0 application/x-dbf
792
- #
793
- #0 byte 0x7b
794
- #>8 leshort >0
795
- #>>12 leshort 0 application/x-dbf
796
- #
797
- #0 byte 0x83
798
- #>8 leshort >0
799
- #>>12 leshort 0 application/x-dbf
800
- #
801
- #0 byte 0x8b
802
- #>8 leshort >0
803
- #>>12 leshort 0 application/x-dbf
804
- #
805
- #0 byte 0x8e
806
- #>8 leshort >0
807
- #>>12 leshort 0 application/x-dbf
808
- #
809
- #0 byte 0xb3
810
- #>8 leshort >0
811
- #>>12 leshort 0 application/x-dbf
812
- #
813
- #0 byte 0xf5
814
- #>8 leshort >0
815
- #>>12 leshort 0 application/x-dbf
816
- #
817
- #0 leshort 0x0006 application/x-dbt
818
-
819
- # Debian has entries for the old PGP formats:
820
- # pgp: file(1) magic for Pretty Good Privacy
821
- # see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
822
- #0 beshort 0x9900 application/x-pgp-keyring
823
- #0 beshort 0x9501 application/x-pgp-keyring
824
- #0 beshort 0x9500 application/x-pgp-keyring
825
- #0 beshort 0xa600 application/pgp-encrypted
826
- #0 string -----BEGIN\040PGP text/PGP armored data
827
- #>15 string PUBLIC\040KEY\040BLOCK- public key block
828
- #>15 string MESSAGE- message
829
- #>15 string SIGNED\040MESSAGE- signed message
830
- #>15 string PGP\040SIGNATURE- signature
831
- #0 beshort 0x8501 data
832
- #text/PGP key public ring
833
- 0 beshort 0x9900 application/pgp
834
- #text/PGP key security ring
835
- 0 beshort 0x9501 application/pgp
836
- #text/PGP key security ring
837
- 0 beshort 0x9500 application/pgp
838
- #text/PGP encrypted data
839
- 0 beshort 0xa600 application/pgp-encrypted
840
- #text/PGP armored data
841
- ##public key block
842
- 2 string ---BEGIN\ PGP\ PUBLIC\ KEY\ BLOCK- application/pgp-keys
843
- 0 string -----BEGIN\040PGP\40MESSAGE- application/pgp
844
- 0 string -----BEGIN\040PGP\40SIGNATURE- application/pgp-signature
845
-
846
- #
847
- # GnuPG Magic:
848
- #
849
- #0 beshort 0x9901 application/x-gnupg-keyring
850
- #0 beshort 0x8501 text/OpenPGP data
851
- #text/GnuPG key public ring
852
- 0 beshort 0x9901 application/pgp
853
- #text/OpenPGP data
854
- 0 beshort 0x8501 application/pgp-encrypted
855
-
856
- # flash: file(1) magic for Macromedia Flash file format
857
- #
858
- # See
859
- #
860
- # http://www.macromedia.com/software/flash/open/
861
- #
862
- 0 string FWS
863
- >3 byte x application/x-shockwave-flash
864
- # Flash Video
865
- 0 string FLV video/x-flv
866
-
867
-
868
- # The following paramaters are created for Namazu.
869
- # <http://www.namazu.org/>
870
- #
871
- # 1999/08/13
872
- #0 string \<!--\ MHonArc text/html; x-type=mhonarc
873
- 0 string BZh application/x-bzip2
874
-
875
- # 1999/09/09
876
- # VRML (suggested by Masao Takaku)
877
- 0 string #VRML\ V1.0\ ascii model/vrml
878
- 0 string #VRML\ V2.0\ utf8 model/vrml
879
-
880
- #------------------------------------------------------------------------------
881
- # ichitaro456: file(1) magic for Just System Word Processor Ichitaro
882
- #
883
- # Contributor kenzo-:
884
- # Reversed-engineered JS Ichitaro magic numbers
885
- #
886
-
887
- 0 string DOC
888
- >43 byte 0x14 application/x-ichitaro4
889
- >144 string JDASH application/x-ichitaro4
890
-
891
- 0 string DOC
892
- >43 byte 0x15 application/x-ichitaro5
893
-
894
- 0 string DOC
895
- >43 byte 0x16 application/x-ichitaro6
896
-
897
- #------------------------------------------------------------------------------
898
- # office97: file(1) magic for MicroSoft Office files
899
- #
900
- # Contributor kenzo-:
901
- # Reversed-engineered MS Office magic numbers
902
- #
903
-
904
- #0 string \320\317\021\340\241\261\032\341
905
- #>48 byte 0x1B application/excel
906
-
907
- 2080 string Microsoft\ Excel\ 5.0\ Worksheet application/vnd.ms-excel
908
- 2114 string Biff5 application/vnd.ms-excel
909
-
910
- 0 string \224\246\056 application/msword
911
-
912
- 0 belong 0x31be0000 application/msword
913
-
914
- 0 string PO^Q` application/msword
915
-
916
- 0 string \320\317\021\340\241\261\032\341
917
- >546 string bjbj application/msword
918
- >546 string jbjb application/msword
919
-
920
- 512 string R\0o\0o\0t\0\ \0E\0n\0t\0r\0y application/msword
921
-
922
- 2080 string Microsoft\ Word\ 6.0\ Document application/msword
923
- 2080 string Documento\ Microsoft\ Word\ 6 application/msword
924
- 2112 string MSWordDoc application/msword
925
-
926
- #0 string \320\317\021\340\241\261\032\341 application/powerpoint
927
- 0 string \320\317\021\340\241\261\032\341 application/msword
928
-
929
- 0 string #\ PaCkAgE\ DaTaStReAm application/x-svr4-package
930
-
931
-
932
- # WinNT/WinCE PE files (Warner Losh, imp@village.org)
933
- #
934
- 128 string PE\000\000 application/octet-stream
935
- 0 string PE\000\000 application/octet-stream
936
-
937
- # miscellaneous formats
938
- 0 string LZ application/octet-stream
939
-
940
- # DOS device drivers by Joerg Jenderek
941
- 0 belong 0xffffffff application/octet-stream
942
-
943
- # .EXE formats (Greg Roelofs, newt@uchicago.edu)
944
- #
945
- 0 string MZ
946
- >24 string @ application/octet-stream
947
-
948
- 0 string MZ
949
- >30 string Copyright\ 1989-1990\ PKWARE\ Inc. application/zip
950
-
951
- 0 string MZ
952
- >30 string PKLITE\ Copr. application/zip
953
-
954
- 0 string MZ
955
- >36 string LHa's\ SFX application/x-lha
956
-
957
- 0 string MZ application/octet-stream
958
-
959
- # LHA archiver
960
- 2 string -lh
961
- >6 string - application/x-lha
962
-
963
-
964
- # Zoo archiver
965
- 20 lelong 0xfdc4a7dc application/x-zoo
966
-
967
- # ARC archiver
968
- 0 lelong&0x8080ffff 0x0000081a application/x-arc
969
- 0 lelong&0x8080ffff 0x0000091a application/x-arc
970
- 0 lelong&0x8080ffff 0x0000021a application/x-arc
971
- 0 lelong&0x8080ffff 0x0000031a application/x-arc
972
- 0 lelong&0x8080ffff 0x0000041a application/x-arc
973
- 0 lelong&0x8080ffff 0x0000061a application/x-arc
974
-
975
- # Microsoft Outlook's Transport Neutral Encapsulation Format (TNEF)
976
- 0 lelong 0x223e9f78 application/vnd.ms-tnef
977
-
978
- # From: stephane.loeuillet@tiscali.f
979
- # http://www.djvuzone.org/
980
- 0 string AT&TFORM image/vnd.djvu
981
-
982
- # Danny Milosavljevic <danny.milo@gmx.net>
983
- # this are adrift (adventure game standard) game files, extension .taf
984
- # depending on version magic continues with 0x93453E6139FA (V 4.0)
985
- # 0x9445376139FA (V 3.90)
986
- # 0x9445366139FA (V 3.80)
987
- # this is from source (http://www.adrift.org.uk/) and I have some taf
988
- # files, and checked them.
989
- #0 belong 0x3C423FC9
990
- #>4 belong 0x6A87C2CF application/x-adrift
991
- #0 string \000\000\001\000 image/x-ico
992
-
993
- # Quark Xpress 3 Files:
994
- # (made the mimetype up)
995
- 0 string \0\0MMXPR3\0 application/x-quark-xpress-3
996
-
997
- # EET archive
998
- # From: Tilman Sauerbeck <tilman@code-monkey.de>
999
- 0 belong 0x1ee7ff00 application/x-eet
1000
-
1001
- # From: Denis Knauf, via gentoo.
1002
- 0 string fLaC audio/x-flac
1003
- 0 string CWS application/x-shockwave-flash
1004
-
1005
- # Hangul Document Files:
1006
- # Reversed-engineered HWP magic numbers
1007
- # From: Won-Kyu Park <wkpark@kldp.org>
1008
- 512 string R\0o\0o\0t\0 application/x-hwp
1009
-
1010
- 0 string/c BEGIN:VCARD text/x-vcard
1011
- 0 string WordPro\0 application/vnd.lotus-wordpro
1012
- 0 string WordPro\r\373 application/vnd.lotus-wordpro
1013
- 0 string CPC\262 image/x-cpi
1014
-
1015
- #
1016
- 128 string DICM application/dicom
1017
-
1018
- # Symbian installation files
1019
- 8 lelong 0x10000419 application/vnd.symbian.install
1020
- 0 lelong 0x10201A7A x-epoc/x-sisx-app
1021
- # FORTRAN source
1022
- 0 string/c c\ text/x-fortran
1023
-
1024
- # Gnumeric spreadsheet
1025
- # This entry is only semi-helpful, as Gnumeric compresses its files, so
1026
- # they will ordinarily reported as "compressed", but at least -z helps
1027
- 39 string =<gmr:Workbook application/x-gnumeric
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/libs/rackspace/share/magic.mime.mgc DELETED
Binary file
app/list-tables.php DELETED
@@ -1,501 +0,0 @@
1
- <?PHP
2
- if (!class_exists('WP_List_Table'))
3
- include_once( trailingslashit(ABSPATH).'wp-admin/includes/class-wp-list-table.php' );
4
-
5
- class BackWPup_Jobs_Table extends WP_List_Table {
6
- function BackWPup_Jobs_Table() {
7
- global $current_screen;
8
- parent::WP_List_Table( array(
9
- 'screen' => $current_screen,
10
- 'plural' => 'jobs',
11
- 'singular' => 'job'
12
- ) );
13
- }
14
-
15
- function check_permissions() {
16
- if ( !current_user_can( 10 ) )
17
- wp_die( __( 'No rights' ) );
18
- }
19
-
20
- function prepare_items() {
21
- global $mode;
22
- $this->items=get_option('backwpup_jobs');
23
- $mode = empty( $_REQUEST['mode'] ) ? 'list' : $_REQUEST['mode'];
24
- }
25
-
26
- function pagination( $which ) {
27
- global $mode;
28
-
29
- parent::pagination( $which );
30
-
31
- if ( 'top' == $which )
32
- $this->view_switcher( $mode );
33
- }
34
-
35
- function no_items() {
36
- _e( 'No Jobs.','backwpup');
37
- }
38
-
39
- function get_bulk_actions() {
40
- $actions = array();
41
- $actions['export'] = __( 'Export' );
42
- $actions['delete'] = __( 'Delete' );
43
-
44
- return $actions;
45
- }
46
-
47
- function get_columns() {
48
- $posts_columns = array();
49
- $posts_columns['cb'] = '<input type="checkbox" />';
50
- $posts_columns['id'] = __('ID','backwpup');
51
- $posts_columns['jobname'] = __('Job Name','backwpup');
52
- $posts_columns['type'] = __('Type','backwpup');
53
- $posts_columns['info'] = __('Information','backwpup');
54
- $posts_columns['next'] = __('Next Run','backwpup');
55
- $posts_columns['last'] = __('Last Run','backwpup');
56
- return $posts_columns;
57
- }
58
-
59
- function get_sortable_columns() {
60
- return array();
61
- }
62
-
63
- function get_hidden_columns() {
64
- return (array) get_user_option( 'backwpup_jobs_columnshidden' );
65
- }
66
-
67
- function display_rows() {
68
- $style = '';
69
- foreach ( $this->items as $jobid => $jobvalue ) {
70
- $jobvalue=backwpup_check_job_vars($jobvalue,$jobid);//Set and check job settings
71
- $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
72
- echo "\n\t", $this->single_row( $jobid, $jobvalue, $style );
73
- }
74
- }
75
-
76
- function single_row( $jobid, $jobvalue, $style = '' ) {
77
- global $mode;
78
- list( $columns, $hidden, $sortable ) = $this->get_column_info();
79
- $r = "<tr id='jodid-$jobid'$style>";
80
- foreach ( $columns as $column_name => $column_display_name ) {
81
- $class = "class=\"$column_name column-$column_name\"";
82
-
83
- $style = '';
84
- if ( in_array( $column_name, $hidden ) )
85
- $style = ' style="display:none;"';
86
-
87
- $attributes = "$class$style";
88
-
89
- switch( $column_name ) {
90
- case 'cb':
91
- $r .= '<th scope="row" class="check-column"><input type="checkbox" name="jobs[]" value="'. esc_attr($jobid) .'" /></th>';
92
- break;
93
- case 'id':
94
- $r .= "<td $attributes>".$jobid."</td>";
95
- break;
96
- case 'jobname':
97
- $r .= "<td $attributes><strong><a href=\"".wp_nonce_url('admin.php?page=BackWPup&subpage=edit&jobid='.$jobid, 'edit-job')."\" title=\"".__('Edit:','backwpup').$jobvalue['name']."\">".esc_html($jobvalue['name'])."</a></strong>";
98
- $actions = array();
99
- if (empty($jobvalue['logfile']) and empty($jobvalue['starttime'])) {
100
- $actions['edit'] = "<a href=\"" . wp_nonce_url('admin.php?page=BackWPup&subpage=edit&jobid='.$jobid, 'edit-job') . "\">" . __('Edit') . "</a>";
101
- $actions['copy'] = "<a href=\"" . wp_nonce_url('admin.php?page=BackWPup&action=copy&jobid='.$jobid, 'copy-job_'.$jobid) . "\">" . __('Copy','backwpup') . "</a>";
102
- $actions['export'] = "<a href=\"" . wp_nonce_url('admin.php?page=BackWPup&action=export&jobs[]='.$jobid, 'bulk-jobs') . "\">" . __('Export','backwpup') . "</a>";
103
- $actions['delete'] = "<a class=\"submitdelete\" href=\"" . wp_nonce_url('admin.php?page=BackWPup&action=delete&jobs[]='.$jobid, 'bulk-jobs') . "\" onclick=\"if ( confirm('" . esc_js(__("You are about to delete this Job. \n 'Cancel' to stop, 'OK' to delete.","backwpup")) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
104
- $actions['runnow'] = "<a href=\"" . wp_nonce_url('admin.php?page=BackWPup&subpage=runnow&jobid='.$jobid, 'runnow-job_'.$jobid) . "\">" . __('Run Now','backwpup') . "</a>";
105
- } else {
106
- $actions['clear'] = "<a class=\"submitdelete\" href=\"" . wp_nonce_url('admin.php?page=BackWPup&action=clear&jobid='.$jobid, 'clear-job_'.$jobid) . "\">" . __('Clear','backwpup') . "</a>";
107
- }
108
- $action_count = count($actions);
109
- $i = 0;
110
- $r .= '<br /><div class="row-actions">';
111
- foreach ( $actions as $action => $linkaction ) {
112
- ++$i;
113
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
114
- $r .= "<span class='$action'>$linkaction$sep</span>";
115
- }
116
- $r .= '</div>';
117
- $r .= '</td>';
118
- break;
119
- case 'type':
120
- $r .= "<td $attributes>";
121
- $r .= backwpup_backup_types($jobvalue['type'],false);
122
- $r .= "</td>";
123
- break;
124
- case 'info':
125
- $r .= "<td $attributes>";
126
- if (in_array('FILE',explode('+',$jobvalue['type']))) {
127
- $files=backwpup_calc_file_size($jobvalue);
128
- $r .= __("Files Size:","backwpup")." ".backwpup_formatBytes($files['size'])."<br />";
129
- if ( 'excerpt' == $mode ) {
130
- $r .= __("Files count:","backwpup")." ".$files['num']."<br />";
131
- }
132
- }
133
- if (in_array('DB',explode('+',$jobvalue['type'])) or in_array('OPTIMIZE',explode('+',$jobvalue['type'])) or in_array('CHECK',explode('+',$jobvalue['type']))) {
134
- $dbsize=backwpup_calc_db_size($jobvalue);
135
- $r .= "DB Size: ".backwpup_formatBytes($dbsize['size'])."<br />";
136
- if ( 'excerpt' == $mode ) {
137
- $r .= __("DB Tables:","backwpup")." ".$dbsize['num']."<br />";
138
- $r .= __("DB Rows:","backwpup")." ".$dbsize['rows']."<br />";
139
- }
140
- }
141
- $r .= "</td>";
142
- break;
143
- case 'next':
144
- $r .= "<td $attributes>";
145
- if ($jobvalue['starttime']>0 and !empty($jobvalue['logfile'])) {
146
- $runtime=current_time('timestamp')-$jobvalue['starttime'];
147
- $r .= __('Running since:','backwpup').' '.$runtime.' '.__('sec.','backwpup');
148
- } elseif ($jobvalue['activated']) {
149
- $r .= date(get_option('date_format'),$jobvalue['cronnextrun']).'<br />'. date(get_option('time_format'),$jobvalue['cronnextrun']);
150
- } else {
151
- $r .= __('Inactive','backwpup');
152
- }
153
- if ( 'excerpt' == $mode ) {
154
- $r .= '<br />'.__('<a href="http://wikipedia.org/wiki/Cron" target="_blank">Cron</a>:','backwpup').' '.$jobvalue['cron'];
155
- }
156
- $r .= "</td>";
157
- break;
158
- case 'last':
159
- $r .= "<td $attributes>";
160
- if ($jobvalue['lastrun']) {
161
- $r .= date_i18n(get_option('date_format'),$jobvalue['lastrun']).'<br />'. date_i18n(get_option('time_format'),$jobvalue['lastrun']);
162
- if (isset($jobvalue['lastruntime']))
163
- $r .= '<br />'.__('Runtime:','backwpup').' '.$jobvalue['lastruntime'].' '.__('sec.','backwpup').'<br />';
164
- } else {
165
- $r .= __('None','backwpup');
166
- }
167
- if (!empty($jobvalue['lastbackupdownloadurl']))
168
- $r .="<a href=\"" . wp_nonce_url($jobvalue['lastbackupdownloadurl'], 'download-backup') . "\" title=\"".__('Download last Backup','backwpup')."\">" . __('Download','backwpup') . "</a> | ";
169
- if (!empty($jobvalue['lastlogfile']))
170
- $r .="<a href=\"" . wp_nonce_url('admin.php?page=BackWPup&subpage=view_log&logfile='.$jobvalue['lastlogfile'], 'view-log_'.basename($jobvalue['lastlogfile'])) . "\" title=\"".__('View last Log','backwpup')."\">" . __('Log','backwpup') . "</a><br />";
171
-
172
- $r .= "</td>";
173
- break;
174
- }
175
- }
176
- $r .= '</tr>';
177
- return $r;
178
- }
179
- }
180
-
181
- class BackWPup_Logs_Table extends WP_List_Table {
182
- function BackWPup_Logs_Table() {
183
- global $current_screen;
184
- parent::WP_List_Table( array(
185
- 'screen' => $current_screen,
186
- 'plural' => 'logs',
187
- 'singular' => 'log'
188
- ) );
189
- }
190
-
191
- function check_permissions() {
192
- if ( !current_user_can( 10 ) )
193
- wp_die( __( 'No rights' ) );
194
- }
195
-
196
- function prepare_items() {
197
-
198
- $per_page = (int) get_user_option( 'backwpup_logs_per_page' );
199
- if ( empty( $per_page ) || $per_page < 1 )
200
- $per_page = 20;
201
-
202
- //load logs
203
- $cfg=get_option('backwpup');
204
- $logfiles=array();
205
- if ( $dir = @opendir( $cfg['dirlogs'] ) ) {
206
- while (($file = readdir( $dir ) ) !== false ) {
207
- if (is_file($cfg['dirlogs'].'/'.$file) and 'backwpup_log_' == substr($file,0,strlen('backwpup_log_')) and ('.html' == substr($file,-5) or '.html.gz' == substr($file,-8)))
208
- $logfiles[]=$file;
209
- }
210
- closedir( $dir );
211
- if ( !isset( $_REQUEST['orderby'] ) or $_REQUEST['orderby']=='log') {
212
- if ( $_REQUEST['order']=='asc')
213
- sort($logfiles);
214
- else
215
- rsort($logfiles);
216
- }
217
- if (!isset( $_REQUEST['orderby'] ) and !isset( $_REQUEST['order'] ))
218
- rsort($logfiles);
219
- }
220
- //by page
221
- $start=intval( ( $this->get_pagenum() - 1 ) * $per_page );
222
- $end=$start+$per_page;
223
- if ($end>count($logfiles))
224
- $end=count($logfiles);
225
-
226
- for ($i=$start;$i<$end;$i++) {
227
- $this->items[] = $logfiles[$i];
228
- }
229
-
230
- $this->set_pagination_args( array(
231
- 'total_items' => count($logfiles),
232
- 'per_page' => $per_page
233
- ) );
234
-
235
- }
236
-
237
- function get_sortable_columns() {
238
- return array(
239
- 'log' => 'log',
240
- );
241
- }
242
-
243
- function no_items() {
244
- _e( 'No Logs.','backwpup');
245
- }
246
-
247
- function get_bulk_actions() {
248
- $actions = array();
249
- $actions['delete'] = __( 'Delete' );
250
-
251
- return $actions;
252
- }
253
-
254
- function get_columns() {
255
- $posts_columns = array();
256
- $posts_columns['cb'] = '<input type="checkbox" />';
257
- $posts_columns['id'] = __('Job','backwpup');
258
- $posts_columns['type'] = __('Type','backwpup');
259
- $posts_columns['log'] = __('Backup/Log Date/Time','backwpup');
260
- $posts_columns['status'] = __('Status','backwpup');
261
- $posts_columns['size'] = __('Size','backwpup');
262
- $posts_columns['runtime'] = __('Runtime','backwpup');
263
- return $posts_columns;
264
- }
265
-
266
- function get_hidden_columns() {
267
- return (array) get_user_option( 'backwpup_logs_columnshidden' );
268
- }
269
-
270
- function display_rows() {
271
- $style = '';
272
- $cfg=get_option('backwpup');
273
- foreach ( $this->items as $logfile ) {
274
- $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
275
- $logdata=backwpup_read_logheader($cfg['dirlogs'].$logfile);
276
- echo "\n\t", $this->single_row( $cfg['dirlogs'].$logfile, $logdata, $style );
277
- }
278
- }
279
-
280
- function single_row( $logfile, $logdata, $style = '' ) {
281
- list( $columns, $hidden, $sortable ) = $this->get_column_info();
282
- $r = "<tr id='".basename($logfile)."'$style>";
283
- foreach ( $columns as $column_name => $column_display_name ) {
284
- $class = "class=\"$column_name column-$column_name\"";
285
-
286
- $style = '';
287
- if ( in_array( $column_name, $hidden ) )
288
- $style = ' style="display:none;"';
289
-
290
- $attributes = "$class$style";
291
-
292
- switch($column_name) {
293
- case 'cb':
294
- $r .= '<th scope="row" class="check-column"><input type="checkbox" name="logfiles[]" value="'. esc_attr(basename($logfile)) .'" /></th>';
295
- break;
296
- case 'id':
297
- $r .= "<td $attributes>".$logdata['jobid']."</td>";
298
- break;
299
- case 'type':
300
- $r .= "<td $attributes>";
301
- $r .= backwpup_backup_types($logdata['type'],false);
302
- $r .= "</td>";
303
- break;
304
- case 'log':
305
- $name='';
306
- if (is_file($logvalue['backupfile']))
307
- $name=basename($logvalue['backupfile']);
308
-
309
- $r .= "<td $attributes><strong><a href=\"".wp_nonce_url('admin.php?page=BackWPup&subpage=view_log&logfile='.$logfile, 'view-log_'.basename($logfile))."\" title=\"".__('View log','backwpup')."\">".date_i18n(get_option('date_format'),$logdata['logtime'])." ".date_i18n(get_option('time_format'),$logdata['logtime']).": <i>".$logdata['name']."</i></a></strong>";
310
- $actions = array();
311
- $actions['view'] = "<a href=\"" . wp_nonce_url('admin.php?page=BackWPup&subpage=view_log&logfile='.$logfile, 'view-log_'.basename($logfile)) . "\">" . __('View','backwpup') . "</a>";
312
- $actions['delete'] = "<a class=\"submitdelete\" href=\"" . wp_nonce_url('admin.php?page=BackWPup&subpage=logs&action=delete&paged='.$this->get_pagenum().'&logfiles[]='.basename($logfile), 'bulk-logs') . "\" onclick=\"return showNotice.warn();\">" . __('Delete') . "</a>";
313
- $actions['download'] = "<a href=\"" . wp_nonce_url('admin.php?page=BackWPup&subpage=logs&action=download&file='.$logfile, 'download-backup_'.basename($logfile)) . "\">" . __('Download','backwpup') . "</a>";
314
- $action_count = count($actions);
315
- $i = 0;
316
- $r .= '<br /><div class="row-actions">';
317
- foreach ( $actions as $action => $linkaction ) {
318
- ++$i;
319
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
320
- $r .= "<span class='$action'>$linkaction$sep</span>";
321
- }
322
- $r .= '</div>';
323
- $r .= "</td>";
324
- break;
325
- case 'status':
326
- $r .= "<td $attributes>";
327
- if($logdata['errors']>0 or $logdata['warnings']>0) {
328
- if ($logdata['errors']>0)
329
- $r .= '<span style="color:red;">'.$logdata['errors'].' '.__('ERROR(S)','backwpup').'</span><br />';
330
- if ($logdata['warnings']>0)
331
- $r .= '<span style="color:yellow;">'.$logdata['warnings'].' '.__('WARNING(S)','backwpup').'</span>';
332
- } else {
333
- $r .= '<span style="color:green;">'.__('OK','backwpup').'</span>';
334
- }
335
- $r .= "</td>";
336
- break;
337
- case 'size':
338
- $r .= "<td $attributes>";
339
- if (!empty($logdata['backupfilesize'])) {
340
- $r .= backwpup_formatBytes($logdata['backupfilesize']);
341
- } else {
342
- $r .= __('only Log','backwpup');
343
- }
344
- $r .= "</td>";
345
- break;
346
- case 'runtime':
347
- $r .= "<td $attributes>";
348
- $r .= $logdata['runtime'].' '.__('sec.','backwpup');
349
- $r .= "</td>";
350
- break;
351
- }
352
- }
353
- $r .= '</tr>';
354
- return $r;
355
- }
356
- }
357
-
358
- class BackWPup_Backups_Table extends WP_List_Table {
359
- function BackWPup_Backups_Table() {
360
- global $current_screen;
361
- parent::WP_List_Table( array(
362
- 'screen' => $current_screen,
363
- 'plural' => 'backups',
364
- 'singular' => 'backup'
365
- ) );
366
- }
367
-
368
- function check_permissions() {
369
- if ( !current_user_can( 10 ) )
370
- wp_die( __( 'No rights' ) );
371
- }
372
-
373
- function prepare_items() {
374
-
375
- $per_page = (int) get_user_option( 'backwpup_backups_per_page' );
376
- if ( empty( $per_page ) || $per_page < 1 )
377
- $per_page = 20;
378
-
379
- $backups=get_option('backwpup_backups_chache');
380
-
381
- //by page
382
- $start=intval( ( $this->get_pagenum() - 1 ) * $per_page );
383
- $end=$start+$per_page;
384
- if ($end>count($backups))
385
- $end=count($backups);
386
-
387
- for ($i=$start;$i<$end;$i++) {
388
- $this->items[] = $backups[$i];
389
- }
390
-
391
- $this->set_pagination_args( array(
392
- 'total_items' => count($backups),
393
- 'per_page' => $per_page
394
- ) );
395
-
396
- }
397
-
398
- function no_items() {
399
- _e( 'No Backups.','backwpup');
400
- }
401
-
402
-
403
- function get_bulk_actions() {
404
- $actions = array();
405
- $actions['delete'] = __( 'Delete' );
406
-
407
- return $actions;
408
- }
409
-
410
- function get_columns() {
411
- $posts_columns = array();
412
- $posts_columns['cb'] = '<input type="checkbox" />';
413
- $posts_columns['backup'] = __('Backupfile','backwpup');
414
- $posts_columns['size'] = __('Size','backwpup');
415
- return $posts_columns;
416
- }
417
-
418
- function get_sortable_columns() {
419
- return array();
420
- }
421
-
422
- function get_hidden_columns() {
423
- return (array) get_user_option( 'backwpup_backups_columnshidden' );
424
- }
425
-
426
- function display_rows() {
427
- $style = '';
428
- $jobs=get_option('backwpup_jobs'); //Load jobs
429
- foreach ( $this->items as $backup ) {
430
- $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
431
- echo "\n\t", $this->single_row( $backup, backwpup_check_job_vars($jobs[$backup['jobid']],$backup['jobid']), $style );
432
- }
433
- }
434
-
435
- function single_row( $backup, $jobvalue, $style = '' ) {
436
- list( $columns, $hidden, $sortable ) = $this->get_column_info();
437
- $r = "<tr id='$logfile'$style>";
438
- foreach ( $columns as $column_name => $column_display_name ) {
439
- $class = "class=\"$column_name column-$column_name\"";
440
-
441
- $style = '';
442
- if ( in_array( $column_name, $hidden ) )
443
- $style = ' style="display:none;"';
444
-
445
- $attributes = "$class$style";
446
-
447
- switch($column_name) {
448
- case 'cb':
449
- $r .= '<th scope="row" class="check-column"><input type="checkbox" name="backupfiles[]" value="'. esc_attr($backup['file'].'|'.$backup['jobid'].'|'.$backup['type']) .'" /></th>';
450
- break;
451
- case 'backup':
452
- $dir=dirname($backup['file']);
453
- if ($dir=='.')
454
- $dir='';
455
- else
456
- $dir.='/';
457
- if ($backup['type']=='FOLDER') {
458
- $r .= "<td $attributes><strong>".basename($backup['file'])."</strong><br />".$dir;
459
- } elseif ($backup['type']=='S3') {
460
- $r .= "<td $attributes><strong>".basename($backup['file'])."</strong><br />S3://".$jobvalue['awsBucket']."/".$dir;
461
- } elseif ($backup['type']=='FTP') {
462
- $r .= "<td $attributes><strong>".basename($backup['file'])."</strong><br />ftp://".$jobvalue['ftphost'].$dir;
463
- } elseif ($backup['type']=='RSC') {
464
- $r .= "<td $attributes><strong>".basename($backup['file'])."</strong><br />RSC://".$jobvalue['rscContainer']."/".$dir;
465
- } elseif ($backup['type']=='MSAZURE') {
466
- $r .= "<td $attributes><strong>".basename($backup['file'])."</strong><br />azure://".$jobvalue['msazureContainer']."/".$dir;
467
- } elseif ($backup['type']=='DROPBOX') {
468
- $r .= "<td $attributes><strong>".basename($backup['file'])."</strong><br />dropbox:/".$dir;
469
- } elseif ($backup['type']=='SUGARSYNC') {
470
- $r .= "<td $attributes><strong>".$backup['filename']."</strong><br />sugarsync://magicBriefcase/".$jobvalue['sugardir'];
471
- }
472
- $actions = array();
473
- $actions['delete'] = "<a class=\"submitdelete\" href=\"" . wp_nonce_url('admin.php?page=BackWPup&subpage=backups&action=delete&paged='.$this->get_pagenum().'&backupfiles[]='.esc_attr($backup['file'].'|'.$backup['jobid'].'|'.$backup['type']), 'bulk-backups') . "\" onclick=\"if ( confirm('" . esc_js(__("You are about to delete this Backup Archive. \n 'Cancel' to stop, 'OK' to delete.","backwpup")) . "') ) { return true;}return false;\">" . __('Delete') . "</a>";
474
- $actions['download'] = "<a href=\"" . wp_nonce_url($backup['downloadurl'], 'download-backup') . "\">" . __('Download','backwpup') . "</a>";
475
- $action_count = count($actions);
476
- $i = 0;
477
- $r .= '<br /><div class="row-actions">';
478
- foreach ( $actions as $action => $linkaction ) {
479
- ++$i;
480
- ( $i == $action_count ) ? $sep = '' : $sep = ' | ';
481
- $r .= "<span class='$action'>$linkaction$sep</span>";
482
- }
483
- $r .= '</div>';
484
- $r .= "</td>";
485
- break;
486
- case 'size':
487
- $r .= "<td $attributes>";
488
- if (!empty($backup['filesize']) and $backup['filesize']!=-1) {
489
- $r .= backwpup_formatBytes($backup['filesize']);
490
- } else {
491
- $r .= __('?','backwpup');
492
- }
493
- $r .= "</td>";
494
- break;
495
- }
496
- }
497
- $r .= '</tr>';
498
- return $r;
499
- }
500
- }
501
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/options-edit-job.php DELETED
@@ -1,474 +0,0 @@
1
- <?PHP
2
- // don't load directly
3
- if ( !defined('ABSPATH') )
4
- die('-1');
5
-
6
- check_admin_referer('edit-job');
7
- global $wpdb;
8
- $jobid = (int) $_REQUEST['jobid'];
9
- $jobs=get_option('backwpup_jobs');
10
- if (empty($jobid)) { //generate a new id for new job
11
- if (is_array($jobs)) {
12
- foreach ($jobs as $jobkey => $jobvalue) {
13
- if ($jobkey>$heighestid) $heighestid=$jobkey;
14
- }
15
- $jobid=$heighestid+1;
16
- } else {
17
- $jobid=1;
18
- }
19
- }
20
- $jobvalue=backwpup_check_job_vars($jobs[$jobid],$jobid);
21
- $todo=explode('+',$jobvalue['type']);
22
- $dests=explode(',',strtoupper(BACKWPUP_DESTS));
23
- ?>
24
- <div class="wrap">
25
- <div id="icon-tools" class="icon32"><br /></div>
26
- <h2><?php _e('BackWPup Job Settings', 'backwpup'); ?></h2>
27
-
28
- <?PHP backwpup_option_submenues(); ?>
29
- <div class="clear"></div>
30
-
31
-
32
- <form method="post" action="<?PHP echo get_admin_url().'admin.php?page=BackWPup&subpage=edit';?>">
33
- <input type="hidden" name="subpage" value="edit" />
34
- <input type="hidden" name="jobid" value="<?PHP echo $jobid;?>" />
35
- <?php wp_nonce_field('edit-job'); ?>
36
- <div id="poststuff" class="metabox-holder has-right-sidebar">
37
- <div class="inner-sidebar">
38
- <div id="side-sortables" class="meta-box-sortables">
39
-
40
- <div id="jobtype" class="postbox">
41
- <h3 class="hndle"><span><?PHP _e('Job Type','backwpup'); ?></span></h3>
42
- <div class="inside">
43
- <?php
44
- foreach (backwpup_backup_types() as $type) {
45
- echo "<input class=\"jobtype-select checkbox\" id=\"jobtype-select-".$type."\" type=\"checkbox\"".checked(true,in_array($type,$todo),false)." name=\"type[]\" value=\"".$type."\"/> ".backwpup_backup_types($type);
46
- }
47
- ?>
48
-
49
-
50
- </div>
51
- <div id="major-publishing-actions">
52
- <div id="delete-action">
53
- <a class="submitdelete deletion" style="color:red" href="<?PHP echo wp_nonce_url('admin.php?page=BackWPup&action=delete&jobid='.$jobid, 'delete-job_'.$jobid); ?>" onclick="if ( confirm('<?PHP echo esc_js(__("You are about to delete this Job. \n 'Cancel' to stop, 'OK' to delete.","backwpup")); ?>') ) { return true;}return false;"><?php _e('Delete', 'backwpup'); ?></a>
54
- </div>
55
- <div id="publishing-action">
56
- <input type="submit" name="submit" class="button-primary right" accesskey="s" value="<?php _e('Save Changes', 'backwpup'); ?>" />
57
- </div>
58
- <div class="clear"></div>
59
- </div>
60
- </div>
61
-
62
- <div id="jobschedule" class="postbox">
63
- <h3 class="hndle"><span><?PHP _e('Job Schedule','backwpup'); ?></span></h3>
64
- <div class="inside">
65
- <input class="checkbox" value="1" type="checkbox" <?php checked($jobvalue['activated'],true); ?> name="activated" /> <?PHP _e('Activate scheduling', 'backwpup'); ?><br />
66
- <?PHP list($cronstr['minutes'],$cronstr['hours'],$cronstr['mday'],$cronstr['mon'],$cronstr['wday'])=explode(' ',$jobvalue['cron'],5); ?>
67
- <div style="width:85px; float: left;">
68
- <b><?PHP _e('Minutes: ','backwpup'); ?></b><br />
69
- <?PHP
70
- if (strstr($cronstr['minutes'],'*/'))
71
- $minutes=explode('/',$cronstr['minutes']);
72
- else
73
- $minutes=explode(',',$cronstr['minutes']);
74
- ?>
75
- <select name="cronminutes[]" id="cronminutes" style="height:65px;" multiple="multiple">
76
- <option value="*"<?PHP selected(in_array('*',$minutes,true),true,true); ?>><?PHP _e('Any (*)','backwpup'); ?></option>
77
- <?PHP
78
- for ($i=0;$i<60;$i=$i+5) {
79
- echo "<option value=\"".$i."\"".selected(in_array("$i",$minutes,true),true,false).">".$i."</option>";
80
- }
81
- ?>
82
- </select>
83
- </div>
84
- <div style="width:85px; float: left;">
85
- <b><?PHP _e('Hours:','backwpup'); ?></b><br />
86
- <?PHP
87
- if (strstr($cronstr['hours'],'*/'))
88
- $hours=explode('/',$cronstr['hours']);
89
- else
90
- $hours=explode(',',$cronstr['hours']);
91
- ?>
92
- <select name="cronhours[]" id="cronhours" style="height:65px;" multiple="multiple">
93
- <option value="*"<?PHP selected(in_array('*',$hours,true),true,true); ?>><?PHP _e('Any (*)','backwpup'); ?></option>
94
- <?PHP
95
- for ($i=0;$i<24;$i++) {
96
- echo "<option value=\"".$i."\"".selected(in_array("$i",$hours,true),true,false).">".$i."</option>";
97
- }
98
- ?>
99
- </select>
100
- </div>
101
- <div style="width:85px; float: right;">
102
- <b><?PHP _e('Days:','backwpup'); ?></b><br />
103
- <?PHP
104
- if (strstr($cronstr['mday'],'*/'))
105
- $mday=explode('/',$cronstr['mday']);
106
- else
107
- $mday=explode(',',$cronstr['mday']);
108
- ?>
109
- <select name="cronmday[]" id="cronmday" style="height:65px;" multiple="multiple">
110
- <option value="*"<?PHP selected(in_array('*',$mday,true),true,true); ?>><?PHP _e('Any (*)','backwpup'); ?></option>
111
- <?PHP
112
- for ($i=1;$i<=31;$i++) {
113
- echo "<option value=\"".$i."\"".selected(in_array("$i",$mday,true),true,false).">".$i."</option>";
114
- }
115
- ?>
116
- </select>
117
- </div>
118
- <br class="clear" />
119
- <div style="width:130px; float: left;">
120
- <b><?PHP _e('Day of Month:','backwpup'); ?></b><br />
121
- <?PHP
122
- if (strstr($cronstr['mon'],'*/'))
123
- $mon=explode('/',$cronstr['mon']);
124
- else
125
- $mon=explode(',',$cronstr['mon']);
126
- ?>
127
- <select name="cronmon[]" id="cronmon" style="height:65px;" multiple="multiple">
128
- <option value="*"<?PHP selected(in_array('*',$mon,true),true,true); ?>><?PHP _e('Any (*)','backwpup'); ?></option>
129
- <option value="1"<?PHP selected(in_array('1',$mon,true),true,true); ?>><?PHP _e('January'); ?></option>
130
- <option value="2"<?PHP selected(in_array('2',$mon,true),true,true); ?>><?PHP _e('February'); ?></option>
131
- <option value="3"<?PHP selected(in_array('3',$mon,true),true,true); ?>><?PHP _e('March'); ?></option>
132
- <option value="4"<?PHP selected(in_array('4',$mon,true),true,true); ?>><?PHP _e('April'); ?></option>
133
- <option value="5"<?PHP selected(in_array('5',$mon,true),true,true); ?>><?PHP _e('May'); ?></option>
134
- <option value="6"<?PHP selected(in_array('6',$mon,true),true,true); ?>><?PHP _e('June'); ?></option>
135
- <option value="7"<?PHP selected(in_array('7',$mon,true),true,true); ?>><?PHP _e('July'); ?></option>
136
- <option value="8"<?PHP selected(in_array('8',$mon,true),true,true); ?>><?PHP _e('Augest'); ?></option>
137
- <option value="9"<?PHP selected(in_array('9',$mon,true),true,true); ?>><?PHP _e('September'); ?></option>
138
- <option value="10"<?PHP selected(in_array('10',$mon,true),true,true); ?>><?PHP _e('October'); ?></option>
139
- <option value="11"<?PHP selected(in_array('11',$mon,true),true,true); ?>><?PHP _e('November'); ?></option>
140
- <option value="12"<?PHP selected(in_array('12',$mon,true),true,true); ?>><?PHP _e('December'); ?></option>
141
- </select>
142
- </div>
143
- <div style="width:130px; float: right;">
144
- <b><?PHP _e('Day of Week:','backwpup'); ?></b><br />
145
- <select name="cronwday[]" id="cronwday" style="height:65px;" multiple="multiple">
146
- <?PHP
147
- if (strstr($cronstr['wday'],'*/'))
148
- $wday=explode('/',$cronstr['wday']);
149
- else
150
- $wday=explode(',',$cronstr['wday']);
151
- ?>
152
- <option value="*"<?PHP selected(in_array('*',$wday,true),true,true); ?>><?PHP _e('Any (*)','backwpup'); ?></option>
153
- <option value="0"<?PHP selected(in_array('0',$wday,true),true,true); ?>><?PHP _e('Sunday'); ?></option>
154
- <option value="1"<?PHP selected(in_array('1',$wday,true),true,true); ?>><?PHP _e('Monday'); ?></option>
155
- <option value="2"<?PHP selected(in_array('2',$wday,true),true,true); ?>><?PHP _e('Tuesday'); ?></option>
156
- <option value="3"<?PHP selected(in_array('3',$wday,true),true,true); ?>><?PHP _e('Wednesday'); ?></option>
157
- <option value="4"<?PHP selected(in_array('4',$wday,true),true,true); ?>><?PHP _e('Thursday'); ?></option>
158
- <option value="5"<?PHP selected(in_array('5',$wday,true),true,true); ?>><?PHP _e('Friday'); ?></option>
159
- <option value="6"<?PHP selected(in_array('6',$wday,true),true,true); ?>><?PHP _e('Saturday'); ?></option>
160
- </select>
161
- </div>
162
- <br class="clear" />
163
- <?PHP
164
- _e('Working as <a href="http://wikipedia.org/wiki/Cron" target="_blank">Cron</a> job schedule:','backwpup'); echo ' <i>'.$jobvalue['cron'].'</i><br />';
165
- _e('Next runtime:'); echo ' '.date('D, j M Y H:i',backwpup_cron_next($jobvalue['cron']));
166
- ?>
167
- </div>
168
- </div>
169
-
170
- <div id="fileformart" class="postbox" <?PHP if (!in_array("FILE",$todo) and !in_array("DB",$todo) and !in_array("WPEXP",$todo)) echo 'style="display:none;"';?>>
171
- <h3 class="hndle"><span><?PHP _e('Backup File','backwpup'); ?></span></h3>
172
- <div class="inside">
173
- <b><?PHP _e('File Prefix:','backwpup'); ?></b><br />
174
- <input name="fileprefix" type="text" value="<?PHP echo $jobvalue['fileprefix'];?>" class="large-text" /><br />
175
- <b><?PHP _e('File Formart:','backwpup'); ?></b><br />
176
- <?PHP
177
- if (function_exists('gzopen') or class_exists('ZipArchive'))
178
- echo '<input class="radio" type="radio"'.checked('.zip',$jobvalue['fileformart'],false).' name="fileformart" value=".zip" />'.__('Zip','backwpup').'<br />';
179
- else
180
- echo '<input class="radio" type="radio"'.checked('.zip',$jobvalue['fileformart'],false).' name="fileformart" value=".zip" disabled="disabled" />'.__('Zip','backwpup').'<br />';
181
- echo '<input class="radio" type="radio"'.checked('.tar',$jobvalue['fileformart'],false).' name="fileformart" value=".tar" />'.__('Tar','backwpup').'<br />';
182
- if (function_exists('gzopen'))
183
- echo '<input class="radio" type="radio"'.checked('.tar.gz',$jobvalue['fileformart'],false).' name="fileformart" value=".tar.gz" />'.__('Tar GZip','backwpup').'<br />';
184
- else
185
- echo '<input class="radio" type="radio"'.checked('.tar.gz',$jobvalue['fileformart'],false).' name="fileformart" value=".tar.gz" disabled="disabled" />'.__('Tar GZip','backwpup').'<br />';
186
- if (function_exists('bzopen'))
187
- echo '<input class="radio" type="radio"'.checked('.tar.bz2',$jobvalue['fileformart'],false).' name="fileformart" value=".tar.bz2" />'.__('Tar BZip2','backwpup').'<br />';
188
- else
189
- echo '<input class="radio" type="radio"'.checked('.tar.bz2',$jobvalue['fileformart'],false).' name="fileformart" value=".tar.bz2" disabled="disabled" />'.__('Tar BZip2','backwpup').'<br />';
190
- _e('Example:','backwpup');
191
- echo '<br /><i>'.$jobvalue['fileprefix'].date_i18n('Y-m-d_H-i-s').$jobvalue['fileformart'].'</i>';
192
- ?>
193
- </div>
194
- </div>
195
-
196
- <div id="logmail" class="postbox">
197
- <h3 class="hndle"><span><?PHP _e('Send log','backwpup'); ?></span></h3>
198
- <div class="inside">
199
- <?PHP _e('E-Mail-Adress:','backwpup'); ?>
200
- <input name="mailaddresslog" id="mailaddresslog" type="text" value="<?PHP echo $jobvalue['mailaddresslog'];?>" class="large-text" /><br />
201
- <input class="checkbox" value="1" type="checkbox" <?php checked($jobvalue['mailerroronly'],true); ?> name="mailerroronly" /> <?PHP _e('Only send an e-mail if there are errors.','backwpup'); ?>
202
- </div>
203
- </div>
204
-
205
-
206
- </div>
207
- </div>
208
- <div class="has-sidebar" >
209
- <div id="post-body-content" class="has-sidebar-content">
210
-
211
- <div id="titlediv">
212
- <div id="titlewrap">
213
- <label class="hide-if-no-js" style="visibility:hidden" id="title-prompt-text" for="title"><?PHP _e('Enter Job name here','backwpup'); ?></label>
214
- <input type="text" name="name" size="30" tabindex="1" value="<?PHP echo $jobvalue['name'];?>" id="title" autocomplete="off" />
215
- </div>
216
- </div>
217
-
218
- <div id="databasejobs" class="postbox" <?PHP if (!in_array("CHECK",$todo) and !in_array("DB",$todo) and !in_array("OPTIMIZE",$todo)) echo 'style="display:none;"';?>>
219
- <h3 class="hndle"><span><?PHP _e('Database Jobs','backwpup'); ?></span></h3>
220
- <div class="inside">
221
-
222
- <b><?PHP _e('Database tables to <span style="color:red;">ex</span>clude:','backwpup'); ?></b>
223
- <div id="dbexclude-pop" style="border-color:#CEE1EF; border-style:solid; border-width:2px; height:10em; width:50%; margin:5px 0px 5px 40px; overflow:auto; padding:0.5em 0.5em;">
224
- <?php
225
- $tables=$wpdb->get_col('SHOW TABLES FROM `'.DB_NAME.'`');
226
- foreach ($tables as $table) {
227
- if ($wpdb->backwpup_logs<>$table) {
228
- echo ' <input class="checkbox" type="checkbox"'.checked(in_array($table,(array)$jobvalue['dbexclude']),true,false).' name="dbexclude[]" value="'.$table.'"/> '.$table.'<br />';
229
- }
230
- }
231
- ?>
232
- </div><br />
233
- <span id="dbshortinsert" <?PHP if (!in_array("DB",$todo)) echo 'style="display:none;"';?>><input class="checkbox" type="checkbox"<?php checked($jobvalue['dbshortinsert'],true,true);?> name="dbshortinsert" value="1"/> <?php _e('Use short INSERTs instead of full (with keys)','backwpup');?><br /></span>
234
- <input class="checkbox" type="checkbox"<?php checked($jobvalue['maintenance'],true,true);?> name="maintenance" value="1"/> <?php _e('Set Blog Maintenance Mode on Database Operations','backwpup');?><br />
235
- </div>
236
- </div>
237
-
238
- <div id="filebackup" class="postbox" <?PHP if (!in_array("FILE",$todo)) echo 'style="display:none;"';?>>
239
- <h3 class="hndle"><span><?PHP _e('File Backup','backwpup'); ?></span></h3>
240
- <div class="inside">
241
- <b><?PHP _e('Blog Folders to Backup:','backwpup'); ?></b><br />&nbsp;<br />
242
- <div>
243
- <div style="width:20%; float: left;">
244
- &nbsp;<b><input class="checkbox" type="checkbox"<?php checked($jobvalue['backuproot'],true,true);?> name="backuproot" value="1"/> <?php _e('root','backwpup');?></b><br />
245
- <div style="border-color:#CEE1EF; border-style:solid; border-width:2px; height:10em; width:90%; margin:2px; overflow:auto;">
246
- <?PHP
247
- echo '<i>'.__('Exclude:','backwpup').'</i><br />';
248
- $folder=untrailingslashit(str_replace('\\','/',ABSPATH));
249
- if ( $dir = @opendir( $folder ) ) {
250
- while (($file = readdir( $dir ) ) !== false ) {
251
- if ( !in_array($file, array('.', '..','.svn')) and is_dir($folder.'/'.$file) and !in_array($folder.'/'.$file.'/',backwpup_get_exclude_wp_dirs($folder)))
252
- echo '<nobr><input class="checkbox" type="checkbox"'.checked(in_array($folder.'/'.$file.'/',$jobvalue['backuprootexcludedirs']),true,false).' name="backuprootexcludedirs[]" value="'.$folder.'/'.$file.'/"/> '.$file.'</nobr><br />';
253
- }
254
- @closedir( $dir );
255
- }
256
- ?>
257
- </div>
258
- </div>
259
- <div style="width:20%;float: left;">
260
- &nbsp;<b><input class="checkbox" type="checkbox"<?php checked($jobvalue['backupcontent'],true,true);?> name="backupcontent" value="1"/> <?php _e('Content','backwpup');?></b><br />
261
- <div style="border-color:#CEE1EF; border-style:solid; border-width:2px; height:10em; width:90%; margin:2px; overflow:auto;">
262
- <?PHP
263
- echo '<i>'.__('Exclude:','backwpup').'</i><br />';
264
- $folder=untrailingslashit(str_replace('\\','/',WP_CONTENT_DIR));
265
- if ( $dir = @opendir( $folder ) ) {
266
- while (($file = readdir( $dir ) ) !== false ) {
267
- if ( !in_array($file, array('.', '..','.svn')) and is_dir($folder.'/'.$file) and !in_array($folder.'/'.$file.'/',backwpup_get_exclude_wp_dirs($folder)))
268
- echo '<nobr><input class="checkbox" type="checkbox"'.checked(in_array($folder.'/'.$file.'/',$jobvalue['backupcontentexcludedirs']),true,false).' name="backupcontentexcludedirs[]" value="'.$folder.'/'.$file.'/"/> '.$file.'</nobr><br />';
269
- }
270
- @closedir( $dir );
271
- }
272
- ?>
273
- </div>
274
- </div>
275
- <div style="width:20%; float: left;">
276
- &nbsp;<b><input class="checkbox" type="checkbox"<?php checked($jobvalue['backupplugins'],true,true);?> name="backupplugins" value="1"/> <?php _e('Plugins','backwpup');?></b><br />
277
- <div style="border-color:#CEE1EF; border-style:solid; border-width:2px; height:10em; width:90%; margin:2px; overflow:auto;">
278
- <?PHP
279
- echo '<i>'.__('Exclude:','backwpup').'</i><br />';
280
- $folder=untrailingslashit(str_replace('\\','/',WP_PLUGIN_DIR));
281
- if ( $dir = @opendir( $folder ) ) {
282
- while (($file = readdir( $dir ) ) !== false ) {
283
- if ( !in_array($file, array('.', '..','.svn')) and is_dir($folder.'/'.$file) and !in_array($folder.'/'.$file.'/',backwpup_get_exclude_wp_dirs($folder)))
284
- echo '<nobr><input class="checkbox" type="checkbox"'.checked(in_array($folder.'/'.$file.'/',$jobvalue['backuppluginsexcludedirs']),true,false).' name="backuppluginsexcludedirs[]" value="'.$folder.'/'.$file.'/"/> '.$file.'</nobr><br />';
285
- }
286
- @closedir( $dir );
287
- }
288
- ?>
289
- </div>
290
- </div>
291
- <div style="width:20%; float: left;">
292
- &nbsp;<b><input class="checkbox" type="checkbox"<?php checked($jobvalue['backupthemes'],true,true);?> name="backupthemes" value="1"/> <?php _e('Themes','backwpup');?></b><br />
293
- <div style="border-color:#CEE1EF; border-style:solid; border-width:2px; height:10em; width:90%; margin:2px; overflow:auto;">
294
- <?PHP
295
- echo '<i>'.__('Exclude:','backwpup').'</i><br />';
296
- $folder=untrailingslashit(str_replace('\\','/',trailingslashit(WP_CONTENT_DIR).'themes'));
297
- if ( $dir = @opendir( $folder ) ) {
298
- while (($file = readdir( $dir ) ) !== false ) {
299
- if ( !in_array($file, array('.', '..','.svn')) and is_dir($folder.'/'.$file) and !in_array($folder.'/'.$file.'/',backwpup_get_exclude_wp_dirs($folder)))
300
- echo '<nobr><input class="checkbox" type="checkbox"'.checked(in_array($folder.'/'.$file.'/',$jobvalue['backupthemesexcludedirs']),true,false).' name="backupthemesexcludedirs[]" value="'.$folder.'/'.$file.'/"/> '.$file.'</nobr><br />';
301
- }
302
- @closedir( $dir );
303
- }
304
- ?>
305
- </div>
306
- </div>
307
- <div style="width:20%; float: left;">
308
- &nbsp;<b><input class="checkbox" type="checkbox"<?php checked($jobvalue['backupuploads'],true,true);?> name="backupuploads" value="1"/> <?php _e('Blog Uploads','backwpup');?></b><br />
309
- <div style="border-color:#CEE1EF; border-style:solid; border-width:2px; height:10em; width:90%; margin:2px; overflow:auto;">
310
- <?PHP
311
- echo '<i>'.__('Exclude:','backwpup').'</i><br />';
312
- $folder=untrailingslashit(backwpup_get_upload_dir());
313
- if ( $dir = @opendir( $folder ) ) {
314
- while (($file = readdir( $dir ) ) !== false ) {
315
- if ( !in_array($file, array('.', '..','.svn')) and is_dir($folder.'/'.$file) and !in_array($folder.'/'.$file,backwpup_get_exclude_wp_dirs($folder)))
316
- echo '<nobr><input class="checkbox" type="checkbox"'.checked(in_array($folder.'/'.$file.'/',$jobvalue['backupuploadsexcludedirs']),true,false).' name="backupuploadsexcludedirs[]" value="'.$folder.'/'.$file.'/"/> '.$file.'</nobr><br />';
317
- }
318
- @closedir( $dir );
319
- }
320
- ?>
321
- </div>
322
- </div>
323
- </div>
324
- <br />&nbsp;<br />
325
- <b><?PHP _e('Include Folders to Backup:','backwpup'); ?></b><br />
326
- <?PHP _e('Example:','backwpup'); ?> <?PHP echo str_replace('\\','/',ABSPATH); ?>,...<br />
327
- <input name="dirinclude" id="dirinclude" type="text" value="<?PHP echo $jobvalue['dirinclude'];?>" class="large-text" /><br />
328
- <br />
329
- <b><?PHP _e('Exclude Files/Folders from Backup:','backwpup'); ?></b><br />
330
- <?PHP _e('Example:','backwpup'); ?> /logs/,.log,.tmp,/temp/,....<br />
331
- <input name="fileexclude" id="fileexclude" type="text" value="<?PHP echo $jobvalue['fileexclude'];?>" class="large-text" /><br />
332
- </div>
333
- </div>
334
-
335
- <div id="todir" class="postbox" <?PHP if (!in_array("FILE",$todo) and !in_array("DB",$todo) and !in_array("WPEXP",$todo)) echo 'style="display:none;"';?>>
336
- <h3 class="hndle"><span><?PHP _e('Backup to Directory','backwpup'); ?></span></h3>
337
- <div class="inside">
338
- <b><?PHP _e('Full Path to Folder for Backup Files:','backwpup'); ?></b><br />
339
- <input name="backupdir" id="backupdir" type="text" value="<?PHP echo $jobvalue['backupdir'];?>" class="large-text" /><br />
340
- <span class="description"><?PHP _e('(Leave it empty to store Backups not local!)','backwpup');?></span><br />
341
- <?PHP _e('Max. Backup Files in Folder:','backwpup'); ?> <input name="maxbackups" id="maxbackups" type="text" size="3" value="<?PHP echo $jobvalue['maxbackups'];?>" class="small-text" /><span class="description"><?PHP _e('(Oldest files will deleted first.)','backwpup');?></span>
342
- </div>
343
- </div>
344
-
345
- <?PHP if (in_array('FTP',$dests)) { ?>
346
- <div id="toftp" class="postbox" <?PHP if (!in_array("FILE",$todo) and !in_array("DB",$todo) and !in_array("WPEXP",$todo)) echo 'style="display:none;"';?>>
347
- <h3 class="hndle"><span><?PHP _e('Backup to FTP Server','backwpup'); ?></span></h3>
348
- <div class="inside">
349
- <b><?PHP _e('Hostname:','backwpup'); ?></b><br />
350
- <input name="ftphost" type="text" value="<?PHP echo $jobvalue['ftphost'];?>" class="large-text" /><br />
351
- <b><?PHP _e('Username:','backwpup'); ?></b><br />
352
- <input name="ftpuser" type="text" value="<?PHP echo $jobvalue['ftpuser'];?>" class="user large-text" /><br />
353
- <b><?PHP _e('Password:','backwpup'); ?></b><br />
354
- <input name="ftppass" type="password" value="<?PHP echo base64_decode($jobvalue['ftppass']);?>" class="password large-text" /><br />
355
- <b><?PHP _e('Directory on Server:','backwpup'); ?></b><br />
356
- <input name="ftpdir" type="text" value="<?PHP echo $jobvalue['ftpdir'];?>" class="large-text" /><br />
357
- <?PHP if (!is_numeric($jobvalue['ftpmaxbackups'])) $jobvalue['ftpmaxbackups']=0; ?>
358
- <?PHP _e('Max. Backup Files in FTP Folder:','backwpup'); ?> <input name="ftpmaxbackups" type="text" size="3" value="<?PHP echo $jobvalue['ftpmaxbackups'];?>" class="small-text" /><span class="description"><?PHP _e('(Oldest files will be deleted first.)','backwpup');?></span><br />
359
- <input class="checkbox" value="1" type="checkbox" <?php checked($jobvalue['ftpssl'],true); ?> name="ftpssl" /> <?PHP _e('Use SSL-FTP Connection.','backwpup'); ?><br />
360
- <input class="checkbox" value="1" type="checkbox" <?php checked($jobvalue['ftppasv'],true); ?> name="ftppasv" /> <?PHP _e('Use FTP Passiv mode.','backwpup'); ?><br />
361
- </div>
362
- </div>
363
- <?PHP } ?>
364
-
365
- <?PHP if (in_array('S3',$dests) and function_exists('curl_exec')) { ?>
366
- <div id="toamazon" class="postbox" <?PHP if (!in_array("FILE",$todo) and !in_array("DB",$todo) and !in_array("WPEXP",$todo)) echo 'style="display:none;"';?>>
367
- <h3 class="hndle"><span><?PHP _e('Backup to Amazon S3','backwpup'); ?></span>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.amazon.de/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2Fgp%2Faws%2Fregistration%2Fregistration-form.html&site-redirect=de&tag=hueskennet-21&linkCode=ur2&camp=1638&creative=6742" target="_blank"><?PHP _e('Create Account','backwpup'); ?></a><img src="http://www.assoc-amazon.de/e/ir?t=hueskennet-21&l=ur2&o=3" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /></h3>
368
- <div class="inside">
369
- <b><?PHP _e('Access Key ID:','backwpup'); ?></b>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://aws-portal.amazon.com/gp/aws/developer/account/index.html?action=access-key" target="_blank"><?PHP _e('Find it','backwpup'); ?></a><br />
370
- <input id="awsAccessKey" name="awsAccessKey" type="text" value="<?PHP echo $jobvalue['awsAccessKey'];?>" class="large-text" /><br />
371
- <b><?PHP _e('Secret Access Key:','backwpup'); ?></b><br />
372
- <input id="awsSecretKey" name="awsSecretKey" type="password" value="<?PHP echo $jobvalue['awsSecretKey'];?>" class="large-text" /><br />
373
- <b><?PHP _e('Bucket:','backwpup'); ?></b><br />
374
- <input id="awsBucketselected" name="awsBucketselected" type="hidden" value="<?PHP echo $jobvalue['awsBucket'];?>" />
375
- <?PHP if (!empty($jobvalue['awsAccessKey']) and !empty($jobvalue['awsSecretKey'])) backwpup_get_aws_buckets(array('awsAccessKey'=>$jobvalue['awsAccessKey'],'awsSecretKey'=>$jobvalue['awsSecretKey'],'awsselected'=>$jobvalue['awsBucket'])); ?>
376
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?PHP _e('Create Bucket:','backwpup'); ?><input name="newawsBucket" type="text" value="" class="text" /> <select name="awsRegion" title="<?php _e('Bucket Region', 'backwpup'); ?>"><option value=""><?php _e('US-East (Northern Virginia)', 'backwpup'); ?></option><option value="us-west-1"><?php _e('US-West (Northern California)', 'backwpup'); ?></option><option value="EU"><?php _e('EU (Ireland)', 'backwpup'); ?></option><option value="ap-southeast-1"><?php _e('Asia Pacific (Singapore)', 'backwpup'); ?></option><option value="ap-northeast-1"><?php _e('Asia Pacific (Japan)', 'backwpup'); ?></option></select><br />
377
- <b><?PHP _e('Directory in Bucket:','backwpup'); ?></b><br />
378
- <input name="awsdir" type="text" value="<?PHP echo $jobvalue['awsdir'];?>" class="large-text" /><br />
379
- <?PHP _e('Max. Backup Files in Bucket Folder:','backwpup'); ?><input name="awsmaxbackups" type="text" size="3" value="<?PHP echo $jobvalue['awsmaxbackups'];?>" class="small-text" /><span class="description"><?PHP _e('(Oldest files will be deleted first.)','backwpup');?></span><br />
380
- <input class="checkbox" value="1" type="checkbox" <?php checked($jobvalue['awsrrs'],true); ?> name="awsrrs" /> <?PHP _e('Save Backups with reduced redundancy!','backwpup'); ?><br />
381
- </div>
382
- </div>
383
- <?PHP } ?>
384
-
385
- <?PHP if (in_array('MSAZURE',$dests) and function_exists('curl_exec')) { ?>
386
- <div id="tomsazure" class="postbox" <?PHP if (!in_array("FILE",$todo) and !in_array("DB",$todo) and !in_array("WPEXP",$todo)) echo 'style="display:none;"';?>>
387
- <h3 class="hndle"><span><?PHP _e('Backup to Micosoft Azure (Blob)','backwpup'); ?></span>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.microsoft.com/windowsazure/offers/" target="_blank"><?PHP _e('Create Account','backwpup'); ?></a></h3>
388
- <div class="inside">
389
- <b><?PHP _e('Host:','backwpup'); ?></b><br />
390
- <input id="msazureHost" name="msazureHost" type="text" value="<?PHP echo $jobvalue['msazureHost'];?>" class="large-text" /><span class="description"><?PHP _e('Normely: blob.core.windows.net','backwpup');?></span><br />
391
- <b><?PHP _e('Account Name:','backwpup'); ?></b><br />
392
- <input id="msazureAccName" name="msazureAccName" type="text" value="<?PHP echo $jobvalue['msazureAccName'];?>" class="large-text" /><br />
393
- <b><?PHP _e('Access Key:','backwpup'); ?></b>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://windows.azure.com/" target="_blank"><?PHP _e('Find it','backwpup'); ?></a><br />
394
- <input id="msazureKey" name="msazureKey" type="password" value="<?PHP echo $jobvalue['msazureKey'];?>" class="large-text" /><br />
395
- <b><?PHP _e('Container:','backwpup'); ?></b><br />
396
- <input id="msazureContainerselected" name="msazureContainerselected" type="hidden" value="<?PHP echo $jobvalue['msazureContainer'];?>" />
397
- <?PHP if (!empty($jobvalue['msazureAccName']) and !empty($jobvalue['msazureKey'])) backwpup_get_msazure_container(array('msazureHost'=>$jobvalue['msazureHost'],'msazureAccName'=>$jobvalue['msazureAccName'],'msazureKey'=>$jobvalue['msazureKey'],'msazureselected'=>$jobvalue['msazureContainer'])); ?>
398
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?PHP _e('Create Container:','backwpup'); ?><input name="newmsazureContainer" type="text" value="" class="text" /> <br />
399
- <b><?PHP _e('Directory in Container:','backwpup'); ?></b><br />
400
- <input name="msazuredir" type="text" value="<?PHP echo $jobvalue['msazuredir'];?>" class="large-text" /><br />
401
- <?PHP _e('Max. Backup Files in Container Folder:','backwpup'); ?><input name="msazuremaxbackups" type="text" size="3" value="<?PHP echo $jobvalue['msazuremaxbackups'];?>" class="small-text" /><span class="description"><?PHP _e('(Oldest files will be deleted first.)','backwpup');?></span><br />
402
- </div>
403
- </div>
404
- <?PHP } ?>
405
-
406
- <?PHP if (in_array('RSC',$dests) and function_exists('curl_exec')) { ?>
407
- <div id="torsc" class="postbox" <?PHP if (!in_array("FILE",$todo) and !in_array("DB",$todo) and !in_array("WPEXP",$todo)) echo 'style="display:none;"';?>>
408
- <h3 class="hndle"><span><?PHP _e('Backup to Rackspace Cloud','backwpup'); ?></span>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.rackspacecloud.com/2073.html" target="_blank"><?PHP _e('Create Account','backwpup'); ?></a></h3>
409
- <div class="inside">
410
- <b><?PHP _e('Username:','backwpup'); ?></b><br />
411
- <input id="rscUsername" name="rscUsername" type="text" value="<?PHP echo $jobvalue['rscUsername'];?>" class="large-text" /><br />
412
- <b><?PHP _e('API Key:','backwpup'); ?></b>&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://manage.rackspacecloud.com/APIAccess.do" target="_blank"><?PHP _e('Find it','backwpup'); ?></a><br />
413
- <input id="rscAPIKey" name="rscAPIKey" type="text" value="<?PHP echo $jobvalue['rscAPIKey'];?>" class="large-text" /><br />
414
- <b><?PHP _e('Container:','backwpup'); ?></b><br />
415
- <input id="rscContainerselected" name="rscContainerselected" type="hidden" value="<?PHP echo $jobvalue['rscContainer'];?>" />
416
- <?PHP if (!empty($jobvalue['rscUsername']) and !empty($jobvalue['rscAPIKey'])) backwpup_get_rsc_container(array('rscUsername'=>$jobvalue['rscUsername'],'rscAPIKey'=>$jobvalue['rscAPIKey'],'rscselected'=>$jobvalue['rscContainer'])); ?>
417
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?PHP _e('Create Container:','backwpup'); ?><input name="newrscContainer" type="text" value="" class="text" /> <br />
418
- <b><?PHP _e('Directory in Container:','backwpup'); ?></b><br />
419
- <input name="rscdir" type="text" value="<?PHP echo $jobvalue['rscdir'];?>" class="large-text" /><br />
420
- <?PHP _e('Max. Backup Files in Container Folder:','backwpup'); ?><input name="rscmaxbackups" type="text" size="3" value="<?PHP echo $jobvalue['rscmaxbackups'];?>" class="small-text" /><span class="description"><?PHP _e('(Oldest files will be deleted first.)','backwpup');?></span><br />
421
- </div>
422
- </div>
423
- <?PHP } ?>
424
-
425
- <?PHP if (in_array('DROPBOX',$dests) and function_exists('curl_exec') and function_exists('json_decode')) { ?>
426
- <div id="todropbox" class="postbox" <?PHP if (!in_array("FILE",$todo) and !in_array("DB",$todo) and !in_array("WPEXP",$todo)) echo 'style="display:none;"';?>>
427
- <h3 class="hndle"><span><?PHP _e('Backup to Dropbox','backwpup'); ?></span>&nbsp;&nbsp;&nbsp;&nbsp;<a name="dropbox" href="http://db.tt/MfxHKBd" target="_blank"><?PHP _e('Create Account','backwpup'); ?></a></h3>
428
- <div class="inside">
429
- <b><?PHP _e('Login:','backwpup'); ?></b>&nbsp;
430
- <?PHP if (empty($jobvalue['dropetoken']) and empty($jobvalue['dropesecret'])) { ?>
431
- <span style="color:red;"><?php _e('Not authenticated!', 'backwpup'); ?></span> <input type="submit" name="dropboxauth" class="button-primary" accesskey="d" value="<?php _e('Authenticate!', 'backwpup'); ?>" /><br />
432
- <?PHP } else { ?>
433
- <span style="color:green;"><?php _e('Authenticated!', 'backwpup'); ?></span> <input type="submit" name="dropboxauthdel" class="button-primary" accesskey="d" value="<?php _e('Delete!', 'backwpup'); ?>" /><br />
434
- <?PHP } ?><br />
435
- <b><?PHP _e('Directory:','backwpup'); ?></b><br />
436
- <input name="dropedir" type="text" value="<?PHP echo $jobvalue['dropedir'];?>" class="user large-text" /><br />
437
- <?PHP _e('Max. Backup Files in Dopbox Folder:','backwpup'); ?><input name="dropemaxbackups" type="text" size="3" value="<?PHP echo $jobvalue['dropemaxbackups'];?>" class="small-text" /><span class="description"><?PHP _e('(Oldest files will be deleted first.)','backwpup');?></span><br />
438
- </div>
439
- </div>
440
- <?PHP } ?>
441
-
442
- <?PHP if (in_array('SUGARSYNC',$dests) and function_exists('curl_exec')) { ?>
443
- <div id="tosugarsync" class="postbox" <?PHP if (!in_array("FILE",$todo) and !in_array("DB",$todo) and !in_array("WPEXP",$todo)) echo 'style="display:none;"';?>>
444
- <h3 class="hndle"><span><?PHP _e('Backup to SugarSync','backwpup'); ?></span>&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://www.sugarsync.com/referral?rf=cajw0b09tbw6k" target="_blank"><?PHP _e('Create Account','backwpup'); ?></a></h3>
445
- <div class="inside">
446
- <b><?PHP _e('E-mail address:','backwpup'); ?></b><br />
447
- <input id="sugaruser" name="sugaruser" type="text" value="<?PHP echo $jobvalue['sugaruser'];?>" class="large-text" /><br />
448
- <b><?PHP _e('Password:','backwpup'); ?></b><br />
449
- <input id="sugarpass" name="sugarpass" type="password" value="<?PHP echo base64_decode($jobvalue['sugarpass']);?>" class="large-text" /><br />
450
- <b><?PHP _e('Root:','backwpup'); ?></b><br />
451
- <input id="sugarrootselected" name="sugarrootselected" type="hidden" value="<?PHP echo $jobvalue['sugarroot'];?>" />
452
- <?PHP if (!empty($jobvalue['sugaruser']) and !empty($jobvalue['sugarpass'])) backwpup_get_sugarsync_root(array('sugaruser'=>$jobvalue['sugaruser'],'sugarpass'=>base64_decode($jobvalue['sugarpass']),'sugarrootselected'=>$jobvalue['sugarroot'])); ?><br />
453
- <b><?PHP _e('Directory:','backwpup'); ?></b><br />
454
- <input name="sugardir" type="text" value="<?PHP echo $jobvalue['sugardir'];?>" class="large-text" /><br />
455
- <?PHP _e('Max. Backup Files in Folder:','backwpup'); ?><input name="sugarmaxbackups" type="text" size="3" value="<?PHP echo $jobvalue['sugarmaxbackups'];?>" class="small-text" /><span class="description"><?PHP _e('(Oldest files will be deleted first.)','backwpup');?></span><br />
456
- </div>
457
- </div>
458
- <?PHP } ?>
459
-
460
- <div id="tomail" class="postbox" <?PHP if (!in_array("FILE",$todo) and !in_array("DB",$todo) and !in_array("WPEXP",$todo)) echo 'style="display:none;"';?>>
461
- <h3 class="hndle"><span><?PHP _e('Backup to E-Mail','backwpup'); ?></span></h3>
462
- <div class="inside">
463
- <b><?PHP _e('E-mail address:','backwpup'); ?></b><br />
464
- <input name="mailaddress" id="mailaddress" type="text" value="<?PHP echo $jobvalue['mailaddress'];?>" class="large-text" /><br />
465
- <?PHP if (!is_numeric($jobvalue['mailefilesize'])) $jobvalue['mailefilesize']=0; ?>
466
- <?PHP echo __('Max. File Size for sending Backups with mail:','backwpup').'<input name="mailefilesize" type="text" value="'.$jobvalue['mailefilesize'].'" class="small-text" />MB<br />';?>
467
- </div>
468
- </div>
469
- </div>
470
- </div>
471
- </div>
472
-
473
- </form>
474
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/options-runnow-iframe.php DELETED
@@ -1,40 +0,0 @@
1
- <?PHP
2
- if (file_exists(trim($_GET['wpabs']).'wp-load.php') and is_numeric(trim($_GET['jobid']))) {
3
- @ini_set('zlib.output_compression', 0);
4
- define('DONOTCACHEPAGE', true);
5
- define('DONOTCACHEDB', true);
6
- define('DONOTMINIFY', true);
7
- define('DONOTCDN', true);
8
- define('DONOTCACHCEOBJECT', true);
9
- define("QUICK_CACHE_ALLOWED", false);
10
- $_SERVER["QUICK_CACHE_ALLOWED"] = false;
11
- require_once(trim($_GET['wpabs']).'wp-load.php'); /** Setup WordPress environment */
12
- if (function_exists('w3tc_pgcache_flush'))
13
- w3tc_pgcache_flush();
14
- check_admin_referer('dojob-now_' . (int)$_GET['jobid']);
15
- backwpup_send_no_cache_header();
16
- // flush any buffers and send the headers
17
- @flush();
18
- @ob_flush();
19
- ?>
20
- <html>
21
- <head>
22
- <?PHP backwpup_meta_no_cache(); ?>
23
- <title><?PHP _e('Do Job','backwpup'); ?></title>
24
- </head>
25
- <body style="font-family:monospace;font-size:12px;white-space:nowrap;">
26
- <!--mfunc -->
27
- <?PHP
28
- @flush();
29
- @ob_flush();
30
- backwpup_dojob($_GET['jobid']);
31
- ?>
32
- <!--/mfunc-->
33
- </body>
34
- </html>
35
- <?PHP
36
- } else {
37
- header("HTTP/1.0 404 Not Found");
38
- die();
39
- }
40
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/options-save.php DELETED
@@ -1,657 +0,0 @@
1
- <?PHP
2
- // don't load directly
3
- if ( !defined('ABSPATH') )
4
- die('-1');
5
-
6
- function backwpup_job_operations($action) {
7
- switch($action) {
8
- case 'delete': //Delete Job
9
- $jobs=get_option('backwpup_jobs');
10
- if (is_array($_REQUEST['jobs'])) {
11
- check_admin_referer('bulk-jobs');
12
- foreach ($_REQUEST['jobs'] as $jobid) {
13
- unset($jobs[$jobid]);
14
- }
15
- }
16
- update_option('backwpup_jobs',$jobs);
17
- break;
18
- case 'copy': //Copy Job
19
- $jobid = (int) $_GET['jobid'];
20
- check_admin_referer('copy-job_'.$jobid);
21
- $jobs=get_option('backwpup_jobs');
22
- //generate new ID
23
- foreach ($jobs as $jobkey => $jobvalue) {
24
- if ($jobkey>$heighestid) $heighestid=$jobkey;
25
- }
26
- $newjobid=$heighestid+1;
27
- $jobs[$newjobid]=$jobs[$jobid];
28
- $jobs[$newjobid]['name']=__('Copy of','backwpup').' '.$jobs[$newjobid]['name'];
29
- $jobs[$newjobid]['activated']=false;
30
- update_option('backwpup_jobs',$jobs);
31
- break;
32
- case 'export': //Copy Job
33
- $jobs=get_option('backwpup_jobs');
34
- if (is_array($_REQUEST['jobs'])) {
35
- check_admin_referer('bulk-jobs');
36
- foreach ($_REQUEST['jobs'] as $jobid) {
37
- $jobsexport[$jobid]=$jobs[$jobid];
38
- }
39
- }
40
- $export=serialize($jobsexport);
41
- header("Pragma: public");
42
- header("Expires: 0");
43
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
44
- header("Content-Type: text/plain");
45
- header("Content-Type: application/force-download");
46
- header("Content-Type: application/octet-stream");
47
- header("Content-Type: application/download");
48
- header("Content-Disposition: attachment; filename=".sanitize_key(get_bloginfo('name'))."_BackWPupExport.txt;");
49
- header("Content-Transfer-Encoding: 8bit");
50
- header("Content-Length: ".strlen($export));
51
- echo $export;
52
- die();
53
- break;
54
- case 'clear': //Abort Job
55
- $jobid = (int) $_GET['jobid'];
56
- check_admin_referer('clear-job_'.$jobid);
57
- $jobs=get_option('backwpup_jobs');
58
- $cfg=get_option('backwpup'); //Load Settings
59
-
60
- if (is_file($jobs[$jobid]['logfile']) and substr($jobs[$jobid]['logfile'],-3)!='.gz') {
61
- $logheader=backwpup_read_logheader($jobs[$jobid]['logfile']); //read waring count from log header
62
- $fd=fopen($jobs[$jobid]['logfile'],"a+");
63
- fwrite($fd,"<span style=\"background-color:c3c3c3;\" title=\"[Line: ".__LINE__."|File: ".basename(__FILE__)."\">".date_i18n('Y-m-d H:i.s').":</span> <span style=\"background-color:red;\">".__('[ERROR]','backwpup')." ".__('Backup Cleand by User!!!','backwpup')."</span><br />\n");
64
- fwrite($fd,"</body>\n</html>\n");
65
- fclose($fd);
66
- $logheader['errors']=$logheader['errors']+1;
67
- //write new log header
68
- $fd=fopen($jobs[$jobid]['logfile'],"r+");
69
- while (!feof($fd)) {
70
- $line=fgets($fd);
71
- if (stripos($line,"<meta name=\"backwpup_errors\"") !== false) {
72
- fseek($fd,$filepos);
73
- fwrite($fd,str_pad("<meta name=\"backwpup_errors\" content=\"".$logheader['errors']."\" />",100)."\n");
74
- break;
75
- }
76
- $filepos=ftell($fd);
77
- }
78
- fclose($fd);
79
- }
80
- if ($cfg['gzlogs'] and function_exists('gzopen') and file_exists($jobs[$jobid]['logfile']) and substr($jobs[$jobid]['logfile'],-3)!='.gz') {
81
- $fd=fopen($jobs[$jobid]['logfile'],'r');
82
- $zd=gzopen($jobs[$jobid]['logfile'].'.gz','w9');
83
- while (!feof($fd)) {
84
- gzwrite($zd,fread($fd,4096));
85
- }
86
- gzclose($zd);
87
- fclose($fd);
88
- unlink($jobs[$jobid]['logfile']);
89
- $jobs[$jobid]['logfile']=$jobs[$jobid]['logfile'].'.gz';
90
- }
91
- $jobs[$jobid]['cronnextrun']=backwpup_cron_next($jobs[$jobid]['cron']);
92
- $jobs[$jobid]['stoptime']=current_time('timestamp');
93
- if (!empty($jobs[$jobid]['starttime'])) {
94
- $jobs[$jobid]['lastrun']=$jobs[$jobid]['starttime'];
95
- $jobs[$jobid]['lastruntime']=$jobs[$jobid]['stoptime']-$jobs[$jobid]['starttime'];
96
- $jobs[$jobid]['starttime']='';
97
- }
98
- if (!empty($jobs[$jobid]['logfile'])) {
99
- $jobs[$jobid]['lastlogfile']=$jobs[$jobid]['logfile'];
100
- $jobs[$jobid]['logfile']='';
101
- }
102
- update_option('backwpup_jobs',$jobs);
103
- break;
104
- }
105
- }
106
-
107
- function backwpup_log_operations($action) {
108
- switch($action) {
109
- case 'delete': //Delete Log
110
- $cfg=get_option('backwpup'); //Load Settings
111
- if (is_array($_REQUEST['logfiles'])) {
112
- check_admin_referer('bulk-logs');
113
- $num=0;
114
- foreach ($_REQUEST['logfiles'] as $logfile) {
115
- if (is_file($cfg['dirlogs'].'/'.$logfile))
116
- unlink($cfg['dirlogs'].'/'.$logfile);
117
- $num++;
118
- }
119
- }
120
- break;
121
- case 'download': //Download Backup
122
- check_admin_referer('download-backup_'.basename($_GET['file']));
123
- if (is_file($_GET['file'])) {
124
- header("Pragma: public");
125
- header("Expires: 0");
126
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
127
- header("Content-Type: application/force-download");
128
- header("Content-Type: application/octet-stream");
129
- header("Content-Type: application/download");
130
- header("Content-Disposition: attachment; filename=".basename($_GET['file']).";");
131
- header("Content-Transfer-Encoding: binary");
132
- header("Content-Length: ".filesize($_GET['file']));
133
- @readfile($_GET['file']);
134
- die();
135
- } else {
136
- header('HTTP/1.0 404 Not Found');
137
- die(__('File does not exist.', 'backwpup'));
138
- }
139
- break;
140
- }
141
- }
142
-
143
- function backwpup_backups_operations($action) {
144
- switch($action) {
145
- case 'delete': //Delete Backup archives
146
- $deletebackups=array();
147
- if (is_array($_REQUEST['backupfiles'])) {
148
- check_admin_referer('bulk-backups');
149
- $i=0;
150
- foreach ($_REQUEST['backupfiles'] as $backupfile) {
151
- list($deletebackups[$i]['file'],$deletebackups[$i]['jobid'],$deletebackups[$i]['type'])=explode('|',$backupfile,3);
152
- $i++;
153
- }
154
- }
155
-
156
- if(empty($deletebackups)) {
157
- $_REQUEST['action']='backups';
158
- break;
159
- }
160
-
161
- $jobs=get_option('backwpup_jobs'); //Load jobs
162
- $dests=explode(',',strtoupper(BACKWPUP_DESTS));
163
- if (extension_loaded('curl') or @dl(PHP_SHLIB_SUFFIX == 'so' ? 'curl.so' : 'php_curl.dll')) {
164
- set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__).'/libs');
165
- if (!class_exists('Microsoft_WindowsAzure_Storage_Blob') and in_array('MSAZURE',$dests))
166
- require_once 'Microsoft/WindowsAzure/Storage/Blob.php';
167
- if (!class_exists('CFRuntime') and in_array('S3',$dests))
168
- require_once(dirname(__FILE__).'/libs/aws/sdk.class.php');
169
- if (!class_exists('CF_Authentication') and in_array('RSC',$dests))
170
- require_once(plugin_dir_path(__FILE__).'libs/rackspace/cloudfiles.php');
171
- if (!class_exists('Dropbox') and in_array('DROPBOX',$dests))
172
- require_once(dirname(__FILE__).'/libs/dropbox/dropbox.php');
173
- if (!class_exists('SugarSync') and in_array('SUGARSYNC',$dests))
174
- require_once (dirname(__FILE__).'/libs/sugarsync.php');
175
- }
176
-
177
- foreach ($deletebackups as $backups) {
178
- $jobvalue=backwpup_check_job_vars($jobs[$backups['jobid']],$backups['jobid']); //Check job values
179
- if ($backups['type']=='FOLDER') {
180
- if (is_file($backups['file']))
181
- unlink($backups['file']);
182
- } elseif ($backups['type']=='S3' and in_array('S3',$dests)) {
183
- if (class_exists('AmazonS3')) {
184
- if (!empty($jobvalue['awsAccessKey']) and !empty($jobvalue['awsSecretKey']) and !empty($jobvalue['awsBucket'])) {
185
- $s3 = new AmazonS3($jobvalue['awsAccessKey'], $jobvalue['awsSecretKey']);
186
- $s3->delete_object($jobvalue['awsBucket'],$backups['file']);
187
- unset($s3);
188
- }
189
- }
190
- } elseif ($backups['type']=='MSAZURE' and in_array('MSAZURE',$dests)) {
191
- if (class_exists('Microsoft_WindowsAzure_Storage_Blob')) {
192
- if (!empty($jobvalue['msazureHost']) and !empty($jobvalue['msazureAccName']) and !empty($jobvalue['msazureKey']) and !empty($jobvalue['msazureContainer'])) {
193
- $storageClient = new Microsoft_WindowsAzure_Storage_Blob($jobvalue['msazureHost'],$jobvalue['msazureAccName'],$jobvalue['msazureKey']);
194
- $storageClient->deleteBlob($jobvalue['msazureContainer'],$backups['file']);
195
- unset($storageClient);
196
- }
197
- }
198
- } elseif ($backups['type']=='DROPBOX' and in_array('DROPBOX',$dests)) {
199
- if (class_exists('Dropbox')) {
200
- if (!empty($jobvalue['dropetoken']) and !empty($jobvalue['dropesecret'])) {
201
- $dropbox = new Dropbox(BACKWPUP_DROPBOX_APP_KEY, BACKWPUP_DROPBOX_APP_SECRET);
202
- $dropbox->setOAuthTokens($jobvalue['dropetoken'],$jobvalue['dropesecret']);
203
- $dropbox->fileopsDelete($backups['file']);
204
- unset($dropbox);
205
- }
206
- }
207
- } elseif ($backups['type']=='SUGARSYNC' and in_array('SUGARSYNC',$dests)) {
208
- if (class_exists('SugarSync')) {
209
- if (!empty($jobvalue['sugaruser']) and !empty($jobvalue['sugarpass'])) {
210
- $sugarsync = new SugarSync($jobvalue['sugaruser'],base64_decode($jobvalue['sugarpass']),BACKWPUP_SUGARSYNC_ACCESSKEY, BACKWPUP_SUGARSYNC_PRIVATEACCESSKEY);
211
- $sugarsync->delete(urldecode($backups['file']));
212
- unset($sugarsync);
213
- }
214
- }
215
- } elseif ($backups['type']=='RSC' and in_array('RSC',$dests)) {
216
- if (class_exists('CF_Authentication')) {
217
- if (!empty($jobvalue['rscUsername']) and !empty($jobvalue['rscAPIKey']) and !empty($jobvalue['rscContainer'])) {
218
- $auth = new CF_Authentication($jobvalue['rscUsername'], $jobvalue['rscAPIKey']);
219
- $auth->ssl_use_cabundle();
220
- if ($auth->authenticate()) {
221
- $conn = new CF_Connection($auth);
222
- $conn->ssl_use_cabundle();
223
- $backwpupcontainer = $conn->get_container($jobvalue['rscContainer']);
224
- $backwpupcontainer->delete_object($backups['file']);
225
- }
226
- unset($auth);
227
- unset($conn);
228
- unset($backwpupcontainer);
229
- }
230
- }
231
- } elseif ($backups['type']=='FTP') {
232
- if (!empty($jobvalue['ftphost']) and !empty($jobvalue['ftpuser']) and !empty($jobvalue['ftppass'])) {
233
- $ftpport=21;
234
- $ftphost=$jobvalue['ftphost'];
235
- if (false !== strpos($jobvalue['ftphost'],':')) //look for port
236
- list($ftphost,$ftpport)=explode(':',$jobvalue,2);
237
-
238
- if (function_exists('ftp_ssl_connect') and $jobvalue['ftpssl']) { //make SSL FTP connection
239
- $ftp_conn_id = ftp_ssl_connect($ftphost,$ftpport,10);
240
- } elseif (!$jobvalue['ftpssl']) { //make normal FTP conection if SSL not work
241
- $ftp_conn_id = ftp_connect($ftphost,$ftpport,10);
242
- }
243
- $loginok=false;
244
- if ($ftp_conn_id) {
245
- //FTP Login
246
- if (@ftp_login($ftp_conn_id, $jobvalue['ftpuser'], base64_decode($jobvalue['ftppass']))) {
247
- $loginok=true;
248
- } else { //if PHP ftp login don't work use raw login
249
- ftp_raw($ftp_conn_id,'USER '.$jobvalue['ftpuser']);
250
- $return=ftp_raw($ftp_conn_id,'PASS '.base64_decode($jobvalue['ftppass']));
251
- if (substr(trim($return[0]),0,3)<=400)
252
- $loginok=true;
253
- }
254
- }
255
- if ($loginok) {
256
- ftp_pasv($ftp_conn_id, true);
257
- ftp_delete($ftp_conn_id, $backups['file']);
258
- }
259
- }
260
- }
261
- }
262
- update_option('backwpup_backups_chache',backwpup_get_backup_files());
263
- break;
264
- case 'download': //Download Backup
265
- check_admin_referer('download-backup');
266
- if (is_file($_GET['file'])) {
267
- header("Pragma: public");
268
- header("Expires: 0");
269
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
270
- header("Content-Type: application/force-download");
271
- header("Content-Type: application/octet-stream");
272
- header("Content-Type: application/download");
273
- header("Content-Disposition: attachment; filename=".basename($_GET['file']).";");
274
- header("Content-Transfer-Encoding: binary");
275
- header("Content-Length: ".filesize($_GET['file']));
276
- @readfile($_GET['file']);
277
- die();
278
- } else {
279
- header('HTTP/1.0 404 Not Found');
280
- die(__('File does not exist.', 'backwpup'));
281
- }
282
- break;
283
- case 'downloads3': //Download S3 Backup
284
- check_admin_referer('download-backup');
285
- require_once(dirname(__FILE__).'/libs/aws/sdk.class.php');
286
- $jobs=get_option('backwpup_jobs');
287
- $jobid=$_GET['jobid'];
288
- try {
289
- $s3 = new AmazonS3($jobs[$jobid]['awsAccessKey'], $jobs[$jobid]['awsSecretKey']);
290
- $s3file=$s3->get_object($jobs[$jobid]['awsBucket'], $_GET['file']);
291
- } catch (Exception $e) {
292
- die($e->getMessage());
293
- }
294
- if ($s3file->status==200) {
295
- header("Pragma: public");
296
- header("Expires: 0");
297
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
298
- header("Content-Type: ".$s3file->header->_info->content_type);
299
- header("Content-Type: application/force-download");
300
- header("Content-Type: application/octet-stream");
301
- header("Content-Type: application/download");
302
- header("Content-Disposition: attachment; filename=".basename($_GET['file']).";");
303
- header("Content-Transfer-Encoding: binary");
304
- header("Content-Length: ".$s3file->header->_info->size_download);
305
- echo $s3file->body;
306
- die();
307
- } else {
308
- header('HTTP/1.0 '.$s3file->status.' Not Found');
309
- die();
310
- }
311
- break;
312
- case 'downloaddropbox': //Download Dropbox Backup
313
- check_admin_referer('download-backup');
314
- require_once(dirname(__FILE__).'/libs/dropbox/dropbox.php');
315
- $jobs=get_option('backwpup_jobs');
316
- $jobid=$_GET['jobid'];
317
- try {
318
- $dropbox = new Dropbox(BACKWPUP_DROPBOX_APP_KEY, BACKWPUP_DROPBOX_APP_SECRET);
319
- $dropbox->setOAuthTokens($jobs[$jobid]['dropetoken'],$jobs[$jobid]['dropesecret']);
320
- header("Pragma: public");
321
- header("Expires: 0");
322
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
323
- //header("Content-Type: ".$dropfile['content_type']);
324
- header("Content-Type: application/force-download");
325
- header("Content-Type: application/octet-stream");
326
- header("Content-Type: application/download");
327
- header("Content-Disposition: attachment; filename=".basename($_GET['file']).";");
328
- header("Content-Transfer-Encoding: binary");
329
- //header("Content-Length: ".$dropfile['bytes']);
330
- echo $dropbox->download($_GET['file']);
331
- die();
332
- } catch (Exception $e) {
333
- die($e->getMessage());
334
- }
335
- break;
336
- case 'downloadsugarsync': //Download Dropbox Backup
337
- check_admin_referer('download-backup');
338
- require_once(dirname(__FILE__).'/libs/sugarsync.php');
339
- $jobs=get_option('backwpup_jobs');
340
- $jobid=$_GET['jobid'];
341
- try {
342
- $sugarsync = new SugarSync($jobs[$jobid]['sugaruser'],base64_decode($jobs[$jobid]['sugarpass']),BACKWPUP_SUGARSYNC_ACCESSKEY, BACKWPUP_SUGARSYNC_PRIVATEACCESSKEY);
343
- $response=$sugarsync->get(urldecode($_GET['file']));
344
- header("Pragma: public");
345
- header("Expires: 0");
346
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
347
- header("Content-Type: ".(string)$response->mediaType);
348
- header("Content-Type: application/force-download");
349
- header("Content-Type: application/octet-stream");
350
- header("Content-Type: application/download");
351
- header("Content-Disposition: attachment; filename=".(string)$response->displayName.";");
352
- header("Content-Transfer-Encoding: binary");
353
- header("Content-Length: ".(int)$response->size);
354
- echo $sugarsync->download(urldecode($_GET['file']));
355
- die();
356
- } catch (Exception $e) {
357
- die($e->getMessage());
358
- }
359
- break;
360
- case 'downloadmsazure': //Download Microsoft Azure Backup
361
- check_admin_referer('download-backup');
362
- set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__).'/libs');
363
- if (!class_exists('Microsoft_WindowsAzure_Storage_Blob'))
364
- require_once 'Microsoft/WindowsAzure/Storage/Blob.php';
365
- $jobs=get_option('backwpup_jobs');
366
- $jobid=$_GET['jobid'];
367
- try {
368
- $storageClient = new Microsoft_WindowsAzure_Storage_Blob($jobs[$jobid]['msazureHost'],$jobs[$jobid]['msazureAccName'],$jobs[$jobid]['msazureKey']);
369
- header("Pragma: public");
370
- header("Expires: 0");
371
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
372
- //header("Content-Type: ".$s3file->header->_info->content_type);
373
- header("Content-Type: application/force-download");
374
- header("Content-Type: application/octet-stream");
375
- header("Content-Type: application/download");
376
- header("Content-Disposition: attachment; filename=".basename($_GET['file']).";");
377
- header("Content-Transfer-Encoding: binary");
378
- //header("Content-Length: ".$s3file->header->_info->size_download);
379
- echo $storageClient->getBlobData($jobs[$jobid]['msazureContainer'], $_GET['file']);
380
- die();
381
- } catch (Exception $e) {
382
- die($e->getMessage());
383
- }
384
- break;
385
- case 'downloadrsc': //Download RSC Backup
386
- check_admin_referer('download-backup');
387
- require_once(plugin_dir_path(__FILE__).'libs/rackspace/cloudfiles.php');
388
- $jobs=get_option('backwpup_jobs');
389
- $jobid=$_GET['jobid'];
390
- try {
391
- $auth = new CF_Authentication($jobs[$jobid]['rscUsername'], $jobs[$jobid]['rscAPIKey']);
392
- $auth->ssl_use_cabundle();
393
- if ($auth->authenticate()) {
394
- $conn = new CF_Connection($auth);
395
- $conn->ssl_use_cabundle();
396
- $backwpupcontainer = $conn->get_container($jobs[$jobid]['rscContainer']);
397
- $backupfile=$backwpupcontainer->get_object($_GET['file']);
398
- header("Pragma: public");
399
- header("Expires: 0");
400
- header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
401
- header("Content-Type: ".$backupfile->content_type);
402
- header("Content-Type: application/force-download");
403
- header("Content-Type: application/octet-stream");
404
- header("Content-Type: application/download");
405
- header("Content-Disposition: attachment; filename=".basename($_GET['file']).";");
406
- header("Content-Transfer-Encoding: binary");
407
- header("Content-Length: ".$backupfile->content_length);
408
- $output = fopen("php://output", "w");
409
- $backupfile->stream($output);
410
- fclose($output);
411
- die();
412
- } else {
413
- header('HTTP/1.0 404 Not Found');
414
- die();
415
- }
416
- } catch (Exception $e) {
417
- die($e->getMessage());
418
- }
419
- break;
420
- }
421
- }
422
-
423
- function backwpup_save_settings() {
424
- check_admin_referer('backwpup-cfg');
425
- $cfg=get_option('backwpup'); //Load Settings
426
- $cfg['mailsndemail']=sanitize_email($_POST['mailsndemail']);
427
- $cfg['mailsndname']=$_POST['mailsndname'];
428
- $cfg['mailmethod']=$_POST['mailmethod'];
429
- $cfg['mailsendmail']=untrailingslashit(str_replace('//','/',str_replace('\\','/',stripslashes($_POST['mailsendmail']))));
430
- $cfg['mailsecure']=$_POST['mailsecure'];
431
- $cfg['mailhost']=$_POST['mailhost'];
432
- $cfg['mailuser']=$_POST['mailuser'];
433
- $cfg['mailpass']=base64_encode($_POST['mailpass']);
434
- $cfg['memorylimit']=$_POST['memorylimit'];
435
- $cfg['disablewpcron']=$_POST['disablewpcron']==1 ? true : false;
436
- $cfg['logfilelist']=$_POST['logfilelist']==1 ? true : false;
437
- $cfg['maxlogs']=abs((int)$_POST['maxlogs']);
438
- $cfg['gzlogs']=$_POST['gzlogs']==1 ? true : false;
439
- $cfg['dirlogs']=trailingslashit(str_replace('//','/',str_replace('\\','/',stripslashes(trim($_POST['dirlogs'])))));
440
- $cfg['dirtemp']=trailingslashit(str_replace('//','/',str_replace('\\','/',stripslashes(trim($_POST['dirtemp'])))));
441
- //set def. folders
442
- if (empty($cfg['dirtemp']) or $cfg['dirtemp']=='/')
443
- $cfg['dirtemp']=str_replace('\\','/',trailingslashit(backwpup_get_upload_dir()));
444
- if (empty($cfg['dirlogs']) or $cfg['dirlogs']=='/') {
445
- $rand = substr( md5( md5( SECURE_AUTH_KEY ) ), -5 );
446
- $cfg['dirlogs']=str_replace('\\','/',trailingslashit(WP_CONTENT_DIR)).'backwpup-'.$rand.'-logs/';
447
- }
448
-
449
- if (update_option('backwpup',$cfg))
450
- $backwpup_message=__('Settings saved', 'backwpup');
451
- return $backwpup_message;
452
- }
453
-
454
-
455
- function backwpup_save_dropboxauth() { //Save Job settings
456
- $jobid = (int) $_GET['jobid'];
457
- check_admin_referer('edit-job');
458
- if ((int)$_GET['uid']>0 and !empty($_GET['oauth_token'])) {
459
- $reqtoken=get_option('backwpup_dropboxrequest');
460
- if ($reqtoken['oAuthRequestToken']==$_GET['oauth_token']) {
461
- //Get Access Tokens
462
- if (!class_exists('Dropbox'))
463
- require_once (dirname(__FILE__).'/libs/dropbox/dropbox.php');
464
- $dropbox = new Dropbox(BACKWPUP_DROPBOX_APP_KEY, BACKWPUP_DROPBOX_APP_SECRET);
465
- $oAuthStuff = $dropbox->oAuthAccessToken($reqtoken['oAuthRequestToken'],$reqtoken['oAuthRequestTokenSecret']);
466
- //Save Tokens
467
- $jobs=get_option('backwpup_jobs');
468
- $jobs[$jobid]['dropetoken']=$oAuthStuff['oauth_token'];
469
- $jobs[$jobid]['dropesecret']=$oAuthStuff['oauth_token_secret'];
470
- update_option('backwpup_jobs',$jobs);
471
- $backwpup_message.=__('Dropbox authentication complete!','backwpup').'<br />';
472
- } else {
473
- $backwpup_message.=__('Wrong Token for Dropbox authentication reseved!','backwpup').'<br />';
474
- }
475
- } else {
476
- $backwpup_message.=__('No Dropbox authentication reseved!','backwpup').'<br />';
477
- }
478
- delete_option('backwpup_dropboxrequest');
479
- $_POST['jobid']=$jobid;
480
- return $backwpup_message;
481
- }
482
-
483
-
484
- function backwpup_save_job() { //Save Job settings
485
- $jobid = (int) $_POST['jobid'];
486
- check_admin_referer('edit-job');
487
- $jobs=get_option('backwpup_jobs'); //Load Settings
488
-
489
- if ($jobs[$jobid]['type']!=$_POST['type']) // set type to save
490
- $savetype=explode('+',$jobs[$jobid]['type']);
491
- else
492
- $savetype=$_POST['type'];
493
-
494
- $jobs[$jobid]['type']= implode('+',(array)$_POST['type']);
495
- $jobs[$jobid]['name']= esc_html($_POST['name']);
496
- $jobs[$jobid]['activated']= $_POST['activated']==1 ? true : false;
497
- if ($_POST['cronminutes'][0]=='*' or empty($_POST['cronminutes'])) {
498
- if (!empty($_POST['cronminutes'][1]))
499
- $_POST['cronminutes']=array('*/'.$_POST['cronminutes'][1]);
500
- else
501
- $_POST['cronminutes']=array('*');
502
- }
503
- if ($_POST['cronhours'][0]=='*' or empty($_POST['cronhours'])) {
504
- if (!empty($_POST['cronhours'][1]))
505
- $_POST['cronhours']=array('*/'.$_POST['cronhours'][1]);
506
- else
507
- $_POST['cronhours']=array('*');
508
- }
509
- if ($_POST['cronmday'][0]=='*' or empty($_POST['cronmday'])) {
510
- if (!empty($_POST['cronmday'][1]))
511
- $_POST['cronmday']=array('*/'.$_POST['cronmday'][1]);
512
- else
513
- $_POST['cronmday']=array('*');
514
- }
515
- if ($_POST['cronmon'][0]=='*' or empty($_POST['cronmon'])) {
516
- if (!empty($_POST['cronmon'][1]))
517
- $_POST['cronmon']=array('*/'.$_POST['cronmon'][1]);
518
- else
519
- $_POST['cronmon']=array('*');
520
- }
521
- if ($_POST['cronwday'][0]=='*' or empty($_POST['cronwday'])) {
522
- if (!empty($_POST['cronwday'][1]))
523
- $_POST['cronwday']=array('*/'.$_POST['cronwday'][1]);
524
- else
525
- $_POST['cronwday']=array('*');
526
- }
527
- $jobs[$jobid]['cron']=implode(",",$_POST['cronminutes']).' '.implode(",",$_POST['cronhours']).' '.implode(",",$_POST['cronmday']).' '.implode(",",$_POST['cronmon']).' '.implode(",",$_POST['cronwday']);
528
- $jobs[$jobid]['cronnextrun']=backwpup_cron_next($jobs[$jobid]['cron']);
529
- $jobs[$jobid]['mailaddresslog']=sanitize_email($_POST['mailaddresslog']);
530
- $jobs[$jobid]['mailerroronly']= $_POST['mailerroronly']==1 ? true : false;
531
- $jobs[$jobid]['dbexclude']=(array)$_POST['dbexclude'];
532
- $jobs[$jobid]['dbshortinsert']=$_POST['dbshortinsert']==1 ? true : false;
533
- $jobs[$jobid]['maintenance']= $_POST['maintenance']==1 ? true : false;
534
- $jobs[$jobid]['fileexclude']=stripslashes($_POST['fileexclude']);
535
- $jobs[$jobid]['dirinclude']=stripslashes($_POST['dirinclude']);
536
- $jobs[$jobid]['backuproot']= $_POST['backuproot']==1 ? true : false;
537
- $jobs[$jobid]['backuprootexcludedirs']=(array)$_POST['backuprootexcludedirs'];
538
- $jobs[$jobid]['backupcontent']= $_POST['backupcontent']==1 ? true : false;
539
- $jobs[$jobid]['backupcontentexcludedirs']=(array)$_POST['backupcontentexcludedirs'];
540
- $jobs[$jobid]['backupplugins']= $_POST['backupplugins']==1 ? true : false;
541
- $jobs[$jobid]['backuppluginsexcludedirs']=(array)$_POST['backuppluginsexcludedirs'];
542
- $jobs[$jobid]['backupthemes']= $_POST['backupthemes']==1 ? true : false;
543
- $jobs[$jobid]['backupthemesexcludedirs']=(array)$_POST['backupthemesexcludedirs'];
544
- $jobs[$jobid]['backupuploads']= $_POST['backupuploads']==1 ? true : false;
545
- $jobs[$jobid]['backupuploadsexcludedirs']=(array)$_POST['backupuploadsexcludedirs'];
546
- $jobs[$jobid]['fileprefix']=$_POST['fileprefix'];
547
- $jobs[$jobid]['fileformart']=$_POST['fileformart'];
548
- $jobs[$jobid]['mailefilesize']=(float)$_POST['mailefilesize'];
549
- $jobs[$jobid]['backupdir']=stripslashes($_POST['backupdir']);
550
- $jobs[$jobid]['maxbackups']=(int)$_POST['maxbackups'];
551
- $jobs[$jobid]['ftphost']=$_POST['ftphost'];
552
- $jobs[$jobid]['ftpuser']=$_POST['ftpuser'];
553
- $jobs[$jobid]['ftppass']=base64_encode($_POST['ftppass']);
554
- $jobs[$jobid]['ftpdir']=stripslashes($_POST['ftpdir']);
555
- $jobs[$jobid]['ftpmaxbackups']=(int)$_POST['ftpmaxbackups'];
556
- $jobs[$jobid]['ftpssl']= $_POST['ftpssl']==1 ? true : false;
557
- $jobs[$jobid]['ftppasv']= $_POST['ftppasv']==1 ? true : false;
558
- $jobs[$jobid]['dropemaxbackups']=(int)$_POST['dropemaxbackups'];
559
- $jobs[$jobid]['dropedir']=$_POST['dropedir'];
560
- $jobs[$jobid]['awsAccessKey']=$_POST['awsAccessKey'];
561
- $jobs[$jobid]['awsSecretKey']=$_POST['awsSecretKey'];
562
- $jobs[$jobid]['awsrrs']= $_POST['awsrrs']==1 ? true : false;
563
- $jobs[$jobid]['awsBucket']=$_POST['awsBucket'];
564
- $jobs[$jobid]['awsdir']=stripslashes($_POST['awsdir']);
565
- $jobs[$jobid]['awsmaxbackups']=(int)$_POST['awsmaxbackups'];
566
- $jobs[$jobid]['msazureHost']=$_POST['msazureHost'];
567
- $jobs[$jobid]['msazureAccName']=$_POST['msazureAccName'];
568
- $jobs[$jobid]['msazureKey']=$_POST['msazureKey'];
569
- $jobs[$jobid]['msazureContainer']=$_POST['msazureContainer'];
570
- $jobs[$jobid]['msazuredir']=stripslashes($_POST['msazuredir']);
571
- $jobs[$jobid]['msazuremaxbackups']=(int)$_POST['msazuremaxbackups'];
572
- $jobs[$jobid]['sugaruser']=$_POST['sugaruser'];
573
- $jobs[$jobid]['sugarpass']=base64_encode($_POST['sugarpass']);
574
- $jobs[$jobid]['sugardir']=stripslashes($_POST['sugardir']);
575
- $jobs[$jobid]['sugarroot']=$_POST['sugarroot'];
576
- $jobs[$jobid]['sugarmaxbackups']=(int)$_POST['sugarmaxbackups'];
577
- $jobs[$jobid]['rscUsername']=$_POST['rscUsername'];
578
- $jobs[$jobid]['rscAPIKey']=$_POST['rscAPIKey'];
579
- $jobs[$jobid]['rscContainer']=$_POST['rscContainer'];
580
- $jobs[$jobid]['rscdir']=stripslashes($_POST['rscdir']);
581
- $jobs[$jobid]['rscmaxbackups']=(int)$_POST['rscmaxbackups'];
582
- $jobs[$jobid]['mailaddress']=sanitize_email($_POST['mailaddress']);
583
- //unset old vars
584
- unset($jobs[$jobid]['scheduletime']);
585
- unset($jobs[$jobid]['scheduleintervaltype']);
586
- unset($jobs[$jobid]['scheduleintervalteimes']);
587
- unset($jobs[$jobid]['scheduleinterval']);
588
-
589
- $jobs[$jobid]=backwpup_check_job_vars($jobs[$jobid],$jobid); //check vars and set def.
590
-
591
- if (!empty($_POST['newawsBucket']) and !empty($_POST['awsAccessKey']) and !empty($_POST['awsSecretKey'])) { //create new s3 bucket if needed
592
- if (!class_exists('CFRuntime'))
593
- require_once(dirname(__FILE__).'/libs/aws/sdk.class.php');
594
- try {
595
- $s3 = new AmazonS3($_POST['awsAccessKey'], $_POST['awsSecretKey']);
596
- $s3->create_bucket($_POST['newawsBucket'], $_POST['awsRegion']);
597
- $jobs[$jobid]['awsBucket']=$_POST['newawsBucket'];
598
- } catch (Exception $e) {
599
- $backwpup_message.=__($e->getMessage(),'backwpup').'<br />';
600
- }
601
- }
602
-
603
- if (!empty($_POST['newmsazureContainer']) and !empty($_POST['msazureHost']) and !empty($_POST['msazureAccName']) and !empty($_POST['msazureKey'])) { //create new s3 bucket if needed
604
- if (!class_exists('Microsoft_WindowsAzure_Storage_Blob')) {
605
- set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__).'/libs');
606
- require_once 'Microsoft/WindowsAzure/Storage/Blob.php';
607
- }
608
- try {
609
- $storageClient = new Microsoft_WindowsAzure_Storage_Blob($_POST['msazureHost'],$_POST['msazureAccName'],$_POST['msazureKey']);
610
- $result = $storageClient->createContainer($_POST['newmsazureContainer']);
611
- $jobs[$jobid]['msazureContainer']=$result->Name;
612
- } catch (Exception $e) {
613
- $backwpup_message.=__($e->getMessage(),'backwpup').'<br />';
614
- }
615
- }
616
-
617
-
618
- if (!empty($_POST['rscUsername']) and !empty($_POST['rscAPIKey']) and !empty($_POST['newrscContainer'])) { //create new Rackspase Container if needed
619
- if (!class_exists('CF_Authentication'))
620
- require_once(plugin_dir_path(__FILE__).'libs/rackspace/cloudfiles.php');
621
- try {
622
- $auth = new CF_Authentication($_POST['rscUsername'], $_POST['rscAPIKey']);
623
- if ($auth->authenticate()) {
624
- $conn = new CF_Connection($auth);
625
- $public_container = $conn->create_container($_POST['newrscContainer']);
626
- $public_container->make_private();
627
- }
628
- } catch (Exception $e) {
629
- $backwpup_message.=__($e->getMessage(),'backwpup').'<br />';
630
- }
631
- }
632
-
633
- if ($_POST['dropboxauth']==__('Authenticate!', 'backwpup')) {
634
- if (!class_exists('Dropbox'))
635
- require_once (dirname(__FILE__).'/libs/dropbox/dropbox.php');
636
- $dropbox = new Dropbox(BACKWPUP_DROPBOX_APP_KEY, BACKWPUP_DROPBOX_APP_SECRET);
637
- // request request tokens
638
- $response = $dropbox->oAuthRequestToken();
639
- // save job id and referer
640
- update_option('backwpup_dropboxrequest',array('oAuthRequestToken' => $response['oauth_token'],'oAuthRequestTokenSecret' => $response['oauth_token_secret']));
641
- // let the user authorize (user will be redirected)
642
- $response = $dropbox->oAuthAuthorize($response['oauth_token'], get_admin_url().'admin.php?page=BackWPup&subpage=edit&jobid='.$jobid.'&dropboxauth=AccessToken&_wpnonce='.wp_create_nonce('edit-job'));
643
- }
644
-
645
- if ($_POST['dropboxauthdel']==__('Delete!', 'backwpup')) {
646
- $jobs[$jobid]['dropetoken']='';
647
- $jobs[$jobid]['dropesecret']='';
648
- $backwpup_message.=__('Dropbox authentication deleted!','backwpup').'<br />';
649
- }
650
-
651
- //save chages
652
- update_option('backwpup_jobs',$jobs);
653
- $_POST['jobid']=$jobid;
654
- $backwpup_message.=str_replace('%1',$jobs[$jobid]['name'],__('Job \'%1\' changes saved.', 'backwpup')).' <a href="admin.php?page=BackWPup">'.__('Jobs overview.', 'backwpup').'</a>';
655
- return $backwpup_message;
656
- }
657
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/options-settings.php DELETED
@@ -1,92 +0,0 @@
1
- <?PHP
2
- // don't load directly
3
- if ( !defined('ABSPATH') )
4
- die('-1');
5
-
6
- $cfg=get_option('backwpup');
7
- ?>
8
- <div class="wrap">
9
- <div id="icon-tools" class="icon32"><br /></div>
10
- <h2><?php _e("BackWPup Settings", "backwpup"); ?></h2>
11
- <?php backwpup_option_submenues(); ?>
12
-
13
- <div class="clear"></div>
14
-
15
- <form method="post" action="<?PHP echo get_admin_url().'admin.php?page=BackWPup&subpage=settings';?>">
16
- <input type="hidden" name="subpage" value="settings" />
17
- <?php wp_nonce_field('backwpup-cfg'); ?>
18
-
19
- <div id="poststuff" class="metabox-holder has-right-sidebar">
20
- <div class="inner-sidebar">
21
- <div id="side-sortables" class="meta-box-sortables">
22
- <input type="submit" name="submit" class="button-primary" value="<?php _e('Save Changes', 'backwpup'); ?>" />
23
- </div>
24
- </div>
25
- <div class="has-sidebar" >
26
- <div id="post-body-content" class="has-sidebar-content">
27
-
28
- <div id="mailtype" class="postbox">
29
- <h3 class="hndle"><span><?PHP _e('Send Mail','backwpup'); ?></span></h3>
30
- <div class="inside">
31
- <b><?PHP _e('Sender Email:','backwpup'); ?></b><br /><input name="mailsndemail" type="text" value="<?PHP echo $cfg['mailsndemail'];?>" class="large-text" /><br />
32
- <b><?PHP _e('Sender Name:','backwpup'); ?></b><br /><input name="mailsndname" type="text" value="<?PHP echo $cfg['mailsndname'];?>" class="large-text" /><br />
33
- <b><?PHP _e('Send mail method:','backwpup'); ?></b><br />
34
- <?PHP
35
- echo '<select id="mailmethod" name="mailmethod">';
36
- echo '<option value="mail"'.selected('mail',$cfg['mailmethod'],false).'>'.__('PHP: mail()','backwpup').'</option>';
37
- echo '<option value="Sendmail"'.selected('Sendmail',$cfg['mailmethod'],false).'>'.__('Sendmail','backwpup').'</option>';
38
- echo '<option value="SMTP"'.selected('SMTP',$cfg['mailmethod'],false).'>'.__('SMTP','backwpup').'</option>';
39
- echo '</select>';
40
- ?><br />
41
- <label id="mailsendmail" <?PHP if ($cfg['mailmethod']!='Sendmail') echo 'style="display:none;"';?>><b><?PHP _e('Sendmail Path:','backwpup'); ?></b><br /><input name="mailsendmail" type="text" value="<?PHP echo $cfg['mailsendmail'];?>" class="large-text" /><br /></label>
42
- <label id="mailsmtp" <?PHP if ($cfg['mailmethod']!='SMTP') echo 'style="display:none;"';?>>
43
- <b><?PHP _e('SMTP Hostname:','backwpup'); ?></b><br /><input name="mailhost" type="text" value="<?PHP echo $cfg['mailhost'];?>" class="large-text" /><br />
44
- <b><?PHP _e('SMTP Secure Connection:','backwpup'); ?></b><br />
45
- <select name="mailsecure">
46
- <option value=""<?PHP selected('',$cfg['mailsecure'],true); ?>><?PHP _e('none','backwpup'); ?></option>
47
- <option value="ssl"<?PHP selected('ssl',$cfg['mailsecure'],true); ?>>SSL</option>
48
- <option value="tls"<?PHP selected('tls',$cfg['mailsecure'],true); ?>>TLS</option>
49
- </select><br />
50
- <b><?PHP _e('SMTP Username:','backwpup'); ?></b><br /><input name="mailuser" type="text" value="<?PHP echo $cfg['mailuser'];?>" class="user large-text" /><br />
51
- <b><?PHP _e('SMTP Password:','backwpup'); ?></b><br /><input name="mailpass" type="password" value="<?PHP echo base64_decode($cfg['mailpass']);?>" class="password large-text" /><br />
52
- </label>
53
- </div>
54
- </div>
55
-
56
- <div id="logs" class="postbox">
57
- <h3 class="hndle"><span><?PHP _e('Logs','backwpup'); ?></span></h3>
58
- <div class="inside">
59
- <b><?PHP _e('Log file Folder:','backwpup'); ?></b><br />
60
- <input name="dirlogs" type="text" value="<?PHP echo $cfg['dirlogs'];?>" class="large-text" /><br />
61
- <b><?PHP _e('Max. Log Files in Folder:','backwpup'); ?></b><br />
62
- <input name="maxlogs" id="maxlogs" size="3" type="text" value="<?PHP echo $cfg['maxlogs'];?>" class="small-text" /><span class="description"><?PHP _e('(Oldest files will deleted first.)','backwpup');?></span><br />
63
- <input class="checkbox" value="1" type="checkbox" <?php checked($cfg['gzlogs'],true); ?> name="gzlogs" <?php if (!function_exists('gzopen')) echo "disabled=\"disabled\""; ?> /><b>&nbsp;<?PHP _e('Gzip Log files!','backwpup'); ?></b><br />
64
- <input class="checkbox" value="1" type="checkbox" <?php checked($cfg['logfilelist'],true); ?> name="logfilelist" /><b>&nbsp;<?PHP _e('Log a detailed file list.','backwpup'); ?></b><br />
65
- </div>
66
- </div>
67
-
68
- <div id="disablewpcron" class="postbox">
69
- <h3 class="hndle"><span><?PHP _e('Disable WP-Cron','backwpup'); ?></span></h3>
70
- <div class="inside">
71
- <input class="checkbox" id="disablewpcron" type="checkbox"<?php checked($cfg['disablewpcron'],true,true);?> name="disablewpcron" value="1"/> <?PHP _e('Use your host\'s Cron Job and disable WP-Cron','backwpup'); ?><br />
72
- <?PHP _e('You must set up a cron job that calls:','backwpup'); ?><br />
73
- <i> php -q <?PHP echo ABSPATH.'wp-cron.php'; ?></i><br />
74
- <?PHP _e('or URL:','backwpup'); ?> <i><?PHP echo trailingslashit(get_option('siteurl')).'wp-cron.php'; ?></i><br />
75
- </div>
76
- </div>
77
-
78
- <div id="dirtemp" class="postbox">
79
- <h3 class="hndle"><span><?PHP _e('Temp Folder','backwpup'); ?></span></h3>
80
- <div class="inside">
81
- <input name="dirtemp" type="text" value="<?PHP echo $cfg['dirtemp'];?>" class="large-text" /><br />
82
- </div>
83
- </div>
84
- <input type="submit" name="submit" class="button-primary" value="<?php _e('Save Changes', 'backwpup'); ?>" />
85
- </div>
86
- </div>
87
- </div>
88
- <p class="submit">
89
-
90
- </p>
91
- </form>
92
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/options-tools.php DELETED
@@ -1,127 +0,0 @@
1
- <?PHP
2
- // don't load directly
3
- if ( !defined('ABSPATH') )
4
- die('-1');
5
- ?>
6
- <div class="wrap">
7
- <div id="icon-tools" class="icon32"><br /></div>
8
- <h2><?php _e("BackWPup Tools", "backwpup"); ?></h2>
9
-
10
- <?php backwpup_option_submenues(); ?>
11
-
12
- <div class="clear"></div>
13
-
14
- <form enctype="multipart/form-data" method="post" action="">
15
- <input type="hidden" name="subpage" value="tools" />
16
- <input type="hidden" name="page" value="BackWPup" />
17
- <?php wp_nonce_field('backwpup-tools'); ?>
18
-
19
- <div id="poststuff" class="metabox-holder has-right-sidebar">
20
- <div class="inner-sidebar">
21
- <div id="side-sortables" class="meta-box-sortables">
22
-
23
- </div>
24
- </div>
25
- <div class="has-sidebar" >
26
- <div id="post-body-content" class="has-sidebar-content">
27
-
28
- <div id="dbrestore" class="postbox">
29
- <h3 class="hndle"><span><?PHP _e('Database restore','backwpup'); ?></span></h3>
30
- <div class="inside">
31
- <?PHP
32
- if ($_POST['dbrestore']==__('Restore', 'backwpup') and is_file($_POST['sqlfile'])) {
33
- $sqlfile=$_POST['sqlfile'];
34
- require('tools/db_restore.php');
35
- } else {
36
- if ( $dir = @opendir(ABSPATH)) {
37
- $sqlfile="";
38
- while (($file = readdir( $dir ) ) !== false ) {
39
- if (strtolower(substr($file,-4))==".sql") {
40
- $sqlfile=$file;
41
- break;
42
- }
43
- }
44
- @closedir( $dir );
45
- }
46
- if (!empty($sqlfile)) {
47
- echo __('SQL File to restore:','backwpup').' '.trailingslashit(ABSPATH).$sqlfile."<br />";
48
- ?>
49
- <input type="hidden" name="sqlfile" id="sqlfile" value="<?PHP echo trailingslashit(ABSPATH).$sqlfile;?>" />
50
- <input type="submit" name="dbrestore" class="button-primary" value="<?php _e('Restore', 'backwpup'); ?>" />
51
- <?PHP
52
- } else {
53
- echo __('Copy SQL file to blog root folder to use for a restoration.', 'backwpup')."<br />";
54
- }
55
- }
56
- ?>
57
- </div>
58
- </div>
59
-
60
- <div id="import" class="postbox">
61
- <h3 class="hndle"><span><?PHP _e('Import Jobs settings','backwpup'); ?></span></h3>
62
- <div class="inside">
63
- <?php _e('Select File to import:', 'backwpup'); ?> <input name="importfile" type="file" />
64
- <input type="submit" name="upload" value="<?php _e('Upload', 'backwpup'); ?>" /><br />
65
- <?PHP
66
- if (is_uploaded_file($_FILES['importfile']['tmp_name']) and $_POST['upload']==__('Upload', 'backwpup')) {
67
- _e('Select Jobs to Import:', 'backwpup'); echo "<br />";
68
- $import=file_get_contents($_FILES['importfile']['tmp_name']);
69
- $oldjobs=get_option('backwpup_jobs');
70
- foreach ( unserialize($import) as $jobid => $jobvalue ) {
71
- echo $jobid.". ".$jobvalue['name']." <select name=\"importtype[".$jobid."]\" title=\"".__('Import Type', 'backwpup')."\"><option value=\"not\">".__('No Import', 'backwpup')."</option>";
72
- if (is_array($oldjobs[$jobid]))
73
- echo "<option value=\"over\">".__('Overwrite', 'backwpup')."</option><option value=\"append\">".__('Append', 'backwpup')."</option>";
74
- else
75
- echo "<option value=\"over\">".__('Import', 'backwpup')."</option>";
76
- echo "</select><br />";
77
- }
78
- echo "<input type=\"hidden\" name=\"importfile\" value=\"".urlencode($import)."\" />";
79
- echo "<input type=\"submit\" name=\"import\" class=\"button-primary\" value=\"".__('Import', 'backwpup')."\" />";
80
- }
81
- if ($_POST['import']==__('Import', 'backwpup') and !empty($_POST['importfile'])) {
82
- $oldjobs=get_option('backwpup_jobs');
83
- $import=unserialize(urldecode($_POST['importfile']));
84
- foreach ( $_POST['importtype'] as $id => $type ) {
85
- if ($type=='over') {
86
- unset($oldjobs[$id]);
87
- $oldjobs[$id]=$import[$id];
88
- $oldjobs[$id]['activated']=false;
89
- $oldjobs[$id]['cronnextrun']='';
90
- $oldjobs[$id]['starttime']='';
91
- $oldjobs[$id]['logfile']='';
92
- $oldjobs[$id]['lastlogfile']='';
93
- $oldjobs[$id]['lastrun']='';
94
- $oldjobs[$id]['lastruntime']='';
95
- $oldjobs[$id]['lastbackupdownloadurl']='';
96
- } elseif ($type=='append') {
97
- if (is_array($oldjobs)) { //generate a new id for new job
98
- foreach ($oldjobs as $jobkey => $jobvalue) {
99
- if ($jobkey>$heighestid) $heighestid=$jobkey;
100
- }
101
- $jobid=$heighestid+1;
102
- } else {
103
- $jobid=1;
104
- }
105
- $oldjobs[$jobid]=$import[$id];
106
- $oldjobs[$jobid]['activated']=false;
107
- $oldjobs[$jobid]['cronnextrun']='';
108
- $oldjobs[$jobid]['starttime']='';
109
- $oldjobs[$jobid]['logfile']='';
110
- $oldjobs[$jobid]['lastlogfile']='';
111
- $oldjobs[$jobid]['lastrun']='';
112
- $oldjobs[$jobid]['lastruntime']='';
113
- $oldjobs[$jobid]['lastbackupdownloadurl']='';
114
- }
115
- }
116
- update_option('backwpup_jobs',$oldjobs);
117
- _e('Jobs imported!', 'backwpup');
118
- }
119
- ?>
120
- </div>
121
- </div>
122
-
123
- </div>
124
- </div>
125
- </div>
126
- </form>
127
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/options-view_log-iframe.php DELETED
@@ -1,14 +0,0 @@
1
- <?PHP
2
- if (file_exists(trim($_GET['wpabs']).'wp-load.php') and file_exists(trim($_GET['logfile']))) {
3
- require_once(trim($_GET['wpabs']).'wp-load.php'); /** Setup WordPress environment */
4
- check_admin_referer('viewlognow_'.basename($_GET['logfile']));
5
- if (strtolower(substr($_GET['logfile'],-3))==".gz") {
6
- readgzfile(trim($_GET['logfile']));
7
- } else {
8
- readfile(trim($_GET['logfile']));
9
- }
10
- } else {
11
- header("HTTP/1.0 404 Not Found");
12
- die();
13
- }
14
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/php-functions.php DELETED
@@ -1,852 +0,0 @@
1
- <?PHP
2
- // don't load directly
3
- if ( !defined('ABSPATH') )
4
- die('-1');
5
-
6
- //Thems Option menu entry
7
- function backwpup_admin_menu() {
8
- $hook = add_management_page(__('BackWPup','backwpup'), __('BackWPup','backwpup'), BACKWPUP_USER_CAPABILITY, 'BackWPup','backwpup_options_page') ;
9
- add_action('load-'.$hook, 'backwpup_options_load');
10
- }
11
-
12
- //Options Page
13
- function backwpup_options_page() {
14
- global $table,$backwpup_message,$page_hook;
15
- if (!current_user_can(BACKWPUP_USER_CAPABILITY))
16
- return;
17
- if(!empty($backwpup_message))
18
- echo '<div id="message" class="updated fade"><p><strong>'.$backwpup_message.'</strong></p></div>';
19
- switch($_REQUEST['subpage']) {
20
- case 'edit':
21
- require_once(dirname(__FILE__).'/options-edit-job.php');
22
- break;
23
- case 'logs':
24
- echo "<div class=\"wrap\">";
25
- echo "<div id=\"icon-tools\" class=\"icon32\"><br /></div>";
26
- echo "<h2>".__('BackWPup Logs', 'backwpup')."</h2>";
27
- backwpup_option_submenues();
28
- echo "<form id=\"posts-filter\" action=\"\" method=\"post\">";
29
- echo "<input type=\"hidden\" name=\"page\" value=\"BackWPup\" />";
30
- echo "<input type=\"hidden\" name=\"subpage\" value=\"logs\" />";
31
- $table->display();
32
- echo "<div id=\"ajax-response\"></div>";
33
- echo "</form>";
34
- echo "</div>";
35
- break;
36
- case 'settings':
37
- require_once(dirname(__FILE__).'/options-settings.php');
38
- break;
39
- case 'tools':
40
- require_once(dirname(__FILE__).'/options-tools.php');
41
- break;
42
- case 'backups':
43
- echo "<div class=\"wrap\">";
44
- echo "<div id=\"icon-tools\" class=\"icon32\"><br /></div>";
45
- echo "<h2>".__('BackWPup Manage Backups', 'backwpup')."</h2>";
46
- backwpup_option_submenues();
47
- echo "<form id=\"posts-filter\" action=\"\" method=\"post\">";
48
- echo "<input type=\"hidden\" name=\"page\" value=\"BackWPup\" />";
49
- echo "<input type=\"hidden\" name=\"subpage\" value=\"backups\" />";
50
- $table->display();
51
- echo "<div id=\"ajax-response\"></div>";
52
- echo "</form>";
53
- echo "</div>";
54
- break;
55
- case 'runnow':
56
- $jobid = (int) $_GET['jobid'];
57
- check_admin_referer('runnow-job_' . $jobid);
58
- $jobs=get_option('backwpup_jobs');
59
- echo "<div class=\"wrap\">";
60
- echo "<div id=\"icon-tools\" class=\"icon32\"><br /></div>";
61
- echo "<h2>".__('BackWPup Job Running', 'backwpup')."</h2>";
62
- backwpup_option_submenues();
63
- echo "<br class=\"clear\" />";
64
- echo "<big>".__('Running Job','backwpup')." <strong>".$jobs[$jobid]['name']."</strong></big>";
65
- echo "<iframe src=\"".wp_nonce_url(plugins_url('options-runnow-iframe.php',__FILE__).'?wpabs='.trailingslashit(ABSPATH).'&jobid=' . $jobid, 'dojob-now_' . $jobid)."\" name=\"runframe\" id=\"runframe\" width=\"100%\" height=\"450\" align=\"left\" scrolling=\"auto\" style=\"border: 1px solid gray\" frameborder=\"0\"></iframe>";
66
- echo "</div>";
67
- break;
68
- case 'view_log':
69
- check_admin_referer('view-log_'.basename($_GET['logfile']));
70
- echo "<div class=\"wrap\">";
71
- echo "<div id=\"icon-tools\" class=\"icon32\"><br /></div>";
72
- echo "<h2>".__('BackWPup View Logs', 'backwpup')."</h2>";
73
- backwpup_option_submenues();
74
- echo "<br class=\"clear\" />";
75
- echo "<big>".__('View Log','backwpup')." <strong>".basename($_GET['logfile'])."</strong></big>";
76
- echo "<iframe src=\"".wp_nonce_url(plugins_url('options-view_log-iframe.php',__FILE__).'?wpabs='.trailingslashit(ABSPATH).'&logfile=' . $_GET['logfile'], 'viewlognow_'.basename($_GET['logfile']))."\" name=\"logframe\" id=\"logframe\" width=\"100%\" height=\"450\" align=\"left\" scrolling=\"auto\" style=\"border: 1px solid gray\" frameborder=\"0\"></iframe>";
77
- echo "</div>";
78
- break;
79
- default:
80
- echo "<div class=\"wrap\">";
81
- echo "<div id=\"icon-tools\" class=\"icon32\"><br /></div>";
82
- echo "<h2>".__('BackWPup', 'backwpup')."&nbsp;<a href=\"".wp_nonce_url('admin.php?page=BackWPup&subpage=edit', 'edit-job')."\" class=\"button add-new-h2\">".esc_html__('Add New')."</a></h2>";
83
- backwpup_option_submenues();
84
- echo "<form id=\"posts-filter\" action=\"\" method=\"post\">";
85
- echo "<input type=\"hidden\" name=\"page\" value=\"BackWPup\" />";
86
- echo "<input type=\"hidden\" name=\"subpage\" value=\"\" />";
87
- $table->display();
88
- echo "<div id=\"ajax-response\"></div>";
89
- echo "</form>";
90
- echo "</div>";
91
- break;
92
- }
93
- }
94
-
95
- //Options Page
96
- function backwpup_options_load() {
97
- global $current_screen,$table,$backwpup_message;
98
- if (!current_user_can(BACKWPUP_USER_CAPABILITY))
99
- return;
100
- //Css for Admin Section
101
- wp_enqueue_style('BackWpup',plugins_url('css/options.css',__FILE__),'',BACKWPUP_VERSION,'screen');
102
- wp_enqueue_script('common');
103
- wp_enqueue_script('wp-lists');
104
- wp_enqueue_script('postbox');
105
- wp_enqueue_script('BackWpupOptions',plugins_url('js/options.js',__FILE__),'',BACKWPUP_VERSION,true);
106
-
107
- add_contextual_help($current_screen,
108
- '<div class="metabox-prefs">'.
109
- '<a href="http://wordpress.org/tags/backwpup" target="_blank">'.__('Support').'</a>'.
110
- ' | <a href="http://wordpress.org/extend/plugins/backwpup/faq/" target="_blank">' . __('FAQ') . '</a>'.
111
- ' | <a href="http://danielhuesken.de/portfolio/backwpup" target="_blank">' . __('Plugin Homepage', 'backwpup') . '</a>'.
112
- ' | <a href="http://wordpress.org/extend/plugins/backwpup" target="_blank">' . __('Plugin Home on WordPress.org', 'backwpup') . '</a>'.
113
- ' | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=daniel%40huesken-net%2ede&amp;item_name=Daniel%20Huesken%20Plugin%20Donation&amp;item_number=BackWPup&amp;no_shipping=0&amp;no_note=1&amp;tax=0&amp;bn=PP%2dDonationsBF&amp;charset=UTF%2d8" target="_blank">' . __('Donate') . '</a>'.
114
- ' | <script type="text/javascript">
115
- var flattr_btn = \'compact\'
116
- var flattr_url = \'http://danielhuesken.de/portfolio/backwpup/\'
117
- </script><script src="http://api.flattr.com/button/load.js" type="text/javascript"></script>'.
118
- '</div>'.
119
- '<div class="metabox-prefs">'.
120
- __('Version:', 'backwpup').' '.BACKWPUP_VERSION.' | '.
121
- __('Author:', 'backwpup').' <a href="http://danielhuesken.de" target="_blank">Daniel H&uuml;sken</a>'.
122
- '</div>'
123
- );
124
-
125
- if ($_REQUEST['action2']!='-1' and $_REQUEST['action']=='-1')
126
- $_REQUEST['action']=$_REQUEST['action2'];
127
-
128
- switch($_REQUEST['subpage']) {
129
- case 'logs':
130
- if (!empty($_REQUEST['action'])) {
131
- require_once(dirname(__FILE__).'/options-save.php');
132
- backwpup_log_operations($_REQUEST['action']);
133
- }
134
- require_once(dirname(__FILE__).'/list-tables.php');
135
- $table = new BackWPup_Logs_Table;
136
- $table->check_permissions();
137
- $table->prepare_items();
138
- break;
139
- case 'edit':
140
- if (!empty($_POST['submit']) or !empty($_REQUEST['dropboxauth']) or !empty($_REQUEST['dropboxauthdel'])) {
141
- require_once(dirname(__FILE__).'/options-save.php');
142
- if ($_GET['dropboxauth']=='AccessToken')
143
- $backwpup_message=backwpup_save_dropboxauth();
144
- else
145
- $backwpup_message=backwpup_save_job();
146
- }
147
- break;
148
- case 'settings':
149
- if (!empty($_POST['submit'])) {
150
- require_once(dirname(__FILE__).'/options-save.php');
151
- $backwpup_message=backwpup_save_settings();
152
- }
153
- break;
154
- case 'tools':
155
- break;
156
- case 'backups':
157
- if (!empty($_REQUEST['action'])) {
158
- require_once(dirname(__FILE__).'/options-save.php');
159
- backwpup_backups_operations($_REQUEST['action']);
160
- }
161
- require_once(dirname(__FILE__).'/list-tables.php');
162
- $table = new BackWPup_Backups_Table;
163
- $table->check_permissions();
164
- $table->prepare_items();
165
- break;
166
- case 'runnow':
167
- break;
168
- case 'view_log':
169
- break;
170
- default:
171
- if (!empty($_REQUEST['action'])) {
172
- require_once(dirname(__FILE__).'/options-save.php');
173
- backwpup_job_operations($_REQUEST['action']);
174
- }
175
- require_once(dirname(__FILE__).'/list-tables.php');
176
- $table = new BackWPup_Jobs_Table;
177
- $table->check_permissions();
178
- $table->prepare_items();
179
- break;
180
- }
181
- }
182
-
183
-
184
- function backwpup_option_submenues() {
185
- $maincurrent="";$logscurrent="";$backupscurrent="";$toolscurrent="";$settingscurrent="";
186
- if (empty($_REQUEST['subpage']))
187
- $maincurrent=" class=\"current\"";
188
- if ($_REQUEST['subpage']=='logs')
189
- $logscurrent=" class=\"current\"";
190
- if ($_REQUEST['subpage']=='backups')
191
- $backupscurrent=" class=\"current\"";
192
- if ($_REQUEST['subpage']=='tools')
193
- $toolscurrent=" class=\"current\"";
194
- if ($_REQUEST['subpage']=='settings')
195
- $settingscurrent=" class=\"current\"";
196
- echo "<ul class=\"subsubsub\">";
197
- echo "<li><a href=\"admin.php?page=BackWPup\"$maincurrent>".__('Jobs','backwpup')."</a> |</li>";
198
- echo "<li><a href=\"admin.php?page=BackWPup&amp;subpage=logs\"$logscurrent>".__('Logs','backwpup')."</a> |</li>";
199
- echo "<li><a href=\"admin.php?page=BackWPup&amp;subpage=backups\"$backupscurrent>".__('Backups','backwpup')."</a> |</li>";
200
- echo "<li><a href=\"admin.php?page=BackWPup&amp;subpage=tools\"$toolscurrent>".__('Tools','backwpup')."</a> |</li>";
201
- echo "<li><a href=\"admin.php?page=BackWPup&amp;subpage=settings\"$settingscurrent>".__('Settings','backwpup')."</a></li>";
202
- echo "</ul>";
203
- }
204
-
205
- //On Plugin activate
206
- function backwpup_plugin_activate() {
207
- //remove old cron jobs
208
- $jobs=(array)get_option('backwpup_jobs');
209
- foreach ($jobs as $jobid => $jobvalue) {
210
- if ($time=wp_next_scheduled('backwpup_cron',array('jobid'=>$jobid))) {
211
- wp_unschedule_event($time,'backwpup_cron',array('jobid'=>$jobid));
212
- }
213
- }
214
- wp_clear_scheduled_hook('backwpup_cron');
215
- //make schedule
216
- wp_schedule_event(0, 'backwpup_int', 'backwpup_cron');
217
- //Set defaults
218
- $cfg=get_option('backwpup'); //Load Settings
219
- if (empty($cfg['mailsndemail'])) $cfg['mailsndemail']=sanitize_email(get_bloginfo( 'admin_email' ));
220
- if (empty($cfg['mailsndname'])) $cfg['mailsndname']='BackWPup '.get_bloginfo( 'name' );
221
- if (empty($cfg['mailmethod'])) $cfg['mailmethod']='mail';
222
- if (empty($cfg['mailsendmail'])) $cfg['mailsendmail']=substr(ini_get('sendmail_path'),0,strpos(ini_get('sendmail_path'),' -'));
223
- if (empty($cfg['maxlogs'])) $cfg['maxlogs']=0;
224
- if (!function_exists('gzopen') or !isset($cfg['gzlogs'])) $cfg['gzlogs']=false;
225
- if (empty($cfg['dirtemp'])) {
226
- $rand = substr( md5( md5( SECURE_AUTH_KEY ) ), -5 );
227
- $cfg['dirtemp']=backwpup_get_upload_dir();
228
- }
229
- if (empty($cfg['dirlogs'])) {
230
- $rand = substr( md5( md5( SECURE_AUTH_KEY ) ), -5 );
231
- $cfg['dirlogs']=str_replace('\\','/',trailingslashit(WP_CONTENT_DIR)).'backwpup-'.$rand.'-logs/';
232
- }
233
- update_option('backwpup',$cfg);
234
- }
235
-
236
- //on Plugin deaktivate
237
- function backwpup_plugin_deactivate() {
238
- //remove old cron jobs
239
- $jobs=(array)get_option('backwpup_jobs');
240
- foreach ($jobs as $jobid => $jobvalue) {
241
- if ($time=wp_next_scheduled('backwpup_cron',array('jobid'=>$jobid))) {
242
- wp_unschedule_event($time,'backwpup_cron',array('jobid'=>$jobid));
243
- }
244
- }
245
- wp_clear_scheduled_hook('backwpup_cron');
246
- }
247
-
248
- //add edit setting to plugins page
249
- function backwpup_plugin_options_link($links) {
250
- if (!current_user_can(BACKWPUP_USER_CAPABILITY))
251
- return $links;
252
- $settings_link='<a href="admin.php?page=BackWPup" title="' . __('Go to Settings Page','backwpup') . '" class="edit">' . __('Settings') . '</a>';
253
- array_unshift( $links, $settings_link );
254
- return $links;
255
- }
256
-
257
- //add links on plugins page
258
- function backwpup_plugin_links($links, $file) {
259
- if (!current_user_can('install_plugins'))
260
- return $links;
261
- if ($file == BACKWPUP_PLUGIN_BASEDIR.'/backwpup.php') {
262
- $links[] = '<a href="http://wordpress.org/extend/plugins/backwpup/faq/" target="_blank">' . __('FAQ') . '</a>';
263
- $links[] = '<a href="http://wordpress.org/tags/backwpup/" target="_blank">' . __('Support') . '</a>';
264
- $links[] = '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=daniel%40huesken-net%2ede&amp;item_name=Daniel%20Huesken%20Plugin%20Donation&amp;item_number=BackWPup&amp;no_shipping=0&amp;no_note=1&amp;tax=0&amp;currency_code=EUR&amp;lc=DE&amp;bn=PP%2dDonationsBF&amp;charset=UTF%2d8" target="_blank">' . __('Donate') . '</a>';
265
- }
266
- return $links;
267
- }
268
-
269
- //Add cron interval
270
- function backwpup_intervals($schedules) {
271
- $intervals['backwpup_int']=array('interval' => '300', 'display' => __('BackWPup', 'backwpup'));
272
- $schedules=array_merge($intervals,$schedules);
273
- return $schedules;
274
- }
275
-
276
- //cron work
277
- function backwpup_cron() {
278
- define('DONOTCACHEPAGE', true);
279
- define('DONOTCACHEDB', true);
280
- define('DONOTMINIFY', true);
281
- define('DONOTCDN', true);
282
- define('DONOTCACHCEOBJECT', true);
283
- define("QUICK_CACHE_ALLOWED", false);
284
- $_SERVER["QUICK_CACHE_ALLOWED"] = false;
285
- if (function_exists('w3tc_pgcache_flush'))
286
- w3tc_pgcache_flush();
287
- echo "<!-- mfunc -->";
288
- foreach ((array)get_option('backwpup_jobs') as $jobid => $jobvalue) {
289
- if (!isset($jobvalue['activated']) or !$jobvalue['activated'])
290
- continue;
291
- if ($jobvalue['cronnextrun']<=current_time('timestamp') and empty($jobvalue['logfile']))
292
- backwpup_dojob($jobid);
293
- }
294
- echo "<!--/mfunc-->";
295
- }
296
-
297
- //DoJob
298
- function backwpup_dojob($jobid) {
299
- if (empty($jobid))
300
- return false;
301
- require_once(dirname(__FILE__).'/backwpup_dojob.php');
302
- $backwpup_dojob= new backwpup_dojob($jobid);
303
-
304
- //run job parts
305
- foreach($backwpup_dojob->todo as $key => $value) {
306
- switch ($value) {
307
- case 'DB':
308
- $backwpup_dojob->dump_db();
309
- break;
310
- case 'WPEXP':
311
- $backwpup_dojob->export_wp();
312
- break;
313
- case 'FILE':
314
- $backwpup_dojob->file_list();
315
- break;
316
- }
317
- }
318
-
319
- if (isset($backwpup_dojob->filelist[0][79001])) { // Make backup file
320
- if ($backwpup_dojob->backupfileformat==".zip")
321
- $backwpup_dojob->zip_files();
322
- elseif ($backwpup_dojob->backupfileformat==".tar.gz" or $backwpup_dojob->backupfileformat==".tar.bz2" or $backwpup_dojob->backupfileformat==".tar")
323
- $backwpup_dojob->tar_pack_files();
324
- }
325
-
326
- if (is_file($backwpup_dojob->backupdir.$backwpup_dojob->backupfile)) { // Put backup file to destination
327
- $dests=explode(',',strtoupper(BACKWPUP_DESTS));
328
- if (!empty($backwpup_dojob->job['mailaddress'])) {
329
- $backwpup_dojob->destination_mail();
330
- }
331
- if (in_array('FTP',$dests) and !empty($backwpup_dojob->job['ftphost']) and !empty($backwpup_dojob->job['ftpuser']) and !empty($backwpup_dojob->job['ftppass'])) {
332
- if (function_exists('ftp_connect'))
333
- $backwpup_dojob->destination_ftp();
334
- else
335
- trigger_error(__('FTP extension needed for FTP!','backwpup'),E_USER_ERROR);
336
- }
337
- if (in_array('DROPBOX',$dests) and !empty($backwpup_dojob->job['dropetoken']) and !empty($backwpup_dojob->job['dropesecret'])) {
338
- if (function_exists('curl_exec') and function_exists('json_decode'))
339
- $backwpup_dojob->destination_dropbox();
340
- else
341
- trigger_error(__('Curl and Json extensions needed for DropBox!','backwpup'),E_USER_ERROR);
342
- }
343
- if (in_array('SUGARSYNC',$dests) and !empty($backwpup_dojob->job['sugaruser']) and !empty($backwpup_dojob->job['sugarpass'])) {
344
- if (function_exists('curl_exec') )
345
- $backwpup_dojob->destination_sugarsync();
346
- else
347
- trigger_error(__('Curl and Json extensions needed for DropBox!','backwpup'),E_USER_ERROR);
348
- }
349
- if (in_array('S3',$dests) and !empty($backwpup_dojob->job['awsAccessKey']) and !empty($backwpup_dojob->job['awsSecretKey']) and !empty($backwpup_dojob->job['awsBucket'])) {
350
- if (function_exists('curl_exec'))
351
- $backwpup_dojob->destination_s3();
352
- else
353
- trigger_error(__('Curl extension needed for Amazon S3!','backwpup'),E_USER_ERROR);
354
- }
355
- if (in_array('RSC',$dests) and !empty($backwpup_dojob->job['rscUsername']) and !empty($backwpup_dojob->job['rscAPIKey']) and !empty($backwpup_dojob->job['rscContainer'])) {
356
- if (function_exists('curl_exec'))
357
- $backwpup_dojob->destination_rsc();
358
- else
359
- trigger_error(__('Curl extension needed for RackSpaceCloud!','backwpup'),E_USER_ERROR);
360
- }
361
- if (in_array('MSAZURE',$dests) and !empty($backwpup_dojob->job['msazureHost']) and !empty($backwpup_dojob->job['msazureAccName']) and !empty($backwpup_dojob->job['msazureKey']) and !empty($backwpup_dojob->job['msazureContainer'])) {
362
- if (function_exists('curl_exec'))
363
- $backwpup_dojob->destination_msazure();
364
- else
365
- trigger_error(__('Curl extension needed for Microsoft Azure!','backwpup'),E_USER_ERROR);
366
- }
367
- if (!empty($backwpup_dojob->job['backupdir'])) {
368
- $backwpup_dojob->destination_dir();
369
- }
370
- }
371
-
372
- foreach($backwpup_dojob->todo as $key => $value) {
373
- switch ($value) {
374
- case 'CHECK':
375
- $backwpup_dojob->check_db();
376
- break;
377
- case 'OPTIMIZE':
378
- $backwpup_dojob->optimize_db();
379
- break;
380
- }
381
- }
382
-
383
- $backwpup_dojob->job_end();
384
- //geneate new chache
385
- update_option('backwpup_backups_chache',backwpup_get_backup_files());
386
- return $backwpup_dojob->logdir.$backwpup_dojob->logfile;
387
- }
388
-
389
- //file size
390
- function backwpup_formatBytes($bytes, $precision = 2) {
391
- $units = array('B', 'KB', 'MB', 'GB', 'TB');
392
- $bytes = max($bytes, 0);
393
- $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
394
- $pow = min($pow, count($units) - 1);
395
- $bytes /= pow(1024, $pow);
396
- return round($bytes, $precision) . ' ' . $units[$pow];
397
- }
398
-
399
- //echo long backup type name
400
- function backwpup_backup_types($type='',$echo=false) {
401
- $typename='';
402
- if (!empty($type)) {
403
- $todo=explode('+',$type);
404
- foreach($todo as $key => $value) {
405
- switch($value) {
406
- case 'WPEXP':
407
- $typename.=__('WP XML Export','backwpup')."<br />";
408
- break;
409
- case 'DB':
410
- $typename.=__('Database Backup','backwpup')."<br />";
411
- break;
412
- case 'FILE':
413
- $typename.=__('File Backup','backwpup')."<br />";
414
- break;
415
- case 'OPTIMIZE':
416
- $typename.=__('Optimize Database Tables','backwpup')."<br />";
417
- break;
418
- case 'CHECK':
419
- $typename.=__('Check Database Tables','backwpup')."<br />";
420
- break;
421
- }
422
- }
423
- } else {
424
- $typename=array('WPEXP','DB','FILE','OPTIMIZE','CHECK');
425
- }
426
-
427
- if ($echo)
428
- echo $typename;
429
- else
430
- return $typename;
431
- }
432
-
433
- //read log file header
434
- function backwpup_read_logheader($logfile) {
435
- $headers=array("backwpup_version" => "version","backwpup_logtime" => "logtime","backwpup_errors" => "errors","backwpup_warnings" => "warnings","backwpup_jobid" => "jobid","backwpup_jobname" => "name","backwpup_jobtype" => "type","backwpup_jobruntime" => "runtime","backwpup_backupfilesize" => "backupfilesize");
436
- if (!is_readable($logfile))
437
- return false;
438
- //Read file
439
- if (strtolower(substr($logfile,-3))==".gz") {
440
- $fp = gzopen( $logfile, 'r' );
441
- $file_data = gzread( $fp, 1536 ); // Pull only the first 1,5kiB of the file in.
442
- gzclose( $fp );
443
- } else {
444
- $fp = fopen( $logfile, 'r' );
445
- $file_data = fread( $fp, 1536 ); // Pull only the first 1,5kiB of the file in.
446
- fclose( $fp );
447
- }
448
-
449
- //get data form file
450
- foreach ($headers as $keyword => $field) {
451
- preg_match('/(<meta name="'.$keyword.'" content="(.*)" \/>)/i',$file_data,$content);
452
- if (!empty($content))
453
- $joddata[$field]=$content[2];
454
- else
455
- $joddata[$field]='';
456
- }
457
-
458
- if (empty($joddata['logtime']))
459
- $joddata['logtime']=filectime($logfile);
460
-
461
- return $joddata;
462
- }
463
-
464
-
465
- //Dashboard widget
466
- function backwpup_dashboard_output() {
467
- global $wpdb;
468
- if (!current_user_can(BACKWPUP_USER_CAPABILITY))
469
- return;
470
- $cfg=get_option('backwpup');
471
- echo '<strong>'.__('Logs:','backwpup').'</strong><br />';
472
- //get log files
473
- $logfiles=array();
474
- if ( $dir = @opendir( $cfg['dirlogs'] ) ) {
475
- while (($file = readdir( $dir ) ) !== false ) {
476
- if (is_file($cfg['dirlogs'].'/'.$file) and 'backwpup_log_' == substr($file,0,strlen('backwpup_log_')) and ('.html' == substr($file,-5) or '.html.gz' == substr($file,-8)))
477
- $logfiles[]=$file;
478
- }
479
- closedir( $dir );
480
- rsort($logfiles);
481
- }
482
-
483
- if (is_array($logfiles)) {
484
- $count=0;
485
- foreach ($logfiles as $logfile) {
486
- $logdata=backwpup_read_logheader($cfg['dirlogs'].'/'.$logfile);
487
- echo '<a href="'.wp_nonce_url('admin.php?page=BackWPup&subpage=view_log&logfile='.$cfg['dirlogs'].'/'.$logfile, 'view-log_'.$logfile).'" title="'.__('View Log','backwpup').'">'.date_i18n(get_option('date_format'),$logdata['logtime']).' '.date_i18n(get_option('time_format'),$logdata['logtime']).': <i>';
488
- if (empty($logdata['name']))
489
- echo $logdata['type'];
490
- else
491
- echo $logdata['name'];
492
- echo '</i>';
493
- if($logdata['errors']>0 or $logdata['warnings']>0) {
494
- if ($logdata['errors']>0)
495
- echo ' <span style="color:red;">'.$logdata['errors'].' '.__('ERROR(S)','backwpup').'</span>';
496
- if ($logdata['warnings']>0)
497
- echo ' <span style="color:yellow;">'.$logdata['warnings'].' '.__('WARNING(S)','backwpup').'</span>';
498
- } else {
499
- echo ' <span style="color:green;">'.__('OK','backwpup').'</span>';
500
- }
501
- echo '</a><br />';
502
- $count++;
503
- if ($count>=5)
504
- break;
505
- }
506
- } else {
507
- echo '<i>'.__('none','backwpup').'</i><br />';
508
- }
509
- $jobs=(array)get_option('backwpup_jobs');
510
- echo '<strong>'.__('Scheduled Jobs:','backwpup').'</strong><br />';
511
- foreach ($jobs as $jobid => $jobvalue) {
512
- if ($jobvalue['activated']) {
513
- echo '<a href="'.wp_nonce_url('admin.php?page=BackWPup&action=edit&jobid='.$jobid, 'edit-job').'" title="'.__('Edit Job','backwpup').'">';
514
- if ($jobvalue['starttime']>0 and empty($jobvalue['stoptime'])) {
515
- $runtime=current_time('timestamp')-$jobvalue['starttime'];
516
- echo __('Running since:','backwpup').' '.$runtime.' '.__('sec.','backwpup');
517
- } elseif ($jobvalue['activated']) {
518
- echo date(get_option('date_format'),$jobvalue['cronnextrun']).' '.date(get_option('time_format'),$jobvalue['cronnextrun']);
519
- }
520
- echo ': <span>'.$jobvalue['name'].'</span></a><br />';
521
- }
522
- }
523
- if (empty($jobs))
524
- echo '<i>'.__('none','backwpup').'</i><br />';
525
-
526
- }
527
-
528
- //add dashboard widget
529
- function backwpup_add_dashboard() {
530
- if (!current_user_can(BACKWPUP_USER_CAPABILITY))
531
- return;
532
- wp_add_dashboard_widget( 'backwpup_dashboard_widget', 'BackWPup', 'backwpup_dashboard_output' );
533
- }
534
-
535
- //turn cache off
536
- function backwpup_meta_no_cache() {
537
- echo "<meta http-equiv=\"expires\" content=\"0\" />\n";
538
- echo "<meta http-equiv=\"pragma\" content=\"no-cache\" />\n";
539
- echo "<meta http-equiv=\"cache-control\" content=\"no-cache\" />\n";
540
- }
541
-
542
- function backwpup_send_no_cache_header() {
543
- header("Expires: 0");
544
- header("Cache-Control: no-cache, must-revalidate");
545
- header("Pragma: no-cache");
546
- header("Cache-Control: post-check=0, pre-check=0");
547
- }
548
-
549
- function backwpup_get_upload_dir() {
550
- global $switched;
551
- $upload_path = get_option( 'upload_path' );
552
- $upload_path = trim($upload_path);
553
- $main_override = defined( 'MULTISITE' ) && is_main_site();
554
- if ( empty($upload_path) ) {
555
- $dir = WP_CONTENT_DIR . '/uploads';
556
- } else {
557
- $dir = $upload_path;
558
- if ( 'wp-content/uploads' == $upload_path ) {
559
- $dir = WP_CONTENT_DIR . '/uploads';
560
- } elseif ( 0 !== strpos($dir, ABSPATH) ) {
561
- // $dir is absolute, $upload_path is (maybe) relative to ABSPATH
562
- $dir = path_join( ABSPATH, $dir );
563
- }
564
- }
565
- if ( defined('UPLOADS') && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
566
- $dir = ABSPATH . UPLOADS;
567
- }
568
- if (function_exists('is_multisite')) {
569
- if ( is_multisite() && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
570
- if ( defined( 'BLOGUPLOADDIR' ) )
571
- $dir = untrailingslashit(BLOGUPLOADDIR);
572
- }
573
- }
574
-
575
- return str_replace('\\','/',trailingslashit($dir));
576
- }
577
-
578
- function backwpup_get_exclude_wp_dirs($folder) {
579
- $folder=trailingslashit(str_replace('\\','/',$folder));
580
- $excludedir=array();
581
- if (false !== stripos(trailingslashit(str_replace('\\','/',ABSPATH)),$folder) and trailingslashit(str_replace('\\','/',ABSPATH))!=$folder)
582
- $excludedir[]=trailingslashit(str_replace('\\','/',ABSPATH));
583
- if (false !== stripos(trailingslashit(str_replace('\\','/',WP_CONTENT_DIR)),$folder) and trailingslashit(str_replace('\\','/',WP_CONTENT_DIR))!=$folder)
584
- $excludedir[]=trailingslashit(str_replace('\\','/',WP_CONTENT_DIR));
585
- if (false !== stripos(trailingslashit(str_replace('\\','/',WP_PLUGIN_DIR)),$folder) and trailingslashit(str_replace('\\','/',WP_PLUGIN_DIR))!=$folder)
586
- $excludedir[]=trailingslashit(str_replace('\\','/',WP_PLUGIN_DIR));
587
- if (false !== stripos(str_replace('\\','/',trailingslashit(WP_CONTENT_DIR).'themes/'),$folder) and str_replace('\\','/',trailingslashit(WP_CONTENT_DIR).'themes/')!=$folder)
588
- $excludedir[]=str_replace('\\','/',trailingslashit(WP_CONTENT_DIR).'themes/');
589
- if (false !== stripos(backwpup_get_upload_dir(),$folder) and backwpup_get_upload_dir()!=$folder)
590
- $excludedir[]=backwpup_get_upload_dir();
591
- //Exclude Backup dirs
592
- $jobs=(array)get_option('backwpup_jobs');
593
- foreach($jobs as $jobsvale) {
594
- if (!empty($jobsvale['backupdir']) and $jobsvale['backupdir']!='/')
595
- $excludedir[]=trailingslashit(str_replace('\\','/',$jobsvale['backupdir']));
596
- }
597
- return $excludedir;
598
- }
599
-
600
-
601
- function backwpup_calc_db_size($jobvalues) {
602
- global $wpdb;
603
- $dbsize=array('size'=>0,'num'=>0,'rows'=>0);
604
- $status=$wpdb->get_results("SHOW TABLE STATUS FROM `".DB_NAME."`;", ARRAY_A);
605
- foreach($status as $tablekey => $tablevalue) {
606
- if (!in_array($tablevalue['Name'],$jobvalues['dbexclude'])) {
607
- $dbsize['size']=$dbsize['size']+$tablevalue["Data_length"]+$tablevalue["Index_length"];
608
- $dbsize['num']++;
609
- $dbsize['rows']=$dbsize['rows']+$tablevalue["Rows"];
610
- }
611
- }
612
- return $dbsize;
613
- }
614
-
615
-
616
- function _backwpup_calc_file_size_file_list_folder( $folder = '', $levels = 100, $excludes=array(),$excludedirs=array()) {
617
- global $backwpup_temp_files;
618
- if ( !empty($folder) and $levels and $dir = @opendir( $folder )) {
619
- while (($file = readdir( $dir ) ) !== false ) {
620
- if ( in_array($file, array('.', '..','.svn') ) )
621
- continue;
622
- foreach ($excludes as $exclusion) { //exclude dirs and files
623
- if (false !== stripos($folder.$file,$exclusion) and !empty($exclusion) and $exclusion!='/')
624
- continue 2;
625
- }
626
- if ( @is_dir( $folder.$file )) {
627
- if (!in_array(trailingslashit($folder.$file),$excludedirs))
628
- _backwpup_calc_file_size_file_list_folder( trailingslashit($folder.$file), $levels - 1, $excludes);
629
- } elseif ((@is_file( $folder.$file ) or @is_executable($folder.$file)) and @is_readable($folder.$file)) {
630
- $backwpup_temp_files['num']++;
631
- $backwpup_temp_files['size']=$backwpup_temp_files['size']+filesize($folder.$file);
632
- }
633
- }
634
- @closedir( $dir );
635
- }
636
- return $files;
637
- }
638
-
639
- function backwpup_calc_file_size($jobvalues) {
640
- global $backwpup_temp_files;
641
- $backwpup_temp_files=array('size'=>0,'num'=>0);
642
- //Exclude Temp Files
643
- $backwpup_exclude=explode(',',trim($jobvalues['fileexclude']));
644
- $backwpup_exclude=array_unique($backwpup_exclude);
645
-
646
- //File list for blog folders
647
- if ($jobvalues['backuproot'])
648
- _backwpup_calc_file_size_file_list_folder(trailingslashit(ABSPATH),100,$backwpup_exclude,array_merge($jobvalues['backuprootexcludedirs'],backwpup_get_exclude_wp_dirs(ABSPATH)));
649
- if ($jobvalues['backupcontent'])
650
- _backwpup_calc_file_size_file_list_folder(trailingslashit(WP_CONTENT_DIR),100,$backwpup_exclude,array_merge($jobvalues['backupcontentexcludedirs'],backwpup_get_exclude_wp_dirs(WP_CONTENT_DIR)));
651
- if ($jobvalues['backupplugins'])
652
- _backwpup_calc_file_size_file_list_folder(trailingslashit(WP_PLUGIN_DIR),100,$backwpup_exclude,array_merge($jobvalues['backuppluginsexcludedirs'],backwpup_get_exclude_wp_dirs(WP_PLUGIN_DIR)));
653
- if ($jobvalues['backupthemes'])
654
- _backwpup_calc_file_size_file_list_folder(trailingslashit(trailingslashit(WP_CONTENT_DIR).'themes'),100,$backwpup_exclude,array_merge($jobvalues['backupthemesexcludedirs'],backwpup_get_exclude_wp_dirs(trailingslashit(WP_CONTENT_DIR).'themes')));
655
- if ($jobvalues['backupuploads'])
656
- _backwpup_calc_file_size_file_list_folder(trailingslashit(backwpup_get_upload_dir()),100,$backwpup_exclude,array_merge($jobvalues['backupuploadsexcludedirs'],backwpup_get_exclude_wp_dirs(backwpup_get_upload_dir())));
657
-
658
- //include dirs
659
- if (!empty($jobvalues['dirinclude'])) {
660
- $dirinclude=explode(',',$jobvalues['dirinclude']);
661
- $dirinclude=array_unique($dirinclude);
662
- //Crate file list for includes
663
- foreach($dirinclude as $dirincludevalue) {
664
- if (is_dir($dirincludevalue))
665
- _backwpup_calc_file_size_file_list_folder(trailingslashit($dirincludevalue),100,$backwpup_exclude);
666
- }
667
- }
668
-
669
- return $backwpup_temp_files;
670
-
671
- }
672
-
673
- //Calcs next run for a cron string as timestamp
674
- function backwpup_cron_next($cronstring) {
675
- //Cronstring zerlegen
676
- list($cronstr['minutes'],$cronstr['hours'],$cronstr['mday'],$cronstr['mon'],$cronstr['wday'])=explode(' ',$cronstring,5);
677
-
678
- //make arrys form string
679
- foreach ($cronstr as $key => $value) {
680
- if (strstr($value,','))
681
- $cronarray[$key]=explode(',',$value);
682
- else
683
- $cronarray[$key]=array(0=>$value);
684
- }
685
- //make arrys complete with ranges and steps
686
- foreach ($cronarray as $cronarraykey => $cronarrayvalue) {
687
- $cron[$cronarraykey]=array();
688
- foreach ($cronarrayvalue as $key => $value) {
689
- //steps
690
- $step=1;
691
- if (strstr($value,'/'))
692
- list($value,$step)=explode('/',$value,2);
693
- //replase weekeday 7 with 0 for sundays
694
- if ($cronarraykey=='wday')
695
- $value=str_replace('7','0',$value);
696
- //ranges
697
- if (strstr($value,'-')) {
698
- list($first,$last)=explode('-',$value,2);
699
- if (!is_numeric($first) or !is_numeric($last) or $last>60 or $first>60) //check
700
- return 2147483647;
701
- if ($cronarraykey=='minutes' and $step<5) //set step ninmum to 5 min.
702
- $step=5;
703
- $range=array();
704
- for ($i=$first;$i<=$last;$i=$i+$step)
705
- $range[]=$i;
706
- $cron[$cronarraykey]=array_merge($cron[$cronarraykey],$range);
707
- } elseif ($value=='*') {
708
- $range=array();
709
- if ($cronarraykey=='minutes') {
710
- if ($step<5) //set step ninmum to 5 min.
711
- $step=5;
712
- for ($i=0;$i<=59;$i=$i+$step)
713
- $range[]=$i;
714
- }
715
- if ($cronarraykey=='hours') {
716
- for ($i=0;$i<=23;$i=$i+$step)
717
- $range[]=$i;
718
- }
719
- if ($cronarraykey=='mday') {
720
- for ($i=$step;$i<=31;$i=$i+$step)
721
- $range[]=$i;
722
- }
723
- if ($cronarraykey=='mon') {
724
- for ($i=$step;$i<=12;$i=$i+$step)
725
- $range[]=$i;
726
- }
727
- if ($cronarraykey=='wday') {
728
- for ($i=0;$i<=6;$i=$i+$step)
729
- $range[]=$i;
730
- }
731
- $cron[$cronarraykey]=array_merge($cron[$cronarraykey],$range);
732
- } else {
733
- //Month names
734
- if (strtolower($value)=='jan')
735
- $value=1;
736
- if (strtolower($value)=='feb')
737
- $value=2;
738
- if (strtolower($value)=='mar')
739
- $value=3;
740
- if (strtolower($value)=='apr')
741
- $value=4;
742
- if (strtolower($value)=='may')
743
- $value=5;
744
- if (strtolower($value)=='jun')
745
- $value=6;
746
- if (strtolower($value)=='jul')
747
- $value=7;
748
- if (strtolower($value)=='aug')
749
- $value=8;
750
- if (strtolower($value)=='sep')
751
- $value=9;
752
- if (strtolower($value)=='oct')
753
- $value=10;
754
- if (strtolower($value)=='nov')
755
- $value=11;
756
- if (strtolower($value)=='dec')
757
- $value=12;
758
- //Week Day names
759
- if (strtolower($value)=='sun')
760
- $value=0;
761
- if (strtolower($value)=='sat')
762
- $value=6;
763
- if (strtolower($value)=='mon')
764
- $value=1;
765
- if (strtolower($value)=='tue')
766
- $value=2;
767
- if (strtolower($value)=='wed')
768
- $value=3;
769
- if (strtolower($value)=='thu')
770
- $value=4;
771
- if (strtolower($value)=='fri')
772
- $value=5;
773
- if (!is_numeric($value) or $value>60) //check
774
- return 2147483647;
775
- $cron[$cronarraykey]=array_merge($cron[$cronarraykey],array(0=>$value));
776
- }
777
- }
778
- }
779
- //generate next 10 years
780
- for ($i=date('Y');$i<2038;$i++)
781
- $cron['year'][]=$i;
782
-
783
- //calc next timestamp
784
- $currenttime=current_time('timestamp');
785
- foreach ($cron['year'] as $year) {
786
- foreach ($cron['mon'] as $mon) {
787
- foreach ($cron['mday'] as $mday) {
788
- foreach ($cron['hours'] as $hours) {
789
- foreach ($cron['minutes'] as $minutes) {
790
- $timestamp=mktime($hours,$minutes,0,$mon,$mday,$year);
791
- if ($timestamp and in_array(date('j',$timestamp),$cron['mday']) and in_array(date('w',$timestamp),$cron['wday']) and $timestamp>$currenttime) {
792
- return $timestamp;
793
- }
794
- }
795
- }
796
- }
797
- }
798
- }
799
- return 2147483647;
800
- }
801
-
802
- function backwpup_env_checks() {
803
- global $wp_version,$backwpup_admin_message;
804
- $message='';
805
- $checks=true;
806
- $cfg=get_option('backwpup');
807
- if (version_compare($wp_version, '3.1', '<')) { // check WP Version
808
- $message.=__('- WordPress 3.1 or heiger needed!','backwpup') . '<br />';
809
- $checks=false;
810
- }
811
- if (version_compare(phpversion(), '5.2.0', '<')) { // check PHP Version
812
- $message.=__('- PHP 5.2.0 or higher needed!','backwpup') . '<br />';
813
- $checks=false;
814
- }
815
- if (!is_dir($cfg['dirlogs'])) { // create logs folder if it not exists
816
- @mkdir($cfg['dirlogs'],0755,true);
817
- }
818
- if (!is_dir($cfg['dirlogs'])) { // check logs folder
819
- $message.=__('- Logs Folder not exists:','backwpup') . ' '.$cfg['dirlogs'].'<br />';
820
- }
821
- if (!is_writable($cfg['dirlogs'])) { // check logs folder
822
- $message.=__('- Logs Folder not writeable:','backwpup') . ' '.$cfg['dirlogs'].'<br />';
823
- }
824
- if (!is_dir($cfg['dirtemp'])) { // create Temp folder if it not exists
825
- @mkdir($cfg['dirtemp'],0755,true);
826
- }
827
- if (!is_dir($cfg['dirtemp'])) { // check Temp folder
828
- $message.=__('- Temp Folder not exists:','backwpup') . ' '.$cfg['dirtemp'].'<br />';
829
- }
830
- if (!is_writable($cfg['dirtemp'])) { // check Temp folder
831
- $message.=__('- Temp Folder not writeable:','backwpup') . ' '.$cfg['dirtemp'].'<br />';
832
- }
833
- $jobs=(array)get_option('backwpup_jobs');
834
- foreach ($jobs as $jobid => $jobvalue) { //check for old cheduling
835
- if (isset($jobvalue['scheduletime']) and empty($jobvalue['cron']))
836
- $message.=__('- Please Check Scheduling time for Job:','backwpup') . ' '.$jobid.'. '.$jobvalue['name'].'<br />';
837
- }
838
- if (wp_next_scheduled('backwpup_cron')!=0 and wp_next_scheduled('backwpup_cron')>(time()+360)) { //check cron jobs work
839
- $message.=__("- WP-Cron don't working please check it!","backwpup") .'<br />';
840
- }
841
- //put massage if one
842
- if (!empty($message))
843
- $backwpup_admin_message = '<div id="message" class="error fade"><strong>BackWPup:</strong><br />'.$message.'</div>';
844
- return $checks;
845
- }
846
-
847
- function backwpup_admin_notice() {
848
- global $backwpup_admin_message;
849
- echo $backwpup_admin_message;
850
- }
851
-
852
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/php5-functions.php DELETED
@@ -1,786 +0,0 @@
1
- <?PHP
2
- // don't load directly
3
- if ( !defined('ABSPATH') )
4
- die('-1');
5
-
6
- //Checking,upgrade and default job setting
7
- function backwpup_check_job_vars($jobsettings,$jobid='') {
8
- global $wpdb;
9
- //check job type
10
- if (!isset($jobsettings['type']) or !is_string($jobsettings['type']))
11
- $jobsettings['type']='DB+FILE';
12
- $todo=explode('+',strtoupper($jobsettings['type']));
13
- foreach($todo as $key => $value) {
14
- if (!in_array($value,backwpup_backup_types()))
15
- unset($todo[$key]);
16
- }
17
- $jobsettings['type']=implode('+',$todo);
18
- if (empty($jobsettings['type']))
19
- $jobsettings['type']='DB+FILE';
20
-
21
- if (empty($jobsettings['name']) or !is_string($jobsettings['name']))
22
- $jobsettings['name']= __('New');
23
-
24
- if (!isset($jobsettings['activated']) or !is_bool($jobsettings['activated']))
25
- $jobsettings['activated']=false;
26
-
27
- //upgrade old schedule
28
- if (!isset($jobsettings['cron']) and isset($jobsettings['scheduletime']) and isset($jobsettings['scheduleintervaltype']) and isset($jobsettings['scheduleintervalteimes'])) { //Upgrade to cron string
29
- if ($jobsettings['scheduleintervaltype']==60) { //Min
30
- $jobsettings['cron']='*/'.$jobsettings['scheduleintervalteimes'].' * * * *';
31
- }
32
- if ($jobsettings['scheduleintervaltype']==3600) { //Houer
33
- $jobsettings['cron']=(date('i',$jobsettings['scheduletime'])*1).' */'.$jobsettings['scheduleintervalteimes'].' * * *';
34
- }
35
- if ($jobsettings['scheduleintervaltype']==86400) { //Days
36
- $jobsettings['cron']=(date('i',$jobsettings['scheduletime'])*1).' '.date('G',$jobsettings['scheduletime']).' */'.$jobsettings['scheduleintervalteimes'].' * *';
37
- }
38
- }
39
-
40
- if (!isset($jobsettings['cron']) or !is_string($jobsettings['cron']))
41
- $jobsettings['cron']='0 3 * * *';
42
-
43
- if (!isset($jobsettings['cronnextrun']) or !is_numeric($jobsettings['cronnextrun']))
44
- $jobsettings['cronnextrun']=backwpup_cron_next($jobs[$jobid]['cron']);;
45
-
46
- if (!is_string($jobsettings['mailaddresslog']) or false === $pos=strpos($jobsettings['mailaddresslog'],'@') or false === strpos($jobsettings['mailaddresslog'],'.',$pos))
47
- $jobsettings['mailaddresslog']=get_option('admin_email');
48
-
49
- if (!isset($jobsettings['mailerroronly']) or !is_bool($jobsettings['mailerroronly']))
50
- $jobsettings['mailerroronly']=true;
51
-
52
- if (!isset($jobsettings['dbexclude']) or !is_array($jobsettings['dbexclude'])) {
53
- $jobsettings['dbexclude']=array();
54
- $tables=$wpdb->get_col('SHOW TABLES FROM `'.DB_NAME.'`');
55
- foreach ($tables as $table) {
56
- if (substr($table,0,strlen($wpdb->prefix))!=$wpdb->prefix)
57
- $jobsettings['dbexclude'][]=$table;
58
- }
59
- }
60
- $tables=$wpdb->get_col('SHOW TABLES FROM `'.DB_NAME.'`');
61
- foreach($jobsettings['dbexclude'] as $key => $value) {
62
- if (empty($jobsettings['dbexclude'][$key]) or !in_array($value,$tables))
63
- unset($jobsettings['dbexclude'][$key]);
64
- }
65
- sort($jobsettings['dbexclude']);
66
-
67
- if (!isset($jobsettings['dbshortinsert']) or !is_bool($jobsettings['dbshortinsert']))
68
- $jobsettings['dbshortinsert']=false;
69
-
70
- if (!isset($jobsettings['maintenance']) or !is_bool($jobsettings['maintenance']))
71
- $jobsettings['maintenance']=false;
72
-
73
- if (!isset($jobsettings['fileexclude']) or !is_string($jobsettings['fileexclude']))
74
- $jobsettings['fileexclude']='';
75
- $fileexclude=explode(',',$jobsettings['fileexclude']);
76
- foreach($fileexclude as $key => $value) {
77
- $fileexclude[$key]=str_replace('//','/',str_replace('\\','/',trim($value)));
78
- if (empty($fileexclude[$key]))
79
- unset($fileexclude[$key]);
80
- }
81
- sort($fileexclude);
82
- $jobsettings['fileexclude']=implode(',',$fileexclude);
83
-
84
- if (!isset($jobsettings['dirinclude']) or !is_string($jobsettings['dirinclude']))
85
- $jobsettings['dirinclude']='';
86
- $dirinclude=explode(',',$jobsettings['dirinclude']);
87
- foreach($dirinclude as $key => $value) {
88
- $dirinclude[$key]=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($value))));
89
- if ($dirinclude[$key]=='/' or empty($dirinclude[$key]) or !is_dir($dirinclude[$key]))
90
- unset($dirinclude[$key]);
91
- }
92
- sort($dirinclude);
93
- $jobsettings['dirinclude']=implode(',',$dirinclude);
94
-
95
- if (!isset($jobsettings['backuproot']) or !is_bool($jobsettings['backuproot']))
96
- $jobsettings['backuproot']=true;
97
-
98
- if (!isset($jobsettings['backupcontent']) or !is_bool($jobsettings['backupcontent']))
99
- $jobsettings['backupcontent']=true;
100
-
101
- if (!isset($jobsettings['backupplugins']) or !is_bool($jobsettings['backupplugins']))
102
- $jobsettings['backupplugins']=true;
103
-
104
- if (!isset($jobsettings['backupthemes']) or !is_bool($jobsettings['backupthemes']))
105
- $jobsettings['backupthemes']=true;
106
-
107
- if (!isset($jobsettings['backupuploads']) or !is_bool($jobsettings['backupuploads']))
108
- $jobsettings['backupuploads']=true;
109
-
110
- if (!isset($jobsettings['backuprootexcludedirs']) or !is_array($jobsettings['backuprootexcludedirs']))
111
- $jobsettings['backuprootexcludedirs']=array();
112
- foreach($jobsettings['backuprootexcludedirs'] as $key => $value) {
113
- $jobsettings['backuprootexcludedirs'][$key]=str_replace('//','/',str_replace('\\','/',trim($value)));
114
- if (empty($jobsettings['backuprootexcludedirs'][$key]) or $jobsettings['backuprootexcludedirs'][$key]=='/' or !is_dir($jobsettings['backuprootexcludedirs'][$key]))
115
- unset($jobsettings['backuprootexcludedirs'][$key]);
116
- }
117
- sort($jobsettings['backuprootexcludedirs']);
118
-
119
- if (!isset($jobsettings['backupcontentexcludedirs']) or !is_array($jobsettings['backupcontentexcludedirs']))
120
- $jobsettings['backupcontentexcludedirs']=array();
121
- foreach($jobsettings['backupcontentexcludedirs'] as $key => $value) {
122
- $jobsettings['backupcontentexcludedirs'][$key]=str_replace('//','/',str_replace('\\','/',trim($value)));
123
- if (empty($jobsettings['backupcontentexcludedirs'][$key]) or $jobsettings['backupcontentexcludedirs'][$key]=='/' or !is_dir($jobsettings['backupcontentexcludedirs'][$key]))
124
- unset($jobsettings['backupcontentexcludedirs'][$key]);
125
- }
126
- sort($jobsettings['backupcontentexcludedirs']);
127
-
128
- if (!isset($jobsettings['backuppluginsexcludedirs']) or !is_array($jobsettings['backuppluginsexcludedirs']))
129
- $jobsettings['backuppluginsexcludedirs']=array();
130
- foreach($jobsettings['backuppluginsexcludedirs'] as $key => $value) {
131
- $jobsettings['backuppluginsexcludedirs'][$key]=str_replace('//','/',str_replace('\\','/',trim($value)));
132
- if (empty($jobsettings['backuppluginsexcludedirs'][$key]) or $jobsettings['backuppluginsexcludedirs'][$key]=='/' or !is_dir($jobsettings['backuppluginsexcludedirs'][$key]))
133
- unset($jobsettings['backuppluginsexcludedirs'][$key]);
134
- }
135
- sort($jobsettings['backuppluginsexcludedirs']);
136
-
137
- if (!isset($jobsettings['backupthemesexcludedirs']) or !is_array($jobsettings['backupthemesexcludedirs']))
138
- $jobsettings['backupthemesexcludedirs']=array();
139
- foreach($jobsettings['backupthemesexcludedirs'] as $key => $value) {
140
- $jobsettings['backupthemesexcludedirs'][$key]=str_replace('//','/',str_replace('\\','/',trim($value)));
141
- if (empty($jobsettings['backupthemesexcludedirs'][$key]) or $jobsettings['backupthemesexcludedirs'][$key]=='/' or !is_dir($jobsettings['backupthemesexcludedirs'][$key]))
142
- unset($jobsettings['backupthemesexcludedirs'][$key]);
143
- }
144
- sort($jobsettings['backupthemesexcludedirs']);
145
-
146
- if (!isset($jobsettings['backupuploadsexcludedirs']) or !is_array($jobsettings['backupuploadsexcludedirs']))
147
- $jobsettings['backupuploadsexcludedirs']=array();
148
- foreach($jobsettings['backupuploadsexcludedirs'] as $key => $value) {
149
- $jobsettings['backupuploadsexcludedirs'][$key]=str_replace('//','/',str_replace('\\','/',trim($value)));
150
- if (empty($jobsettings['backupuploadsexcludedirs'][$key]) or $jobsettings['backupuploadsexcludedirs'][$key]=='/' or !is_dir($jobsettings['backupuploadsexcludedirs'][$key]))
151
- unset($jobsettings['backupuploadsexcludedirs'][$key]);
152
- }
153
- sort($jobsettings['backupuploadsexcludedirs']);
154
-
155
- $fileformarts=array('.zip','.tar.gz','.tar.bz2','.tar');
156
- if (!isset($jobsettings['fileformart']) or !in_array($jobsettings['fileformart'],$fileformarts))
157
- $jobsettings['fileformart']='.zip';
158
-
159
- if (!isset($jobsettings['fileprefix']) or !is_string($jobsettings['fileprefix']))
160
- $jobsettings['fileprefix']='backwpup_'.$jobid.'_';
161
-
162
- if (!isset($jobsettings['mailefilesize']) or !is_float($jobsettings['mailefilesize']))
163
- $jobsettings['mailefilesize']=0;
164
-
165
- if (!isset($jobsettings['backupdir']) or (!is_dir($jobsettings['backupdir']) and !empty($jobsettings['backupdir']))) {
166
- $rand = substr( md5( md5( SECURE_AUTH_KEY ) ), -5 );
167
- $jobsettings['backupdir']=str_replace('\\','/',trailingslashit(WP_CONTENT_DIR)).'backwpup-'.$rand.'/';
168
- }
169
- $jobsettings['backupdir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['backupdir']))));
170
- if ($jobsettings['backupdir']=='/')
171
- $jobsettings['backupdir']='';
172
-
173
- if (!isset($jobsettings['maxbackups']) or !is_int($jobsettings['maxbackups']))
174
- $jobsettings['maxbackups']=0;
175
-
176
- if (!isset($jobsettings['ftphost']) or !is_string($jobsettings['ftphost']))
177
- $jobsettings['ftphost']='';
178
-
179
- if (!isset($jobsettings['ftpuser']) or !is_string($jobsettings['ftpuser']))
180
- $jobsettings['ftpuser']='';
181
-
182
- if (!isset($jobsettings['ftppass']) or !is_string($jobsettings['ftppass']))
183
- $jobsettings['ftppass']='';
184
-
185
- if (!isset($jobsettings['ftpdir']) or !is_string($jobsettings['ftpdir']) or $jobsettings['ftpdir']=='/')
186
- $jobsettings['ftpdir']='';
187
- $jobsettings['ftpdir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['ftpdir']))));
188
- if (substr($jobsettings['ftpdir'],0,1)!='/')
189
- $jobsettings['ftpdir']='/'.$jobsettings['ftpdir'];
190
-
191
- if (!isset($jobsettings['ftpmaxbackups']) or !is_int($jobsettings['ftpmaxbackups']))
192
- $jobsettings['ftpmaxbackups']=0;
193
-
194
- if (!isset($jobsettings['ftppasv']) or !is_bool($jobsettings['ftppasv']))
195
- $jobsettings['ftppasv']=true;
196
-
197
- if (!isset($jobsettings['ftpssl']) or !is_bool($jobsettings['ftpssl']))
198
- $jobsettings['ftpssl']=false;
199
-
200
- if (!isset($jobsettings['awsAccessKey']) or !is_string($jobsettings['awsAccessKey']))
201
- $jobsettings['awsAccessKey']='';
202
-
203
- if (!isset($jobsettings['awsSecretKey']) or !is_string($jobsettings['awsSecretKey']))
204
- $jobsettings['awsSecretKey']='';
205
-
206
- if (!isset($jobsettings['awsrrs']) or !is_bool($jobsettings['awsrrs']))
207
- $jobsettings['awsrrs']=false;
208
-
209
- if (!isset($jobsettings['awsBucket']) or !is_string($jobsettings['awsBucket']))
210
- $jobsettings['awsBucket']='';
211
-
212
- if (!isset($jobsettings['awsdir']) or !is_string($jobsettings['awsdir']) or $jobsettings['awsdir']=='/')
213
- $jobsettings['awsdir']='';
214
- $jobsettings['awsdir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['awsdir']))));
215
- if (substr($jobsettings['awsdir'],0,1)=='/')
216
- $jobsettings['awsdir']=substr($jobsettings['awsdir'],1);
217
-
218
- if (!isset($jobsettings['awsmaxbackups']) or !is_int($jobsettings['awsmaxbackups']))
219
- $jobsettings['awsmaxbackups']=0;
220
-
221
- if (!isset($jobsettings['msazureHost']) or !is_string($jobsettings['msazureHost']))
222
- $jobsettings['msazureHost']='blob.core.windows.net';
223
-
224
- if (!isset($jobsettings['msazureAccName']) or !is_string($jobsettings['msazureAccName']))
225
- $jobsettings['msazureAccName']='';
226
-
227
- if (!isset($jobsettings['msazureKey']) or !is_string($jobsettings['msazureKey']))
228
- $jobsettings['msazureKey']='';
229
-
230
- if (!isset($jobsettings['msazureContainer']) or !is_string($jobsettings['msazureContainer']))
231
- $jobsettings['msazureContainer']='';
232
-
233
- if (!isset($jobsettings['msazuredir']) or !is_string($jobsettings['msazuredir']) or $jobsettings['msazuredir']=='/')
234
- $jobsettings['msazuredir']='';
235
- $jobsettings['msazuredir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['msazuredir']))));
236
- if (substr($jobsettings['msazuredir'],0,1)=='/')
237
- $jobsettings['msazuredir']=substr($jobsettings['msazuredir'],1);
238
-
239
- if (!isset($jobsettings['msazuremaxbackups']) or !is_int($jobsettings['msazuremaxbackups']))
240
- $jobsettings['msazuremaxbackups']=0;
241
-
242
- if (!isset($jobsettings['rscUsername']) or !is_string($jobsettings['rscUsername']))
243
- $jobsettings['rscUsername']='';
244
-
245
- if (!isset($jobsettings['rscAPIKey']) or !is_string($jobsettings['rscAPIKey']))
246
- $jobsettings['rscAPIKey']='';
247
-
248
- if (!isset($jobsettings['rscContainer']) or !is_string($jobsettings['rscContainer']))
249
- $jobsettings['rscContainer']='';
250
-
251
- if (!isset($jobsettings['rscdir']) or !is_string($jobsettings['rscdir']) or $jobsettings['rscdir']=='/')
252
- $jobsettings['rscdir']='';
253
- $jobsettings['rscdir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['rscdir']))));
254
- if (substr($jobsettings['rscdir'],0,1)=='/')
255
- $jobsettings['rscdir']=substr($jobsettings['rscdir'],1);
256
-
257
- if (!isset($jobsettings['rscmaxbackups']) or !is_int($jobsettings['rscmaxbackups']))
258
- $jobsettings['rscmaxbackups']=0;
259
-
260
- if (isset($jobsettings['dropemail']))
261
- unset($jobsettings['dropemail']);
262
-
263
- if (isset($jobsettings['dropepass']))
264
- unset($jobsettings['dropepass']);
265
-
266
- if (!isset($jobsettings['dropetoken']) or !is_string($jobsettings['dropetoken']))
267
- $jobsettings['dropetoken']='';
268
-
269
- if (!isset($jobsettings['dropesecret']) or !is_string($jobsettings['dropesecret']))
270
- $jobsettings['dropesecret']='';
271
-
272
- if (!isset($jobsettings['dropedir']) or !is_string($jobsettings['dropedir']) or $jobsettings['dropedir']=='/')
273
- $jobsettings['dropedir']='';
274
- $jobsettings['dropedir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['dropedir']))));
275
- if (substr($jobsettings['dropedir'],0,1)=='/')
276
- $jobsettings['dropedir']=substr($jobsettings['dropedir'],1);
277
-
278
- if (!isset($jobsettings['dropemaxbackups']) or !is_int($jobsettings['dropemaxbackups']))
279
- $jobsettings['dropemaxbackups']=0;
280
-
281
- if (!isset($jobsettings['sugaruser']) or !is_string($jobsettings['sugaruser']))
282
- $jobsettings['sugaruser']='';
283
-
284
- if (!isset($jobsettings['sugarpass']) or !is_string($jobsettings['sugarpass']))
285
- $jobsettings['sugarpass']='';
286
-
287
- if (!isset($jobsettings['sugarroot']) or !is_string($jobsettings['sugarroot']))
288
- $jobsettings['sugarroot']='';
289
-
290
- if (!isset($jobsettings['sugardir']) or !is_string($jobsettings['sugardir']) or $jobsettings['sugardir']=='/')
291
- $jobsettings['sugardir']='';
292
- $jobsettings['sugardir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['sugardir']))));
293
- if (substr($jobsettings['sugardir'],0,1)=='/')
294
- $jobsettings['sugardir']=substr($jobsettings['sugardir'],1);
295
-
296
- if (!isset($jobsettings['sugarmaxbackups']) or !is_int($jobsettings['sugarmaxbackups']))
297
- $jobsettings['sugarmaxbackups']=0;
298
-
299
-
300
-
301
- if (!is_string($jobsettings['mailaddress']) or false === $pos=strpos($jobsettings['mailaddress'],'@') or false === strpos($jobsettings['mailaddress'],'.',$pos))
302
- $jobsettings['mailaddress']='';
303
-
304
- return $jobsettings;
305
- }
306
-
307
-
308
- //ajax/normal get backup files and infos
309
- function backwpup_get_backup_files($onlyjobid='') {
310
- $jobs=(array)get_option('backwpup_jobs'); //Load jobs
311
- $dests=explode(',',strtoupper(BACKWPUP_DESTS));
312
- $filecounter=0;
313
- $files=array();
314
- $donefolders=array();
315
- if (function_exists('curl_exec')) {
316
- set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__).'/libs');
317
- if (!class_exists('Microsoft_WindowsAzure_Storage_Blob'))
318
- require_once 'Microsoft/WindowsAzure/Storage/Blob.php';
319
- if (!class_exists('CFRuntime'))
320
- require_once(dirname(__FILE__).'/libs/aws/sdk.class.php');
321
- if (!class_exists('CF_Authentication'))
322
- require_once(dirname(__FILE__).'/libs/rackspace/cloudfiles.php');
323
- if (!class_exists('Dropbox') and function_exists('json_decode'))
324
- require_once(dirname(__FILE__).'/libs/dropbox/dropbox.php');
325
- if (!class_exists('SugarSync'))
326
- require_once (dirname(__FILE__).'/libs/sugarsync.php');
327
- }
328
-
329
- foreach ($jobs as $jobid => $jobvalue) { //go job by job
330
- if (!empty($onlyjobid) and $jobid!=$onlyjobid)
331
- continue;
332
- $jobvalue=backwpup_check_job_vars($jobvalue,$jobid); //Check job values
333
- $todo=explode('+',$jobvalue['type']); //only for backup jobs
334
- if (!in_array('FILE',$todo) and !in_array('DB',$todo) and !in_array('WPEXP',$todo))
335
- continue;
336
-
337
- //Get files/filinfo in backup folder
338
- if (!empty($jobvalue['backupdir']) and !in_array($jobvalue['backupdir'],$donefolders)) {
339
- if ( $dir = @opendir( $jobvalue['backupdir'] ) ) {
340
- while (($file = readdir( $dir ) ) !== false ) {
341
- if (substr($file,0,1)=='.' or !(strtolower(substr($file,-4))=='.zip' or strtolower(substr($file,-4))=='.tar' or strtolower(substr($file,-7))=='.tar.gz' or strtolower(substr($file,-8))=='.tar.bz2'))
342
- continue;
343
- if (is_file($jobvalue['backupdir'].$file)) {
344
- $files[$filecounter]['type']='FOLDER';
345
- $files[$filecounter]['jobid']=$jobid;
346
- $files[$filecounter]['file']=$jobvalue['backupdir'].$file;
347
- $files[$filecounter]['filename']=$file;
348
- $files[$filecounter]['downloadurl']='admin.php?page=BackWPup&subpage=backups&action=download&file='.$jobvalue['backupdir'].$file;
349
- $files[$filecounter]['filesize']=filesize($jobvalue['backupdir'].$file);
350
- $files[$filecounter]['time']=filemtime($jobvalue['backupdir'].$file);
351
- $filecounter++;
352
- }
353
- }
354
- closedir( $dir );
355
- $donefolders[]=$jobvalue['backupdir'];
356
- }
357
- }
358
- //Get files/filinfo from Dropbox
359
- if (class_exists('Dropbox') and in_array('DROPBOX',$dests) and !in_array($jobvalue['dropetoken'].'|'.$jobvalue['dropesecret'].'|'.$jobvalue['dropedir'],$donefolders)) {
360
- if (!empty($jobvalue['dropetoken']) and !empty($jobvalue['dropesecret'])) {
361
- try {
362
- $dropbox = new Dropbox(BACKWPUP_DROPBOX_APP_KEY, BACKWPUP_DROPBOX_APP_SECRET);
363
- $dropbox->setOAuthTokens($jobvalue['dropetoken'],$jobvalue['dropesecret']);
364
- $contents = $dropbox->metadata($jobvalue['dropedir']);
365
- if (is_array($contents)) {
366
- foreach ($contents['contents'] as $object) {
367
- if ($object['is_dir']!=true and (strtolower(substr($object['path'],-4))=='.zip' or strtolower(substr($object['path'],-4))=='.tar' or strtolower(substr($object['path'],-7))=='.tar.gz' or strtolower(substr($object['path'],-8))=='.tar.bz2')) {
368
- $files[$filecounter]['type']='DROPBOX';
369
- $files[$filecounter]['jobid']=$jobid;
370
- $files[$filecounter]['file']=$object['path'];
371
- $files[$filecounter]['filename']=basename($object['path']);
372
- $files[$filecounter]['downloadurl']='admin.php?page=BackWPup&subpage=backups&action=downloaddropbox&file='.$object['path'].'&jobid='.$jobid;
373
- $files[$filecounter]['filesize']=$object['bytes'];
374
- $files[$filecounter]['time']=strtotime($object['modified']);
375
- $filecounter++;
376
- }
377
- }
378
- }
379
- $donefolders[]=$jobvalue['dropetoken'].'|'.$jobvalue['dropesecret'].'|'.$jobvalue['dropedir'];
380
- } catch (Exception $e) {
381
- }
382
- }
383
- }
384
- //Get files/filinfo from Sugarsync
385
- if (class_exists('SugarSync') and in_array('SUGARSYNC',$dests) and !in_array($jobvalue['sugaruser'].'|'.base64_decode($jobvalue['sugarpass']).'|'.$jobvalue['sugardir'],$donefolders)) {
386
- if (!empty($jobvalue['sugarpass']) and !empty($jobvalue['sugarpass'])) {
387
- try {
388
- $sugarsync = new SugarSync($jobvalue['sugaruser'],base64_decode($jobvalue['sugarpass']),BACKWPUP_SUGARSYNC_ACCESSKEY, BACKWPUP_SUGARSYNC_PRIVATEACCESSKEY);
389
- $sugarsync->chdir($jobvalue['sugardir'],$jobvalue['sugarroot']);
390
- $getfiles=$sugarsync->getcontents('file');
391
- if (is_object($getfiles)) {
392
- foreach ($getfiles->file as $getfile) {
393
- if (strtolower(substr($getfile->displayName,-4))=='.zip' or strtolower(substr($getfile->displayName,-4))=='.tar' or strtolower(substr($getfile->displayName,-7))=='.tar.gz' or strtolower(substr($getfile->displayName,-8))=='.tar.bz2') {
394
- $files[$filecounter]['type']='SUGARSYNC';
395
- $files[$filecounter]['jobid']=$jobid;
396
- $files[$filecounter]['file']= (string) $getfile->ref;
397
- $files[$filecounter]['filename']=utf8_decode((string) $getfile->displayName);
398
- $files[$filecounter]['downloadurl']='admin.php?page=BackWPup&subpage=backups&action=downloadsugarsync&file='.(string) $getfile->ref.'&jobid='.$jobid;
399
- $files[$filecounter]['filesize']=(int) $getfile->size;
400
- $files[$filecounter]['time']=strtotime((string) $getfile->lastModified);
401
- $filecounter++;
402
- }
403
- }
404
- }
405
- $donefolders[]=$jobvalue['sugaruser'].'|'.base64_decode($jobvalue['sugarpass']).'|'.$jobvalue['sugardir'];
406
- } catch (Exception $e) {
407
- }
408
- }
409
- }
410
- //Get files/filinfo from S3
411
- if (class_exists('AmazonS3') and in_array('S3',$dests) and !in_array($jobvalue['awsAccessKey'].'|'.$jobvalue['awsBucket'].'|'.$jobvalue['awsdir'],$donefolders)) {
412
- if (!empty($jobvalue['awsAccessKey']) and !empty($jobvalue['awsSecretKey']) and !empty($jobvalue['awsBucket'])) {
413
- try {
414
- $s3 = new AmazonS3($jobvalue['awsAccessKey'], $jobvalue['awsSecretKey']);
415
- if (($contents = $s3->list_objects($jobvalue['awsBucket'],array('prefix'=>$jobvalue['awsdir']))) !== false) {
416
- foreach ($contents->body->Contents as $object) {
417
- if (strtolower(substr($object->Key,-4))=='.zip' or strtolower(substr($object->Key,-4))=='.tar' or strtolower(substr($object->Key,-7))=='.tar.gz' or strtolower(substr($object->Key,-8))=='.tar.bz2') {
418
- $files[$filecounter]['type']='S3';
419
- $files[$filecounter]['jobid']=$jobid;
420
- $files[$filecounter]['file']=(string)$object->Key;
421
- $files[$filecounter]['filename']=basename($object->Key);
422
- $files[$filecounter]['downloadurl']='admin.php?page=BackWPup&subpage=backups&action=downloads3&file='.$object->Key.'&jobid='.$jobid;
423
- $files[$filecounter]['filesize']=(string)$object->Size;
424
- $files[$filecounter]['time']=strtotime($object->LastModified);
425
- $filecounter++;
426
- }
427
- }
428
- }
429
- $donefolders[]=$jobvalue['awsAccessKey'].'|'.$jobvalue['awsBucket'].'|'.$jobvalue['awsdir'];
430
- } catch (Exception $e) {
431
- }
432
- }
433
- }
434
- //Get files/filinfo from Microsoft Azure
435
- if (class_exists('Microsoft_WindowsAzure_Storage_Blob') and in_array('MSAZURE',$dests) and !in_array($jobvalue['msazureAccName'].'|'.$jobvalue['msazureKey'].'|'.$jobvalue['msazureContainer'].'|'.$jobvalue['msazuredir'],$donefolders)) {
436
- if (!empty($jobvalue['msazureHost']) and !empty($jobvalue['msazureAccName']) and !empty($jobvalue['msazureKey']) and !empty($jobvalue['msazureContainer'])) {
437
- try {
438
- $storageClient = new Microsoft_WindowsAzure_Storage_Blob($jobvalue['msazureHost'],$jobvalue['msazureAccName'],$jobvalue['msazureKey']);
439
- $blobs = $storageClient->listBlobs($jobvalue['msazureContainer'],$jobvalue['msazuredir']);
440
- if (is_array($blobs)) {
441
- foreach ($blobs as $blob) {
442
- if (strtolower(substr($blob->Name,-4))=='.zip' or strtolower(substr($blob->Name,-4))=='.tar' or strtolower(substr($blob->Name,-7))=='.tar.gz' or strtolower(substr($blob->Name,-8))=='.tar.bz2') {
443
- $files[$filecounter]['type']='MSAZURE';
444
- $files[$filecounter]['jobid']=$jobid;
445
- $files[$filecounter]['file']=$blob->Name;
446
- $files[$filecounter]['filename']=basename($blob->Name);
447
- $files[$filecounter]['downloadurl']='admin.php?page=BackWPup&subpage=backups&action=downloadmsazure&file='.$blob->Name.'&jobid='.$jobid;
448
- $files[$filecounter]['filesize']=$blob->size;
449
- $files[$filecounter]['time']=strtotime($blob->lastmodified);
450
- $filecounter++;
451
- }
452
- }
453
- }
454
- $donefolders[]=$jobvalue['msazureAccName'].'|'.$jobvalue['msazureKey'].'|'.$jobvalue['msazureContainer'].'|'.$jobvalue['msazuredir'];
455
- } catch (Exception $e) {
456
- }
457
- }
458
- }
459
- //Get files/filinfo from RSC
460
- if (class_exists('CF_Authentication') and in_array('RSC',$dests) and !in_array($jobvalue['rscUsername'].'|'.$jobvalue['rscContainer'].'|'.$jobvalue['rscdir'],$donefolders)) {
461
- if (!empty($jobvalue['rscUsername']) and !empty($jobvalue['rscAPIKey']) and !empty($jobvalue['rscContainer'])) {
462
- try {
463
- $auth = new CF_Authentication($jobvalue['rscUsername'], $jobvalue['rscAPIKey']);
464
- $auth->ssl_use_cabundle();
465
- if ($auth->authenticate()) {
466
- $conn = new CF_Connection($auth);
467
- $conn->ssl_use_cabundle();
468
- $backwpupcontainer = $conn->get_container($jobvalue['rscContainer']);
469
- $contents = $backwpupcontainer->get_objects(0,NULL,NULL,$jobvalue['rscdir']);
470
- foreach ($contents as $object) {
471
- if (strtolower(substr($object->name,-4))=='.zip' or strtolower(substr($object->name,-4))=='.tar' or strtolower(substr($object->name,-7))=='.tar.gz' or strtolower(substr($object->name,-8))=='.tar.bz2') {
472
- $files[$filecounter]['type']='RSC';
473
- $files[$filecounter]['jobid']=$jobid;
474
- $files[$filecounter]['file']=$object->name;
475
- $files[$filecounter]['filename']=basename($object->name);
476
- $files[$filecounter]['downloadurl']='admin.php?page=BackWPup&subpage=backups&action=downloadrsc&file='.$object->name.'&jobid='.$jobid;
477
- $files[$filecounter]['filesize']=$object->content_length;
478
- $files[$filecounter]['time']=$object->last_modified;
479
- $filecounter++;
480
- }
481
- }
482
- $donefolders[]=$jobvalue['rscUsername'].'|'.$jobvalue['rscContainer'].'|'.$jobvalue['rscdir'];
483
- }
484
- } catch (Exception $e) {
485
- }
486
- }
487
- }
488
- //Get files/filinfo from FTP
489
- if (!empty($jobvalue['ftphost']) and in_array('FTP',$dests) and function_exists('ftp_connect') and !empty($jobvalue['ftpuser']) and !empty($jobvalue['ftppass']) and !in_array($jobvalue['ftphost'].'|'.$jobvalue['ftpuser'].'|'.$jobvalue['ftpdir'],$donefolders)) {
490
- $ftpport=21;
491
- $ftphost=$jobvalue['ftphost'];
492
- if (false !== strpos($jobvalue['ftphost'],':')) //look for port
493
- list($ftphost,$ftpport)=explode(':',$jobvalue,2);
494
-
495
- if (function_exists('ftp_ssl_connect') and $jobvalue['ftpssl']) { //make SSL FTP connection
496
- $ftp_conn_id = ftp_ssl_connect($ftphost,$ftpport,10);
497
- } elseif (!$jobvalue['ftpssl']) { //make normal FTP conection if SSL not work
498
- $ftp_conn_id = ftp_connect($ftphost,$ftpport,10);
499
- }
500
- $loginok=false;
501
- if ($ftp_conn_id) {
502
- //FTP Login
503
- if (@ftp_login($ftp_conn_id, $jobvalue['ftpuser'], base64_decode($jobvalue['ftppass']))) {
504
- $loginok=true;
505
- } else { //if PHP ftp login don't work use raw login
506
- ftp_raw($ftp_conn_id,'USER '.$jobvalue['ftpuser']);
507
- $return=ftp_raw($ftp_conn_id,'PASS '.base64_decode($jobvalue['ftppass']));
508
- if (substr(trim($return[0]),0,3)<=400)
509
- $loginok=true;
510
- }
511
- }
512
- if ($loginok) {
513
- ftp_pasv($ftp_conn_id, $jobvalue['ftppasv']);
514
- if ($ftpfilelist=ftp_nlist($ftp_conn_id, $jobvalue['ftpdir'])) {
515
- foreach($ftpfilelist as $ftpfiles) {
516
- if (substr(basename($ftpfiles),0,1)=='.' or !(strtolower(substr($ftpfiles,-4))=='.zip' or strtolower(substr($ftpfiles,-4))=='.tar' or strtolower(substr($ftpfiles,-7))=='.tar.gz' or strtolower(substr($ftpfiles,-8))=='.tar.bz2'))
517
- continue;
518
- $files[$filecounter]['type']='FTP';
519
- $files[$filecounter]['jobid']=$jobid;
520
- $files[$filecounter]['file']=$ftpfiles;
521
- $files[$filecounter]['filename']=basename($ftpfiles);
522
- $files[$filecounter]['downloadurl']="ftp://".rawurlencode($jobvalue['ftpuser']).":".rawurlencode(base64_decode($jobvalue['ftppass']))."@".$jobvalue['ftphost'].rawurlencode($ftpfiles);
523
- $files[$filecounter]['filesize']=ftp_size($ftp_conn_id,$ftpfiles);
524
- $files[$filecounter]['time']=ftp_mdtm($ftp_conn_id,$ftpfiles);
525
- $filecounter++;
526
- }
527
- }
528
- }
529
- $donefolders[]=$jobvalue['ftphost'].'|'.$jobvalue['ftpuser'].'|'.$jobvalue['ftpdir'];
530
- }
531
- }
532
- //Sort list
533
- $tmp = Array();
534
- foreach($files as &$ma)
535
- $tmp[] = &$ma["time"];
536
- array_multisort($tmp, SORT_DESC, $files);
537
- return $files;
538
- }
539
-
540
- //ajax/normal get buckests select box
541
- function backwpup_get_aws_buckets($args='') {
542
- if (is_array($args)) {
543
- extract($args);
544
- $ajax=false;
545
- } else {
546
- $awsAccessKey=$_POST['awsAccessKey'];
547
- $awsSecretKey=$_POST['awsSecretKey'];
548
- $awsselected=$_POST['awsselected'];
549
- $ajax=true;
550
- }
551
- if (!class_exists('CFRuntime'))
552
- require_once(dirname(__FILE__).'/libs/aws/sdk.class.php');
553
- if (empty($awsAccessKey)) {
554
- echo '<span id="awsBucket" style="color:red;">'.__('Missing Access Key ID!','backwpup').'</span>';
555
- if ($ajax)
556
- die();
557
- else
558
- return;
559
- }
560
- if (empty($awsSecretKey)) {
561
- echo '<span id="awsBucket" style="color:red;">'.__('Missing Secret Access Key!','backwpup').'</span>';
562
- if ($ajax)
563
- die();
564
- else
565
- return;
566
- }
567
- try {
568
- $s3 = new AmazonS3($awsAccessKey, $awsSecretKey);
569
- $buckets=$s3->list_buckets();
570
- } catch (Exception $e) {
571
- echo '<span id="awsBucket" style="color:red;">'.__($e->getMessage(),'backwpup').'</span>';
572
- if ($ajax)
573
- die();
574
- else
575
- return;
576
- }
577
- if ($buckets->status<200 and $buckets->status>=300) {
578
- echo '<span id="awsBucket" style="color:red;">'.__('S3 Message:','backwpup').' '.$buckets->status.': '.$buckets->body->Message.'</span>';
579
- if ($ajax)
580
- die();
581
- else
582
- return;
583
- }
584
- if (empty($buckets->body->Buckets->Bucket)) {
585
- echo '<span id="awsBucket" style="color:red;">'.__('No Buckets found!','backwpup').'</span>';
586
- if ($ajax)
587
- die();
588
- else
589
- return;
590
- }
591
- echo '<select name="awsBucket" id="awsBucket">';
592
- foreach ($buckets->body->Buckets->Bucket as $bucket) {
593
- echo "<option ".selected(strtolower($awsselected),strtolower($bucket->Name),false).">".$bucket->Name."</option>";
594
- }
595
- echo '</select>';
596
- if ($ajax)
597
- die();
598
- else
599
- return;
600
- }
601
-
602
- //ajax/normal get Container for RSC select box
603
- function backwpup_get_rsc_container($args='') {
604
- if (is_array($args)) {
605
- extract($args);
606
- $ajax=false;
607
- } else {
608
- $rscUsername=$_POST['rscUsername'];
609
- $rscAPIKey=$_POST['rscAPIKey'];
610
- $rscselected=$_POST['rscselected'];
611
- $ajax=true;
612
- }
613
- if (!class_exists('CF_Authentication'))
614
- require_once(dirname(__FILE__).'/libs/rackspace/cloudfiles.php');
615
-
616
- if (empty($rscUsername)) {
617
- echo '<span id="rscContainer" style="color:red;">'.__('Missing Username!','backwpup').'</span>';
618
- if ($ajax)
619
- die();
620
- else
621
- return;
622
- }
623
- if (empty($rscAPIKey)) {
624
- echo '<span id="rscContainer" style="color:red;">'.__('Missing API Key!','backwpup').'</span>';
625
- if ($ajax)
626
- die();
627
- else
628
- return;
629
- }
630
-
631
- try {
632
- $auth = new CF_Authentication($rscUsername, $rscAPIKey);
633
- $auth->authenticate();
634
- $conn = new CF_Connection($auth);
635
- $containers=$conn->get_containers();
636
- } catch (Exception $e) {
637
- echo '<span id="rscContainer" style="color:red;">'.__($e->getMessage(),'backwpup').'</span>';
638
- if ($ajax)
639
- die();
640
- else
641
- return;
642
- }
643
-
644
- if (!is_array($containers)) {
645
- echo '<span id="rscContainer" style="color:red;">'.__('No Containerss found!','backwpup').'</span>';
646
- if ($ajax)
647
- die();
648
- else
649
- return;
650
- }
651
- echo '<select name="rscContainer" id="rscContainer">';
652
- foreach ($containers as $container) {
653
- echo "<option ".selected(strtolower($rscselected),strtolower($container->name),false).">".$container->name."</option>";
654
- }
655
- echo '</select>';
656
- if ($ajax)
657
- die();
658
- else
659
- return;
660
- }
661
-
662
- //ajax/normal get buckests select box
663
- function backwpup_get_msazure_container($args='') {
664
- if (is_array($args)) {
665
- extract($args);
666
- $ajax=false;
667
- } else {
668
- $msazureHost=$_POST['msazureHost'];
669
- $msazureAccName=$_POST['msazureAccName'];
670
- $msazureKey=$_POST['msazureKey'];
671
- $msazureselected=$_POST['msazureselected'];
672
- $ajax=true;
673
- }
674
- if (!class_exists('Microsoft_WindowsAzure_Storage_Blob')) {
675
- set_include_path(get_include_path().PATH_SEPARATOR.dirname(__FILE__).'/libs');
676
- require_once 'Microsoft/WindowsAzure/Storage/Blob.php';
677
- }
678
- if (empty($msazureHost)) {
679
- echo '<span id="msazureContainer" style="color:red;">'.__('Missing Hostname!','backwpup').'</span>';
680
- if ($ajax)
681
- die();
682
- else
683
- return;
684
- }
685
- if (empty($msazureAccName)) {
686
- echo '<span id="msazureContainer" style="color:red;">'.__('Missing Account Name!','backwpup').'</span>';
687
- if ($ajax)
688
- die();
689
- else
690
- return;
691
- }
692
- if (empty($msazureKey)) {
693
- echo '<span id="msazureContainer" style="color:red;">'.__('Missing Access Key!','backwpup').'</span>';
694
- if ($ajax)
695
- die();
696
- else
697
- return;
698
- }
699
- try {
700
- $storageClient = new Microsoft_WindowsAzure_Storage_Blob($msazureHost,$msazureAccName,$msazureKey);
701
- $Containers=$storageClient->listContainers();
702
- } catch (Exception $e) {
703
- echo '<span id="msazureContainer" style="color:red;">'.$e->getMessage().'</span>';
704
- if ($ajax)
705
- die();
706
- else
707
- return;
708
- }
709
- if (empty($Containers)) {
710
- echo '<span id="msazureContainer" style="color:red;">'.__('No Container found!','backwpup').'</span>';
711
- if ($ajax)
712
- die();
713
- else
714
- return;
715
- }
716
- echo '<select name="msazureContainer" id="msazureContainer">';
717
- foreach ($Containers as $Container) {
718
- echo "<option ".selected(strtolower($msazureselected),strtolower($Container->Name),false).">".$Container->Name."</option>";
719
- }
720
- echo '</select>';
721
- if ($ajax)
722
- die();
723
- else
724
- return;
725
- }
726
-
727
- //ajax/normal get SugarSync roots select box
728
- function backwpup_get_sugarsync_root($args='') {
729
- if (is_array($args)) {
730
- extract($args);
731
- $ajax=false;
732
- } else {
733
- $sugaruser=$_POST['sugaruser'];
734
- $sugarpass=$_POST['sugarpass'];
735
- $sugarrootselected=$_POST['sugarrootselected'];
736
- $ajax=true;
737
- }
738
-
739
- if (!class_exists('SugarSync'))
740
- require_once(dirname(__FILE__).'/libs/sugarsync.php');
741
-
742
- if (empty($sugaruser)) {
743
- echo '<span id="sugarroot" style="color:red;">'.__('Missing Username!','backwpup').'</span>';
744
- if ($ajax)
745
- die();
746
- else
747
- return;
748
- }
749
- if (empty($sugarpass)) {
750
- echo '<span id="sugarroot" style="color:red;">'.__('Missing Password!','backwpup').'</span>';
751
- if ($ajax)
752
- die();
753
- else
754
- return;
755
- }
756
-
757
- try {
758
- $sugarsync = new SugarSync($sugaruser,$sugarpass,BACKWPUP_SUGARSYNC_ACCESSKEY, BACKWPUP_SUGARSYNC_PRIVATEACCESSKEY);
759
- $user=$sugarsync->user();
760
- $syncfolders=$sugarsync->get($user->syncfolders);
761
- } catch (Exception $e) {
762
- echo '<span id="sugarroot" style="color:red;">'.__($e->getMessage(),'backwpup').'</span>';
763
- if ($ajax)
764
- die();
765
- else
766
- return;
767
- }
768
-
769
- if (!is_object($syncfolders)) {
770
- echo '<span id="sugarroot" style="color:red;">'.__('No Syncfolders found!','backwpup').'</span>';
771
- if ($ajax)
772
- die();
773
- else
774
- return;
775
- }
776
- echo '<select name="sugarroot" id="sugarroot">';
777
- foreach ($syncfolders->collection as $roots) {
778
- echo "<option ".selected(strtolower($sugarrootselected),strtolower($roots->ref),false)." value=\"".$roots->ref."\">".$roots->displayName."</option>";
779
- }
780
- echo '</select>';
781
- if ($ajax)
782
- die();
783
- else
784
- return;
785
- }
786
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/wp_xml_export.php DELETED
@@ -1,17 +0,0 @@
1
- <?PHP
2
- if (file_exists(trim($_GET['wpabs']).'wp-load.php')) {
3
- require_once(trim($_GET['wpabs']).'wp-load.php'); /** Setup WordPress environment */
4
- } else {
5
- header("HTTP/1.0 404 Not Found");
6
- die();
7
- }
8
- $nonce=get_option('backwpup_nonce');
9
- delete_option('backwpup_nonce');
10
- if (!empty($nonce['nonce']) and $_GET['_nonce']==$nonce['nonce'] and $nonce['timestamp']<time()+60) {
11
- require_once(trim($_GET['wpabs']).'wp-admin/includes/export.php');
12
- export_wp();
13
- } else {
14
- header("HTTP/1.0 404 Not Found");
15
- die();
16
- }
17
- ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
backwpup-functions.php ADDED
@@ -0,0 +1,1074 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('ABSPATH')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ //Thems Option menu entry
9
+ function backwpup_admin_menu() {
10
+ add_menu_page( __('BackWPup','backwpup'), __('BackWPup','backwpup'), BACKWPUP_USER_CAPABILITY, 'backwpup', 'backwpup_menu_page', BACKWPUP_PLUGIN_BASEURL.'/css/backup-icon20.gif');
11
+ $hook = add_submenu_page( 'backwpup', __('Jobs','backwpup'), __('Jobs','backwpup'), BACKWPUP_USER_CAPABILITY, 'backwpup', 'backwpup_menu_page' );
12
+ add_action('load-'.$hook, 'backwpup_menu_page_header');
13
+ $hook = add_submenu_page( 'backwpup', __('Add New','backwpup'), __('Add New','backwpup'), BACKWPUP_USER_CAPABILITY, 'backwpupeditjob', 'backwpup_menu_page' );
14
+ add_action('load-'.$hook, 'backwpup_menu_page_header');
15
+ $hook = add_submenu_page( 'backwpup', __('Working','backwpup'), __('Working','backwpup'), BACKWPUP_USER_CAPABILITY, 'backwpupworking', 'backwpup_menu_page' );
16
+ add_action('load-'.$hook, 'backwpup_menu_page_header');
17
+ $hook = add_submenu_page( 'backwpup', __('Logs','backwpup'), __('Logs','backwpup'), BACKWPUP_USER_CAPABILITY, 'backwpuplogs', 'backwpup_menu_page' );
18
+ add_action('load-'.$hook, 'backwpup_menu_page_header');
19
+ $hook = add_submenu_page( 'backwpup', __('Backups','backwpup'), __('Backups','backwpup'), BACKWPUP_USER_CAPABILITY, 'backwpupbackups', 'backwpup_menu_page' );
20
+ add_action('load-'.$hook, 'backwpup_menu_page_header');
21
+ $hook = add_submenu_page( 'backwpup', __('Tools','backwpup'), __('Tools','backwpup'), BACKWPUP_USER_CAPABILITY, 'backwpuptools', 'backwpup_menu_page' );
22
+ add_action('load-'.$hook, 'backwpup_menu_page_header');
23
+ $hook = add_submenu_page( 'backwpup', __('Settings','backwpup'), __('Settings','backwpup'), BACKWPUP_USER_CAPABILITY, 'backwpupsettings', 'backwpup_menu_page' );
24
+ add_action('load-'.$hook, 'backwpup_menu_page_header');
25
+ }
26
+
27
+ function backwpup_menu_page() {
28
+ global $backwpup_message,$backwpup_listtable,$current_screen;
29
+ //check user premessions
30
+ if (!current_user_can(BACKWPUP_USER_CAPABILITY))
31
+ return;
32
+ //Set pages that exists
33
+ $menupages=array('backwpup','backwpupeditjob','backwpupworking','backwpuplogs','backwpupbackups','backwpuptools','backwpupsettings');
34
+ //check called page exists
35
+ if (!empty($_REQUEST['page']) and in_array($_REQUEST['page'],$menupages)) {
36
+ $page=$_REQUEST['page'];
37
+ //check page file exists
38
+ if (is_file(dirname(__FILE__).'/pages/page_'.$page.'.php'))
39
+ require_once(dirname(__FILE__).'/pages/page_'.$page.'.php');
40
+ }
41
+ }
42
+
43
+ function backwpup_menu_page_header() {
44
+ global $backwpup_message,$backwpup_listtable,$current_screen;
45
+ //check user premessions
46
+ if (!current_user_can(BACKWPUP_USER_CAPABILITY))
47
+ return;
48
+ //Set pages that exists
49
+ $menupages=array('backwpup','backwpupeditjob','backwpupworking','backwpuplogs','backwpupbackups','backwpuptools','backwpupsettings');
50
+ //check called page exists
51
+ if (!empty($_REQUEST['page']) and in_array($_REQUEST['page'],$menupages)) {
52
+ $page=$_REQUEST['page'];
53
+ //check page file exists
54
+ if (is_file(dirname(__FILE__).'/pages/page_'.$page.'.php')) {
55
+ //Css for Admin Section
56
+ if (is_file(dirname(__FILE__).'/css/'.$page.'.css')) {
57
+ if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)
58
+ wp_enqueue_style($page,BACKWPUP_PLUGIN_BASEURL.'/css/'.$page.'.css','',time(),'screen');
59
+ else
60
+ wp_enqueue_style($page,BACKWPUP_PLUGIN_BASEURL.'/css/'.$page.'.css','',BACKWPUP_VERSION,'screen');
61
+ }
62
+ //add java
63
+ if (is_file(dirname(__FILE__).'/js/'.$page.'.js')) {
64
+ if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG)
65
+ wp_enqueue_script($page,BACKWPUP_PLUGIN_BASEURL.'/js/'.$page.'.js','',time(),true);
66
+ else
67
+ wp_enqueue_script($page,BACKWPUP_PLUGIN_BASEURL.'/js/'.$page.'.js','',BACKWPUP_VERSION,true);
68
+ }
69
+ //incude functions
70
+ if (is_file(dirname(__FILE__).'/pages/func_'.$page.'.php'))
71
+ require_once(dirname(__FILE__).'/pages/func_'.$page.'.php');
72
+ //include code
73
+ if (is_file(dirname(__FILE__).'/pages/header_'.$page.'.php'))
74
+ require_once(dirname(__FILE__).'/pages/header_'.$page.'.php');
75
+ }
76
+ }
77
+ }
78
+
79
+ function backwpup_load_ajax() {
80
+ //Set pages that exists
81
+ $menupages=array('backwpup','backwpupeditjob','backwpupworking','backwpuplogs','backwpupbackups','backwpuptools','backwpupsettings');
82
+ if (!empty($_POST['backwpupajaxpage']) and in_array($_POST['backwpupajaxpage'],$menupages)) {
83
+ $page=$_POST['backwpupajaxpage'];
84
+ //incude functions
85
+ if (is_file(dirname(__FILE__).'/pages/func_'.$page.'.php'))
86
+ require_once(dirname(__FILE__).'/pages/func_'.$page.'.php');
87
+ }
88
+ }
89
+
90
+ function backwpup_contextual_help($help='') {
91
+ global $current_screen;
92
+ if (0!= stripos($help,'<p>'))
93
+ $help='<p>'.$help.'</p>';
94
+ add_contextual_help($current_screen,$help.
95
+ '<p><strong>'.__('For more information:','backwpup').'</strong></p>'.
96
+ '<p><a href="http://backwpup.com/forum/" target="_blank">'.__('Support','backwpup').'</a>'.
97
+ ' | <a href="http://backwpup.com/faq/" target="_blank">' . __('FAQ','backwpup') . '</a>'.
98
+ ' | <a href="http://backwpup.com/" target="_blank">' . __('Plugin Homepage', 'backwpup') . '</a>'.
99
+ ' | <a href="http://wordpress.org/extend/plugins/backwpup" target="_blank">' . __('Plugin Home on WordPress.org', 'backwpup') . '</a>'.
100
+ ' | <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=mail%40backwpup%2ecom&amp;item_name=BackWPup%20Plugin%20Donation&amp;item_number=BackWPup&amp;no_shipping=0&amp;no_note=1&amp;tax=0&amp;bn=PP%2dDonationsBF&amp;charset=UTF%2d8" target="_blank">' . __('Donate','backwpup') . '</a>'.
101
+ ' | <a href="https://flattr.com/thing/32235/BackWPup" target="_blank">' . __('Flattr', 'backwpup') . '</a>'.
102
+ '<p>BackWPup version '.BACKWPUP_VERSION.', Copyright &copy; '.date('Y').' <a href="http://danielhuesken.de" target="_blank">Daniel H&uuml;sken</a><br />'.__('BackWPup comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.','backwpup').'</p>'.
103
+ '</p>');
104
+ }
105
+
106
+ //On Plugin activate
107
+ function backwpup_plugin_activate() {
108
+ $jobs=get_option('backwpup_jobs');
109
+ if (!empty($jobs) and is_array($jobs)) {
110
+ foreach ($jobs as $jobid => $jobvalue) {
111
+ //check jobvaules
112
+ $jobs[$jobid]=backwpup_get_job_vars($jobid);
113
+ }
114
+ //save job values
115
+ update_option('backwpup_jobs',$jobs);
116
+ }
117
+ //remove old cron jobs
118
+ wp_clear_scheduled_hook('backwpup_cron');
119
+ //make new schedule
120
+ wp_schedule_event(0, 'backwpup_int', 'backwpup_cron');
121
+ //Set settings defaults
122
+ $cfg=get_option('backwpup'); //Load Settings
123
+ if (empty($cfg['mailsndemail'])) $cfg['mailsndemail']=sanitize_email(get_bloginfo( 'admin_email' ));
124
+ if (empty($cfg['mailsndname'])) $cfg['mailsndname']='BackWPup '.get_bloginfo( 'name' );
125
+ if (empty($cfg['mailmethod'])) $cfg['mailmethod']='mail';
126
+ if (empty($cfg['mailsendmail'])) $cfg['mailsendmail']=substr(ini_get('sendmail_path'),0,strpos(ini_get('sendmail_path'),' -'));
127
+ if (false !== strpos($cfg['mailhost'],':'))
128
+ list($cfg['mailhost'],$cfg['mailhostport'])=explode(':',$cfg['mailhost'],2);
129
+ if (!isset($cfg['mailhost'])) $cfg['mailhost']='';
130
+ if (!isset($cfg['mailhostport'])) $cfg['mailhostport']=25;
131
+ if (!isset($cfg['mailsecure'])) $cfg['mailsecure']='';
132
+ if (!isset($cfg['mailuser'])) $cfg['mailuser']='';
133
+ if (!isset($cfg['mailpass'])) $cfg['mailpass']='';
134
+ if (!isset($cfg['showadminbar'])) $cfg['showadminbar']=true;
135
+ if (!isset($cfg['jobstepretry']) or !is_int($cfg['jobstepretry']) or 99<=$cfg['jobstepretry']) $cfg['jobstepretry']=3;
136
+ if (!isset($cfg['jobscriptretry']) or !is_int($cfg['jobscriptretry']) or 99<=$cfg['jobscriptretry']) $cfg['jobscriptretry']=5;
137
+ if (!isset($cfg['jobscriptruntime']) or !is_int($cfg['jobscriptruntime']) or 100>$cfg['jobscriptruntime']) $cfg['jobscriptruntime']=30;
138
+ if (!isset($cfg['jobscriptruntimelong']) or !is_int($cfg['jobscriptruntimelong']) or 1000>$cfg['jobscriptruntimelong']) $cfg['jobscriptruntimelong']=300;
139
+ if (!isset($cfg['maxlogs']) or !is_int($cfg['maxlogs'])) $cfg['maxlogs']=50;
140
+ if (!function_exists('gzopen') or !isset($cfg['gzlogs'])) $cfg['gzlogs']=false;
141
+ if (!isset($cfg['dirlogs']) or empty($cfg['dirlogs']) or !is_dir($cfg['dirlogs'])) {
142
+ $rand = substr( md5( md5( SECURE_AUTH_KEY ) ), -5 );
143
+ $cfg['dirlogs']=str_replace('\\','/',trailingslashit(WP_CONTENT_DIR)).'backwpup-'.$rand.'-logs/';
144
+ }
145
+ if (!isset($cfg['disablewpcron']) or !is_bool($cfg['disablewpcron'])) $cfg['disablewpcron']=false;
146
+ //remove old option
147
+ unset($cfg['dirtemp']);
148
+ unset($cfg['logfilelist']);
149
+ update_option('backwpup',$cfg);
150
+ //delete not longer used options
151
+ delete_option('backwpup_backups_chache');
152
+ backwpup_api(true);
153
+ }
154
+
155
+ //on Plugin deaktivate
156
+ function backwpup_plugin_deactivate() {
157
+ wp_clear_scheduled_hook('backwpup_cron');
158
+ backwpup_api(false);
159
+ }
160
+
161
+ //Backwpup API
162
+ function backwpup_api($active=false) {
163
+ global $wp_version;
164
+ if ($active)
165
+ $active='Y';
166
+ else
167
+ $active='N';
168
+ $ch=curl_init();
169
+ curl_setopt($ch,CURLOPT_URL,BACKWPUP_API_URL);
170
+ curl_setopt($ch,CURLOPT_POST,true);
171
+ curl_setopt($ch,CURLOPT_POSTFIELDS,array('URL'=>get_option('siteurl'),'EMAIL'=>get_option('admin_email'),'WP_VER'=>$wp_version,'BACKWPUP_VER'=>BACKWPUP_VERSION,'ACTIVE'=>$active));
172
+ curl_setopt($ch,CURLOPT_USERAGENT,'BackWPup '.BACKWPUP_VERSION);
173
+ curl_setopt($ch,CURLOPT_RETURNTRANSFER,false);
174
+ curl_setopt($ch,CURLOPT_FORBID_REUSE,true);
175
+ curl_setopt($ch,CURLOPT_FRESH_CONNECT,true);
176
+ curl_setopt($ch,CURLOPT_TIMEOUT,0.01);
177
+ curl_exec($ch);
178
+ curl_close($ch);
179
+ }
180
+
181
+ //add edit setting to plugins page
182
+ function backwpup_plugin_options_link($links) {
183
+ if (!current_user_can(BACKWPUP_USER_CAPABILITY))
184
+ return $links;
185
+ $settings_link='<a href="'.admin_url('admin.php').'?page=backwpup" title="' . __('Go to Settings Page','backwpup') . '" class="edit">' . __('Settings') . '</a>';
186
+ array_unshift( $links, $settings_link );
187
+ return $links;
188
+ }
189
+
190
+ //add links on plugins page
191
+ function backwpup_plugin_links($links, $file) {
192
+ if (!current_user_can('install_plugins'))
193
+ return $links;
194
+ if ($file == BACKWPUP_PLUGIN_BASEDIR.'/backwpup.php') {
195
+ $links[] = '<a href="http://wordpress.org/extend/plugins/backwpup/faq/" target="_blank">' . __('FAQ') . '</a>';
196
+ $links[] = '<a href="http://wordpress.org/tags/backwpup/" target="_blank">' . __('Support') . '</a>';
197
+ $links[] = '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&amp;business=daniel%40huesken-net%2ede&amp;item_name=Daniel%20Huesken%20Plugin%20Donation&amp;item_number=BackWPup&amp;no_shipping=0&amp;no_note=1&amp;tax=0&amp;currency_code=EUR&amp;lc=DE&amp;bn=PP%2dDonationsBF&amp;charset=UTF%2d8" target="_blank">' . __('Donate') . '</a>';
198
+ }
199
+ return $links;
200
+ }
201
+
202
+ //Add cron interval
203
+ function backwpup_intervals($schedules) {
204
+ $intervals['backwpup_int']=array('interval' => '120', 'display' => __('BackWPup', 'backwpup'));
205
+ $schedules=array_merge($intervals,$schedules);
206
+ return $schedules;
207
+ }
208
+
209
+ //cron work
210
+ function backwpup_cron() {
211
+ define('DONOTCACHEPAGE', true);
212
+ define('DONOTCACHEDB', true);
213
+ define('DONOTMINIFY', true);
214
+ define('DONOTCDN', true);
215
+ define('DONOTCACHCEOBJECT', true);
216
+ define('QUICK_CACHE_ALLOWED', false);
217
+ $_SERVER["QUICK_CACHE_ALLOWED"] = false;
218
+ if (function_exists('w3tc_pgcache_flush'))
219
+ w3tc_pgcache_flush();
220
+ echo "<!-- mfunc -->";
221
+ if ($infile=backwpup_get_working_file()) {
222
+ if ($infile['timestamp']>time()-310) {
223
+ $ch=curl_init();
224
+ curl_setopt($ch,CURLOPT_URL,BACKWPUP_PLUGIN_BASEURL.'/job/job_run.php');
225
+ curl_setopt($ch,CURLOPT_RETURNTRANSFER,false);
226
+ curl_setopt($ch,CURLOPT_FORBID_REUSE,true);
227
+ curl_setopt($ch,CURLOPT_FRESH_CONNECT,true);
228
+ curl_setopt($ch,CURLOPT_TIMEOUT,0.01);
229
+ curl_exec($ch);
230
+ curl_close($ch);
231
+ }
232
+ } else {
233
+ foreach ((array)get_option('backwpup_jobs') as $jobid => $jobvalue) {
234
+ if (!isset($jobvalue['activated']) or !$jobvalue['activated'])
235
+ continue;
236
+ if ($jobvalue['cronnextrun']<=current_time('timestamp')) {
237
+ //include jobstart function
238
+ require_once(dirname(__FILE__).'/job/job_start.php');
239
+ backwpup_jobstart($jobid);
240
+ }
241
+ }
242
+ }
243
+ echo "<!--/mfunc-->";
244
+ }
245
+
246
+ //file size
247
+ function backwpup_formatBytes($bytes, $precision = 2) {
248
+ $units = array('B', 'KB', 'MB', 'GB', 'TB');
249
+ $bytes = max($bytes, 0);
250
+ $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
251
+ $pow = min($pow, count($units) - 1);
252
+ $bytes /= pow(1024, $pow);
253
+ return round($bytes, $precision) . ' ' . $units[$pow];
254
+ }
255
+
256
+ //echo long backup type name
257
+ function backwpup_backup_types($type='',$echo=false) {
258
+ $typename='';
259
+ if (!empty($type)) {
260
+ $todo=explode('+',$type);
261
+ foreach($todo as $key => $value) {
262
+ switch($value) {
263
+ case 'WPEXP':
264
+ $typename.=__('WP XML Export','backwpup')."<br />";
265
+ break;
266
+ case 'DB':
267
+ $typename.=__('Database Backup','backwpup')."<br />";
268
+ break;
269
+ case 'FILE':
270
+ $typename.=__('File Backup','backwpup')."<br />";
271
+ break;
272
+ case 'OPTIMIZE':
273
+ $typename.=__('Optimize Database Tables','backwpup')."<br />";
274
+ break;
275
+ case 'CHECK':
276
+ $typename.=__('Check Database Tables','backwpup')."<br />";
277
+ break;
278
+ }
279
+ }
280
+ } else {
281
+ $typename=array('WPEXP','DB','FILE','OPTIMIZE','CHECK');
282
+ }
283
+
284
+ if ($echo)
285
+ echo $typename;
286
+ else
287
+ return $typename;
288
+ }
289
+
290
+ //read log file header
291
+ function backwpup_read_logheader($logfile) {
292
+ $headers=array("backwpup_version" => "version","backwpup_logtime" => "logtime","backwpup_errors" => "errors","backwpup_warnings" => "warnings","backwpup_jobid" => "jobid","backwpup_jobname" => "name","backwpup_jobtype" => "type","backwpup_jobruntime" => "runtime","backwpup_backupfilesize" => "backupfilesize");
293
+ if (!is_readable($logfile))
294
+ return false;
295
+ //Read file
296
+ if (strtolower(substr($logfile,-3))==".gz") {
297
+ $fp = gzopen( $logfile, 'r' );
298
+ $file_data = gzread( $fp, 1536 ); // Pull only the first 1,5kiB of the file in.
299
+ gzclose( $fp );
300
+ } else {
301
+ $fp = fopen( $logfile, 'r' );
302
+ $file_data = fread( $fp, 1536 ); // Pull only the first 1,5kiB of the file in.
303
+ fclose( $fp );
304
+ }
305
+ //get data form file
306
+ foreach ($headers as $keyword => $field) {
307
+ preg_match('/(<meta name="'.$keyword.'" content="(.*)" \/>)/i',$file_data,$content);
308
+ if (!empty($content))
309
+ $joddata[$field]=$content[2];
310
+ else
311
+ $joddata[$field]='';
312
+ }
313
+ if (empty($joddata['logtime']))
314
+ $joddata['logtime']=filectime($logfile);
315
+ return $joddata;
316
+ }
317
+
318
+ //Dashboard widget for Logs
319
+ function backwpup_dashboard_logs() {
320
+ $cfg=get_option('backwpup');
321
+ $widgets = get_option( 'dashboard_widget_options' );
322
+ if (!isset($widgets['backwpup_dashboard_logs']) or $widgets['backwpup_dashboard_logs']<1 or $widgets['backwpup_dashboard_logs']>20)
323
+ $widgets['backwpup_dashboard_logs'] =5;
324
+ //get log files
325
+ $logfiles=array();
326
+ if ( $dir = @opendir( $cfg['dirlogs'] ) ) {
327
+ while (($file = readdir( $dir ) ) !== false ) {
328
+ if (is_file($cfg['dirlogs'].'/'.$file) and 'backwpup_log_' == substr($file,0,strlen('backwpup_log_')) and ('.html' == substr($file,-5) or '.html.gz' == substr($file,-8)))
329
+ $logfiles[]=$file;
330
+ }
331
+ closedir( $dir );
332
+ rsort($logfiles);
333
+ }
334
+ echo '<ul>';
335
+ if (count($logfiles)>0) {
336
+ $count=0;
337
+ foreach ($logfiles as $logfile) {
338
+ $logdata=backwpup_read_logheader($cfg['dirlogs'].'/'.$logfile);
339
+ echo '<li>';
340
+ echo '<span>'.date_i18n(get_option('date_format').' '.get_option('time_format'),$logdata['logtime']).'</span> ';
341
+ echo '<a href="'.wp_nonce_url(admin_url('admin.php').'?page=backwpupworking&logfile='.$cfg['dirlogs'].'/'.$logfile, 'view-log_'.$logfile).'" title="'.__('View Log:','backwpup').' '.basename($logfile).'">'.$logdata['name'].'</i></a>';
342
+ if ($logdata['errors']>0)
343
+ printf(' <span style="color:red;font-weight:bold;">'._n("%d ERROR", "%d ERRORS", $logdata['errors'],'backwpup').'</span>', $logdata['errors']);
344
+ if ($logdata['warnings']>0)
345
+ printf(' <span style="color:#e66f00;font-weight:bold;">'._n("%d WARNING", "%d WARNINGS", $logdata['warnings'],'backwpup').'</span>', $logdata['warnings']);
346
+ if($logdata['errors']==0 and $logdata['warnings']==0)
347
+ echo ' <span style="color:green;font-weight:bold;">'.__('O.K.','backwpup').'</span>';
348
+ echo '</li>';
349
+ $count++;
350
+ if ($count>=$widgets['backwpup_dashboard_logs'])
351
+ break;
352
+ }
353
+ echo '</ul>';
354
+ } else {
355
+ echo '<i>'.__('none','backwpup').'</i>';
356
+ }
357
+ }
358
+
359
+ //Dashboard widget for Logs config
360
+ function backwpup_dashboard_logs_config() {
361
+ if ( !$widget_options = get_option( 'dashboard_widget_options' ) )
362
+ $widget_options = array();
363
+
364
+ if ( !isset($widget_options['backwpup_dashboard_logs']) )
365
+ $widget_options['backwpup_dashboard_logs'] = 5;
366
+
367
+ if ( 'POST' == $_SERVER['REQUEST_METHOD'] && isset($_POST['backwpup_dashboard_logs']) ) {
368
+ $number = absint( $_POST['backwpup_dashboard_logs'] );
369
+ $widget_options['backwpup_dashboard_logs'] = $number;
370
+ update_option( 'dashboard_widget_options', $widget_options );
371
+ }
372
+
373
+ echo '<p><label for="backwpup-logs">'.__('How many of the lastes logs would you like to display?','backwpup').'</label>';
374
+ echo '<select id="backwpup-logs" name="backwpup_dashboard_logs">';
375
+ for ($i=0;$i<=20;$i++)
376
+ echo '<option value="'.$i.'" '.selected($i,$widget_options['backwpup_dashboard_logs']).'>'.$i.'</option>';
377
+ echo '</select>';
378
+
379
+ }
380
+
381
+ //Dashboard widget for Jobs
382
+ function backwpup_dashboard_activejobs() {
383
+ $jobs=(array)get_option('backwpup_jobs');
384
+ $runningfile['JOBID']='';
385
+ $runningfile=backwpup_get_working_file();
386
+ $tmp = Array();
387
+ foreach($jobs as &$ma)
388
+ $tmp[] = &$ma["cronnextrun"];
389
+ array_multisort($tmp, SORT_DESC, $jobs);
390
+ $count=0;
391
+ echo '<ul>';
392
+ foreach ($jobs as $jobid => $jobvalue) {
393
+ if ($runningfile['JOBID']==$jobvalue["jobid"]) {
394
+ $runtime=time()-$jobvalue['starttime'];
395
+ echo '<li><span style="font-weight:bold;">'.$jobvalue['jobid'].'. '.$jobvalue['name'].': </span>';
396
+ printf('<span style="color:#e66f00;">'.__('working since %d sec.','backwpup').'</span>',$runtime);
397
+ echo " <a style=\"color:green;\" href=\"" . admin_url('admin.php').'?page=backwpupworking' . "\">" . __('View!','backwpup') . "</a>";
398
+ echo " <a style=\"color:red;\" href=\"" . wp_nonce_url(admin_url('admin.php').'?page=backwpup&action=abort', 'abort-job') . "\">" . __('Abort!','backwpup') . "</a>";
399
+ echo "</li>";
400
+ $count++;
401
+ } elseif ($jobvalue['activated']) {
402
+ echo '<li><span>'.date(get_option('date_format'),$jobvalue['cronnextrun']).' '.date(get_option('time_format'),$jobvalue['cronnextrun']).'</span>';
403
+ echo ' <a href="'.wp_nonce_url(admin_url('admin.php').'?page=backwpupeditjob&jobid='.$jobid, 'edit-job').'" title="'.__('Edit Job','backwpup').'">'.$jobvalue['name'].'</a><br />';
404
+ echo "</li>";
405
+ $count++;
406
+ }
407
+ }
408
+
409
+ if ($count==0)
410
+ echo '<li><i>'.__('none','backwpup').'</i></li>';
411
+ echo '</ul>';
412
+ }
413
+
414
+ //add dashboard widget
415
+ function backwpup_add_dashboard() {
416
+ if (!current_user_can(BACKWPUP_USER_CAPABILITY))
417
+ return;
418
+ wp_add_dashboard_widget( 'backwpup_dashboard_widget_logs', __('BackWPup Logs','backwpup'), 'backwpup_dashboard_logs' , 'backwpup_dashboard_logs_config');
419
+ wp_add_dashboard_widget( 'backwpup_dashboard_widget_activejobs', __('BackWPup Aktive Jobs','backwpup'), 'backwpup_dashboard_activejobs' );
420
+ }
421
+
422
+ //add admin bar menu
423
+ function backwpup_add_adminbar() {
424
+ global $wp_admin_bar;
425
+ $cfg=get_option('backwpup'); //Load Settings
426
+ if (!$cfg['showadminbar'] || !current_user_can(BACKWPUP_USER_CAPABILITY) || !is_super_admin() || !is_admin_bar_showing())
427
+ return;
428
+ /* Add the main siteadmin menu item */
429
+ $wp_admin_bar->add_menu(array( 'id' => 'backwpup', 'title' => __( 'BackWPup', 'textdomain' ), 'href' => admin_url('admin.php').'?page=backwpup'));
430
+ if (backwpup_get_working_file())
431
+ $wp_admin_bar->add_menu(array( 'parent' => 'backwpup', 'title' => __('See Working!','backwpup'), 'href' => admin_url('admin.php').'?page=backwpupworking'));
432
+ $wp_admin_bar->add_menu(array( 'parent' => 'backwpup', 'title' => __('Jobs','backwpup'), 'href' => admin_url('admin.php').'?page=backwpup'));
433
+ $wp_admin_bar->add_menu(array( 'parent' => 'backwpup', 'title' => __('Logs','backwpup'), 'href' => admin_url('admin.php').'?page=backwpuplogs'));
434
+ $wp_admin_bar->add_menu(array( 'parent' => 'backwpup', 'title' => __('Backups','backwpup'), 'href' => admin_url('admin.php').'?page=backwpupbackups'));
435
+
436
+ $wp_admin_bar->add_menu(array( 'parent' => 'new-content', 'title' => __('BackWPup Job','backwpup'), 'href' => admin_url('admin.php').'?page=backwpupeditjob'));
437
+ }
438
+
439
+ //turn cache off
440
+ function backwpup_meta_no_cache() {
441
+ echo "<meta http-equiv=\"expires\" content=\"0\" />\n";
442
+ echo "<meta http-equiv=\"pragma\" content=\"no-cache\" />\n";
443
+ echo "<meta http-equiv=\"cache-control\" content=\"no-cache\" />\n";
444
+ }
445
+
446
+ function backwpup_send_no_cache_header() {
447
+ header("Expires: 0");
448
+ header("Cache-Control: no-cache, must-revalidate");
449
+ header("Pragma: no-cache");
450
+ header("Cache-Control: post-check=0, pre-check=0");
451
+ }
452
+
453
+ function backwpup_get_upload_dir() {
454
+ global $switched;
455
+ $upload_path = get_option( 'upload_path' );
456
+ $upload_path = trim($upload_path);
457
+ $main_override = defined( 'MULTISITE' ) && is_main_site();
458
+ if ( empty($upload_path) ) {
459
+ $dir = WP_CONTENT_DIR . '/uploads';
460
+ } else {
461
+ $dir = $upload_path;
462
+ if ( 'wp-content/uploads' == $upload_path ) {
463
+ $dir = WP_CONTENT_DIR . '/uploads';
464
+ } elseif ( 0 !== strpos($dir, ABSPATH) ) {
465
+ // $dir is absolute, $upload_path is (maybe) relative to ABSPATH
466
+ $dir = path_join( ABSPATH, $dir );
467
+ }
468
+ }
469
+ if ( defined('UPLOADS') && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
470
+ $dir = ABSPATH . UPLOADS;
471
+ }
472
+ if (function_exists('is_multisite')) {
473
+ if ( is_multisite() && !$main_override && ( !isset( $switched ) || $switched === false ) ) {
474
+ if ( defined( 'BLOGUPLOADDIR' ) )
475
+ $dir = untrailingslashit(BLOGUPLOADDIR);
476
+ }
477
+ }
478
+ return str_replace('\\','/',trailingslashit($dir));
479
+ }
480
+
481
+ function backwpup_get_exclude_wp_dirs($folder) {
482
+ $cfg=get_option('backwpup'); //Load Settings
483
+ $folder=trailingslashit(str_replace('\\','/',$folder));
484
+ $excludedir=array();
485
+ $excludedir[]=rtrim(str_replace('\\','/',backwpup_get_working_dir()),'/').'/'; //exclude temp
486
+ $excludedir[]=rtrim(str_replace('\\','/',$cfg['dirlogs']),'/').'/'; //exclude logfiles
487
+ if (false !== strpos(trailingslashit(str_replace('\\','/',ABSPATH)),$folder) and trailingslashit(str_replace('\\','/',ABSPATH))!=$folder)
488
+ $excludedir[]=trailingslashit(str_replace('\\','/',ABSPATH));
489
+ if (false !== strpos(trailingslashit(str_replace('\\','/',WP_CONTENT_DIR)),$folder) and trailingslashit(str_replace('\\','/',WP_CONTENT_DIR))!=$folder)
490
+ $excludedir[]=trailingslashit(str_replace('\\','/',WP_CONTENT_DIR));
491
+ if (false !== strpos(trailingslashit(str_replace('\\','/',WP_PLUGIN_DIR)),$folder) and trailingslashit(str_replace('\\','/',WP_PLUGIN_DIR))!=$folder)
492
+ $excludedir[]=trailingslashit(str_replace('\\','/',WP_PLUGIN_DIR));
493
+ if (false !== strpos(str_replace('\\','/',trailingslashit(WP_CONTENT_DIR).'themes/'),$folder) and str_replace('\\','/',trailingslashit(WP_CONTENT_DIR).'themes/')!=$folder)
494
+ $excludedir[]=str_replace('\\','/',trailingslashit(WP_CONTENT_DIR).'themes/');
495
+ if (false !== strpos(backwpup_get_upload_dir(),$folder) and backwpup_get_upload_dir()!=$folder)
496
+ $excludedir[]=backwpup_get_upload_dir();
497
+ //Exclude Backup dirs
498
+ $jobs=(array)get_option('backwpup_jobs');
499
+ foreach($jobs as $jobsvale) {
500
+ if (!empty($jobsvale['backupdir']) and $jobsvale['backupdir']!='/')
501
+ $excludedir[]=trailingslashit(str_replace('\\','/',$jobsvale['backupdir']));
502
+ }
503
+ return $excludedir;
504
+ }
505
+
506
+ //Calcs next run for a cron string as timestamp
507
+ function backwpup_cron_next($cronstring) {
508
+ //Cronstring zerlegen
509
+ list($cronstr['minutes'],$cronstr['hours'],$cronstr['mday'],$cronstr['mon'],$cronstr['wday'])=explode(' ',$cronstring,5);
510
+
511
+ //make arrys form string
512
+ foreach ($cronstr as $key => $value) {
513
+ if (strstr($value,','))
514
+ $cronarray[$key]=explode(',',$value);
515
+ else
516
+ $cronarray[$key]=array(0=>$value);
517
+ }
518
+ //make arrys complete with ranges and steps
519
+ foreach ($cronarray as $cronarraykey => $cronarrayvalue) {
520
+ $cron[$cronarraykey]=array();
521
+ foreach ($cronarrayvalue as $key => $value) {
522
+ //steps
523
+ $step=1;
524
+ if (strstr($value,'/'))
525
+ list($value,$step)=explode('/',$value,2);
526
+ //replase weekeday 7 with 0 for sundays
527
+ if ($cronarraykey=='wday')
528
+ $value=str_replace('7','0',$value);
529
+ //ranges
530
+ if (strstr($value,'-')) {
531
+ list($first,$last)=explode('-',$value,2);
532
+ if (!is_numeric($first) or !is_numeric($last) or $last>60 or $first>60) //check
533
+ return 2147483647;
534
+ if ($cronarraykey=='minutes' and $step<5) //set step ninmum to 5 min.
535
+ $step=5;
536
+ $range=array();
537
+ for ($i=$first;$i<=$last;$i=$i+$step)
538
+ $range[]=$i;
539
+ $cron[$cronarraykey]=array_merge($cron[$cronarraykey],$range);
540
+ } elseif ($value=='*') {
541
+ $range=array();
542
+ if ($cronarraykey=='minutes') {
543
+ if ($step<5) //set step ninmum to 5 min.
544
+ $step=5;
545
+ for ($i=0;$i<=59;$i=$i+$step)
546
+ $range[]=$i;
547
+ }
548
+ if ($cronarraykey=='hours') {
549
+ for ($i=0;$i<=23;$i=$i+$step)
550
+ $range[]=$i;
551
+ }
552
+ if ($cronarraykey=='mday') {
553
+ for ($i=$step;$i<=31;$i=$i+$step)
554
+ $range[]=$i;
555
+ }
556
+ if ($cronarraykey=='mon') {
557
+ for ($i=$step;$i<=12;$i=$i+$step)
558
+ $range[]=$i;
559
+ }
560
+ if ($cronarraykey=='wday') {
561
+ for ($i=0;$i<=6;$i=$i+$step)
562
+ $range[]=$i;
563
+ }
564
+ $cron[$cronarraykey]=array_merge($cron[$cronarraykey],$range);
565
+ } else {
566
+ //Month names
567
+ if (strtolower($value)=='jan')
568
+ $value=1;
569
+ if (strtolower($value)=='feb')
570
+ $value=2;
571
+ if (strtolower($value)=='mar')
572
+ $value=3;
573
+ if (strtolower($value)=='apr')
574
+ $value=4;
575
+ if (strtolower($value)=='may')
576
+ $value=5;
577
+ if (strtolower($value)=='jun')
578
+ $value=6;
579
+ if (strtolower($value)=='jul')
580
+ $value=7;
581
+ if (strtolower($value)=='aug')
582
+ $value=8;
583
+ if (strtolower($value)=='sep')
584
+ $value=9;
585
+ if (strtolower($value)=='oct')
586
+ $value=10;
587
+ if (strtolower($value)=='nov')
588
+ $value=11;
589
+ if (strtolower($value)=='dec')
590
+ $value=12;
591
+ //Week Day names
592
+ if (strtolower($value)=='sun')
593
+ $value=0;
594
+ if (strtolower($value)=='sat')
595
+ $value=6;
596
+ if (strtolower($value)=='mon')
597
+ $value=1;
598
+ if (strtolower($value)=='tue')
599
+ $value=2;
600
+ if (strtolower($value)=='wed')
601
+ $value=3;
602
+ if (strtolower($value)=='thu')
603
+ $value=4;
604
+ if (strtolower($value)=='fri')
605
+ $value=5;
606
+ if (!is_numeric($value) or $value>60) //check
607
+ return 2147483647;
608
+ $cron[$cronarraykey]=array_merge($cron[$cronarraykey],array(0=>$value));
609
+ }
610
+ }
611
+ }
612
+ //generate next 10 years
613
+ for ($i=date('Y');$i<2038;$i++)
614
+ $cron['year'][]=$i;
615
+
616
+ //calc next timestamp
617
+ $currenttime=current_time('timestamp');
618
+ foreach ($cron['year'] as $year) {
619
+ foreach ($cron['mon'] as $mon) {
620
+ foreach ($cron['mday'] as $mday) {
621
+ foreach ($cron['hours'] as $hours) {
622
+ foreach ($cron['minutes'] as $minutes) {
623
+ $timestamp=mktime($hours,$minutes,0,$mon,$mday,$year);
624
+ if ($timestamp and in_array(date('j',$timestamp),$cron['mday']) and in_array(date('w',$timestamp),$cron['wday']) and $timestamp>$currenttime) {
625
+ return $timestamp;
626
+ }
627
+ }
628
+ }
629
+ }
630
+ }
631
+ }
632
+ return 2147483647;
633
+ }
634
+
635
+ function backwpup_get_working_dir() {
636
+ $folder='backwpup_'.substr(md5(str_replace('\\','/',realpath(rtrim(basename(__FILE__),'/\\').'/job/'))),8,16).'/';
637
+ $tempdir=getenv('TMP');
638
+ if (!$tempdir)
639
+ $tempdir=getenv('TEMP');
640
+ if (!$tempdir or !is_writable($tempdir) or !is_dir($tempdir))
641
+ $tempdir=getenv('TMPDIR');
642
+ if (!$tempdir or !is_writable($tempdir) or !is_dir($tempdir))
643
+ $tempdir=ini_get('upload_tmp_dir');
644
+ if (!$tempdir or empty($tempdir) or !is_writable($tempdir) or !is_dir($tempdir))
645
+ $tempdir=sys_get_temp_dir();
646
+ if (is_readable(dirname(__FILE__).'/../.backwpuptempfolder'))
647
+ $tempdir=trim(file_get_contents(dirname(__FILE__).'/../.backwpuptempfolder',false,NULL,0,255));
648
+ $tempdir=str_replace('\\','/',realpath(rtrim($tempdir,'/'))).'/';
649
+ if (is_dir($tempdir.$folder) and is_writable($tempdir.$folder)) {
650
+ return $tempdir.$folder;
651
+ } else {
652
+ return false;
653
+ }
654
+ }
655
+
656
+ function backwpup_get_working_file() {
657
+ $tempdir=backwpup_get_working_dir();
658
+ if (is_file($tempdir.'.running')) {
659
+ if ($runningfile=file_get_contents($tempdir.'.running'))
660
+ return unserialize(trim($runningfile));
661
+ else
662
+ return false;
663
+ } else {
664
+ return false;
665
+ }
666
+ }
667
+
668
+ function backwpup_env_checks() {
669
+ global $wp_version,$backwpup_admin_message;
670
+ $message='';
671
+ $checks=true;
672
+ $cfg=get_option('backwpup');
673
+ if (version_compare($wp_version, BACKWPUP_MIN_WORDPRESS_VERSION, '<')) { // check WP Version
674
+ $message.=str_replace('%d',BACKWPUP_MIN_WORDPRESS_VERSION,__('- WordPress %d or heiger needed!','backwpup')) . '<br />';
675
+ $checks=false;
676
+ }
677
+ if (version_compare(phpversion(), '5.2.4', '<')) { // check PHP Version sys_get_temp_dir
678
+ $message.=__('- PHP 5.2.4 or higher needed!','backwpup') . '<br />';
679
+ $checks=false;
680
+ }
681
+ if (is_multisite()) {
682
+ $message.=__('- Multiseite Blogs not allowed!','backwpup') . '<br />';
683
+ $checks=false;
684
+ }
685
+ if (!function_exists('curl_init')) { // check curl
686
+ $message.=__('- curl is needed!','backwpup') . '<br />';
687
+ $checks=false;
688
+ }
689
+ if (!function_exists('session_start')) { // check sessions
690
+ $message.=__('- PHP sessions needed!','backwpup') . '<br />';
691
+ $checks=false;
692
+ }
693
+ if (!is_dir($cfg['dirlogs'])) { // create logs folder if it not exists
694
+ @mkdir($cfg['dirlogs'],0755,true);
695
+ }
696
+ if (!is_dir($cfg['dirlogs'])) { // check logs folder
697
+ $message.=__('- Logs Folder not exists:','backwpup') . ' '.$cfg['dirlogs'].'<br />';
698
+ }
699
+ if (!is_writable($cfg['dirlogs'])) { // check logs folder
700
+ $message.=__('- Logs Folder not writeable:','backwpup') . ' '.$cfg['dirlogs'].'<br />';
701
+ }
702
+ $jobs=(array)get_option('backwpup_jobs');
703
+ foreach ($jobs as $jobid => $jobvalue) { //check for old cheduling
704
+ if (isset($jobvalue['scheduletime']) and empty($jobvalue['cron']))
705
+ $message.=__('- Please Check Scheduling time for Job:','backwpup') . ' '.$jobid.'. '.$jobvalue['name'].'<br />';
706
+ }
707
+ if (wp_next_scheduled('backwpup_cron')!=0 and wp_next_scheduled('backwpup_cron')>(time()+360)) { //check cron jobs work
708
+ $message.=__("- WP-Cron don't working please check it!","backwpup") .'<br />';
709
+ }
710
+ //put massage if one
711
+ if (!empty($message))
712
+ $backwpup_admin_message = '<div id="message" class="error fade"><strong>BackWPup:</strong><br />'.$message.'</div>';
713
+ return $checks;
714
+ }
715
+
716
+ function backwpup_admin_notice() {
717
+ global $backwpup_admin_message;
718
+ echo $backwpup_admin_message;
719
+ }
720
+
721
+ //Checking,upgrade and default job setting
722
+ function backwpup_get_job_vars($jobid='',$jobnewsettings='') {
723
+ global $wpdb;
724
+ //get job data
725
+ $jobs=get_option('backwpup_jobs'); //load jobs
726
+ if (!empty($jobid)) {
727
+ if (isset($jobs[$jobid]))
728
+ $jobsettings=$jobs[$jobid];
729
+ $jobsettings['jobid']=$jobid;
730
+ } else {
731
+ if (empty($jobsettings['jobid'])) { //generate jobid if not exists
732
+ $heighestid=0;
733
+ if (is_array($jobs)) {
734
+ foreach ($jobs as $jobkey => $jobvalue) {
735
+ if ($jobkey>$heighestid)
736
+ $heighestid=$jobkey;
737
+ }
738
+ }
739
+ $jobsettings['jobid']=$heighestid+1;
740
+ }
741
+ }
742
+ unset($jobs);
743
+ unset($jobid);
744
+ if (!empty($jobnewsettings) && is_array($jobnewsettings)) { //overwrite with new settings
745
+ $jobsettings=array_merge($jobsettings,$jobnewsettings);
746
+ }
747
+
748
+ //check job type
749
+ if (!isset($jobsettings['type']) or !is_string($jobsettings['type']))
750
+ $jobsettings['type']='DB+FILE';
751
+ $todo=explode('+',strtoupper($jobsettings['type']));
752
+ foreach($todo as $key => $value) {
753
+ if (!in_array($value,backwpup_backup_types()))
754
+ unset($todo[$key]);
755
+ }
756
+ $jobsettings['type']=implode('+',$todo);
757
+ if (empty($jobsettings['type']))
758
+ $jobsettings['type']='DB+FILE';
759
+
760
+ if (empty($jobsettings['name']) or !is_string($jobsettings['name']))
761
+ $jobsettings['name']= __('New', 'backwpup');
762
+
763
+ if (!isset($jobsettings['activated']) or !is_bool($jobsettings['activated']))
764
+ $jobsettings['activated']=false;
765
+
766
+ if (!isset($jobsettings['cronselect']) and !isset($jobsettings['cron']))
767
+ $jobsettings['cronselect']='basic';
768
+ elseif (!isset($jobsettings['cronselect']) and isset($jobsettings['cron']))
769
+ $jobsettings['cronselect']='advanced';
770
+
771
+ if ($jobsettings['cronselect']!='advanced' and $jobsettings['cronselect']!='basic')
772
+ $jobsettings['cronselect']='advanced';
773
+
774
+ if (!isset($jobsettings['cron']) or !is_string($jobsettings['cron']))
775
+ $jobsettings['cron']='0 3 * * *';
776
+
777
+ if (!isset($jobsettings['cronnextrun']) or !is_numeric($jobsettings['cronnextrun']))
778
+ $jobsettings['cronnextrun']=backwpup_cron_next($jobsettings['cron']);
779
+
780
+ if (!isset($jobsettings['mailaddresslog']) or !is_string($jobsettings['mailaddresslog']))
781
+ $jobsettings['mailaddresslog']=get_option('admin_email');
782
+
783
+ if (!isset($jobsettings['mailerroronly']) or !is_bool($jobsettings['mailerroronly']))
784
+ $jobsettings['mailerroronly']=true;
785
+
786
+ //old tables for backup (exclude)
787
+ if (isset($jobsettings['dbexclude'])) {
788
+ if (is_array($jobsettings['dbexclude'])) {
789
+ $jobsettings['dbtables']=array();
790
+ $tables=$wpdb->get_col('SHOW TABLES FROM `'.DB_NAME.'`');
791
+ foreach ($tables as $table) {
792
+ if (!in_array($table,$jobsettings['dbexclude']))
793
+ $jobsettings['dbtables'][]=$table;
794
+ }
795
+ }
796
+ }
797
+
798
+ //Tables to backup
799
+ if (!isset($jobsettings['dbtables']) or !is_array($jobsettings['dbtables'])) {
800
+ $jobsettings['dbtables']=array();
801
+ $tables=$wpdb->get_col('SHOW TABLES FROM `'.DB_NAME.'`');
802
+ foreach ($tables as $table) {
803
+ if (substr($table,0,strlen($wpdb->prefix))==$wpdb->prefix)
804
+ $jobsettings['dbtables'][]=$table;
805
+ }
806
+ }
807
+ sort($jobsettings['dbtables']);
808
+
809
+ if (!isset($jobsettings['dbshortinsert']) or !is_bool($jobsettings['dbshortinsert']))
810
+ $jobsettings['dbshortinsert']=false;
811
+
812
+ if (!isset($jobsettings['maintenance']) or !is_bool($jobsettings['maintenance']))
813
+ $jobsettings['maintenance']=false;
814
+
815
+ if (!isset($jobsettings['fileexclude']) or !is_string($jobsettings['fileexclude']))
816
+ $jobsettings['fileexclude']='';
817
+ $fileexclude=explode(',',$jobsettings['fileexclude']);
818
+ foreach($fileexclude as $key => $value) {
819
+ $fileexclude[$key]=str_replace('//','/',str_replace('\\','/',trim($value)));
820
+ if (empty($fileexclude[$key]))
821
+ unset($fileexclude[$key]);
822
+ }
823
+ sort($fileexclude);
824
+ $jobsettings['fileexclude']=implode(',',$fileexclude);
825
+
826
+ if (!isset($jobsettings['dirinclude']) or !is_string($jobsettings['dirinclude']))
827
+ $jobsettings['dirinclude']='';
828
+ $dirinclude=explode(',',$jobsettings['dirinclude']);
829
+ foreach($dirinclude as $key => $value) {
830
+ $dirinclude[$key]=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($value))));
831
+ if ($dirinclude[$key]=='/' or empty($dirinclude[$key]) or !is_dir($dirinclude[$key]))
832
+ unset($dirinclude[$key]);
833
+ }
834
+ sort($dirinclude);
835
+ $jobsettings['dirinclude']=implode(',',$dirinclude);
836
+
837
+ if (!isset($jobsettings['backuproot']) or !is_bool($jobsettings['backuproot']))
838
+ $jobsettings['backuproot']=true;
839
+
840
+ if (!isset($jobsettings['backupcontent']) or !is_bool($jobsettings['backupcontent']))
841
+ $jobsettings['backupcontent']=true;
842
+
843
+ if (!isset($jobsettings['backupplugins']) or !is_bool($jobsettings['backupplugins']))
844
+ $jobsettings['backupplugins']=true;
845
+
846
+ if (!isset($jobsettings['backupthemes']) or !is_bool($jobsettings['backupthemes']))
847
+ $jobsettings['backupthemes']=true;
848
+
849
+ if (!isset($jobsettings['backupuploads']) or !is_bool($jobsettings['backupuploads']))
850
+ $jobsettings['backupuploads']=true;
851
+
852
+ if (!isset($jobsettings['backuprootexcludedirs']) or !is_array($jobsettings['backuprootexcludedirs']))
853
+ $jobsettings['backuprootexcludedirs']=array();
854
+ foreach($jobsettings['backuprootexcludedirs'] as $key => $value) {
855
+ $jobsettings['backuprootexcludedirs'][$key]=str_replace('//','/',str_replace('\\','/',trim($value)));
856
+ if (empty($jobsettings['backuprootexcludedirs'][$key]) or $jobsettings['backuprootexcludedirs'][$key]=='/' or !is_dir($jobsettings['backuprootexcludedirs'][$key]))
857
+ unset($jobsettings['backuprootexcludedirs'][$key]);
858
+ }
859
+ sort($jobsettings['backuprootexcludedirs']);
860
+
861
+ if (!isset($jobsettings['backupcontentexcludedirs']) or !is_array($jobsettings['backupcontentexcludedirs']))
862
+ $jobsettings['backupcontentexcludedirs']=array();
863
+ foreach($jobsettings['backupcontentexcludedirs'] as $key => $value) {
864
+ $jobsettings['backupcontentexcludedirs'][$key]=str_replace('//','/',str_replace('\\','/',trim($value)));
865
+ if (empty($jobsettings['backupcontentexcludedirs'][$key]) or $jobsettings['backupcontentexcludedirs'][$key]=='/' or !is_dir($jobsettings['backupcontentexcludedirs'][$key]))
866
+ unset($jobsettings['backupcontentexcludedirs'][$key]);
867
+ }
868
+ sort($jobsettings['backupcontentexcludedirs']);
869
+
870
+ if (!isset($jobsettings['backuppluginsexcludedirs']) or !is_array($jobsettings['backuppluginsexcludedirs']))
871
+ $jobsettings['backuppluginsexcludedirs']=array();
872
+ foreach($jobsettings['backuppluginsexcludedirs'] as $key => $value) {
873
+ $jobsettings['backuppluginsexcludedirs'][$key]=str_replace('//','/',str_replace('\\','/',trim($value)));
874
+ if (empty($jobsettings['backuppluginsexcludedirs'][$key]) or $jobsettings['backuppluginsexcludedirs'][$key]=='/' or !is_dir($jobsettings['backuppluginsexcludedirs'][$key]))
875
+ unset($jobsettings['backuppluginsexcludedirs'][$key]);
876
+ }
877
+ sort($jobsettings['backuppluginsexcludedirs']);
878
+
879
+ if (!isset($jobsettings['backupthemesexcludedirs']) or !is_array($jobsettings['backupthemesexcludedirs']))
880
+ $jobsettings['backupthemesexcludedirs']=array();
881
+ foreach($jobsettings['backupthemesexcludedirs'] as $key => $value) {
882
+ $jobsettings['backupthemesexcludedirs'][$key]=str_replace('//','/',str_replace('\\','/',trim($value)));
883
+ if (empty($jobsettings['backupthemesexcludedirs'][$key]) or $jobsettings['backupthemesexcludedirs'][$key]=='/' or !is_dir($jobsettings['backupthemesexcludedirs'][$key]))
884
+ unset($jobsettings['backupthemesexcludedirs'][$key]);
885
+ }
886
+ sort($jobsettings['backupthemesexcludedirs']);
887
+
888
+ if (!isset($jobsettings['backupuploadsexcludedirs']) or !is_array($jobsettings['backupuploadsexcludedirs']))
889
+ $jobsettings['backupuploadsexcludedirs']=array();
890
+ foreach($jobsettings['backupuploadsexcludedirs'] as $key => $value) {
891
+ $jobsettings['backupuploadsexcludedirs'][$key]=str_replace('//','/',str_replace('\\','/',trim($value)));
892
+ if (empty($jobsettings['backupuploadsexcludedirs'][$key]) or $jobsettings['backupuploadsexcludedirs'][$key]=='/' or !is_dir($jobsettings['backupuploadsexcludedirs'][$key]))
893
+ unset($jobsettings['backupuploadsexcludedirs'][$key]);
894
+ }
895
+ sort($jobsettings['backupuploadsexcludedirs']);
896
+
897
+ $fileformarts=array('.zip','.tar.gz','.tar.bz2','.tar');
898
+ if (!isset($jobsettings['fileformart']) or !in_array($jobsettings['fileformart'],$fileformarts))
899
+ $jobsettings['fileformart']='.zip';
900
+
901
+ if (!isset($jobsettings['fileprefix']) or !is_string($jobsettings['fileprefix']))
902
+ $jobsettings['fileprefix']='backwpup_'.$jobsettings['jobid'].'_';
903
+
904
+ if (!isset($jobsettings['mailefilesize']) or !is_float($jobsettings['mailefilesize']))
905
+ $jobsettings['mailefilesize']=0;
906
+
907
+ if (!isset($jobsettings['backupdir']))
908
+ $jobsettings['backupdir']='';
909
+ $jobsettings['backupdir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['backupdir']))));
910
+ if ($jobsettings['backupdir']=='/')
911
+ $jobsettings['backupdir']='';
912
+
913
+ if (!isset($jobsettings['maxbackups']) or !is_int($jobsettings['maxbackups']))
914
+ $jobsettings['maxbackups']=0;
915
+
916
+ if (!empty($jobsettings['ftphost']) and false !== strpos($jobsettings['ftphost'],':'))
917
+ list($jobsettings['ftphost'],$jobsettings['ftphostport'])=explode(':',$jobsettings['ftphost'],2);
918
+
919
+ if (!isset($jobsettings['ftphost']) or !is_string($jobsettings['ftphost']))
920
+ $jobsettings['ftphost']='';
921
+
922
+ if (!isset($jobsettings['ftphostport']) or !is_int($jobsettings['ftphostport']))
923
+ $jobsettings['ftphostport']=21;
924
+
925
+ if (!isset($jobsettings['ftpuser']) or !is_string($jobsettings['ftpuser']))
926
+ $jobsettings['ftpuser']='';
927
+
928
+ if (!isset($jobsettings['ftppass']) or !is_string($jobsettings['ftppass']))
929
+ $jobsettings['ftppass']='';
930
+
931
+ if (!isset($jobsettings['ftpdir']) or !is_string($jobsettings['ftpdir']) or $jobsettings['ftpdir']=='/')
932
+ $jobsettings['ftpdir']='';
933
+ $jobsettings['ftpdir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['ftpdir']))));
934
+ if (substr($jobsettings['ftpdir'],0,1)!='/')
935
+ $jobsettings['ftpdir']='/'.$jobsettings['ftpdir'];
936
+
937
+ if (!isset($jobsettings['ftpmaxbackups']) or !is_int($jobsettings['ftpmaxbackups']))
938
+ $jobsettings['ftpmaxbackups']=0;
939
+
940
+ if (!isset($jobsettings['ftppasv']) or !is_bool($jobsettings['ftppasv']))
941
+ $jobsettings['ftppasv']=true;
942
+
943
+ if (!isset($jobsettings['ftpssl']) or !is_bool($jobsettings['ftpssl']))
944
+ $jobsettings['ftpssl']=false;
945
+
946
+ if (!isset($jobsettings['awsAccessKey']) or !is_string($jobsettings['awsAccessKey']))
947
+ $jobsettings['awsAccessKey']='';
948
+
949
+ if (!isset($jobsettings['awsSecretKey']) or !is_string($jobsettings['awsSecretKey']))
950
+ $jobsettings['awsSecretKey']='';
951
+
952
+ if (!isset($jobsettings['awsrrs']) or !is_bool($jobsettings['awsrrs']))
953
+ $jobsettings['awsrrs']=false;
954
+
955
+ if (!isset($jobsettings['awsBucket']) or !is_string($jobsettings['awsBucket']))
956
+ $jobsettings['awsBucket']='';
957
+
958
+ if (!isset($jobsettings['awsdir']) or !is_string($jobsettings['awsdir']) or $jobsettings['awsdir']=='/')
959
+ $jobsettings['awsdir']='';
960
+ $jobsettings['awsdir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['awsdir']))));
961
+ if (substr($jobsettings['awsdir'],0,1)=='/')
962
+ $jobsettings['awsdir']=substr($jobsettings['awsdir'],1);
963
+
964
+ if (!isset($jobsettings['awsmaxbackups']) or !is_int($jobsettings['awsmaxbackups']))
965
+ $jobsettings['awsmaxbackups']=0;
966
+
967
+ if (!isset($jobsettings['GStorageAccessKey']) or !is_string($jobsettings['GStorageAccessKey']))
968
+ $jobsettings['GStorageAccessKey']='';
969
+
970
+ if (!isset($jobsettings['GStorageSecret']) or !is_string($jobsettings['GStorageSecret']))
971
+ $jobsettings['GStorageSecret']='';
972
+
973
+ if (!isset($jobsettings['GStorageBucket']) or !is_string($jobsettings['GStorageBucket']))
974
+ $jobsettings['GStorageBucket']='';
975
+
976
+ if (!isset($jobsettings['GStoragedir']) or !is_string($jobsettings['GStoragedir']) or $jobsettings['GStoragedir']=='/')
977
+ $jobsettings['GStoragedir']='';
978
+ $jobsettings['GStoragedir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['GStoragedir']))));
979
+ if (substr($jobsettings['GStoragedir'],0,1)=='/')
980
+ $jobsettings['GStoragedir']=substr($jobsettings['GStoragedir'],1);
981
+
982
+ if (!isset($jobsettings['GStoragemaxbackups']) or !is_int($jobsettings['GStoragemaxbackups']))
983
+ $jobsettings['GStoragemaxbackups']=0;
984
+
985
+ if (!isset($jobsettings['msazureHost']) or !is_string($jobsettings['msazureHost']))
986
+ $jobsettings['msazureHost']='blob.core.windows.net';
987
+
988
+ if (!isset($jobsettings['msazureAccName']) or !is_string($jobsettings['msazureAccName']))
989
+ $jobsettings['msazureAccName']='';
990
+
991
+ if (!isset($jobsettings['msazureKey']) or !is_string($jobsettings['msazureKey']))
992
+ $jobsettings['msazureKey']='';
993
+
994
+ if (!isset($jobsettings['msazureContainer']) or !is_string($jobsettings['msazureContainer']))
995
+ $jobsettings['msazureContainer']='';
996
+
997
+ if (!isset($jobsettings['msazuredir']) or !is_string($jobsettings['msazuredir']) or $jobsettings['msazuredir']=='/')
998
+ $jobsettings['msazuredir']='';
999
+ $jobsettings['msazuredir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['msazuredir']))));
1000
+ if (substr($jobsettings['msazuredir'],0,1)=='/')
1001
+ $jobsettings['msazuredir']=substr($jobsettings['msazuredir'],1);
1002
+
1003
+ if (!isset($jobsettings['msazuremaxbackups']) or !is_int($jobsettings['msazuremaxbackups']))
1004
+ $jobsettings['msazuremaxbackups']=0;
1005
+
1006
+ if (!isset($jobsettings['rscUsername']) or !is_string($jobsettings['rscUsername']))
1007
+ $jobsettings['rscUsername']='';
1008
+
1009
+ if (!isset($jobsettings['rscAPIKey']) or !is_string($jobsettings['rscAPIKey']))
1010
+ $jobsettings['rscAPIKey']='';
1011
+
1012
+ if (!isset($jobsettings['rscContainer']) or !is_string($jobsettings['rscContainer']))
1013
+ $jobsettings['rscContainer']='';
1014
+
1015
+ if (!isset($jobsettings['rscdir']) or !is_string($jobsettings['rscdir']) or $jobsettings['rscdir']=='/')
1016
+ $jobsettings['rscdir']='';
1017
+ $jobsettings['rscdir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['rscdir']))));
1018
+ if (substr($jobsettings['rscdir'],0,1)=='/')
1019
+ $jobsettings['rscdir']=substr($jobsettings['rscdir'],1);
1020
+
1021
+ if (!isset($jobsettings['rscmaxbackups']) or !is_int($jobsettings['rscmaxbackups']))
1022
+ $jobsettings['rscmaxbackups']=0;
1023
+
1024
+ if (!isset($jobsettings['dropetoken']) or !is_string($jobsettings['dropetoken']))
1025
+ $jobsettings['dropetoken']='';
1026
+
1027
+ if (!isset($jobsettings['dropesecret']) or !is_string($jobsettings['dropesecret']))
1028
+ $jobsettings['dropesecret']='';
1029
+
1030
+ if (!isset($jobsettings['dropedir']) or !is_string($jobsettings['dropedir']) or $jobsettings['dropedir']=='/')
1031
+ $jobsettings['dropedir']='';
1032
+ $jobsettings['dropedir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['dropedir']))));
1033
+ if (substr($jobsettings['dropedir'],0,1)=='/')
1034
+ $jobsettings['dropedir']=substr($jobsettings['dropedir'],1);
1035
+
1036
+ if (!isset($jobsettings['droperoot']) or ($jobsettings['droperoot']!='dropbox' and $jobsettings['droperoot']!='sandbox'))
1037
+ $jobsettings['droperoot']='dropbox';
1038
+
1039
+ if (!isset($jobsettings['dropemaxbackups']) or !is_int($jobsettings['dropemaxbackups']))
1040
+ $jobsettings['dropemaxbackups']=0;
1041
+
1042
+ if (!isset($jobsettings['sugaruser']) or !is_string($jobsettings['sugaruser']))
1043
+ $jobsettings['sugaruser']='';
1044
+
1045
+ if (!isset($jobsettings['sugarpass']) or !is_string($jobsettings['sugarpass']))
1046
+ $jobsettings['sugarpass']='';
1047
+
1048
+ if (!isset($jobsettings['sugarroot']) or !is_string($jobsettings['sugarroot']))
1049
+ $jobsettings['sugarroot']='';
1050
+
1051
+ if (!isset($jobsettings['sugardir']) or !is_string($jobsettings['sugardir']) or $jobsettings['sugardir']=='/')
1052
+ $jobsettings['sugardir']='';
1053
+ $jobsettings['sugardir']=trailingslashit(str_replace('//','/',str_replace('\\','/',trim($jobsettings['sugardir']))));
1054
+ if (substr($jobsettings['sugardir'],0,1)=='/')
1055
+ $jobsettings['sugardir']=substr($jobsettings['sugardir'],1);
1056
+
1057
+ if (!isset($jobsettings['sugarmaxbackups']) or !is_int($jobsettings['sugarmaxbackups']))
1058
+ $jobsettings['sugarmaxbackups']=0;
1059
+
1060
+ if (!isset($jobsettings['mailaddress']) or !is_string($jobsettings['mailaddress']))
1061
+ $jobsettings['mailaddress']='';
1062
+
1063
+ //unset old not nedded vars
1064
+ unset($jobsettings['scheduletime']);
1065
+ unset($jobsettings['scheduleintervaltype']);
1066
+ unset($jobsettings['scheduleintervalteimes']);
1067
+ unset($jobsettings['scheduleinterval']);
1068
+ unset($jobsettings['dropemail']);
1069
+ unset($jobsettings['dropepass']);
1070
+ unset($jobsettings['dbexclude']);
1071
+
1072
+ return $jobsettings;
1073
+ }
1074
+ ?>
backwpup.php CHANGED
@@ -1,55 +1,64 @@
1
  <?php
2
  /*
3
  Plugin Name: BackWPup
4
- Plugin URI: http://danielhuesken.de/portfolio/backwpup/
5
- Description: Backup and more of your WordPress Blog Database and Files.
6
  Author: Daniel H&uuml;sken
7
- Version: 1.7.8
8
  Author URI: http://danielhuesken.de
9
  Text Domain: backwpup
10
  Domain Path: /lang/
11
  */
12
 
13
  /*
14
- Copyright 2010 Daniel H�sken (email : daniel@huesken-net.de)
15
 
16
- This program is free software; you can redistribute it and/or modify
17
- it under the terms of the GNU General Public License, version 2, as
18
- published by the Free Software Foundation.
 
19
 
20
- This program is distributed in the hope that it will be useful,
21
- but WITHOUT ANY WARRANTY; without even the implied warranty of
22
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
- GNU General Public License for more details.
24
 
25
- You should have received a copy of the GNU General Public License
26
- along with this program; if not, write to the Free Software
27
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28
  */
29
 
30
  // don't load directly
31
- if ( !defined('ABSPATH') )
32
- die('-1');
 
 
 
33
 
34
  //Set plugin dirname
35
  define('BACKWPUP_PLUGIN_BASEDIR', dirname(plugin_basename(__FILE__)));
 
36
  //Set Plugin Version
37
- define('BACKWPUP_VERSION', '1.7.8');
 
 
38
  //Set User Capability
39
- define('BACKWPUP_USER_CAPABILITY', '10');
40
  //Set useable destinations
41
  if (!defined('BACKWPUP_DESTS'))
42
- define('BACKWPUP_DESTS', 'S3,RSC,FTP,DROPBOX,MSAZURE,SUGARSYNC');
43
  //Set Dropbox Aplication Keys
44
  define('BACKWPUP_DROPBOX_APP_KEY', 'q2jbt0unkkc54u2');
45
  define('BACKWPUP_DROPBOX_APP_SECRET', 't5hlbxtz473hchy');
46
  //Set SugarSync Aplication Keys
47
  define('BACKWPUP_SUGARSYNC_ACCESSKEY', 'OTcwNjc5MTI5OTQxMzY1Njc5OA');
48
  define('BACKWPUP_SUGARSYNC_PRIVATEACCESSKEY', 'NzNmNDMwMDBiNTkwNDY0YzhjY2JiN2E5YWVkMjFmYmI');
 
 
49
  //load Text Domain
50
  load_plugin_textdomain('backwpup', false, BACKWPUP_PLUGIN_BASEDIR.'/lang');
51
  //Load functions file
52
- require_once(dirname(__FILE__).'/app/php-functions.php');
53
  //Plugin activate
54
  register_activation_hook(__FILE__, 'backwpup_plugin_activate');
55
  //Plugin deactivate
@@ -57,8 +66,6 @@ register_deactivation_hook(__FILE__, 'backwpup_plugin_deactivate');
57
  //Admin message
58
  add_action('admin_notices', 'backwpup_admin_notice');
59
  if (backwpup_env_checks()) {
60
- //include php5 functions
61
- require_once(dirname(__FILE__).'/app/php5-functions.php');
62
  //add Menu
63
  add_action('admin_menu', 'backwpup_admin_menu');
64
  //add cron intervals
@@ -67,17 +74,16 @@ if (backwpup_env_checks()) {
67
  add_action('backwpup_cron', 'backwpup_cron');
68
  //add Dashboard widget
69
  add_action('wp_dashboard_setup', 'backwpup_add_dashboard');
 
 
70
  //Additional links on the plugin page
71
  add_filter('plugin_action_links_'.BACKWPUP_PLUGIN_BASEDIR.'/backwpup.php', 'backwpup_plugin_options_link');
72
  add_filter('plugin_row_meta', 'backwpup_plugin_links',10,2);
73
- // add ajax function
74
- add_action('wp_ajax_backwpup_get_aws_buckets', 'backwpup_get_aws_buckets');
75
- add_action('wp_ajax_backwpup_get_rsc_container', 'backwpup_get_rsc_container');
76
- add_action('wp_ajax_backwpup_get_msazure_container', 'backwpup_get_msazure_container');
77
- add_action('wp_ajax_backwpup_get_sugarsync_root', 'backwpup_get_sugarsync_root');
78
  //Disabele WP_Corn
79
  $cfg=get_option('backwpup');
80
- if ($cfg['disablewpcron'])
81
  define('DISABLE_WP_CRON',true);
82
  //test if cron active
83
  if (!(wp_next_scheduled('backwpup_cron')))
1
  <?php
2
  /*
3
  Plugin Name: BackWPup
4
+ Plugin URI: http://backwpup.com
5
+ Description: Wordpress Backup and more...
6
  Author: Daniel H&uuml;sken
7
+ Version: 2.0.0
8
  Author URI: http://danielhuesken.de
9
  Text Domain: backwpup
10
  Domain Path: /lang/
11
  */
12
 
13
  /*
14
+ Copyright (C) 2011 Daniel H�sken (email: daniel@huesken-net.de)
15
 
16
+ This program is free software; you can redistribute it and/or
17
+ modify it under the terms of the GNU General Public License
18
+ as published by the Free Software Foundation; either version 2
19
+ of the License, or (at your option) any later version.
20
 
21
+ This program is distributed in the hope that it will be useful,
22
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
23
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24
+ GNU General Public License for more details.
25
 
26
+ You should have received a copy of the GNU General Public License
27
+ along with this program; if not, write to the Free Software
28
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
29
  */
30
 
31
  // don't load directly
32
+ if (!defined('ABSPATH')) {
33
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
34
+ header("Status: 404 Not Found");
35
+ die();
36
+ }
37
 
38
  //Set plugin dirname
39
  define('BACKWPUP_PLUGIN_BASEDIR', dirname(plugin_basename(__FILE__)));
40
+ define('BACKWPUP_PLUGIN_BASEURL',plugins_url('',__FILE__));
41
  //Set Plugin Version
42
+ define('BACKWPUP_VERSION', '2.0.0');
43
+ //Set Min Wordpress Version
44
+ define('BACKWPUP_MIN_WORDPRESS_VERSION', '3.2');
45
  //Set User Capability
46
+ define('BACKWPUP_USER_CAPABILITY', 'export');
47
  //Set useable destinations
48
  if (!defined('BACKWPUP_DESTS'))
49
+ define('BACKWPUP_DESTS', 'FTP,DROPBOX,SUGARSYNC,S3,GSTORAGE,RSC,MSAZURE');
50
  //Set Dropbox Aplication Keys
51
  define('BACKWPUP_DROPBOX_APP_KEY', 'q2jbt0unkkc54u2');
52
  define('BACKWPUP_DROPBOX_APP_SECRET', 't5hlbxtz473hchy');
53
  //Set SugarSync Aplication Keys
54
  define('BACKWPUP_SUGARSYNC_ACCESSKEY', 'OTcwNjc5MTI5OTQxMzY1Njc5OA');
55
  define('BACKWPUP_SUGARSYNC_PRIVATEACCESSKEY', 'NzNmNDMwMDBiNTkwNDY0YzhjY2JiN2E5YWVkMjFmYmI');
56
+ //BAckWPup API url
57
+ define('BACKWPUP_API_URL', 'http://api.backwpup.com');
58
  //load Text Domain
59
  load_plugin_textdomain('backwpup', false, BACKWPUP_PLUGIN_BASEDIR.'/lang');
60
  //Load functions file
61
+ require_once(dirname(__FILE__).'/backwpup-functions.php');
62
  //Plugin activate
63
  register_activation_hook(__FILE__, 'backwpup_plugin_activate');
64
  //Plugin deactivate
66
  //Admin message
67
  add_action('admin_notices', 'backwpup_admin_notice');
68
  if (backwpup_env_checks()) {
 
 
69
  //add Menu
70
  add_action('admin_menu', 'backwpup_admin_menu');
71
  //add cron intervals
74
  add_action('backwpup_cron', 'backwpup_cron');
75
  //add Dashboard widget
76
  add_action('wp_dashboard_setup', 'backwpup_add_dashboard');
77
+ //add Admin Bar menu
78
+ add_action('admin_bar_menu', 'backwpup_add_adminbar',100);
79
  //Additional links on the plugin page
80
  add_filter('plugin_action_links_'.BACKWPUP_PLUGIN_BASEDIR.'/backwpup.php', 'backwpup_plugin_options_link');
81
  add_filter('plugin_row_meta', 'backwpup_plugin_links',10,2);
82
+ //load ajax functions
83
+ backwpup_load_ajax();
 
 
 
84
  //Disabele WP_Corn
85
  $cfg=get_option('backwpup');
86
+ if (isset($cfg['disablewpcron']) && $cfg['disablewpcron'])
87
  define('DISABLE_WP_CRON',true);
88
  //test if cron active
89
  if (!(wp_next_scheduled('backwpup_cron')))
css/backup-icon20.gif ADDED
Binary file
css/backup-icon32.gif ADDED
Binary file
css/backwpup.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #icon-backwpup {
2
+ background: url('backup-icon32.gif') no-repeat;
3
+ }
4
+ .column-id {
5
+ width:5%;text-align:center;
6
+ }
7
+ .column-last, .column-next , .column-type {
8
+ width:15%;
9
+ }
10
+ .column-info {
11
+ width:20%;
12
+ }
css/backwpupbackups.css ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
1
+ #icon-backwpup {
2
+ background: url('backup-icon32.gif') no-repeat;
3
+ }
4
+ .column-size, .column-time {
5
+ width:10%;
6
+ }
css/backwpupeditjob.css ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #icon-backwpup {
2
+ background: url('backup-icon32.gif') no-repeat;
3
+ }
4
+ #cron-min, #cron-hour, #cron-day, #cron-month, #cron-weekday {
5
+ overflow:auto;
6
+ white-space:nowrap;
7
+ height:7em;
8
+ }
9
+ #cron-min-box , #cron-hour-box, #cron-day-box, #cron-month-box, #cron-weekday-box {
10
+ border-color:#CEE1EF;
11
+ border-style:solid;
12
+ border-width:2px;
13
+ margin:5px 0px 5px 5px;
14
+ padding:2px 2px;
15
+ width:85px;
16
+ float:left;
17
+ }
18
+ #dbtables {
19
+ border-color:#CEE1EF;
20
+ border-style:solid;
21
+ border-width:2px;
22
+ height:10em;
23
+ margin:3px 15px 3px 15px;
24
+ overflow:auto;
25
+ padding:0.5em 0.5em;
26
+ white-space:nowrap;
27
+ }
28
+ .dests {
29
+ float:left;
30
+ width:80%;
31
+ }
32
+ .destlinks {
33
+ font-style:italic;
34
+ letter-spacing:1px;
35
+ font-weight:bold;
36
+ line-height:20px;
37
+ white-space:nowrap;
38
+ }
39
+ #cron-text {
40
+ line-height:20px;
41
+ color:#804000;
42
+ }
43
+ #schedbasic {
44
+ border-color:#CEE1EF;
45
+ border-style:solid;
46
+ border-width:2px;
47
+ }
css/backwpuplogs.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #icon-backwpup {
2
+ background: url('backup-icon32.gif') no-repeat;
3
+ }
4
+ .column-id {
5
+ width:5%;text-align:center;
6
+ }
7
+ .column-runtime, .column-status , .column-size {
8
+ width:8%;
9
+ }
10
+ .column-type {
11
+ width:15%;
12
+ }
css/backwpupsettings.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ #icon-backwpup {
2
+ background: url('backup-icon32.gif') no-repeat;
3
+ }
css/backwpuptools.css ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ #icon-backwpup {
2
+ background: url('backup-icon32.gif') no-repeat;
3
+ }
css/backwpupworking.css ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #icon-backwpup {
2
+ background: url('backup-icon32.gif') no-repeat;
3
+ }
4
+ #showworking, #showlogfile{
5
+ background-color:black;
6
+ color:white;
7
+ font-family:fixedsys, monospace, Courier, monospace;
8
+ line-height: 15px;
9
+ font-size:12px;
10
+ border-color:#CEE1EF;
11
+ border-style:solid;
12
+ border-width:5px;
13
+ height:480px;
14
+ width:800px;
15
+ padding:2px 2px 2px 2px;
16
+ overflow:auto;
17
+ white-space:nowrap;
18
+ float:left;
19
+ }
20
+ .timestamp {
21
+ background-color:darkgrey;
22
+ }
23
+ .warning {
24
+ background-color:tan;
25
+ }
26
+ .error {
27
+ background-color:red;
28
+ }
29
+ #warningsid {
30
+ margin-left:10px;
31
+ margin-bottom:5px;
32
+ color:yellow;
33
+ font-size:20px;
34
+ }
35
+ #errorid {
36
+ margin-left:10px;
37
+ margin-bottom:5px;
38
+ color:red;
39
+ font-size:20px;
40
+ }
41
+ .progressbar {
42
+ margin-top:10px;
43
+ border-color:#CEE1EF;
44
+ border-style:solid;
45
+ border-width:2px;
46
+ height:20px;
47
+ width:800px;
48
+ -moz-border-radius: 3px;
49
+ -webkit-border-radius: 3px;
50
+ -khtml-border-radius: 3px;
51
+ border-radius: 3px;
52
+ }
53
+ #progressstep {
54
+ height:20px;
55
+ background-color:gray;
56
+ color:black;
57
+ text-align:center;
58
+ -moz-border-radius: 3px;
59
+ -webkit-border-radius: 3px;
60
+ -khtml-border-radius: 3px;
61
+ border-radius: 3px;
62
+ }
63
+ #progresssteps {
64
+ height:20px;
65
+ background-color:yellow;
66
+ color:black;
67
+ text-align:center;
68
+ -moz-border-radius: 3px;
69
+ -webkit-border-radius: 3px;
70
+ -khtml-border-radius: 3px;
71
+ border-radius: 3px;
72
+ }
job/backup_create.php ADDED
@@ -0,0 +1,174 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ function backup_create() {
9
+ if ($_SESSION['WORKING']['ALLFILESIZE']==0)
10
+ return;
11
+ $_SESSION['WORKING']['STEPTODO']=count($_SESSION['WORKING']['FILELIST']);
12
+ if (empty($_SESSION['WORKING']['STEPDONE']))
13
+ $_SESSION['WORKING']['STEPDONE']=0;
14
+
15
+ if (strtolower($_SESSION['JOB']['fileformart'])==".zip") { //Zip files
16
+ if (!class_exists('ZipArchive')) { //use php zip lib
17
+ trigger_error($_SESSION['WORKING']['BACKUP_CREATE']['STEP_TRY'].'. '.__('Try to create backup zip file...','backwpup'),E_USER_NOTICE);
18
+ $zip = new ZipArchive;
19
+ if ($res=$zip->open($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'],ZIPARCHIVE::CREATE) === TRUE) {
20
+ for ($i=$_SESSION['WORKING']['STEPDONE'];$i<$_SESSION['WORKING']['STEPTODO'];$i++) {
21
+ if (!$zip->addFile($_SESSION['WORKING']['FILELIST'][$i]['FILE'], $_SESSION['WORKING']['FILELIST'][$i]['OUTFILE']))
22
+ trigger_error(__('Can not add File to ZIP file:','backwpup').' '.$_SESSION['WORKING']['FILELIST'][$i]['OUTFILE'],E_USER_ERROR);
23
+ $_SESSION['WORKING']['STEPDONE']++;
24
+ update_working_file();
25
+ }
26
+ $zip->close();
27
+ trigger_error(__('Backup zip file create done!','backwpup'),E_USER_NOTICE);
28
+ $_SESSION['WORKING']['STEPSDONE'][]='BACKUP_CREATE'; //set done
29
+ } else {
30
+ trigger_error(__('Can not create backup zip file:','backwpup').' '.$res,E_USER_ERROR);
31
+ }
32
+ } else { //use PclZip
33
+ define('PCLZIP_TEMPORARY_DIR', $_SESSION['STATIC']['TEMPDIR']);
34
+ if (!class_exists('PclZip'))
35
+ require_once(dirname(__FILE__).'/../libs/pclzip.lib.php');
36
+ //Create Zip File
37
+ if (is_array($_SESSION['WORKING']['FILELIST'][0])) {
38
+ trigger_error($_SESSION['WORKING']['BACKUP_CREATE']['STEP_TRY'].'. '.__('Try to create backup zip (PclZip) file...','backwpup'),E_USER_NOTICE);
39
+ $zipbackupfile = new PclZip($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
40
+ for ($i=$_SESSION['WORKING']['STEPDONE'];$i<$_SESSION['WORKING']['STEPTODO'];$i++) {
41
+ need_free_memory(10485760); //10MB free memory for zip
42
+ if (0==$zipbackupfile -> add($_SESSION['WORKING']['FILELIST'][$i]['FILE'],PCLZIP_OPT_REMOVE_PATH,str_replace($_SESSION['WORKING']['FILELIST'][$i]['OUTFILE'],'',$_SESSION['WORKING']['FILELIST'][$i]['FILE']),PCLZIP_OPT_ADD_TEMP_FILE_ON)) {
43
+ trigger_error(__('Can not add File to ZIP file:','backwpup').' '.$_SESSION['WORKING']['FILELIST'][$i]['OUTFILE'].':'.$zipbackupfile->errorInfo(true),E_USER_ERROR);
44
+ }
45
+ $_SESSION['WORKING']['STEPDONE']++;
46
+ update_working_file();
47
+ }
48
+ trigger_error(__('Backup Zip file create done!','backwpup'),E_USER_NOTICE);
49
+ }
50
+ }
51
+ } elseif (strtolower($_SESSION['JOB']['fileformart'])==".tar.gz" or strtolower($_SESSION['JOB']['fileformart'])==".tar.bz2" or strtolower($_SESSION['JOB']['fileformart'])==".tar") { //tar files
52
+
53
+ if (strtolower($_SESSION['JOB']['fileformart'])=='.tar.gz') {
54
+ $tarbackup=gzopen($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'],'w9');
55
+ } elseif (strtolower($_SESSION['JOB']['fileformart'])=='.tar.bz2') {
56
+ $tarbackup=bzopen($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'],'w');
57
+ } else {
58
+ $tarbackup=fopen($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'],'w');
59
+ }
60
+
61
+ if (!$tarbackup) {
62
+ trigger_error(__('Can not create tar backup file','backwpup'),E_USER_ERROR);
63
+ return;
64
+ } else {
65
+ trigger_error($_SESSION['WORKING']['BACKUP_CREATE']['STEP_TRY'].'. '.__('Try to create backup archive file...','backwpup'),E_USER_NOTICE);
66
+ }
67
+
68
+
69
+ for ($index=$_SESSION['WORKING']['STEPDONE'];$index<$_SESSION['WORKING']['STEPTODO'];$index++) {
70
+ need_free_memory(2097152); //2MB free memory for tar
71
+ $files=$_SESSION['WORKING']['FILELIST'][$index];
72
+ //check file readable
73
+ if (!is_readable($files['FILE']) or empty($files['FILE'])) {
74
+ trigger_error(__('File not readable:','backwpup').' '.$files['FILE'],E_USER_WARNING);
75
+ $_SESSION['WORKING']['STEPDONE']++;
76
+ continue;
77
+ }
78
+
79
+ //split filename larger than 100 chars
80
+ if (strlen($files['OUTFILE'])<=100) {
81
+ $filename=$files['OUTFILE'];
82
+ $filenameprefix="";
83
+ } else {
84
+ $filenameofset=strlen($files['OUTFILE'])-100;
85
+ $dividor=strpos($files['OUTFILE'],'/',$filenameofset);
86
+ $filename=substr($files['OUTFILE'],$dividor+1);
87
+ $filenameprefix=substr($files['OUTFILE'],0,$dividor);
88
+ if (strlen($filename)>100)
89
+ trigger_error(__('File name to long to save corectly in tar backup archive:','backwpup').' '.$files['OUTFILE'],E_USER_WARNING);
90
+ if (strlen($filenameprefix)>155)
91
+ trigger_error(__('File path to long to save corectly in tar backup archive:','backwpup').' '.$files['OUTFILE'],E_USER_WARNING);
92
+ }
93
+ //Set file user/group name if linux
94
+ $fileowner="Unknown";
95
+ $filegroup="Unknown";
96
+ if (function_exists('posix_getpwuid')) {
97
+ $info=posix_getpwuid($files['UID']);
98
+ $fileowner=$info['name'];
99
+ $info=posix_getgrgid($files['GID']);
100
+ $filegroup=$info['name'];
101
+ }
102
+
103
+ // Generate the TAR header for this file
104
+ $header = pack("a100a8a8a8a12a12a8a1a100a6a2a32a32a8a8a155a12",
105
+ $filename, //name of file 100
106
+ sprintf("%07o", $files['MODE']), //file mode 8
107
+ sprintf("%07o", $files['UID']), //owner user ID 8
108
+ sprintf("%07o", $files['GID']), //owner group ID 8
109
+ sprintf("%011o", $files['SIZE']), //length of file in bytes 12
110
+ sprintf("%011o", $files['MTIME']), //modify time of file 12
111
+ " ", //checksum for header 8
112
+ 0, //type of file 0 or null = File, 5=Dir
113
+ "", //name of linked file 100
114
+ "ustar", //USTAR indicator 6
115
+ "00", //USTAR version 2
116
+ $fileowner, //owner user name 32
117
+ $filegroup, //owner group name 32
118
+ "", //device major number 8
119
+ "", //device minor number 8
120
+ $filenameprefix, //prefix for file name 155
121
+ ""); //fill block 512K
122
+
123
+ // Computes the unsigned Checksum of a file's header
124
+ $checksum = 0;
125
+ for ($i = 0; $i < 512; $i++)
126
+ $checksum += ord(substr($header, $i, 1));
127
+ $checksum = pack("a8", sprintf("%07o", $checksum));
128
+
129
+ $header = substr_replace($header, $checksum, 148, 8);
130
+
131
+ if (strtolower($_SESSION['JOB']['fileformart'])=='.tar.gz') {
132
+ gzwrite($tarbackup, $header);
133
+ } elseif (strtolower($_SESSION['JOB']['fileformart'])=='.tar.bz2') {
134
+ bzwrite($tarbackup, $header);
135
+ } else {
136
+ fwrite($tarbackup, $header);
137
+ }
138
+
139
+ // read/write files in 512K Blocks
140
+ $fd=fopen($files['FILE'],'rb');
141
+ while(!feof($fd)) {
142
+ $filedata=fread($fd,512);
143
+ if (strlen($filedata)>0) {
144
+ if (strtolower($_SESSION['JOB']['fileformart'])=='.tar.gz') {
145
+ gzwrite($tarbackup,pack("a512", $filedata));
146
+ } elseif (strtolower($_SESSION['JOB']['fileformart'])=='.tar.bz2') {
147
+ bzwrite($tarbackup,pack("a512", $filedata));
148
+ } else {
149
+ fwrite($tarbackup,pack("a512", $filedata));
150
+ }
151
+ }
152
+ }
153
+ fclose($fd);
154
+ $_SESSION['WORKING']['STEPDONE']++;
155
+ update_working_file();
156
+ }
157
+
158
+ if (strtolower($_SESSION['JOB']['fileformart'])=='.tar.gz') {
159
+ gzwrite($tarbackup, pack("a1024", "")); // Add 1024 bytes of NULLs to designate EOF
160
+ gzclose($tarbackup);
161
+ } elseif (strtolower($_SESSION['JOB']['fileformart'])=='.tar.bz2') {
162
+ bzwrite($tarbackup, pack("a1024", "")); // Add 1024 bytes of NULLs to designate EOF
163
+ bzclose($tarbackup);
164
+ } else {
165
+ fwrite($tarbackup, pack("a1024", "")); // Add 1024 bytes of NULLs to designate EOF
166
+ fclose($tarbackup);
167
+ }
168
+ trigger_error(__('Backup Archive file create done!','backwpup'),E_USER_NOTICE);
169
+ }
170
+ $_SESSION['WORKING']['STEPSDONE'][]='BACKUP_CREATE'; //set done
171
+ if ($filesize=filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']))
172
+ trigger_error(sprintf(__('Backup archive file size is %1s','backwpup'),formatBytes($filesize)),E_USER_NOTICE);
173
+ }
174
+ ?>
job/db_check.php ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ function db_check() {
9
+ trigger_error($_SESSION['WORKING']['DB_CHECK']['STEP_TRY'].'. '.__('Try to run Database check...','backwpup'),E_USER_NOTICE);
10
+ if (!isset($_SESSION['WORKING']['DB_CHECK']['DONETABLE']) or !is_array($_SESSION['WORKING']['DB_CHECK']['DONETABLE']))
11
+ $_SESSION['WORKING']['DB_CHECK']['DONETABLE']=array();
12
+ //Set num of todos
13
+ $_SESSION['WORKING']['STEPTODO']=sizeof($_SESSION['JOB']['dbtables']);
14
+ //check tables
15
+ if (sizeof($_SESSION['JOB']['dbtables'])>0) {
16
+ maintenance_mode(true);
17
+ foreach ($_SESSION['JOB']['dbtables'] as $table) {
18
+ if (in_array($table, $_SESSION['WORKING']['DB_CHECK']['DONETABLE']))
19
+ continue;
20
+ $result=mysql_query('CHECK TABLE `'.$table.'` MEDIUM');
21
+ if (!$result) {
22
+ trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), mysql_error(), "CHECK TABLE `".$table."` MEDIUM"),E_USER_ERROR);
23
+ continue;
24
+ }
25
+ $check=mysql_fetch_assoc($result);
26
+ if ($check['Msg_type']=='error')
27
+ trigger_error(sprintf(__('Result of table check for %1$s is: %2$s','backwpup'), $table, $check['Msg_text']),E_USER_ERROR);
28
+ elseif ($check['Msg_type']=='warning')
29
+ trigger_error(sprintf(__('Result of table check for %1$s is: %2$s','backwpup'), $table, $check['Msg_text']),E_USER_WARNING);
30
+ else
31
+ trigger_error(sprintf(__('Result of table check for %1$s is: %2$s','backwpup'), $table, $check['Msg_text']),E_USER_NOTICE);
32
+
33
+ //Try to Repair tabele
34
+ if ($check['Msg_type']=='error' or $check['Msg_type']=='warning') {
35
+ $result=mysql_query('REPAIR TABLE `'.$table.'`');
36
+ if (!$result) {
37
+ trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), mysql_error(), "REPAIR TABLE `'.$table.'`"),E_USER_ERROR);
38
+ continue;
39
+ }
40
+ $repair=mysql_fetch_assoc($result);
41
+ if ($repair['Msg_type']=='error')
42
+ trigger_error(sprintf(__('Result of table repair for %1$s is: %2$s','backwpup'), $table, $repair['Msg_text']),E_USER_ERROR);
43
+ elseif ($repair['Msg_type']=='warning')
44
+ trigger_error(sprintf(__('Result of table repair for %1$s is: %2$s','backwpup'), $table, $repair['Msg_text']),E_USER_WARNING);
45
+ else
46
+ trigger_error(sprintf(__('Result of table repair for %1$s is: %2$s','backwpup'), $table, $repair['Msg_text']),E_USER_NOTICE);
47
+ }
48
+ $_SESSION['WORKING']['DB_CHECK']['DONETABLE'][]=$table;
49
+ $_SESSION['WORKING']['STEPDONE']=sizeof($_SESSION['WORKING']['DB_CHECK']['DONETABLE']);
50
+ }
51
+ maintenance_mode(false);
52
+ trigger_error(__('Database check done!','backwpup'),E_USER_NOTICE);
53
+ } else {
54
+ trigger_error(__('No Tables to check','backwpup'),E_USER_WARNING);
55
+ }
56
+ $_SESSION['WORKING']['STEPSDONE'][]='DB_CHECK'; //set done
57
+ }
58
+ ?>
job/db_dump.php ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+
9
+ function db_dump() {
10
+ trigger_error($_SESSION['WORKING']['DB_DUMP']['STEP_TRY'].'. '.__('Try for dump database to file...','backwpup'),E_USER_NOTICE);
11
+ if (!isset($_SESSION['WORKING']['DB_DUMP']['DONETABLE']) or !is_array($_SESSION['WORKING']['DB_DUMP']['DONETABLE']))
12
+ $_SESSION['WORKING']['DB_DUMP']['DONETABLE']=array();
13
+ $_SESSION['WORKING']['STEPTODO']=count($_SESSION['JOB']['dbtables']);
14
+ //Set maintenance
15
+ maintenance_mode(true);
16
+
17
+ if (count($_SESSION['JOB']['dbtables'])>0) {
18
+ $result=mysql_query("SHOW TABLE STATUS FROM `".$_SESSION['WP']['DB_NAME']."`"); //get table status
19
+ if (!$result)
20
+ trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), mysql_error(), "SHOW TABLE STATUS FROM `".$_SESSION['WP']['DB_NAME']."`;"),E_USER_ERROR);
21
+
22
+ while ($data = mysql_fetch_assoc($result)) {
23
+ $status[$data['Name']]=$data;
24
+ }
25
+
26
+ if ($file = fopen($_SESSION['STATIC']['TEMPDIR'].$_SESSION['WP']['DB_NAME'].'.sql', 'wb')) {
27
+ fwrite($file, "-- ---------------------------------------------------------\n");
28
+ fwrite($file, "-- Dump with BackWPup ver.: ".$_SESSION['BACKWPUP']['VERSION']."\n");
29
+ fwrite($file, "-- Plugin for WordPress by Daniel Huesken\n");
30
+ fwrite($file, "-- http://danielhuesken.de/portfolio/backwpup/\n");
31
+ fwrite($file, "-- Blog Name: ".$_SESSION['WP']['BLOGNAME']."\n");
32
+ fwrite($file, "-- Blog URL: ".$_SESSION['WP']['SITEURL']."\n");
33
+ fwrite($file, "-- Blog ABSPATH: ".$_SESSION['WP']['ABSPATH']."\n");
34
+ fwrite($file, "-- Table Prefix: ".$_SESSION['WP']['TABLE_PREFIX']."\n");
35
+ fwrite($file, "-- Database Name: ".$_SESSION['WP']['DB_NAME']."\n");
36
+ fwrite($file, "-- Dump on: ".date('Y-m-d H:i.s')."\n");
37
+ fwrite($file, "-- ---------------------------------------------------------\n\n");
38
+ //for better import with mysql client
39
+ fwrite($file, "/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;\n");
40
+ fwrite($file, "/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;\n");
41
+ fwrite($file, "/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;\n");
42
+ fwrite($file, "/*!40101 SET NAMES '".mysql_client_encoding()."' */;\n");
43
+ fwrite($file, "/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;\n");
44
+ fwrite($file, "/*!40103 SET TIME_ZONE='".mysql_result(mysql_query("SELECT @@time_zone"),0)."' */;\n");
45
+ fwrite($file, "/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;\n");
46
+ fwrite($file, "/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;\n");
47
+ fwrite($file, "/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;\n");
48
+ fwrite($file, "/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;\n\n");
49
+ //make table dumps
50
+ foreach($_SESSION['JOB']['dbtables'] as $table) {
51
+ if (in_array($table, $_SESSION['WORKING']['DB_DUMP']['DONETABLE']))
52
+ continue;
53
+ trigger_error(__('Dump Database table: ','backwpup').' '.$table,E_USER_NOTICE);
54
+ need_free_memory(($status[$table]['Data_length']+$status[$table]['Index_length'])*1.3); //get more memory if needed
55
+ _db_dump_table($table,$status[$table],$file);
56
+ $_SESSION['WORKING']['DB_DUMP']['DONETABLE'][]=$table;
57
+ $_SESSION['WORKING']['STEPDONE']=count($_SESSION['WORKING']['DB_DUMP']['DONETABLE']);
58
+ }
59
+ //for better import with mysql client
60
+ fwrite($file, "\n");
61
+ fwrite($file, "/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;\n");
62
+ fwrite($file, "/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;\n");
63
+ fwrite($file, "/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;\n");
64
+ fwrite($file, "/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;\n");
65
+ fwrite($file, "/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;\n");
66
+ fwrite($file, "/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;\n");
67
+ fwrite($file, "/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;\n");
68
+ fwrite($file, "/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\n");
69
+ fclose($file);
70
+ trigger_error(__('Database Dump done!','backwpup'),E_USER_NOTICE);
71
+ } else {
72
+ trigger_error(__('Can not create Database Dump file','backwpup'),E_USER_ERROR);
73
+ }
74
+ } else {
75
+ trigger_error(__('No Tables to Dump','backwpup'),E_USER_WARNING);
76
+ }
77
+
78
+ //add database file to backupfiles
79
+ if (is_readable($_SESSION['STATIC']['TEMPDIR'].$_SESSION['WP']['DB_NAME'].'.sql')) {
80
+ $filestat=stat($_SESSION['STATIC']['TEMPDIR'].$_SESSION['WP']['DB_NAME'].'.sql');
81
+ trigger_error(__('Add Database Dump to Backup list:','backwpup').' '.$_SESSION['WP']['DB_NAME'].'.sql '.formatbytes($filestat['size']),E_USER_NOTICE);
82
+ $_SESSION['WORKING']['ALLFILESIZE']+=$filestat['size'];
83
+ $_SESSION['WORKING']['FILELIST'][]=array('FILE'=>$_SESSION['STATIC']['TEMPDIR'].$_SESSION['WP']['DB_NAME'].'.sql','OUTFILE'=>$_SESSION['WP']['DB_NAME'].'.sql','SIZE'=>$filestat['size'],'ATIME'=>$filestat['atime'],'MTIME'=>$filestat['mtime'],'CTIME'=>$filestat['ctime'],'UID'=>$filestat['uid'],'GID'=>$filestat['gid'],'MODE'=>$filestat['mode']);
84
+ }
85
+ //Back from maintenance
86
+ maintenance_mode(false);
87
+ $_SESSION['WORKING']['STEPSDONE'][]='DB_DUMP'; //set done
88
+ }
89
+
90
+
91
+ function _db_dump_table($table,$status,$file) {
92
+ // create dump
93
+ fwrite($file, "\n");
94
+ fwrite($file, "--\n");
95
+ fwrite($file, "-- Table structure for table $table\n");
96
+ fwrite($file, "--\n\n");
97
+ fwrite($file, "DROP TABLE IF EXISTS `" . $table . "`;\n");
98
+ fwrite($file, "/*!40101 SET @saved_cs_client = @@character_set_client */;\n");
99
+ fwrite($file, "/*!40101 SET character_set_client = '".mysql_client_encoding()."' */;\n");
100
+ //Dump the table structure
101
+ $result=mysql_query("SHOW CREATE TABLE `".$table."`");
102
+ if (!$result) {
103
+ trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), mysql_error(), "SHOW CREATE TABLE `".$table."`"),E_USER_ERROR);
104
+ return false;
105
+ }
106
+ $tablestruc=mysql_fetch_assoc($result);
107
+ fwrite($file, $tablestruc['Create Table'].";\n");
108
+ fwrite($file, "/*!40101 SET character_set_client = @saved_cs_client */;\n");
109
+
110
+ //take data of table
111
+ $result=mysql_query("SELECT * FROM `".$table."`");
112
+ if (!$result) {
113
+ trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), mysql_error(), "SELECT * FROM `".$table."`"),E_USER_ERROR);
114
+ return false;
115
+ }
116
+
117
+ fwrite($file, "--\n");
118
+ fwrite($file, "-- Dumping data for table $table\n");
119
+ fwrite($file, "--\n\n");
120
+ if ($status['Engine']=='MyISAM')
121
+ fwrite($file, "/*!40000 ALTER TABLE `".$table."` DISABLE KEYS */;\n");
122
+
123
+ $i=0;
124
+ while ($data = mysql_fetch_assoc($result)) {
125
+ $keys = array();
126
+ $values = array();
127
+ if ($_SESSION['WORKING']['DB_DUMP']['DONETABLEROW']>$i) {
128
+ $i++;
129
+ continue;
130
+ }
131
+ foreach($data as $key => $value) {
132
+ if (!$_SESSION['JOB']['dbshortinsert'])
133
+ $keys[] = "`".str_replace("�", "��", $key)."`"; // Add key to key list
134
+ if($value === NULL) // Make Value NULL to string NULL
135
+ $value = "NULL";
136
+ elseif($value === "" or $value === false) // if empty or false Value make "" as Value
137
+ $value = "''";
138
+ elseif(!is_numeric($value)) //is value not numeric esc
139
+ $value = "'".mysql_real_escape_string($value)."'";
140
+ $values[] = $value;
141
+ }
142
+ // make data dump
143
+ if ($_SESSION['JOB']['dbshortinsert'])
144
+ fwrite($file, "INSERT INTO `".$table."` VALUES ( ".implode(", ",$values)." );\n");
145
+ else
146
+ fwrite($file, "INSERT INTO `".$table."` ( ".implode(", ",$keys)." )\n\tVALUES ( ".implode(", ",$values)." );\n");
147
+ $_SESSION['WORKING']['DB_DUMP']['DONETABLEROW']=$i;
148
+ $i++;
149
+ }
150
+ if ($status['Engine']=='MyISAM')
151
+ fwrite($file, "/*!40000 ALTER TABLE ".$table." ENABLE KEYS */;\n");
152
+ $_SESSION['WORKING']['DB_DUMP']['DONETABLEROW']=0;
153
+ }
154
+ ?>
job/db_optimize.php ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ function db_optimize() {
9
+ trigger_error($_SESSION['WORKING']['DB_OPTIMIZE']['STEP_TRY'].'. '.__('Try to run database optimize...','backwpup'),E_USER_NOTICE);
10
+ if (!isset($_SESSION['WORKING']['DB_OPTIMIZE']['DONETABLE']) or !is_array($_SESSION['WORKING']['DB_OPTIMIZE']['DONETABLE']))
11
+ $_SESSION['WORKING']['DB_OPTIMIZE']['DONETABLE']=array();
12
+ $_SESSION['WORKING']['STEPTODO']=sizeof($_SESSION['JOB']['dbtables']);
13
+ if (sizeof($_SESSION['JOB']['dbtables'])>0) {
14
+ maintenance_mode(true);
15
+ foreach ($_SESSION['JOB']['dbtables'] as $table) {
16
+ if (in_array($table, $_SESSION['WORKING']['DB_OPTIMIZE']['DONETABLE']))
17
+ continue;
18
+ $result=mysql_query('OPTIMIZE TABLE `'.$table.'`');
19
+ if (!$result) {
20
+ trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), mysql_error(), "OPTIMIZE TABLE `".$table."`"),E_USER_ERROR);
21
+ continue;
22
+ }
23
+ $optimize=mysql_fetch_assoc($result);
24
+ $_SESSION['WORKING']['DB_OPTIMIZE']['DONETABLE'][]=$table;
25
+ $_SESSION['WORKING']['STEPDONE']=sizeof($_SESSION['WORKING']['DB_OPTIMIZE']['DONETABLE']);
26
+ if ($optimize['Msg_type']=='error')
27
+ trigger_error(sprintf(__('Result of table optimize for %1$s is: %2$s','backwpup'), $table, $optimize['Msg_text']),E_USER_ERROR);
28
+ elseif ($optimize['Msg_type']=='warning')
29
+ trigger_error(sprintf(__('Result of table optimize for %1$s is: %2$s','backwpup'), $table, $optimize['Msg_text']),E_USER_WARNING);
30
+ else
31
+ trigger_error(sprintf(__('Result of table optimize for %1$s is: %2$s','backwpup'), $table, $optimize['Msg_text']),E_USER_NOTICE);
32
+ }
33
+ trigger_error(__('Database optimize done!','backwpup'),E_USER_NOTICE);
34
+ maintenance_mode(false);
35
+ } else {
36
+ trigger_error(__('No Tables to optimize','backwpup'),E_USER_WARNING);
37
+ }
38
+ $_SESSION['WORKING']['STEPSDONE'][]='DB_OPTIMIZE'; //set done
39
+ }
40
+
41
+ ?>
job/dest_dropbox.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ function dest_dropbox() {
9
+ if (empty($_SESSION['JOB']['dropetoken']) or empty($_SESSION['JOB']['dropesecret'])) {
10
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_DROPBOX'; //set done
11
+ return;
12
+ }
13
+ $_SESSION['WORKING']['STEPTODO']=2+filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
14
+ $_SESSION['WORKING']['STEPDONE']=0;
15
+ trigger_error($_SESSION['WORKING']['DEST_DROPBOX']['STEP_TRY'].'. '.__('Try to sending backup file to DropBox...','backwpup'),E_USER_NOTICE);
16
+ need_free_memory(filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'])*1.1);
17
+ require_once(realpath(dirname(__FILE__).'/../libs/dropbox/dropbox.php'));
18
+ try {
19
+ $dropbox = new Dropbox($_SESSION['BACKWPUP']['DROPBOX_APP_KEY'], $_SESSION['BACKWPUP']['DROPBOX_APP_SECRET']);
20
+ // set the tokens
21
+ $dropbox->setOAuthTokens($_SESSION['JOB']['dropetoken'],$_SESSION['JOB']['dropesecret']);
22
+ //set boxtype
23
+ if ($_SESSION['JOB']['droperoot']=='sandbox')
24
+ $dropbox->setSandbox();
25
+ else
26
+ $dropbox->setDropbox();
27
+ $info=$dropbox->accountInfo();
28
+ if (!empty($info['uid'])) {
29
+ trigger_error(__('Authed to DropBox from ','backwpup').$info['display_name'],E_USER_NOTICE);
30
+ }
31
+ //Check Quota
32
+ $dropboxfreespase=$info['quota_info']['quota']-$info['quota_info']['shared']-$info['quota_info']['normal'];
33
+ if (filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'])>$dropboxfreespase) {
34
+ trigger_error(__('No free space left on DropBox!!!','backwpup'),E_USER_ERROR);
35
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_DROPBOX'; //set done
36
+ return;
37
+ } else {
38
+ trigger_error(__('Free Space on DropBox: ','backwpup').formatBytes($dropboxfreespase),E_USER_NOTICE);
39
+ }
40
+ //set calback function
41
+ $dropbox->setProgressFunction('curl_progresscallback');
42
+ // put the file
43
+ trigger_error(__('Upload to DropBox now started ... ','backwpup'),E_USER_NOTICE);
44
+ $response = $dropbox->upload($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'],$_SESSION['JOB']['dropedir']);
45
+ if ($response['result']=="winner!") {
46
+ $_SESSION['JOB']['lastbackupdownloadurl']=$_SESSION['WP']['ADMINURL'].'?page=backwpupbackups&action=downloaddropbox&file='.$_SESSION['JOB']['dropedir'].$_SESSION['STATIC']['backupfile'].'&jobid='.$_SESSION['JOB']['jobid'];
47
+ $_SESSION['WORKING']['STEPDONE']++;
48
+ trigger_error(__('Backup File transferred to DropBox://','backwpup').$_SESSION['JOB']['droperoot'].'/'.$_SESSION['JOB']['dropedir'].$_SESSION['STATIC']['backupfile'],E_USER_NOTICE);
49
+ } else {
50
+ trigger_error(__('Can not transfere Backup file to DropBox:','backwpup').' '.$response['error'],E_USER_ERROR);
51
+ return;
52
+ }
53
+ //unset calback function
54
+ $dropbox->setProgressFunction('');
55
+
56
+ if ($_SESSION['JOB']['dropemaxbackups']>0) { //Delete old backups
57
+ $backupfilelist=array();
58
+ $metadata = $dropbox->metadata($_SESSION['JOB']['dropedir']);
59
+ if (is_array($metadata)) {
60
+ foreach ($metadata['contents'] as $data) {
61
+ $file=basename($data['path']);
62
+ if ($data['is_dir']!=true and $_SESSION['JOB']['fileprefix'] == substr($file,0,strlen($_SESSION['JOB']['fileprefix'])) and $_SESSION['JOB']['fileformart'] == substr($file,-strlen($_SESSION['JOB']['fileformart'])))
63
+ $backupfilelist[]=$file;
64
+ }
65
+ }
66
+ if (sizeof($backupfilelist)>0) {
67
+ rsort($backupfilelist);
68
+ $numdeltefiles=0;
69
+ for ($i=$_SESSION['JOB']['dropemaxbackups'];$i<count($backupfilelist);$i++) {
70
+ $dropbox->fileopsDelete($_SESSION['JOB']['dropedir'].$backupfilelist[$i]); //delete files on Cloud
71
+ $numdeltefiles++;
72
+ }
73
+ if ($numdeltefiles>0)
74
+ trigger_error($numdeltefiles.' '.__('files deleted on DropBox Folder!','backwpup'),E_USER_NOTICE);
75
+ }
76
+ }
77
+ } catch (Exception $e) {
78
+ trigger_error(__('DropBox API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
79
+ }
80
+
81
+ $_SESSION['WORKING']['STEPDONE']++;
82
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_DROPBOX'; //set done
83
+ }
84
+ ?>
job/dest_ftp.php ADDED
@@ -0,0 +1,134 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ function dest_ftp() {
9
+ if (empty($_SESSION['JOB']['ftphost']) or empty($_SESSION['JOB']['ftpuser']) or empty($_SESSION['JOB']['ftppass'])) {
10
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_FTP'; //set done
11
+ return;
12
+ }
13
+ $_SESSION['WORKING']['STEPTODO']=2;
14
+ trigger_error($_SESSION['WORKING']['DEST_FTP']['STEP_TRY'].'. '.__('Try to sending backup file to a FTP Server...','backwpup'),E_USER_NOTICE);
15
+
16
+ need_free_memory(filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'])*1.5);
17
+
18
+ if ($_SESSION['JOB']['ftpssl']) { //make SSL FTP connection
19
+ if (function_exists('ftp_ssl_connect')) {
20
+ $ftp_conn_id = ftp_ssl_connect($_SESSION['JOB']['ftphost'],$_SESSION['JOB']['ftphostport'],10);
21
+ if ($ftp_conn_id)
22
+ trigger_error(__('Connected by SSL-FTP to Server:','backwpup').' '.$_SESSION['JOB']['ftphost'].':'.$_SESSION['JOB']['ftphostport'],E_USER_NOTICE);
23
+ else {
24
+ trigger_error(__('Can not connect by SSL-FTP to Server:','backwpup').' '.$_SESSION['JOB']['ftphost'].':'.$_SESSION['JOB']['ftphostport'],E_USER_ERROR);
25
+ return false;
26
+ }
27
+ } else {
28
+ trigger_error(__('PHP Function to connect with SSL-FTP to Server not exists!','backwpup'),E_USER_ERROR);
29
+ return false;
30
+ }
31
+ } else { //make normal FTP conection if SSL not work
32
+ $ftp_conn_id = ftp_connect($_SESSION['JOB']['ftphost'],$_SESSION['JOB']['ftphostport'],10);
33
+ if ($ftp_conn_id)
34
+ trigger_error(__('Connected to FTP Server:','backwpup').' '.$_SESSION['JOB']['ftphost'].':'.$_SESSION['JOB']['ftphostport'],E_USER_NOTICE);
35
+ else {
36
+ trigger_error(__('Can not connect to FTP Server:','backwpup').' '.$_SESSION['JOB']['ftphost'].':'.$_SESSION['JOB']['ftphostport'],E_USER_ERROR);
37
+ return false;
38
+ }
39
+ }
40
+
41
+ //FTP Login
42
+ $loginok=false;
43
+ trigger_error(__('FTP Client command:','backwpup').' USER '.$_SESSION['JOB']['ftpuser'],E_USER_NOTICE);
44
+ if ($loginok=ftp_login($ftp_conn_id, $_SESSION['JOB']['ftpuser'], base64_decode($_SESSION['JOB']['ftppass']))) {
45
+ trigger_error(__('FTP Server reply:','backwpup').' User '.$_SESSION['JOB']['ftpuser'].' logged in.',E_USER_NOTICE);
46
+ } else { //if PHP ftp login don't work use raw login
47
+ $return=ftp_raw($ftp_conn_id,'USER '.$_SESSION['JOB']['ftpuser']);
48
+ trigger_error(__('FTP Server reply:','backwpup').' '.$return[0],E_USER_NOTICE);
49
+ if (substr(trim($return[0]),0,3)<=400) {
50
+ trigger_error(__('FTP Client command:','backwpup').' PASS *******',E_USER_NOTICE);
51
+ $return=ftp_raw($ftp_conn_id,'PASS '.base64_decode($_SESSION['JOB']['ftppass']));
52
+ trigger_error(__('FTP Server reply:','backwpup').' '.$return[0],E_USER_NOTICE);
53
+ if (substr(trim($return[0]),0,3)<=400)
54
+ $loginok=true;
55
+ }
56
+ }
57
+
58
+ if (!$loginok)
59
+ return false;
60
+
61
+ //PASV
62
+ trigger_error(__('FTP Client command:','backwpup').' PASV',E_USER_NOTICE);
63
+ if ($_SESSION['JOB']['ftppasv']) {
64
+ if (ftp_pasv($ftp_conn_id, true))
65
+ trigger_error(__('FTP Server reply:','backwpup').' '.__('Entering Passive Mode','backwpup'),E_USER_NOTICE);
66
+ else
67
+ trigger_error(__('FTP Server reply:','backwpup').' '.__('Can not Entering Passive Mode','backwpup'),E_USER_WARNING);
68
+ } else {
69
+ if (ftp_pasv($ftp_conn_id, false))
70
+ trigger_error(__('FTP Server reply:','backwpup').' '.__('Entering Normal Mode','backwpup'),E_USER_NOTICE);
71
+ else
72
+ trigger_error(__('FTP Server reply:','backwpup').' '.__('Can not Entering Normal Mode','backwpup'),E_USER_WARNING);
73
+ }
74
+ //SYSTYPE
75
+ trigger_error(__('FTP Client command:','backwpup').' SYST',E_USER_NOTICE);
76
+ $systype=ftp_systype($ftp_conn_id);
77
+ if ($systype)
78
+ trigger_error(__('FTP Server reply:','backwpup').' '.$systype,E_USER_NOTICE);
79
+ else
80
+ trigger_error(__('FTP Server reply:','backwpup').' '.__('Error getting SYSTYPE','backwpup'),E_USER_ERROR);
81
+
82
+ if ($_SESSION['WORKING']['STEPDONE']==0) {
83
+ //test ftp dir and create it f not exists
84
+ $ftpdirs=explode("/", rtrim($_SESSION['JOB']['ftpdir'],'/'));
85
+ foreach ($ftpdirs as $ftpdir) {
86
+ if (empty($ftpdir))
87
+ continue;
88
+ if (!@ftp_chdir($ftp_conn_id, $ftpdir)) {
89
+ if (@ftp_mkdir($ftp_conn_id, $ftpdir)) {
90
+ trigger_error('"'.$ftpdir.'" '.__('FTP Folder created!','backwpup'),E_USER_NOTICE);
91
+ ftp_chdir($ftp_conn_id, $ftpdir);
92
+ } else {
93
+ trigger_error('"'.$ftpdir.'" '.__('FTP Folder on Server can not created!','backwpup'),E_USER_ERROR);
94
+ return false;
95
+ }
96
+ }
97
+ }
98
+ trigger_error(__('Upload to FTP now started ... ','backwpup'),E_USER_NOTICE);
99
+ @set_time_limit($_SESSION['CFG']['jobscriptruntimelong']);
100
+ if (ftp_put($ftp_conn_id, $_SESSION['JOB']['ftpdir'].$_SESSION['STATIC']['backupfile'], $_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'], FTP_BINARY)) { //transfere file
101
+ $_SESSION['WORKING']['STEPTODO']=1+filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
102
+ trigger_error(__('Backup File transferred to FTP Server:','backwpup').' '.$_SESSION['JOB']['ftpdir'].$_SESSION['STATIC']['backupfile'],E_USER_NOTICE);
103
+ $_SESSION['JOB']['lastbackupdownloadurl']="ftp://".$_SESSION['JOB']['ftpuser'].":".base64_decode($_SESSION['JOB']['ftppass'])."@".$_SESSION['JOB']['ftphost'].$_SESSION['JOB']['ftpdir'].$_SESSION['STATIC']['backupfile'];
104
+ } else
105
+ trigger_error(__('Can not transfer backup to FTP server.','backwpup'),E_USER_ERROR);
106
+ }
107
+
108
+ if ($_SESSION['JOB']['ftpmaxbackups']>0) { //Delete old backups
109
+ $backupfilelist=array();
110
+ if ($filelist=ftp_nlist($ftp_conn_id, $_SESSION['JOB']['ftpdir'])) {
111
+ foreach($filelist as $files) {
112
+ if ($_SESSION['JOB']['fileprefix'] == substr(basename($files),0,strlen($_SESSION['JOB']['fileprefix'])) and $_SESSION['JOB']['fileformart'] == substr(basename($files),-strlen($_SESSION['JOB']['fileformart'])))
113
+ $backupfilelist[]=basename($files);
114
+ }
115
+ if (sizeof($backupfilelist)>0) {
116
+ rsort($backupfilelist);
117
+ $numdeltefiles=0;
118
+ for ($i=$_SESSION['JOB']['ftpmaxbackups'];$i<sizeof($backupfilelist);$i++) {
119
+ if (ftp_delete($ftp_conn_id, $_SESSION['JOB']['ftpdir'].$backupfilelist[$i])) //delte files on ftp
120
+ $numdeltefiles++;
121
+ else
122
+ trigger_error(__('Can not delete file on FTP Server:','backwpup').' '.$_SESSION['JOB']['ftpdir'].$backupfilelist[$i],E_USER_ERROR);
123
+ }
124
+ if ($numdeltefiles>0)
125
+ trigger_error($numdeltefiles.' '.__('files deleted on FTP Server:','backwpup'),E_USER_NOTICE);
126
+ }
127
+ }
128
+ }
129
+
130
+ ftp_close($ftp_conn_id);
131
+ $_SESSION['WORKING']['STEPDONE']++;
132
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_FTP'; //set done
133
+ }
134
+ ?>
job/dest_gstorage.php ADDED
@@ -0,0 +1,76 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ function dest_gstorage() {
9
+ if (empty($_SESSION['JOB']['GStorageAccessKey']) or empty($_SESSION['JOB']['GStorageSecret']) or empty($_SESSION['JOB']['GStorageBucket'])) {
10
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_GSTORAGE'; //set done
11
+ return;
12
+ }
13
+ $_SESSION['WORKING']['STEPTODO']=2+filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
14
+ $_SESSION['WORKING']['STEPDONE']=0;
15
+ trigger_error($_SESSION['WORKING']['DEST_GSTORAGE']['STEP_TRY'].'. '.__('Try to sending backup file to Google Storage...','backwpup'),E_USER_NOTICE);
16
+
17
+ require_once(dirname(__FILE__).'/../libs/googlestorage.php');
18
+ try {
19
+ $googlestorage = new GoogleStorage($_SESSION['JOB']['GStorageAccessKey'], $_SESSION['JOB']['GStorageSecret']);
20
+ $googlestorage->setProgressFunction('curl_progresscallback');
21
+ $bucket=$googlestorage->getBucketAcl($_SESSION['JOB']['GStorageBucket']);
22
+ if (is_object($bucket)) {
23
+ trigger_error(__('Connected to Google storage bucket:','backwpup').' '.$_SESSION['JOB']['GStorageBucket'],E_USER_NOTICE);
24
+ //set content Type
25
+ if ($_SESSION['JOB']['fileformart']=='.zip')
26
+ $content_type='application/zip';
27
+ if ($_SESSION['JOB']['fileformart']=='.tar')
28
+ $content_type='application/x-ustar';
29
+ if ($_SESSION['JOB']['fileformart']=='.tar.gz')
30
+ $content_type='application/x-compressed';
31
+ if ($_SESSION['JOB']['fileformart']=='.tar.bz2')
32
+ $content_type='application/x-compressed';
33
+ //Transfer Backup to Google Storrage
34
+ trigger_error(__('Upload to Google storage now started ... ','backwpup'),E_USER_NOTICE);
35
+ $upload=$googlestorage->putObject($_SESSION['JOB']['GStorageBucket'],$_SESSION['JOB']['GStoragedir'].$_SESSION['STATIC']['backupfile'],$_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'],'private',$content_type);
36
+ if (empty($upload)) {
37
+ $_SESSION['WORKING']['STEPTODO']=1+filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
38
+ trigger_error(__('Backup File transferred to GSTORAGE://','backwpup').$_SESSION['JOB']['GStorageBucket'].'/'.$_SESSION['JOB']['GStoragedir'].$_SESSION['STATIC']['backupfile'],E_USER_NOTICE);
39
+ $_SESSION['JOB']['lastbackupdownloadurl']=$_SESSION['WP']['ADMINURL'].'?page=backwpupbackups&action=downloadgstorage&file='.$_SESSION['JOB']['GStoragedir'].$_SESSION['STATIC']['backupfile'].'&jobid='.$_SESSION['JOB']['jobid'];
40
+ } else {
41
+ trigger_error(__('Can not transfer backup to Google storage!','backwpup').' '.$upload,E_USER_ERROR);
42
+ }
43
+
44
+ if ($_SESSION['JOB']['GStoragemaxbackups']>0) { //Delete old backups
45
+ $backupfilelist=array();
46
+ $contents = $googlestorage->getBucket($_SESSION['JOB']['GStorageBucket'],$_SESSION['JOB']['GStoragedir']);
47
+ if (is_object($contents)) {
48
+ foreach ($contents as $object) {
49
+ $file=basename($object->Key);
50
+ if ($_SESSION['JOB']['fileprefix'] == substr($file,0,strlen($_SESSION['JOB']['fileprefix'])) and $_SESSION['JOB']['fileformart'] == substr($file,-strlen($_SESSION['JOB']['fileformart'])))
51
+ $backupfilelist[]=$file;
52
+ }
53
+ }
54
+ if (sizeof($backupfilelist)>0) {
55
+ rsort($backupfilelist);
56
+ $numdeltefiles=0;
57
+ for ($i=$_SESSION['JOB']['GStoragemaxbackups'];$i<sizeof($backupfilelist);$i++) {
58
+ $googlestorage->deleteObject($_SESSION['JOB']['GStorageBucket'],$_SESSION['JOB']['GStoragedir'].$backupfilelist[$i]); //delte files on Google Storage
59
+ $numdeltefiles++;
60
+ }
61
+ if ($numdeltefiles>0)
62
+ trigger_error($numdeltefiles.' '.__('files deleted on Google Storage Bucket!','backwpup'),E_USER_NOTICE);
63
+ }
64
+ }
65
+ } else {
66
+ trigger_error(__('Bucket error:','backwpup').' '.$bucket,E_USER_ERROR);
67
+ }
68
+ } catch (Exception $e) {
69
+ trigger_error(__('Amazon Google Storage API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
70
+ return;
71
+ }
72
+
73
+ $_SESSION['WORKING']['STEPDONE']++;
74
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_GSTORAGE'; //set done
75
+ }
76
+ ?>
job/dest_mail.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ function dest_mail() {
9
+ if (empty($_SESSION['JOB']['mailaddress'])) {
10
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_MAIL'; //set done
11
+ return;
12
+ }
13
+ $_SESSION['WORKING']['STEPTODO']=filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
14
+ $_SESSION['WORKING']['STEPDONE']=0;
15
+ trigger_error($_SESSION['WORKING']['DEST_MAIL']['STEP_TRY'].'. '.__('Try to sending backup file with mail...','backwpup'),E_USER_NOTICE);
16
+
17
+ //Create PHP Mailer
18
+ require_once(realpath($_SESSION['WP']['ABSPATH'].$_SESSION['WP']['WPINC']).'/class-phpmailer.php');
19
+ $phpmailer = new PHPMailer();
20
+ //Setting den methode
21
+ if ($_SESSION['CFG']['mailmethod']=="SMTP") {
22
+ require_once(realpath($_SESSION['WP']['ABSPATH'].$_SESSION['WP']['WPINC']).'/class-smtp.php');
23
+ $phpmailer->Host=$_SESSION['CFG']['mailhost'];
24
+ $phpmailer->Port=$_SESSION['CFG']['mailhostport'];
25
+ $phpmailer->SMTPSecure=$_SESSION['CFG']['mailsecure'];
26
+ $phpmailer->Username=$_SESSION['CFG']['mailuser'];
27
+ $phpmailer->Password=base64_decode($_SESSION['CFG']['mailpass']);
28
+ if (!empty($_SESSION['CFG']['mailuser']) and !empty($_SESSION['CFG']['mailpass']))
29
+ $phpmailer->SMTPAuth=true;
30
+ $phpmailer->IsSMTP();
31
+ trigger_error(__('Send mail with SMTP','backwpup'),E_USER_NOTICE);
32
+ } elseif ($_SESSION['CFG']['mailmethod']=="Sendmail") {
33
+ $phpmailer->Sendmail=$_SESSION['CFG']['mailsendmail'];
34
+ $phpmailer->IsSendmail();
35
+ trigger_error(__('Send mail with Sendmail','backwpup'),E_USER_NOTICE);
36
+ } else {
37
+ $phpmailer->IsMail();
38
+ trigger_error(__('Send mail with PHP mail','backwpup'),E_USER_NOTICE);
39
+ }
40
+
41
+ trigger_error(__('Creating mail','backwpup'),E_USER_NOTICE);
42
+ $phpmailer->From = $_SESSION['CFG']['mailsndemail'];
43
+ $phpmailer->FromName = $_SESSION['CFG']['mailsndname'];
44
+ $phpmailer->AddAddress($_SESSION['JOB']['mailaddress']);
45
+ $phpmailer->Subject = __('BackWPup File from','backwpup').' '.date('Y-m-d H:i',$_SESSION['JOB']['starttime']).': '.$_SESSION['JOB']['name'];
46
+ $phpmailer->IsHTML(false);
47
+ $phpmailer->Body = __('Backup File:','backwpup').$_SESSION['STATIC']['backupfile'];
48
+
49
+ //check file Size
50
+ if (!empty($_SESSION['JOB']['mailefilesize'])) {
51
+ $maxfilezise=abs($_SESSION['JOB']['mailefilesize']*1024*1024);
52
+ if (filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'])>$maxfilezise) {
53
+ trigger_error(__('Backup Archive too big for sending by mail','backwpup'),E_USER_ERROR);
54
+ $_SESSION['WORKING']['STEPDONE']=1;
55
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_MAIL'; //set done
56
+ return;
57
+ }
58
+ }
59
+
60
+ trigger_error(__('Adding Attachment to mail','backwpup'),E_USER_NOTICE);
61
+ need_free_memory(filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'])*5);
62
+ $phpmailer->AddAttachment($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
63
+
64
+ trigger_error(__('Send mail....','backwpup'),E_USER_NOTICE);
65
+ @set_time_limit($_SESSION['CFG']['jobscriptruntimelong']);
66
+ if (false == $phpmailer->Send()) {
67
+ trigger_error(__('Can not send mail:','backwpup').' '.$phpmailer->ErrorInfo,E_USER_ERROR);
68
+ } else {
69
+ $_SESSION['WORKING']['STEPTODO']=filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
70
+ trigger_error(__('Mail send!!!','backwpup'),E_USER_NOTICE);
71
+ }
72
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_MAIL'; //set done
73
+ }
74
+ ?>
job/dest_msazure.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ function dest_msazure() {
9
+ if (empty($_SESSION['JOB']['msazureHost']) or empty($_SESSION['JOB']['msazureAccName']) or empty($_SESSION['JOB']['msazureKey']) or empty($_SESSION['JOB']['msazureContainer'])) {
10
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_MSAZURE'; //set done
11
+ return;
12
+ }
13
+ $_SESSION['WORKING']['STEPTODO']=2+filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
14
+ trigger_error($_SESSION['WORKING']['DEST_MSAZURE']['STEP_TRY'].'. '.__('Try to sending backup file to a Microsoft Azure (Blob)...','backwpup'),E_USER_NOTICE);
15
+
16
+ require_once(dirname(__FILE__).'/../libs/Microsoft/WindowsAzure/Storage/Blob.php');
17
+ need_free_memory(4194304*1.5);
18
+
19
+ try {
20
+ $storageClient = new Microsoft_WindowsAzure_Storage_Blob($_SESSION['JOB']['msazureHost'],$_SESSION['JOB']['msazureAccName'],$_SESSION['JOB']['msazureKey']);
21
+
22
+ if(!$storageClient->containerExists($_SESSION['JOB']['msazureContainer'])) {
23
+ trigger_error(__('Microsoft Azure Container not exists:','backwpup').' '.$_SESSION['JOB']['msazureContainer'],E_USER_ERROR);
24
+ return;
25
+ } else {
26
+ trigger_error(__('Connected to Microsoft Azure Container:','backwpup').' '.$_SESSION['JOB']['msazureContainer'],E_USER_NOTICE);
27
+ }
28
+
29
+ trigger_error(__('Upload to MS Azure now started ... ','backwpup'),E_USER_NOTICE);
30
+ @set_time_limit($_SESSION['CFG']['jobscriptruntimelong']);
31
+ $result = $storageClient->putBlob($_SESSION['JOB']['msazureContainer'], $_SESSION['JOB']['msazuredir'].$_SESSION['STATIC']['backupfile'], $_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
32
+
33
+ if ($result->Name==$_SESSION['JOB']['msazuredir'].$_SESSION['STATIC']['backupfile']) {
34
+ $_SESSION['WORKING']['STEPTODO']=1+filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
35
+ trigger_error(__('Backup File transferred to azure://','backwpup').$_SESSION['JOB']['msazuredir'].$_SESSION['STATIC']['backupfile'],E_USER_NOTICE);
36
+ $_SESSION['JOB']['lastbackupdownloadurl']=$_SESSION['WP']['ADMINURL'].'?page=backwpupbackups&action=downloadmsazure&file='.$_SESSION['JOB']['msazuredir'].$_SESSION['STATIC']['backupfile'].'&jobid='.$_SESSION['JOB']['jobid'];
37
+ } else {
38
+ trigger_error(__('Can not transfer backup to Microsoft Azure.','backwpup'),E_USER_ERROR);
39
+ }
40
+
41
+ if ($_SESSION['JOB']['msazuremaxbackups']>0) { //Delete old backups
42
+ $backupfilelist=array();
43
+ $blobs = $storageClient->listBlobs($_SESSION['JOB']['msazureContainer'],$_SESSION['JOB']['msazuredir']);
44
+ if (is_array($blobs)) {
45
+ foreach ($blobs as $blob) {
46
+ $file=basename($blob->Name);
47
+ if ($_SESSION['JOB']['fileprefix'] == substr($file,0,strlen($_SESSION['JOB']['fileprefix'])) and $_SESSION['JOB']['fileformart'] == substr($file,-strlen($_SESSION['JOB']['fileformart'])))
48
+ $backupfilelist[]=$file;
49
+ }
50
+ }
51
+ if (sizeof($backupfilelist)>0) {
52
+ rsort($backupfilelist);
53
+ $numdeltefiles=0;
54
+ for ($i=$_SESSION['JOB']['msazuremaxbackups'];$i<sizeof($backupfilelist);$i++) {
55
+ $storageClient->deleteBlob($_SESSION['JOB']['msazureContainer'],$_SESSION['JOB']['msazuredir'].$backupfilelist[$i]); //delte files on Cloud
56
+ $numdeltefiles++;
57
+ }
58
+ if ($numdeltefiles>0)
59
+ trigger_error($numdeltefiles.' '.__('files deleted on Microsoft Azure Container!','backwpup'),E_USER_NOTICE);
60
+ }
61
+ }
62
+
63
+ } catch (Exception $e) {
64
+ trigger_error(__('Microsoft Azure API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
65
+ }
66
+
67
+ $_SESSION['WORKING']['STEPDONE']++;
68
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_MSAZURE'; //set done
69
+ }
70
+ ?>
job/dest_rsc.php ADDED
@@ -0,0 +1,103 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ function dest_rsc() {
9
+ if (empty($_SESSION['JOB']['rscUsername']) or empty($_SESSION['JOB']['rscAPIKey']) or empty($_SESSION['JOB']['rscContainer'])) {
10
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_RSC'; //set done
11
+ return;
12
+ }
13
+ trigger_error($_SESSION['WORKING']['DEST_RSC']['STEP_TRY'].'. '.__('Try to sending backup file to Rackspace Cloud...','backwpup'),E_USER_NOTICE);
14
+ $_SESSION['WORKING']['STEPTODO']=2+filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
15
+ $_SESSION['WORKING']['STEPDONE']=0;
16
+ require_once(dirname(__FILE__).'/../libs/rackspace/cloudfiles.php');
17
+
18
+ $auth = new CF_Authentication($_SESSION['JOB']['rscUsername'], $_SESSION['JOB']['rscAPIKey']);
19
+ $auth->ssl_use_cabundle();
20
+ try {
21
+ if ($auth->authenticate())
22
+ trigger_error(__('Connected to Rackspase ...','backwpup'),E_USER_NOTICE);
23
+ $conn = new CF_Connection($auth);
24
+ $conn->ssl_use_cabundle();
25
+ $is_container=false;
26
+ $containers=$conn->get_containers();
27
+ foreach ($containers as $container) {
28
+ if ($container->name == $_SESSION['JOB']['rscContainer'] )
29
+ $is_container=true;
30
+ }
31
+ if (!$is_container) {
32
+ $public_container = $conn->create_container($_SESSION['JOB']['rscContainer']);
33
+ $public_container->make_private();
34
+ if (empty($public_container))
35
+ $is_container=false;
36
+ }
37
+ } catch (Exception $e) {
38
+ trigger_error(__('Rackspase Cloud API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
39
+ return;
40
+ }
41
+
42
+ if (!$is_container) {
43
+ trigger_error(__('Rackspase Cloud Container not exists:','backwpup').' '.$_SESSION['JOB']['rscContainer'],E_USER_ERROR);
44
+ return;
45
+ }
46
+
47
+ try {
48
+ //Transfer Backup to Rackspace Cloud
49
+ $backwpupcontainer = $conn->get_container($_SESSION['JOB']['rscContainer']);
50
+ //if (!empty($_SESSION['JOB']['rscdir'])) //make the foldder
51
+ // $backwpupcontainer->create_paths($_SESSION['JOB']['rscdir']);
52
+ $backwpupbackup = $backwpupcontainer->create_object($_SESSION['JOB']['rscdir'].$_SESSION['STATIC']['backupfile']);
53
+ //set content Type
54
+ if ($_SESSION['JOB']['fileformart']=='.zip')
55
+ $backwpupbackup->content_type='application/zip';
56
+ if ($_SESSION['JOB']['fileformart']=='.tar')
57
+ $backwpupbackup->content_type='application/x-ustar';
58
+ if ($_SESSION['JOB']['fileformart']=='.tar.gz')
59
+ $backwpupbackup->content_type='application/x-compressed';
60
+ if ($_SESSION['JOB']['fileformart']=='.tar.bz2')
61
+ $backwpupbackup->content_type='application/x-compressed';
62
+ trigger_error(__('Upload to RSC now started ... ','backwpup'),E_USER_NOTICE);
63
+ if ($backwpupbackup->load_from_filename($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'])) {
64
+ $_SESSION['WORKING']['STEPTODO']=1+filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
65
+ trigger_error(__('Backup File transferred to RSC://','backwpup').$_SESSION['JOB']['rscContainer'].'/'.$_SESSION['JOB']['rscdir'].$_SESSION['STATIC']['backupfile'],E_USER_NOTICE);
66
+ $_SESSION['JOB']['lastbackupdownloadurl']=$_SESSION['WP']['ADMINURL'].'?page=backwpupbackups&action=downloadrsc&file='.$_SESSION['JOB']['rscdir'].$_SESSION['STATIC']['backupfile'].'&jobid='.$_SESSION['JOB']['jobid'];
67
+ } else {
68
+ trigger_error(__('Can not transfer backup to RSC.','backwpup'),E_USER_ERROR);
69
+ }
70
+
71
+ if ($_SESSION['JOB']['rscmaxbackups']>0) { //Delete old backups
72
+ $backupfilelist=array();
73
+ $contents = $backwpupcontainer->list_objects(0,NULL,NULL,$_SESSION['JOB']['rscdir']);
74
+ if (is_array($contents)) {
75
+ foreach ($contents as $object) {
76
+ $file=basename($object);
77
+ if ($_SESSION['JOB']['rscdir'].$file == $object) {//only in the folder and not in complete bucket
78
+ if ($_SESSION['JOB']['fileprefix'] == substr($file,0,strlen($_SESSION['JOB']['fileprefix'])) and $_SESSION['JOB']['fileformart'] == substr($file,-strlen($_SESSION['JOB']['fileformart'])))
79
+ $backupfilelist[]=$file;
80
+ }
81
+ }
82
+ }
83
+ if (sizeof($backupfilelist)>0) {
84
+ rsort($backupfilelist);
85
+ $numdeltefiles=0;
86
+ for ($i=$_SESSION['JOB']['rscmaxbackups'];$i<sizeof($backupfilelist);$i++) {
87
+ if ($backwpupcontainer->delete_object($_SESSION['JOB']['rscdir'].$backupfilelist[$i])) //delte files on Cloud
88
+ $numdeltefiles++;
89
+ else
90
+ trigger_error(__('Can not delete file on RSC://','backwpup').$_SESSION['JOB']['rscContainer'].$_SESSION['JOB']['rscdir'].$backupfilelist[$i],E_USER_ERROR);
91
+ }
92
+ if ($numdeltefiles>0)
93
+ trigger_error($numdeltefiles.' '.__('files deleted on Racspase Cloud Container!','backwpup'),E_USER_NOTICE);
94
+ }
95
+ }
96
+ } catch (Exception $e) {
97
+ trigger_error(__('Rackspase Cloud API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
98
+ }
99
+
100
+ $_SESSION['WORKING']['STEPDONE']++;
101
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_RSC'; //set done
102
+ }
103
+ ?>
job/dest_s3.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ function dest_s3() {
9
+ if (empty($_SESSION['JOB']['awsAccessKey']) or empty($_SESSION['JOB']['awsSecretKey']) or empty($_SESSION['JOB']['awsBucket'])) {
10
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_S3'; //set done
11
+ return;
12
+ }
13
+ trigger_error($_SESSION['WORKING']['DEST_S3']['STEP_TRY'].'. '.__('Try to sending backup file to Amazon S3...','backwpup'),E_USER_NOTICE);
14
+ $_SESSION['WORKING']['STEPTODO']=2+filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
15
+ $_SESSION['WORKING']['STEPDONE']=0;
16
+
17
+ require_once(dirname(__FILE__).'/../libs/aws/sdk.class.php');
18
+ need_free_memory(26214400*1.1);
19
+
20
+ try {
21
+ $s3 = new AmazonS3($_SESSION['JOB']['awsAccessKey'], $_SESSION['JOB']['awsSecretKey']);
22
+ if ($s3->if_bucket_exists($_SESSION['JOB']['awsBucket'])) {
23
+ trigger_error(__('Connected to S3 Bucket:','backwpup').' '.$_SESSION['JOB']['awsBucket'],E_USER_NOTICE);
24
+ //Transfer Backup to S3
25
+ if ($_SESSION['JOB']['awsrrs']) //set reduced redundancy or not
26
+ $storage=AmazonS3::STORAGE_REDUCED;
27
+ else
28
+ $storage=AmazonS3::STORAGE_STANDARD;
29
+ //set surl Prozess bar
30
+ $curlops=array();
31
+ if (function_exists('curl_progresscallback') and is_numeric(CURLOPT_PROGRESSFUNCTION))
32
+ $curlops=array(CURLOPT_NOPROGRESS=>false,CURLOPT_PROGRESSFUNCTION=>'curl_progresscallback',CURLOPT_BUFFERSIZE=>256);
33
+ else
34
+ @set_time_limit($_SESSION['CFG']['jobscriptruntimelong']);
35
+ trigger_error(__('Upload to Amazon S3 now started ... ','backwpup'),E_USER_NOTICE);
36
+ if ($s3->create_mpu_object($_SESSION['JOB']['awsBucket'], $_SESSION['JOB']['awsdir'].$_SESSION['STATIC']['backupfile'], array('fileUpload' => $_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'],'acl' => AmazonS3::ACL_PRIVATE,'storage' => $storage,'partSize'=>26214400,'curlopts'=>$curlops))) {//transfere file to S3
37
+ $_SESSION['WORKING']['STEPTODO']=1+filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
38
+ trigger_error(__('Backup File transferred to S3://','backwpup').$_SESSION['JOB']['awsBucket'].'/'.$_SESSION['JOB']['awsdir'].$_SESSION['STATIC']['backupfile'],E_USER_NOTICE);
39
+ $_SESSION['JOB']['lastbackupdownloadurl']=$_SESSION['WP']['ADMINURL'].'?page=backwpupbackups&action=downloads3&file='.$_SESSION['JOB']['awsdir'].$_SESSION['STATIC']['backupfile'].'&jobid='.$_SESSION['JOB']['jobid'];
40
+ } else {
41
+ trigger_error(__('Can not transfer backup to S3.','backwpup'),E_USER_ERROR);
42
+ }
43
+
44
+ if ($_SESSION['JOB']['awsmaxbackups']>0) { //Delete old backups
45
+ $backupfilelist=array();
46
+ if (($contents = $s3->list_objects($_SESSION['JOB']['awsBucket'],array('prefix'=>$_SESSION['JOB']['awsdir']))) !== false) {
47
+ foreach ($contents->body->Contents as $object) {
48
+ $file=basename($object->Key);
49
+ if ($_SESSION['JOB']['fileprefix'] == substr($file,0,strlen($_SESSION['JOB']['fileprefix'])) and $_SESSION['JOB']['fileformart'] == substr($file,-strlen($_SESSION['JOB']['fileformart'])))
50
+ $backupfilelist[]=$file;
51
+ }
52
+ }
53
+ if (sizeof($backupfilelist)>0) {
54
+ rsort($backupfilelist);
55
+ $numdeltefiles=0;
56
+ for ($i=$_SESSION['JOB']['awsmaxbackups'];$i<sizeof($backupfilelist);$i++) {
57
+ if ($s3->delete_object($_SESSION['JOB']['awsBucket'], $_SESSION['JOB']['awsdir'].$backupfilelist[$i])) //delte files on S3
58
+ $numdeltefiles++;
59
+ else
60
+ trigger_error(__('Can not delete file on S3://','backwpup').$_SESSION['JOB']['awsBucket'].'/'.$_SESSION['JOB']['awsdir'].$backupfilelist[$i],E_USER_ERROR);
61
+ }
62
+ if ($numdeltefiles>0)
63
+ trigger_error($numdeltefiles.' '.__('files deleted on S3 Bucket!','backwpup'),E_USER_NOTICE);
64
+ }
65
+ }
66
+ } else {
67
+ trigger_error(__('S3 Bucket not exists:','backwpup').' '.$_SESSION['JOB']['awsBucket'],E_USER_ERROR);
68
+ }
69
+ } catch (Exception $e) {
70
+ trigger_error(__('Amazon S3 API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
71
+ return;
72
+ }
73
+
74
+ $_SESSION['WORKING']['STEPDONE']++;
75
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_S3'; //set done
76
+ }
77
+ ?>
job/dest_sugarsync.php ADDED
@@ -0,0 +1,80 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ function dest_sugarsync() {
9
+ if (empty($_SESSION['JOB']['sugaruser']) or empty($_SESSION['JOB']['sugarpass']) or empty($_SESSION['JOB']['sugarroot'])) {
10
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_SUGARSYNC'; //set done
11
+ return;
12
+ }
13
+ $_SESSION['WORKING']['STEPTODO']=2+filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
14
+ $_SESSION['WORKING']['STEPDONE']=0;
15
+ trigger_error($_SESSION['WORKING']['DEST_SUGARSYNC']['STEP_TRY'].'. '.__('Try to sending backup file to sugarsync...','backwpup'),E_USER_NOTICE);
16
+
17
+ require_once(realpath(dirname(__FILE__).'/../libs/sugarsync.php'));
18
+
19
+ try {
20
+ $sugarsync = new SugarSync($_SESSION['JOB']['sugaruser'],base64_decode($_SESSION['JOB']['sugarpass']),$_SESSION['BACKWPUP']['SUGARSYNC_ACCESSKEY'], $_SESSION['BACKWPUP']['SUGARSYNC_PRIVATEACCESSKEY']);
21
+ //Check Quota
22
+ $user=$sugarsync->user();
23
+ if (!empty($user->nickname)) {
24
+ trigger_error(__('Authed to SugarSync with Nick ','backwpup').$user->nickname,E_USER_NOTICE);
25
+ }
26
+ $sugarsyncfreespase=(float)$user->quota->limit-(float)$user->quota->usage; //float fixes bug for display of no free space
27
+ if (filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'])>$sugarsyncfreespase) {
28
+ trigger_error(__('No free space left on SugarSync!!!','backwpup'),E_USER_ERROR);
29
+ $_SESSION['WORKING']['STEPTODO']=1+filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
30
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_SUGARSYNC'; //set done
31
+ return;
32
+ } else {
33
+ trigger_error(__('Free Space on SugarSync: ','backwpup').formatBytes($sugarsyncfreespase),E_USER_NOTICE);
34
+ }
35
+ //Create and change folder
36
+ $sugarsync->mkdir($_SESSION['JOB']['sugardir'],$_SESSION['JOB']['sugarroot']);
37
+ $dirid=$sugarsync->chdir($_SESSION['JOB']['sugardir'],$_SESSION['JOB']['sugarroot']);
38
+ //Upload to Sugarsync
39
+ $sugarsync->setProgressFunction('curl_progresscallback');
40
+ trigger_error(__('Upload to SugarSync now started ... ','backwpup'),E_USER_NOTICE);
41
+ $reponse=$sugarsync->upload($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']);
42
+ if (is_object($reponse)) {
43
+ $_SESSION['JOB']['lastbackupdownloadurl']=$_SESSION['WP']['ADMINURL'].'?page=backwpupbackups&action=downloadsugarsync&file='.(string)$reponse.'&jobid='.$_SESSION['JOB']['jobid'];
44
+ $_SESSION['WORKING']['STEPDONE']++;
45
+ trigger_error(__('Backup File transferred to SugarSync://','backwpup').$sugarsync->showdir($dirid).$_SESSION['STATIC']['backupfile'],E_USER_NOTICE);
46
+ } else {
47
+ trigger_error(__('Can not transfere Backup file to SugarSync:','backwpup'),E_USER_ERROR);
48
+ return;
49
+ }
50
+ $sugarsync->setProgressFunction('');
51
+
52
+ if ($_SESSION['JOB']['sugarmaxbackups']>0) { //Delete old backups
53
+ $backupfilelist=array();
54
+ $getfiles=$sugarsync->getcontents('file');
55
+ if (is_object($getfiles)) {
56
+ foreach ($getfiles->file as $getfile) {
57
+ if ($_SESSION['JOB']['fileprefix'] == substr($getfile->displayName,0,strlen($_SESSION['JOB']['fileprefix'])) and $_SESSION['JOB']['fileformart'] == substr($getfile->displayName,-strlen($_SESSION['JOB']['fileformart'])))
58
+ $backupfilelist[]=$getfile->displayName;
59
+ $backupfileref[utf8_encode($getfile->displayName)]=$getfile->ref;
60
+ }
61
+ }
62
+ if (sizeof($backupfilelist)>0) {
63
+ rsort($backupfilelist);
64
+ $numdeltefiles=0;
65
+ for ($i=$_SESSION['JOB']['sugarmaxbackups'];$i<count($backupfilelist);$i++) {
66
+ $sugarsync->delete($backupfileref[utf8_encode($backupfilelist[$i])]); //delete files on Cloud
67
+ $numdeltefiles++;
68
+ }
69
+ if ($numdeltefiles>0)
70
+ trigger_error($numdeltefiles.' '.__('files deleted on Sugarsync folder!','backwpup'),E_USER_NOTICE);
71
+ }
72
+ }
73
+ } catch (Exception $e) {
74
+ trigger_error(__('SugarSync API:','backwpup').' '.$e->getMessage(),E_USER_ERROR);
75
+ }
76
+
77
+ $_SESSION['WORKING']['STEPDONE']++;
78
+ $_SESSION['WORKING']['STEPSDONE'][]='DEST_SUGARSYNC'; //set done
79
+ }
80
+ ?>
job/file_list.php ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+
9
+ function file_list() {
10
+ //Make filelist
11
+ trigger_error(__($_SESSION['WORKING']['FILE_LIST']['STEP_TRY'].'. '.'Try for make a list of files to Backup ....','backwpup'),E_USER_NOTICE);
12
+ $_SESSION['WORKING']['STEPTODO']=2;
13
+
14
+ if ($_SESSION['WORKING']['STEPDONE']==0) {
15
+ //Check free memory for file list
16
+ need_free_memory(2097152); //2MB free memory for filelist
17
+ //empty filelist
18
+ $_SESSION['WORKING']['TEMPFILELIST']=array();
19
+ //exlude of job
20
+ $_SESSION['WORKING']['FILEEXCLUDES']=explode(',',trim($_SESSION['JOB']['fileexclude']));
21
+ $_SESSION['WORKING']['FILEEXCLUDES']=array_unique($_SESSION['WORKING']['FILEEXCLUDES']);
22
+
23
+ //File list for blog folders
24
+ if ($_SESSION['JOB']['backuproot'])
25
+ _file_list($_SESSION['WP']['ABSPATH'],100,array_merge($_SESSION['JOB']['backuprootexcludedirs'],_get_exclude_dirs($_SESSION['WP']['ABSPATH'])));
26
+ if ($_SESSION['JOB']['backupcontent'])
27
+ _file_list($_SESSION['WP']['WP_CONTENT_DIR'],100,array_merge($_SESSION['JOB']['backupcontentexcludedirs'],_get_exclude_dirs($_SESSION['WP']['WP_CONTENT_DIR'])));
28
+ if ($_SESSION['JOB']['backupplugins'])
29
+ _file_list($_SESSION['WP']['WP_PLUGIN_DIR'],100,array_merge($_SESSION['JOB']['backuppluginsexcludedirs'],_get_exclude_dirs($_SESSION['WP']['WP_PLUGIN_DIR'])));
30
+ if ($_SESSION['JOB']['backupthemes'])
31
+ _file_list($_SESSION['WP']['WP_THEMES_DIR'],100,array_merge($_SESSION['JOB']['backupthemesexcludedirs'],_get_exclude_dirs($_SESSION['WP']['WP_THEMES_DIR'])));
32
+ if ($_SESSION['JOB']['backupuploads'])
33
+ _file_list($_SESSION['WP']['WP_UPLOAD_DIR'],100,array_merge($_SESSION['JOB']['backupuploadsexcludedirs'],_get_exclude_dirs($_SESSION['WP']['WP_UPLOAD_DIR'])));
34
+
35
+ //include dirs
36
+ if (!empty($_SESSION['JOB']['dirinclude'])) {
37
+ $dirinclude=explode(',',$_SESSION['JOB']['dirinclude']);
38
+ $dirinclude=array_unique($dirinclude);
39
+ //Crate file list for includes
40
+ foreach($dirinclude as $dirincludevalue) {
41
+ if (is_dir($dirincludevalue))
42
+ _file_list($dirincludevalue,100);
43
+ }
44
+ }
45
+ $_SESSION['WORKING']['TEMPFILELIST']=array_unique($_SESSION['WORKING']['TEMPFILELIST']); //all files only one time in list
46
+ sort($_SESSION['WORKING']['TEMPFILELIST']);
47
+ $_SESSION['WORKING']['FILELISTDONE']=0; //Set number of dine files
48
+ $_SESSION['WORKING']['STEPDONE']=1; //Step done
49
+ update_working_file();
50
+ }
51
+ if ($_SESSION['WORKING']['STEPDONE']==1) {
52
+ //Check abs path
53
+ if ($_SESSION['WP']['ABSPATH']=='/' or $_SESSION['WP']['ABSPATH']=='')
54
+ $removepath='';
55
+ else
56
+ $removepath=$_SESSION['WP']['ABSPATH'];
57
+ //make file list
58
+ for ($i=$_SESSION['WORKING']['FILELISTDONE']; $i<count($_SESSION['WORKING']['TEMPFILELIST']); $i++) {
59
+ $filestat=stat($_SESSION['WORKING']['TEMPFILELIST'][$i]);
60
+ $_SESSION['WORKING']['ALLFILESIZE']+=$filestat['size'];
61
+ $_SESSION['WORKING']['FILELIST'][]=array('FILE'=>$_SESSION['WORKING']['TEMPFILELIST'][$i],'OUTFILE'=>str_replace($removepath,'',$_SESSION['WORKING']['TEMPFILELIST'][$i]),'SIZE'=>$filestat['size'],'ATIME'=>$filestat['atime'],'MTIME'=>$filestat['mtime'],'CTIME'=>$filestat['ctime'],'UID'=>$filestat['uid'],'GID'=>$filestat['gid'],'MODE'=>$filestat['mode']);
62
+ $_SESSION['WORKING']['FILELISTDONE']++;
63
+ }
64
+
65
+ $_SESSION['WORKING']['STEPDONE']=2;
66
+ $_SESSION['WORKING']['STEPSDONE'][]='FILE_LIST'; //set done
67
+ unset($_SESSION['WORKING']['FILELISTDONE']); //clean up
68
+ unset($_SESSION['WORKING']['TEMPFILELIST']);
69
+
70
+ if (!is_array($_SESSION['WORKING']['FILELIST'][0])) {
71
+ trigger_error(__('No files to Backup','backwpup'),E_USER_ERROR);
72
+ } else {
73
+ trigger_error(__('Files to Backup:','backwpup').' '.count($_SESSION['WORKING']['FILELIST']),E_USER_NOTICE);
74
+ trigger_error(__('Size of all Files:','backwpup').' '.formatBytes($_SESSION['WORKING']['ALLFILESIZE']),E_USER_NOTICE);
75
+ }
76
+ }
77
+ }
78
+
79
+ function _file_list( $folder = '', $levels = 100, $excludedirs=array()) {
80
+ if( empty($folder) )
81
+ return false;
82
+ if( ! $levels )
83
+ return false;
84
+ $folder=rtrim($folder,'/').'/';
85
+ if ( $dir = @opendir( $folder ) ) {
86
+ while (($file = readdir( $dir ) ) !== false ) {
87
+ if ( in_array($file, array('.', '..','.svn') ) )
88
+ continue;
89
+ foreach ($_SESSION['WORKING']['FILEEXCLUDES'] as $exclusion) { //exclude dirs and files
90
+ $exclusion=trim($exclusion);
91
+ if (false !== stripos($folder.$file,$exclusion) and !empty($exclusion) and $exclusion!='/')
92
+ continue 2;
93
+ }
94
+ if (in_array(rtrim($folder.$file,'/').'/',$excludedirs) and is_dir( $folder.$file ))
95
+ continue;
96
+ if ( !is_readable($folder.$file)) {
97
+ trigger_error(__('File or folder is not readable:','backwpup').' '.$folder.$file,E_USER_WARNING);
98
+ } elseif ( is_link($folder.$file) ) {
99
+ trigger_error(__('Links not followed:','backwpup').' '.$folder.$file,E_USER_WARNING);
100
+ } elseif ( is_dir( $folder.$file )) {
101
+ _file_list( rtrim($folder.$file,'/'), $levels - 1,$excludedirs);
102
+ } elseif ( is_file( $folder.$file ) or is_executable($folder.$file)) { //add file to filelist
103
+ $_SESSION['WORKING']['TEMPFILELIST'][]=$folder.$file;
104
+ } else {
105
+ trigger_error(__('Is not a file or directory:','backwpup').' '.$folder.$file,E_USER_WARNING);
106
+ }
107
+
108
+ }
109
+ @closedir( $dir );
110
+ }
111
+ }
112
+
113
+ function _get_exclude_dirs($folder) {
114
+ $excludedir=array();
115
+ $excludedir[]=rtrim(str_replace('\\','/',sys_get_temp_dir()),'/').'/'; //exclude temp
116
+ $excludedir[]=$_SESSION['CFG']['dirlogs'];
117
+ if (false !== strpos($_SESSION['WP']['ABSPATH'],$folder) and $_SESSION['WP']['ABSPATH']!=$folder)
118
+ $excludedir[]=$_SESSION['WP']['ABSPATH'];
119
+ if (false !== strpos($_SESSION['WP']['WP_CONTENT_DIR'],$folder) and $_SESSION['WP']['WP_CONTENT_DIR']!=$folder)
120
+ $excludedir[]=$_SESSION['WP']['WP_CONTENT_DIR'];
121
+ if (false !== strpos($_SESSION['WP']['WP_PLUGIN_DIR'],$folder) and $_SESSION['WP']['WP_PLUGIN_DIR']!=$folder)
122
+ $excludedir[]=$_SESSION['WP']['WP_PLUGIN_DIR'];
123
+ if (false !== strpos($_SESSION['WP']['WP_THEMES_DIR'],$folder) and $_SESSION['WP']['WP_THEMES_DIR']!=$folder)
124
+ $excludedir[]=$_SESSION['WP']['WP_THEMES_DIR'];
125
+ if (false !== strpos($_SESSION['WP']['WP_UPLOAD_DIR'],$folder) and $_SESSION['WP']['WP_UPLOAD_DIR']!=$folder)
126
+ $excludedir[]=$_SESSION['WP']['WP_UPLOAD_DIR'];
127
+ //Exclude Backup dirs
128
+ $jobs=(array)get_option('backwpup_jobs');
129
+ foreach($jobs as $jobsvale) {
130
+ if (!empty($jobsvale['backupdir']) and $jobsvale['backupdir']!='/')
131
+ $excludedir[]=$jobsvale['backupdir'];
132
+ }
133
+ return $excludedir;
134
+ }
135
+
136
+ ?>
job/job_functions.php ADDED
@@ -0,0 +1,531 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ // don't load directly
3
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
4
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
5
+ header("Status: 404 Not Found");
6
+ die();
7
+ }
8
+
9
+ function __($message,$domain='backwpup') {
10
+ $msgid=md5($message);
11
+ if (!empty($_SESSION['TRANSLATE'][$msgid]))
12
+ $message=$_SESSION['TRANSLATE'][$msgid];
13
+ return $message;
14
+ }
15
+
16
+ function _e($message,$domain='backwpup') {
17
+ $msgid=md5($message);
18
+ if (!empty($_SESSION['TRANSLATE'][$msgid]))
19
+ $message=$_SESSION['TRANSLATE'][$msgid];
20
+ echo $message;
21
+ }
22
+
23
+ function _n($singular,$plural,$count,$domain='backwpup') {
24
+ if ($count<=1)
25
+ $msgid=md5($singular);
26
+ else
27
+ $msgid=md5($plural);
28
+ if (!empty($_SESSION['TRANSLATE'][$msgid]))
29
+ $message=$_SESSION['TRANSLATE'][$msgid];
30
+ return $message;
31
+ }
32
+
33
+ function exists_option($option='backwpup_jobs') {
34
+ mysql_update();
35
+ $query="SELECT option_value as value FROM ".$_SESSION['WP']['OPTIONS_TABLE']." WHERE option_name='".trim($option)."' LIMIT 1";
36
+ $res=mysql_query($query);
37
+ if (!$res or mysql_num_rows($res)<1) {
38
+ return false;
39
+ }
40
+ return true;
41
+ }
42
+
43
+ function get_option($option='backwpup_jobs') {
44
+ mysql_update();
45
+ $query="SELECT option_value FROM ".$_SESSION['WP']['OPTIONS_TABLE']." WHERE option_name='".trim($option)."' LIMIT 1";
46
+ $res=mysql_query($query);
47
+ if (!$res) {
48
+ trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), mysql_error(), $query),E_USER_ERROR);
49
+ return false;
50
+ }
51
+ return unserialize(mysql_result($res,0));
52
+ }
53
+
54
+ function update_option($option='backwpup_jobs',$data) {
55
+ mysql_update();
56
+ $serdata=mysql_real_escape_string(serialize($data));
57
+ $query="UPDATE ".$_SESSION['WP']['OPTIONS_TABLE']." SET option_value= '".$serdata."' WHERE option_name='".trim($option)."' LIMIT 1";
58
+ $res=mysql_query($query);
59
+ if (!$res) {
60
+ trigger_error(sprintf(__('BackWPup database error %1$s for query %2$s','backwpup'), mysql_error(), $query),E_USER_ERROR);
61
+ return false;
62
+ }
63
+ return true;
64
+ }
65
+
66
+ //file size
67
+ function formatbytes($bytes, $precision = 2) {
68
+ $units = array('B', 'KB', 'MB', 'GB', 'TB');
69
+ $bytes = max($bytes, 0);
70
+ $pow = floor(($bytes ? log($bytes) : 0) / log(1024));
71
+ $pow = min($pow, count($units) - 1);
72
+ $bytes /= pow(1024, $pow);
73
+ return round($bytes, $precision) . ' ' . $units[$pow];
74
+ }
75
+
76
+ function need_free_memory($memneed) {
77
+ if (ini_get('safe_mode') or strtolower(ini_get('safe_mode'))=='on' or ini_get('safe_mode')=='1') {
78
+ trigger_error(sprintf(__('PHP Safe Mode is on!!! Can not increase Memory Limit is %1$s','backwpup'),ini_get('memory_limit')),E_USER_WARNING);
79
+ return false;
80
+ }
81
+
82
+ //calc mem to bytes
83
+ if (strtoupper(substr(trim(ini_get('memory_limit')),-1))=='K')
84
+ $memory=trim(substr(ini_get('memory_limit'),0,-1))*1024;
85
+ elseif (strtoupper(substr(trim(ini_get('memory_limit')),-1))=='M')
86
+ $memory=trim(substr(ini_get('memory_limit'),0,-1))*1024*1024;
87
+ elseif (strtoupper(substr(trim(ini_get('memory_limit')),-1))=='G')
88
+ $memory=trim(substr(ini_get('memory_limit'),0,-1))*1024*1024*1024;
89
+ else
90
+ $memory=trim(ini_get('memory_limit'));
91
+
92
+ //use real memory at php version 5.2.0
93
+ if (version_compare(phpversion(), '5.2.0', '<'))
94
+ $memnow=memory_get_usage();
95
+ else
96
+ $memnow=memory_get_usage(true);
97
+
98
+ //need memory
99
+ $needmemory=$memnow+$memneed;
100
+
101
+ // increase Memory
102
+ if ($needmemory>$memory) {
103
+ $newmemory=round($needmemory/1024/1024)+1;
104
+ if ($oldmem=ini_set('memory_limit', $newmemory.'M'))
105
+ trigger_error(sprintf(__('Memory increased from %1$s to %2$s','backwpup'),$oldmem,ini_get('memory_limit')),E_USER_NOTICE);
106
+ else
107
+ trigger_error(sprintf(__('Can not increase Memory Limit is %1$s','backwpup'),ini_get('memory_limit')),E_USER_WARNING);
108
+ }
109
+ return true;
110
+ }
111
+
112
+ function maintenance_mode($enable = false) {
113
+ if (!$_SESSION['JOB']['maintenance'])
114
+ return;
115
+ if ( $enable ) {
116
+ trigger_error(__('Set Blog to Maintenance Mode','backwpup'),E_USER_NOTICE);
117
+ if ( exists_option('wp-maintenance-mode-msqld') ) { //Support for WP Maintenance Mode Plugin
118
+ update_option('wp-maintenance-mode-msqld','1');
119
+ } elseif ( exists_option('plugin_maintenance-mode') ) { //Support for Maintenance Mode Plugin
120
+ $mamo=get_option('plugin_maintenance-mode');
121
+ $mamo['mamo_activate']='on_'.current_time('timestamp');
122
+ $mamo['mamo_backtime_days']='0';
123
+ $mamo['mamo_backtime_hours']='0';
124
+ $mamo['mamo_backtime_mins']='5';
125
+ update_option('plugin_maintenance-mode',$mamo);
126
+ } else { //WP Support
127
+ if (is_writable(rtrim($_SESSION['WP']['ABSPATH'],'/')))
128
+ file_put_contents(rtrim($_SESSION['WP']['ABSPATH'],'/').'/.maintenance','<?php $upgrading = '.time().'; ?>');
129
+ else
130
+ trigger_error(__('Cannot set Website/Blog to Maintenance Mode! Root folder is not writeable!','backwpup'),E_USER_NOTICE);
131
+ }
132
+ } else {
133
+ trigger_error(__('Set Blog to normal Mode','backwpup'),E_USER_NOTICE);
134
+ if ( exists_option('wp-maintenance-mode-msqld') ) { //Support for WP Maintenance Mode Plugin
135
+ update_option('wp-maintenance-mode-msqld','0');
136
+ } elseif ( exists_option('plugin_maintenance-mode') ) { //Support for Maintenance Mode Plugin
137
+ $mamo=get_option('plugin_maintenance-mode');
138
+ $mamo['mamo_activate']='off';
139
+ update_option('plugin_maintenance-mode',$mamo);
140
+ } else { //WP Support
141
+ @unlink(rtrim($_SESSION['WP']['ABSPATH'],'/').'/.maintenance');
142
+ }
143
+ }
144
+ }
145
+
146
+ function curl_progresscallback($download_size, $downloaded, $upload_size, $uploaded) {
147
+ $_SESSION['WORKING']['STEPDONE']=$uploaded;
148
+ update_working_file();
149
+ return(0);
150
+ }
151
+
152
+ function get_working_dir() {
153
+ $folder='backwpup_'.substr(md5(str_replace('\\','/',realpath(rtrim(basename(__FILE__),'/\\').'/'))),8,16).'/';
154
+ $tempdir=getenv('TMP');
155
+ if (!$tempdir or !is_writable($tempdir) or !is_dir($tempdir))
156
+ $tempdir=getenv('TEMP');
157
+ if (!$tempdir or !is_writable($tempdir) or !is_dir($tempdir))
158
+ $tempdir=getenv('TMPDIR');
159
+ if (!$tempdir or !is_writable($tempdir) or !is_dir($tempdir))
160
+ $tempdir=ini_get('upload_tmp_dir');
161
+ if (!$tempdir or empty($tempdir) or !is_writable($tempdir) or !is_dir($tempdir))
162
+ $tempdir=sys_get_temp_dir();
163
+ if (is_readable(dirname(__FILE__).'/../../.backwpuptempfolder'))
164
+ $tempdir=trim(file_get_contents(dirname(__FILE__).'/../../.backwpuptempfolder',false,NULL,0,255));
165
+ $tempdir=str_replace('\\','/',realpath(rtrim($tempdir,'/'))).'/';
166
+ if (is_dir($tempdir.$folder) and is_writable($tempdir.$folder)) {
167
+ return $tempdir.$folder;
168
+ } else {
169
+ return false;
170
+ }
171
+ }
172
+
173
+ function get_working_file() {
174
+ $tempdir=get_working_dir();
175
+ if (is_file($tempdir.'.running')) {
176
+ if ($runningfile=file_get_contents($tempdir.'.running'))
177
+ return unserialize(trim($runningfile));
178
+ else
179
+ return false;
180
+ } else {
181
+ return false;
182
+ }
183
+ }
184
+
185
+ function delete_working_file() {
186
+ $tempdir=get_working_dir();
187
+ if (is_file($tempdir.'.running')) {
188
+ unlink($tempdir.'.running');
189
+ return true;
190
+ } else {
191
+ return false;
192
+ }
193
+ }
194
+
195
+ function update_working_file() {
196
+ global $runmicrotime;
197
+ if (!file_exists($_SESSION['STATIC']['TEMPDIR'].'.running'))
198
+ job_end();
199
+ if (empty($runmicrotime) or $runmicrotime>(microtime()-500)) { //only update all 500 ms
200
+ if ($_SESSION['WORKING']['STEPTODO']>0 and $_SESSION['WORKING']['STEPDONE']>0)
201
+ $steppersent=round($_SESSION['WORKING']['STEPDONE']/$_SESSION['WORKING']['STEPTODO']*100);
202
+ else
203
+ $steppersent=1;
204
+ if (count($_SESSION['WORKING']['STEPSDONE'])>0)
205
+ $stepspersent=round(count($_SESSION['WORKING']['STEPSDONE'])/count($_SESSION['WORKING']['STEPS'])*100);
206
+ else
207
+ $stepspersent=1;
208
+ $pid=0;
209
+ @set_time_limit($_SESSION['CFG']['jobscriptruntime']);
210
+ mysql_update();
211
+ if (function_exists('posix_getpid'))
212
+ $pid=posix_getpid();
213
+ $runningfile=file_get_contents($_SESSION['STATIC']['TEMPDIR'].'/.running');
214
+ $infile=unserialize(trim($runningfile));
215
+ file_put_contents($_SESSION['STATIC']['TEMPDIR'].'/.running',serialize(array('SID'=>session_id(),'timestamp'=>time(),'JOBID'=>$_SESSION['JOB']['jobid'],'LOGFILE'=>$_SESSION['STATIC']['LOGFILE'],'PID'=>$pid,'WARNING'=>$_SESSION['WORKING']['WARNING'],'ERROR'=>$_SESSION['WORKING']['ERROR'],'STEPSPERSENT'=>$stepspersent,'STEPPERSENT'=>$steppersent,'ABSPATH'=>$_SESSION['WP']['ABSPATH'])));
216
+ $runmicrotime=microtime();
217
+ }
218
+ return true;
219
+ }
220
+
221
+ function mysql_update() {
222
+ global $mysqlconlink;
223
+ if (!$mysqlconlink or !@mysql_ping($mysqlconlink)) {
224
+ // make a mysql connection
225
+ $mysqlconlink=mysql_connect($_SESSION['WP']['DB_HOST'], $_SESSION['WP']['DB_USER'], $_SESSION['WP']['DB_PASSWORD'], true);
226
+ if (!$mysqlconlink)
227
+ trigger_error(__('No MySQL connection:','backwpup').' ' . mysql_error(),E_USER_ERROR);
228
+ //set connecten charset
229
+ if (!empty($_SESSION['WP']['DB_CHARSET'])) {
230
+ if ( function_exists( 'mysql_set_charset' )) {
231
+ mysql_set_charset( $_SESSION['WP']['DB_CHARSET'], $mysqlconlink );
232
+ } else {
233
+ $query = "SET NAMES '".$_SESSION['WP']['DB_CHARSET']."'";
234
+ if (!empty($collate))
235
+ $query .= " COLLATE '".$_SESSION['WP']['DB_COLLATE']."'";
236
+ mysql_query($query,$mysqlconlink);
237
+ }
238
+ }
239
+ //connect to database
240
+ $mysqldblink = mysql_select_db($_SESSION['WP']['DB_NAME'], $mysqlconlink);
241
+ if (!$mysqldblink)
242
+ trigger_error(__('No MySQL connection to database:','backwpup').' ' . mysql_error(),E_USER_ERROR);
243
+ }
244
+ }
245
+
246
+ //function for PHP error handling
247
+ function joberrorhandler() {
248
+ $args = func_get_args(); // 0:errno, 1:errstr, 2:errfile, 3:errline
249
+ $adderrorwarning=false;
250
+
251
+ switch ($args[0]) {
252
+ case E_NOTICE:
253
+ case E_USER_NOTICE:
254
+ $message="<span>".$args[1]."</span>";
255
+ break;
256
+ case E_WARNING:
257
+ case E_USER_WARNING:
258
+ $_SESSION['WORKING']['WARNING']++;
259
+ $adderrorwarning=true;
260
+ $message="<span class=\"warning\">".__('[WARNING]','backwpup')." ".$args[1]."</span>";
261
+ break;
262
+ case E_ERROR:
263
+ case E_USER_ERROR:
264
+ $_SESSION['WORKING']['ERROR']++;
265
+ $adderrorwarning=true;
266
+ $message="<span class=\"error\">".__('[ERROR]','backwpup')." ".$args[1]."</span>";
267
+ break;
268
+ case E_DEPRECATED:
269
+ case E_USER_DEPRECATED:
270
+ $message="<span>".__('[DEPRECATED]','backwpup')." ".$args[1]."</span>";
271
+ break;
272
+ case E_STRICT:
273
+ $message="<span>".__('[STRICT NOTICE]','backwpup')." ".$args[1]."</span>";
274
+ break;
275
+ case E_RECOVERABLE_ERROR:
276
+ $message="<span>".__('[RECOVERABLE ERROR]','backwpup')." ".$args[1]."</span>";
277
+ break;
278
+ default:
279
+ $message="<span>[".$args[0]."] ".$args[1]."</span>";
280
+ break;
281
+ }
282
+
283
+ //genrate timestamp
284
+ $timestamp="<span class=\"timestamp\" title=\"[Line: ".$args[3]."|File: ".basename($args[2])."|Mem: ".formatbytes(@memory_get_usage(true))."|Mem Max: ".formatbytes(@memory_get_peak_usage(true))."|Mem Limit: ".ini_get('memory_limit')."]\">".date('Y-m-d H:i.s').":</span> ";
285
+ //wirte log file
286
+ file_put_contents($_SESSION['STATIC']['LOGFILE'], $timestamp.$message."<br />\n", FILE_APPEND);
287
+
288
+ //write new log header
289
+ if ($adderrorwarning) {
290
+ $found=0;
291
+ $fd=fopen($_SESSION['STATIC']['LOGFILE'],'r+');
292
+ while (!feof($fd)) {
293
+ $line=fgets($fd);
294
+ if (stripos($line,"<meta name=\"backwpup_errors\"") !== false) {
295
+ fseek($fd,$filepos);
296
+ fwrite($fd,str_pad("<meta name=\"backwpup_errors\" content=\"".$_SESSION['WORKING']['ERROR']."\" />",100)."\n");
297
+ $found++;
298
+ }
299
+ if (stripos($line,"<meta name=\"backwpup_warnings\"") !== false) {
300
+ fseek($fd,$filepos);
301
+ fwrite($fd,str_pad("<meta name=\"backwpup_warnings\" content=\"".$_SESSION['WORKING']['WARNING']."\" />",100)."\n");
302
+ $found++;
303
+ }
304
+ if ($found>=2)
305
+ break;
306
+ $filepos=ftell($fd);
307
+ }
308
+ fclose($fd);
309
+ }
310
+
311
+ //write working file
312
+ if (is_file($_SESSION['STATIC']['TEMPDIR'].'/.running'))
313
+ update_working_file();
314
+
315
+ if ($args[0]==E_ERROR or $args[0]==E_CORE_ERROR or $args[0]==E_COMPILE_ERROR) {//Die on fatal php errors.
316
+ die();
317
+ }
318
+
319
+ //true for no more php error hadling.
320
+ return true;
321
+ }
322
+
323
+ //job end function
324
+ function job_end() {
325
+ global $mysqlconlink;
326
+ $_SESSION['WORKING']['STEPTODO']=1;
327
+ $_SESSION['WORKING']['STEPDONE']=0;
328
+ //delete old logs
329
+ if (!empty($_SESSION['CFG']['maxlogs'])) {
330
+ if ( $dir = opendir($_SESSION['CFG']['dirlogs']) ) { //make file list
331
+ while (($file = readdir($dir)) !== false ) {
332
+ if ('backwpup_log_' == substr($file,0,strlen('backwpup_log_')) and (".html" == substr($file,-5) or ".html.gz" == substr($file,-8)))
333
+ $logfilelist[]=$file;
334
+ }
335
+ closedir( $dir );
336
+ }
337
+ if (sizeof($logfilelist)>0) {
338
+ rsort($logfilelist);
339
+ $numdeltefiles=0;
340
+ for ($i=$_SESSION['CFG']['maxlogs'];$i<sizeof($logfilelist);$i++) {
341
+ unlink($_SESSION['CFG']['dirlogs'].$logfilelist[$i]);
342
+ $numdeltefiles++;
343
+ }
344
+ if ($numdeltefiles>0)
345
+ trigger_error($numdeltefiles.__(' old Log files deleted!!!','backwpup'),E_USER_NOTICE);
346
+ }
347
+ }
348
+ //Display job working time
349
+ trigger_error(sprintf(__('Job done in %1s sec.','backwpup'),time()-$_SESSION['JOB']['starttime']),E_USER_NOTICE);
350
+
351
+ if (!is_file($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']) or !($filesize=filesize($_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile']))) //Set the filezie corectly
352
+ $filesize=0;
353
+
354
+ //clean up temp
355
+ if ($dir = opendir($_SESSION['STATIC']['TEMPDIR'])) {
356
+ while (($file = readdir($dir)) !== false) {
357
+ if (is_readable($_SESSION['STATIC']['TEMPDIR'].$file) and is_file($_SESSION['STATIC']['TEMPDIR'].$file)) {
358
+ if ($file!='.' and $file!='..' and $file!='.running') {
359
+ unlink($_SESSION['STATIC']['TEMPDIR'].$file);
360
+ }
361
+ }
362
+ }
363
+ closedir($dir);
364
+ }
365
+
366
+ $jobs=get_option('backwpup_jobs');
367
+ $jobs[$_SESSION['JOB']['jobid']]['lastrun']=$jobs[$_SESSION['JOB']['jobid']]['starttime']+$_SESSION['WP']['TIMEDIFF'];
368
+ $_SESSION['JOB']['lastrun']=$jobs[$_SESSION['JOB']['jobid']]['lastrun'];
369
+ $jobs[$_SESSION['JOB']['jobid']]['lastruntime']=time()-$_SESSION['JOB']['starttime'];
370
+ $_SESSION['JOB']['lastruntime']=$jobs[$_SESSION['JOB']['jobid']]['lastruntime'];
371
+ $jobs[$_SESSION['JOB']['jobid']]['starttime']='';
372
+ if (!empty($_SESSION['JOB']['lastbackupdownloadurl']))
373
+ $jobs[$_SESSION['JOB']['jobid']]['lastbackupdownloadurl']=$_SESSION['JOB']['lastbackupdownloadurl'];
374
+ else
375
+ $jobs[$_SESSION['JOB']['jobid']]['lastbackupdownloadurl']='';
376
+ update_option('backwpup_jobs',$jobs); //Save Settings
377
+
378
+ //write heder info
379
+ $fd=fopen($_SESSION['STATIC']['LOGFILE'],'r+');
380
+ $found=0;
381
+ while (!feof($fd)) {
382
+ $line=fgets($fd);
383
+ if (stripos($line,"<meta name=\"backwpup_jobruntime\"") !== false) {
384
+ fseek($fd,$filepos);
385
+ fwrite($fd,str_pad("<meta name=\"backwpup_jobruntime\" content=\"".$_SESSION['JOB']['lastruntime']."\" />",100)."\n");
386
+ $found++;
387
+ }
388
+ if (stripos($line,"<meta name=\"backwpup_backupfilesize\"") !== false) {
389
+ fseek($fd,$filepos);
390
+ fwrite($fd,str_pad("<meta name=\"backwpup_backupfilesize\" content=\"".$filesize."\" />",100)."\n");
391
+ $found++;
392
+ }
393
+ if ($found>=2)
394
+ break;
395
+ $filepos=ftell($fd);
396
+ }
397
+ fclose($fd);
398
+ //Restore error handler
399
+ restore_error_handler();
400
+ //logfile end
401
+ file_put_contents($_SESSION['STATIC']['LOGFILE'], "</body>\n</html>\n", FILE_APPEND);
402
+ //gzip logfile
403
+ if ($_SESSION['CFG']['gzlogs']) {
404
+ $fd=fopen($_SESSION['STATIC']['LOGFILE'],'r');
405
+ $zd=gzopen($_SESSION['STATIC']['LOGFILE'].'.gz','w9');
406
+ while (!feof($fd)) {
407
+ gzwrite($zd,fread($fd,4096));
408
+ }
409
+ gzclose($zd);
410
+ fclose($fd);
411
+ unlink($_SESSION['STATIC']['LOGFILE']);
412
+ $_SESSION['STATIC']['LOGFILE']=$_SESSION['STATIC']['LOGFILE'].'.gz';
413
+
414
+ $jobs=get_option('backwpup_jobs');
415
+ $jobs[$_SESSION['JOB']['jobid']]['logfile']=$_SESSION['STATIC']['LOGFILE'];
416
+ update_option('backwpup_jobs',$jobs); //Save Settings
417
+ }
418
+
419
+ //Send mail with log
420
+ $sendmail=false;
421
+ if ($_SESSION['WORKING']['ERROR']>0 and $_SESSION['JOB']['mailerroronly'] and !empty($_SESSION['JOB']['mailaddresslog']))
422
+ $sendmail=true;
423
+ if (!$_SESSION['JOB']['mailerroronly'] and !empty($_SESSION['JOB']['mailaddresslog']))
424
+ $sendmail=true;
425
+ if ($sendmail) {
426
+ //Create PHP Mailer
427
+ require_once($_SESSION['WP']['ABSPATH'].$_SESSION['WP']['WPINC'].'/class-phpmailer.php');
428
+ $phpmailer = new PHPMailer();
429
+ //Setting den methode
430
+ if ($_SESSION['CFG']['mailmethod']=="SMTP") {
431
+ require_once($_SESSION['WP']['ABSPATH'].$_SESSION['WP']['WPINC'].'/class-smtp.php');
432
+ $phpmailer->Host=$_SESSION['CFG']['mailhost'];
433
+ $phpmailer->Port=$_SESSION['CFG']['mailhostport'];
434
+ $phpmailer->SMTPSecure=$_SESSION['CFG']['mailsecure'];
435
+ $phpmailer->Username=$_SESSION['CFG']['mailuser'];
436
+ $phpmailer->Password=base64_decode($_SESSION['CFG']['mailpass']);
437
+ if (!empty($_SESSION['CFG']['mailuser']) and !empty($_SESSION['CFG']['mailpass']))
438
+ $phpmailer->SMTPAuth=true;
439
+ $phpmailer->IsSMTP();
440
+ } elseif ($_SESSION['CFG']['mailmethod']=="Sendmail") {
441
+ $phpmailer->Sendmail=$_SESSION['CFG']['mailsendmail'];
442
+ $phpmailer->IsSendmail();
443
+ } else {
444
+ $phpmailer->IsMail();
445
+ }
446
+
447
+ $mailbody=__("Jobname:","backwpup")." ".$_SESSION['JOB']['name']."\n";
448
+ $mailbody.=__("Jobtype:","backwpup")." ".$_SESSION['JOB']['type']."\n";
449
+ if (!empty($_SESSION['WORKING']['ERROR']))
450
+ $mailbody.=__("Errors:","backwpup")." ".$_SESSION['WORKING']['ERROR']."\n";
451
+ if (!empty($_SESSION['WORKING']['WARNINGS']))
452
+ $mailbody.=__("Warnings:","backwpup")." ".$_SESSION['WORKING']['WARNINGS']."\n";
453
+
454
+ $phpmailer->From = $_SESSION['CFG']['mailsndemail'];
455
+ $phpmailer->FromName = $_SESSION['CFG']['mailsndname'];
456
+ $phpmailer->AddAddress($_SESSION['JOB']['mailaddresslog']);
457
+ $phpmailer->Subject = __('BackWPup Log from','backwpup').' '.date('Y-m-d H:i',$_SESSION['JOB']['starttime']).': '.$_SESSION['JOB']['name'];
458
+ $phpmailer->IsHTML(false);
459
+ $phpmailer->Body = $mailbody;
460
+ $phpmailer->AddAttachment($_SESSION['STATIC']['LOGFILE']);
461
+ $phpmailer->Send();
462
+ }
463
+
464
+ $_SESSION['WORKING']['STEPDONE']=1;
465
+ $_SESSION['WORKING']['STEPSDONE'][]='JOB_END'; //set done
466
+ if (is_file($_SESSION['STATIC']['TEMPDIR'].'/.running')) {
467
+ update_working_file();
468
+ unlink($_SESSION['STATIC']['TEMPDIR'].'/.running');
469
+ }
470
+ //Destroy session
471
+ $_SESSION = array();
472
+ session_destroy();
473
+ mysql_close($mysqlconlink);
474
+ die();
475
+ }
476
+
477
+ // execute on script job shutdown
478
+ function job_shutdown() {
479
+ if (empty($_SESSION['STATIC']['LOGFILE'])) //nothing on empy session
480
+ return;
481
+ $_SESSION['WORKING']['RESTART']++;
482
+ if ($_SESSION['WORKING']['RESTART']>=$_SESSION['CFG']['jobscriptretry'] and file_exists($_SESSION['STATIC']['TEMPDIR'].'/.running')) { //only x restarts allowed
483
+ file_put_contents($_SESSION['STATIC']['LOGFILE'], "<span class=\"timestamp\" title=\"[Line: ".__LINE__."|File: ".basename(__FILE__)."\">".date('Y-m-d H:i.s').":</span> <span class=\"error\">[ERROR]".__('To many restarts....','backwpup')."</span><br />\n", FILE_APPEND);
484
+ $_SESSION['WORKING']['ERROR']++;
485
+ $fd=fopen($_SESSION['STATIC']['LOGFILE'],'r+');
486
+ while (!feof($fd)) {
487
+ $line=fgets($fd);
488
+ if (stripos($line,"<meta name=\"backwpup_errors\"") !== false) {
489
+ fseek($fd,$filepos);
490
+ fwrite($fd,str_pad("<meta name=\"backwpup_errors\" content=\"".$_SESSION['WORKING']['ERROR']."\" />",100)."\n");
491
+ break;
492
+ }
493
+ $filepos=ftell($fd);
494
+ }
495
+ fclose($fd);
496
+ job_end();
497
+ }
498
+ //Put last error to log if one
499
+ $lasterror=error_get_last();
500
+ if ($lasterror['type']==E_ERROR or $lasterror['type']==E_PARSE or $lasterror['type']==E_CORE_ERROR or $lasterror['type']==E_COMPILE_ERROR) {
501
+ file_put_contents($_SESSION['STATIC']['LOGFILE'], "<span class=\"timestamp\" title=\"[Line: ".$lasterror['line']."|File: ".basename($lasterror['file'])."\">".date('Y-m-d H:i.s').":</span> <span class=\"error\">[ERROR]".$lasterror['message']."</span><br />\n", FILE_APPEND);
502
+ //write new log header
503
+ $_SESSION['WORKING']['ERROR']++;
504
+ $fd=fopen($_SESSION['STATIC']['LOGFILE'],'r+');
505
+ while (!feof($fd)) {
506
+ $line=fgets($fd);
507
+ if (stripos($line,"<meta name=\"backwpup_errors\"") !== false) {
508
+ fseek($fd,$filepos);
509
+ fwrite($fd,str_pad("<meta name=\"backwpup_errors\" content=\"".$_SESSION['WORKING']['ERROR']."\" />",100)."\n");
510
+ break;
511
+ }
512
+ $filepos=ftell($fd);
513
+ }
514
+ fclose($fd);
515
+ }
516
+ //Close session
517
+ session_write_close();
518
+ //Excute jobrun again
519
+ if (!file_exists($_SESSION['STATIC']['TEMPDIR'].'/.running'))
520
+ return;
521
+ file_put_contents($_SESSION['STATIC']['LOGFILE'], "<span class=\"timestamp\" title=\"[Line: ".__LINE__."|File: ".basename(__FILE__)."|Mem: ".formatbytes(@memory_get_usage(true))."|Mem Max: ".formatbytes(@memory_get_peak_usage(true))."|Mem Limit: ".ini_get('memory_limit')."]\">".date('Y-m-d H:i.s').":</span> <span>".$_SESSION['WORKING']['RESTART'].'. '.__('Script stop! Will started again now!','backwpup')."</span><br />\n", FILE_APPEND);
522
+ $ch=curl_init();
523
+ curl_setopt($ch,CURLOPT_URL,$_SESSION['STATIC']['JOBRUNURL']);
524
+ curl_setopt($ch,CURLOPT_RETURNTRANSFER,false);
525
+ curl_setopt($ch,CURLOPT_FORBID_REUSE,true);
526
+ curl_setopt($ch,CURLOPT_FRESH_CONNECT,true);
527
+ curl_setopt($ch,CURLOPT_TIMEOUT,0.01);
528
+ curl_exec($ch);
529
+ curl_close($ch);
530
+ }
531
+ ?>
job/job_run.php ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ //Set a constance for not direkt loding in other files
3
+ define('BACKWPUP_JOBRUN_FOLDER', dirname(__FILE__).'/');
4
+ // get needed functions for the jobrun
5
+ require_once(BACKWPUP_JOBRUN_FOLDER.'job_functions.php');
6
+ // set the cache limiter to 'nocache'
7
+ session_cache_limiter('nocache');
8
+ // set the cache expire to 30 minutes
9
+ session_cache_expire(30);
10
+ // give the session a name
11
+ session_name('BackWPupSession');
12
+ //check and set session id must bevor session_start
13
+ //read runningfile with SID
14
+ if ($runningfile=get_working_file()) {
15
+ session_id($runningfile['SID']);//Set session id
16
+ } else {
17
+ die();
18
+ }
19
+ //delete session cookie
20
+ session_set_cookie_params(0);
21
+ // start session
22
+ session_start();
23
+ // Conection termination
24
+ ob_end_clean();
25
+ header("Connection: close");
26
+ ob_start();
27
+ header("Content-Length: 0");
28
+ ob_end_flush();
29
+ flush();
30
+ //check existing session and Logfile
31
+ if (!empty($_SESSION) and !file_exists($_SESSION['STATIC']['LOGFILE'])) {
32
+ delete_working_file();
33
+ die();
34
+ }
35
+ //disable safe mode
36
+ @ini_set('safe_mode','0');
37
+ //set execution time tom max on safe mode
38
+ if (ini_get('safe_mode')) {
39
+ $_SESSION['CFG']['jobscriptruntime']=ini_get('max_execution_time');
40
+ $_SESSION['CFG']['jobscriptruntimelong']=ini_get('max_execution_time');
41
+ }
42
+ if (empty($_SESSION['CFG']['jobscriptruntime']) or !is_int($_SESSION['CFG']['jobscriptruntime']))
43
+ $_SESSION['CFG']['jobscriptruntime']=ini_get('max_execution_time');
44
+ if (empty($_SESSION['CFG']['jobscriptruntimelong']) or !is_int($_SESSION['CFG']['jobscriptruntimelong']))
45
+ $_SESSION['CFG']['jobscriptruntimelong']=300;
46
+ // Now user abrot allowed
47
+ @ini_set('ignore_user_abort','0');
48
+ //disable user abort
49
+ ignore_user_abort(true);
50
+ // execute function on job shutdown
51
+ register_shutdown_function('job_shutdown');
52
+ //set function for PHP user defineid error handling
53
+ if ($_SESSION['WP']['WP_DEBUG'])
54
+ set_error_handler('joberrorhandler',E_ALL | E_STRICT);
55
+ else
56
+ set_error_handler('joberrorhandler',E_ALL & ~E_NOTICE);
57
+ //check max script execution tme
58
+ if (ini_get('safe_mode') or strtolower(ini_get('safe_mode'))=='on' or ini_get('safe_mode')=='1')
59
+ trigger_error(sprintf(__('PHP Safe Mode is on!!! Max exec time is %1$d sec.','backwpup'),ini_get('max_execution_time')),E_USER_NOTICE);
60
+
61
+ //update running file
62
+ update_working_file();
63
+
64
+ //Load needed files
65
+ foreach($_SESSION['WORKING']['STEPS'] as $step) {
66
+ $stepfile=strtolower($step).'.php';
67
+ if ($step!='JOB_END') {
68
+ if (is_file(BACKWPUP_JOBRUN_FOLDER.$stepfile)) {
69
+ require_once(BACKWPUP_JOBRUN_FOLDER.$stepfile);
70
+ } else {
71
+ trigger_error(__('Can not find job step file:','backwpup').' '.$stepfile,E_USER_ERROR);
72
+ }
73
+ }
74
+ }
75
+
76
+ // Working step by step
77
+ foreach($_SESSION['WORKING']['STEPS'] as $step) {
78
+ //display some info massages bevor fist step
79
+ if (count($_SESSION['WORKING']['STEPSDONE'])==0) {
80
+ trigger_error('[INFO]: BackWPup version '.$_SESSION['BACKWPUP']['VERSION'].', Copyright &copy; '.date('Y').' <a href="http://danielhuesken.de" target="_blank">Daniel H&uuml;sken</a>',E_USER_NOTICE);
81
+ trigger_error(__('[INFO]: BackWPup comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions.','backwpup'),E_USER_NOTICE);
82
+ trigger_error(__('[INFO]: BackWPup job:','backwpup').' '.$_SESSION['JOB']['jobid'].'. '.$_SESSION['JOB']['name'].'; '.$_SESSION['JOB']['type'],E_USER_NOTICE);
83
+ if ($_SESSION['JOB']['activated'])
84
+ trigger_error(__('[INFO]: BackWPup cron:','backwpup').' '.$_SESSION['JOB']['cron'].'; '.date('D, j M Y H:i',$_SESSION['JOB']['cronnextrun']),E_USER_NOTICE);
85
+ trigger_error(__('[INFO]: PHP ver.:','backwpup').' '.phpversion().'; '.php_sapi_name().'; '.PHP_OS,E_USER_NOTICE);
86
+ trigger_error(__('[INFO]: MySQL ver.:','backwpup').' '.mysql_result(mysql_query("SELECT VERSION() AS version"),0),E_USER_NOTICE);
87
+ $curlversion=curl_version();
88
+ trigger_error(__('[INFO]: curl ver.:','backwpup').' '.$curlversion['version'].'; '.$curlversion['ssl_version'],E_USER_NOTICE);
89
+ trigger_error(__('[INFO]: Temp folder is:','backwpup').' '.$_SESSION['STATIC']['TEMPDIR'],E_USER_NOTICE);
90
+ if(!empty($_SESSION['STATIC']['backupfile']))
91
+ trigger_error(__('[INFO]: Backup file is:','backwpup').' '.$_SESSION['JOB']['backupdir'].$_SESSION['STATIC']['backupfile'],E_USER_NOTICE);
92
+ }
93
+ //update running file
94
+ update_working_file();
95
+ //Set next step
96
+ if (!isset($_SESSION['WORKING'][$step]['STEP_TRY']) or empty($_SESSION['WORKING'][$step]['STEP_TRY'])) {
97
+ $_SESSION['WORKING'][$step]['STEP_TRY']=0;
98
+ $_SESSION['WORKING']['STEPDONE']=0;
99
+ $_SESSION['WORKING']['STEPTODO']=0;
100
+ }
101
+ //Run next step
102
+ if (!in_array($step,$_SESSION['WORKING']['STEPSDONE'])) {
103
+ if (function_exists(strtolower($step))) {
104
+ while ($_SESSION['WORKING'][$step]['STEP_TRY']<$_SESSION['CFG']['jobstepretry']) {
105
+ if (in_array($step,$_SESSION['WORKING']['STEPSDONE']))
106
+ break;
107
+ $_SESSION['WORKING'][$step]['STEP_TRY']++;
108
+ $func=call_user_func(strtolower($step));
109
+ }
110
+ if ($_SESSION['WORKING'][$step]['STEP_TRY']>=$_SESSION['CFG']['jobstepretry'])
111
+ trigger_error(__('Step arborted has too many trys!!!','backwpup'),E_USER_ERROR);
112
+ } else {
113
+ trigger_error(__('Can not find job step function:','backwpup').' '.strtolower($step),E_USER_ERROR);
114
+ $_SESSION['WORKING']['STEPSDONE'][]=$step;
115
+ }
116
+ }
117
+ }
118
+
119
+ //close mysql
120
+ mysql_close($mysqlconlink);
121
+ ?>
job/job_start.php ADDED
@@ -0,0 +1,281 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ // don't load directly
3
+ if (!defined('ABSPATH')) {
4
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
5
+ header("Status: 404 Not Found");
6
+ die();
7
+ }
8
+
9
+ function backwpup_jobstart($jobid='') {
10
+ global $wpdb;
11
+ $jobid=(int)trim($jobid);
12
+ if (empty($jobid) or !is_integer($jobid)) {
13
+ return false;
14
+ }
15
+ //check if a job running
16
+ if ($infile=backwpup_get_working_file()) {
17
+ if ($infile['timestamp']<time()-1800) {
18
+ _e("A job already running!","backwpup");
19
+ return false;
20
+ } else { //delete working file job thing it not works longer.
21
+ unlink(backwpup_get_working_dir().'/.running');
22
+ sleep(3);
23
+ }
24
+ }
25
+ // set the cache limiter to 'nocache'
26
+ session_cache_limiter('nocache');
27
+ // set the cache expire to 30 minutes
28
+ session_cache_expire(30);
29
+ // give the session a name
30
+ session_name('BackWPupSession');
31
+ //delete session cookie
32
+ session_set_cookie_params(0);
33
+ // start session
34
+ session_start();
35
+ //clean session
36
+ $_SESSION = array();
37
+ //Set needed WP vars to Session
38
+ $_SESSION['WP']['DB_NAME']=DB_NAME;
39
+ $_SESSION['WP']['DB_USER']=DB_USER;
40
+ $_SESSION['WP']['DB_PASSWORD']=DB_PASSWORD;
41
+ $_SESSION['WP']['DB_HOST']=DB_HOST;
42
+ $_SESSION['WP']['DB_CHARSET']=DB_CHARSET;
43
+ $_SESSION['WP']['DB_COLLATE']=DB_COLLATE;
44
+ $_SESSION['WP']['OPTIONS_TABLE']=$wpdb->options;
45
+ $_SESSION['WP']['TABLE_PREFIX']=$wpdb->prefix;
46
+ $_SESSION['WP']['WP_DEBUG']=WP_DEBUG;
47
+ $_SESSION['WP']['BLOGNAME']=get_bloginfo('name');
48
+ if (defined('WP_SITEURL'))
49
+ $_SESSION['WP']['SITEURL']=trailingslashit(WP_SITEURL);
50
+ else
51
+ $_SESSION['WP']['SITEURL']=trailingslashit(get_option('siteurl'));
52
+ $_SESSION['WP']['TIMEDIFF']=current_time('timestamp')-time();
53
+ $_SESSION['WP']['WPLANG']=WPLANG;
54
+ //WP folder
55
+ $_SESSION['WP']['ABSPATH']=rtrim(str_replace('\\','/',ABSPATH),'/').'/';
56
+ $_SESSION['WP']['WP_CONTENT_DIR']=rtrim(str_replace('\\','/',WP_CONTENT_DIR),'/').'/';
57
+ $_SESSION['WP']['WP_PLUGIN_DIR']=rtrim(str_replace('\\','/',WP_PLUGIN_DIR),'/').'/';
58
+ $_SESSION['WP']['WP_THEMES_DIR']=rtrim(str_replace('\\','/',trailingslashit(WP_CONTENT_DIR).'themes/'),'/').'/';
59
+ $_SESSION['WP']['WP_UPLOAD_DIR']=rtrim(str_replace('\\','/',backwpup_get_upload_dir()),'/').'/';
60
+ $_SESSION['WP']['WPINC']=WPINC;
61
+ $_SESSION['WP']['MULTISITE']=is_multisite();
62
+ $_SESSION['WP']['ADMINURL']=admin_url('admin.php');
63
+ //Load Translation
64
+ if (!empty($_SESSION['WP']['WPLANG']) and is_file(dirname(__FILE__).'/../lang/backwpup-'.$_SESSION['WP']['WPLANG'].'.po')) {
65
+ $file = fopen (dirname(__FILE__).'/../lang/backwpup-'.$_SESSION['WP']['WPLANG'].'.po', "r");
66
+ while (!feof($file)){
67
+ $line = trim(fgets($file));
68
+ if (substr($line,0,7)=='msgid "') {
69
+ $msgid=md5(substr($line,7,-1));
70
+ $msgstr=substr(trim(fgets($file)),8,-1);
71
+ $_SESSION['TRANSLATE'][$msgid]=$msgstr;
72
+ }
73
+ }
74
+ fclose($file);
75
+ }
76
+ //Set plugin data
77
+ $_SESSION['BACKWPUP']['PLUGIN_BASEDIR']=BACKWPUP_PLUGIN_BASEDIR;
78
+ $_SESSION['BACKWPUP']['VERSION']=BACKWPUP_VERSION;
79
+ $_SESSION['BACKWPUP']['BACKWPUP_DESTS']=BACKWPUP_DESTS;
80
+ $_SESSION['BACKWPUP']['DROPBOX_APP_KEY']=BACKWPUP_DROPBOX_APP_KEY;
81
+ $_SESSION['BACKWPUP']['DROPBOX_APP_SECRET']=BACKWPUP_DROPBOX_APP_SECRET;
82
+ $_SESSION['BACKWPUP']['SUGARSYNC_ACCESSKEY']=BACKWPUP_SUGARSYNC_ACCESSKEY;
83
+ $_SESSION['BACKWPUP']['SUGARSYNC_PRIVATEACCESSKEY']=BACKWPUP_SUGARSYNC_PRIVATEACCESSKEY;
84
+ //Set config data
85
+ $_SESSION['CFG']=get_option('backwpup');
86
+ //Set job data
87
+ $_SESSION['JOB']=backwpup_get_job_vars($jobid);
88
+ //STATIC data
89
+ $_SESSION['STATIC']['JOBRUNURL']=BACKWPUP_PLUGIN_BASEURL.'/job/job_run.php';
90
+ //get and create temp dir
91
+ $tempdir=getenv('TMP');
92
+ if (!$tempdir)
93
+ $tempdir=getenv('TEMP');
94
+ if (!$tempdir or !is_writable($tempdir) or !is_dir($tempdir))
95
+ $tempdir=getenv('TMPDIR');
96
+ if (!$tempdir or !is_writable($tempdir) or !is_dir($tempdir))
97
+ $tempdir=ini_get('upload_tmp_dir');
98
+ if (!$tempdir or empty($tempdir) or !is_writable($tempdir) or !is_dir($tempdir))
99
+ $tempdir=sys_get_temp_dir();
100
+ if (is_readable(dirname(__FILE__).'/../../.backwpuptempfolder'))
101
+ $tempdir=trim(file_get_contents(dirname(__FILE__).'/../../.backwpuptempfolder',false,NULL,0,255));
102
+ $tempdir=str_replace('\\','/',realpath(rtrim($tempdir,'/'))).'/';
103
+ $_SESSION['STATIC']['TEMPDIR']=$tempdir.'backwpup_'.substr(md5(str_replace('\\','/',realpath(rtrim(basename(__FILE__),'/\\').'/'))),8,16).'/';
104
+ if (!is_dir($_SESSION['STATIC']['TEMPDIR'])) {
105
+ if (!mkdir($_SESSION['STATIC']['TEMPDIR'],0755,true)) {
106
+ sprintf(__('Can not create temp folder: %1$s','backwpup'),$_SESSION['STATIC']['TEMPDIR']);
107
+ return false;
108
+ }
109
+ }
110
+ if (!is_writable($_SESSION['STATIC']['TEMPDIR'])) {
111
+ _e("Temp dir not writeable","backwpup");
112
+ session_destroy();
113
+ return false;
114
+ } else { //clean up old temp files
115
+ if ($dir = opendir($_SESSION['STATIC']['TEMPDIR'])) {
116
+ while (($file = readdir($dir)) !== false) {
117
+ if (is_readable($_SESSION['STATIC']['TEMPDIR'].$file) and is_file($_SESSION['STATIC']['TEMPDIR'].$file)) {
118
+ if ($file!='.' and $file!='..') {
119
+ unlink($_SESSION['STATIC']['TEMPDIR'].$file);
120
+ }
121
+ }
122
+ }
123
+ closedir($dir);
124
+ }
125
+ //create .htaccess for apache and index.html for other
126
+ if (strtolower(substr($_SERVER["SERVER_SOFTWARE"],0,6))=="apache") { //check if it a apache webserver
127
+ if (!is_file($_SESSION['STATIC']['TEMPDIR'].'.htaccess'))
128
+ file_put_contents($_SESSION['STATIC']['TEMPDIR'].'.htaccess',"Order allow,deny\ndeny from all");
129
+ } else {
130
+ if (!is_file($_SESSION['STATIC']['TEMPDIR'].'index.html'))
131
+ file_put_contents($_SESSION['STATIC']['TEMPDIR'].'index.html',"\n");
132
+ if (!is_file($_SESSION['STATIC']['TEMPDIR'].'index.php'))
133
+ file_put_contents($_SESSION['STATIC']['TEMPDIR'].'index.php',"\n");
134
+ }
135
+ }
136
+ $_SESSION['CFG']['dirlogs']=rtrim(str_replace('\\','/',$_SESSION['CFG']['dirlogs']),'/').'/';
137
+ if (!is_dir($_SESSION['CFG']['dirlogs'])) {
138
+ if (!mkdir($_SESSION['CFG']['dirlogs'],0755,true)) {
139
+ sprintf(__('Can not create folder for log files: %1$s','backwpup'),$_SESSION['CFG']['dirlogs']);
140
+ return false;
141
+ }
142
+ //create .htaccess for apache and index.html for other
143
+ if (strtolower(substr($_SERVER["SERVER_SOFTWARE"],0,6))=="apache") { //check if it a apache webserver
144
+ if (!is_file($_SESSION['CFG']['dirlogs'].'.htaccess'))
145
+ file_put_contents($_SESSION['CFG']['dirlogs'].'.htaccess',"Order allow,deny\ndeny from all");
146
+ } else {
147
+ if (!is_file($_SESSION['CFG']['dirlogs'].'index.html'))
148
+ file_put_contents($_SESSION['CFG']['dirlogs'].'index.html',"\n");
149
+ if (!is_file($_SESSION['CFG']['dirlogs'].'index.php'))
150
+ file_put_contents($_SESSION['CFG']['dirlogs'].'index.php',"\n");
151
+ }
152
+ }
153
+ if (!is_writable($_SESSION['CFG']['dirlogs'])) {
154
+ _e("Log folder not writeable!","backwpup");
155
+ session_destroy();
156
+ return false;
157
+ }
158
+ //check exists gzip functions
159
+ if(!function_exists('gzopen'))
160
+ $_SESSION['CFG']['gzlogs']=false;
161
+ //set Logfile
162
+ $_SESSION['STATIC']['LOGFILE']=$_SESSION['CFG']['dirlogs'].'backwpup_log_'.date_i18n('Y-m-d_H-i-s').'.html';
163
+ //create log file
164
+ $fd=fopen($_SESSION['STATIC']['LOGFILE'],'w');
165
+ //Create log file header
166
+ fwrite($fd,"<html>\n<head>\n");
167
+ fwrite($fd,"<meta name=\"backwpup_version\" content=\"".BACKWPUP_VERSION."\" />\n");
168
+ fwrite($fd,"<meta name=\"backwpup_logtime\" content=\"".current_time('timestamp')."\" />\n");
169
+ fwrite($fd,str_pad("<meta name=\"backwpup_errors\" content=\"0\" />",100)."\n");
170
+ fwrite($fd,str_pad("<meta name=\"backwpup_warnings\" content=\"0\" />",100)."\n");
171
+ fwrite($fd,"<meta name=\"backwpup_jobid\" content=\"".$_SESSION['JOB']['jobid']."\" />\n");
172
+ fwrite($fd,"<meta name=\"backwpup_jobname\" content=\"".$_SESSION['JOB']['name']."\" />\n");
173
+ fwrite($fd,"<meta name=\"backwpup_jobtype\" content=\"".$_SESSION['JOB']['type']."\" />\n");
174
+ fwrite($fd,str_pad("<meta name=\"backwpup_backupfilesize\" content=\"0\" />",100)."\n");
175
+ fwrite($fd,str_pad("<meta name=\"backwpup_jobruntime\" content=\"0\" />",100)."\n");
176
+ fwrite($fd,"<style type=\"text/css\">\n");
177
+ fwrite($fd,".timestamp {background-color:grey;}\n");
178
+ fwrite($fd,".warning {background-color:yellow;}\n");
179
+ fwrite($fd,".error {background-color:red;}\n");
180
+ fwrite($fd,"#body {font-family:monospace;font-size:12px;white-space:nowrap;}\n");
181
+ fwrite($fd,"</style>\n");
182
+ fwrite($fd,"<title>".sprintf(__('BackWPup Log for %1$s from %2$s at %3$s','backwpup'),$_SESSION['JOB']['name'],date_i18n(get_option('date_format')),date_i18n(get_option('time_format')))."</title>\n</head>\n<body id=\"body\">\n");
183
+ fclose($fd);
184
+ //write working file
185
+ file_put_contents($_SESSION['STATIC']['TEMPDIR'].'/.running',serialize(array('SID'=>session_id(),'timestamp'=>time(),'JOBID'=>$_SESSION['JOB']['jobid'],'LOG'=>'','LOGFILE'=>$_SESSION['STATIC']['LOGFILE'],'WARNING'=>0,'ERROR'=>0,'STEPSPERSENT'=>0,'STEPPERSENT'=>0)));
186
+ //Set job start settings
187
+ $jobs=get_option('backwpup_jobs');
188
+ $jobs[$_SESSION['JOB']['jobid']]['starttime']=time(); //set start time for job
189
+ $_SESSION['JOB']['starttime']=$jobs[$_SESSION['JOB']['jobid']]['starttime'];
190
+ $jobs[$_SESSION['JOB']['jobid']]['logfile']=$_SESSION['STATIC']['LOGFILE']; //Set current logfile
191
+ $jobs[$_SESSION['JOB']['jobid']]['cronnextrun']=backwpup_cron_next($jobs[$_SESSION['JOB']['jobid']]['cron']); //set next run
192
+ $_SESSION['JOB']['cronnextrun']=$jobs[$_SESSION['JOB']['jobid']]['cronnextrun'];
193
+ $jobs[$_SESSION['JOB']['jobid']]['lastbackupdownloadurl']='';
194
+ $_SESSION['JOB']['lastbackupdownloadurl']='';
195
+ update_option('backwpup_jobs',$jobs); //Save job Settings
196
+ //Set todo
197
+ $_SESSION['STATIC']['TODO']=explode('+',$_SESSION['JOB']['type']);
198
+ //only for jos that makes backups
199
+ if (in_array('FILE',$_SESSION['STATIC']['TODO']) or in_array('DB',$_SESSION['STATIC']['TODO']) or in_array('WPEXP',$_SESSION['STATIC']['TODO'])) {
200
+ //make emty file list
201
+ $_SESSION['WORKING']['FILELIST']=array();
202
+ $_SESSION['WORKING']['ALLFILESIZE']=0;
203
+ //set Backup Dir if not set
204
+ if (empty($_SESSION['JOB']['backupdir'])) {
205
+ $_SESSION['JOB']['backupdir']=$_SESSION['STATIC']['TEMPDIR'];
206
+ } else {
207
+ //clear path
208
+ $_SESSION['JOB']['backupdir']=rtrim(str_replace('\\','/',$_SESSION['JOB']['backupdir']),'/').'/';
209
+ //create backup dir if it not exists
210
+ if (!is_dir($_SESSION['JOB']['backupdir'])) {
211
+ if (!mkdir($_SESSION['JOB']['backupdir'],0755,true)) {
212
+ sprintf(__('Can not create folder for backup files: %1$s','backwpup'),$_SESSION['JOB']['backupdir']);
213
+ return false;
214
+ }
215
+ //create .htaccess for apache and index.html for other
216
+ if (strtolower(substr($_SERVER["SERVER_SOFTWARE"],0,6))=="apache") { //check if it a apache webserver
217
+ if (!is_file($_SESSION['JOB']['backupdir'].'.htaccess'))
218
+ file_put_contents($_SESSION['JOB']['backupdir'].'.htaccess',"Order allow,deny\ndeny from all");
219
+ } else {
220
+ if (!is_file($_SESSION['JOB']['backupdir'].'index.html'))
221
+ file_put_contents($_SESSION['JOB']['backupdir'].'index.html',"\n");
222
+ if (!is_file($_SESSION['JOB']['backupdir'].'index.php'))
223
+ file_put_contents($_SESSION['JOB']['backupdir'].'index.php',"\n");
224
+ }
225
+ }
226
+ }
227
+ //check backup dir
228
+ if (!is_writable($_SESSION['JOB']['backupdir'])) {
229
+ _e("Backup folder not writeable!","backwpup");
230
+ session_destroy();
231
+ return false;
232
+ }
233
+ //set Backup file Name
234
+ $_SESSION['STATIC']['backupfile']=$_SESSION['JOB']['fileprefix'].date_i18n('Y-m-d_H-i-s').$_SESSION['JOB']['fileformart'];
235
+ }
236
+ //set ERROR and WARNINGS counter
237
+ $_SESSION['WORKING']['WARNING']=0;
238
+ $_SESSION['WORKING']['ERROR']=0;
239
+ $_SESSION['WORKING']['RESTART']=0;
240
+ $_SESSION['WORKING']['STEPSDONE']=array();
241
+ $_SESSION['WORKING']['STEPTODO']=0;
242
+ $_SESSION['WORKING']['STEPDONE']=0;
243
+ //build working steps
244
+ $_SESSION['WORKING']['STEPS']=array();
245
+ //setup job steps
246
+ if (in_array('DB',$_SESSION['STATIC']['TODO']))
247
+ $_SESSION['WORKING']['STEPS'][]='DB_DUMP';
248
+ if (in_array('WPEXP',$_SESSION['STATIC']['TODO']))
249
+ $_SESSION['WORKING']['STEPS'][]='WP_EXPORT';
250
+ if (in_array('FILE',$_SESSION['STATIC']['TODO']))
251
+ $_SESSION['WORKING']['STEPS'][]='FILE_LIST';
252
+ if (in_array('DB',$_SESSION['STATIC']['TODO']) or in_array('WPEXP',$_SESSION['STATIC']['TODO']) or in_array('FILE',$_SESSION['STATIC']['TODO'])) {
253
+ $_SESSION['WORKING']['STEPS'][]='BACKUP_CREATE';
254
+ //ADD Destinations
255
+ $_SESSION['WORKING']['STEPS'][]='DEST_MAIL';
256
+ $dests=explode(',',strtoupper(BACKWPUP_DESTS));
257
+ foreach($dests as $dest)
258
+ $_SESSION['WORKING']['STEPS'][]='DEST_'.strtoupper($dest);
259
+ }
260
+ if (in_array('CHECK',$_SESSION['STATIC']['TODO']))
261
+ $_SESSION['WORKING']['STEPS'][]='DB_CHECK';
262
+ if (in_array('OPTIMIZE',$_SESSION['STATIC']['TODO']))
263
+ $_SESSION['WORKING']['STEPS'][]='DB_OPTIMIZE';
264
+ $_SESSION['WORKING']['STEPS'][]='JOB_END';
265
+ //mark all as not done
266
+ foreach($_SESSION['WORKING']['STEPS'] as $step)
267
+ $_SESSION['WORKING'][$step]['DONE']=false;
268
+ //Close session
269
+ session_write_close();
270
+ //Run job
271
+ $ch=curl_init();
272
+ curl_setopt($ch,CURLOPT_URL,$_SESSION['STATIC']['JOBRUNURL']);
273
+ curl_setopt($ch,CURLOPT_RETURNTRANSFER,false);
274
+ curl_setopt($ch,CURLOPT_FORBID_REUSE,true);
275
+ curl_setopt($ch,CURLOPT_FRESH_CONNECT,true);
276
+ curl_setopt($ch,CURLOPT_TIMEOUT,0.01);
277
+ curl_exec($ch);
278
+ curl_close($ch);
279
+ return $_SESSION['STATIC']['LOGFILE'];
280
+ }
281
+ ?>
job/show_working.php ADDED
@@ -0,0 +1,117 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ function backwpup_read_logfile($logfile) {
3
+ if (is_file($logfile) and strtolower(substr($logfile,-3))=='.gz')
4
+ $logfiledata=gzfile($logfile);
5
+ elseif (is_file($logfile.'.gz'))
6
+ $logfiledata=gzfile($logfile.'.gz');
7
+ elseif (is_file($logfile))
8
+ $logfiledata=file($logfile);
9
+ else
10
+ return false;
11
+ $lines=array();
12
+ $start=false;
13
+ foreach ($logfiledata as $line){
14
+ $line=trim($line);
15
+ if (strripos($line,'<body')!== false) { // jop over header
16
+ $start=true;
17
+ continue;
18
+ }
19
+ if ($line!='</body>' and $line!='</html>' and $start) //no Footer
20
+ $lines[]=$line;
21
+ }
22
+ return $lines;
23
+ }
24
+
25
+ function backwpup_get_working_file() {
26
+ $tempdir=backwpup_get_working_dir();
27
+ if (is_file($tempdir.'.running')) {
28
+ if ($runningfile=file_get_contents($tempdir.'.running'))
29
+ return unserialize(trim($runningfile));
30
+ else
31
+ return false;
32
+ } else {
33
+ return false;
34
+ }
35
+ }
36
+
37
+ function backwpup_get_working_dir() {
38
+ $folder='backwpup_'.substr(md5(str_replace('\\','/',realpath(rtrim(basename(__FILE__),'/\\').'/'))),8,16).'/';
39
+ $tempdir=getenv('TMP');
40
+ if (!$tempdir)
41
+ $tempdir=getenv('TEMP');
42
+ if (!$tempdir or !is_writable($tempdir) or !is_dir($tempdir))
43
+ $tempdir=getenv('TMPDIR');
44
+ if (!$tempdir or !is_writable($tempdir) or !is_dir($tempdir))
45
+ $tempdir=ini_get('upload_tmp_dir');
46
+ if (!$tempdir or empty($tempdir) or !is_writable($tempdir) or !is_dir($tempdir))
47
+ $tempdir=sys_get_temp_dir();
48
+ if (is_readable(dirname(__FILE__).'/../../.backwpuptempfolder'))
49
+ $tempdir=trim(file_get_contents(dirname(__FILE__).'/../../.backwpuptempfolder',false,NULL,0,255));
50
+ $tempdir=str_replace('\\','/',realpath(rtrim($tempdir,'/'))).'/';
51
+ if (is_dir($tempdir.$folder) and is_writable($tempdir.$folder)) {
52
+ return $tempdir.$folder;
53
+ } else {
54
+ return false;
55
+ }
56
+ }
57
+
58
+ //read log file header
59
+ function backwpup_read_logheader($logfile) {
60
+ $headers=array("backwpup_version" => "version","backwpup_logtime" => "logtime","backwpup_errors" => "errors","backwpup_warnings" => "warnings","backwpup_jobid" => "jobid","backwpup_jobname" => "name","backwpup_jobtype" => "type","backwpup_jobruntime" => "runtime","backwpup_backupfilesize" => "backupfilesize");
61
+ if (!is_readable($logfile))
62
+ return false;
63
+ //Read file
64
+ if (strtolower(substr($logfile,-3))==".gz") {
65
+ $fp = gzopen( $logfile, 'r' );
66
+ $file_data = gzread( $fp, 1536 ); // Pull only the first 1,5kiB of the file in.
67
+ gzclose( $fp );
68
+ } else {
69
+ $fp = fopen( $logfile, 'r' );
70
+ $file_data = fread( $fp, 1536 ); // Pull only the first 1,5kiB of the file in.
71
+ fclose( $fp );
72
+ }
73
+ //get data form file
74
+ foreach ($headers as $keyword => $field) {
75
+ preg_match('/(<meta name="'.$keyword.'" content="(.*)" \/>)/i',$file_data,$content);
76
+ if (!empty($content))
77
+ $joddata[$field]=$content[2];
78
+ else
79
+ $joddata[$field]='';
80
+ }
81
+ if (empty($joddata['logtime']))
82
+ $joddata['logtime']=filectime($logfile);
83
+ return $joddata;
84
+ }
85
+
86
+ if (is_file(trim($_POST['logfile']).'.gz'))
87
+ $_POST['logfile']=trim($_POST['logfile']).'.gz';
88
+
89
+ // check given file is a backwpup logfile
90
+ if (substr(trim($_POST['logfile']),-3)!='.gz' and substr(trim($_POST['logfile']),-8)!='.html.gz' and substr(trim($_POST['logfile']),0,13)!='backwpup_log_' and strlen(trim($_POST['logfile']))>40 and strlen(trim($_POST['logfile']))<37)
91
+ die();
92
+
93
+ $log='';
94
+ if (is_file(trim($_POST['logfile']))) {
95
+ if (is_file(backwpup_get_working_dir().'.running')) {
96
+ if ($infile=backwpup_get_working_file()) {
97
+ $warnings=$infile['WARNING'];
98
+ $errors=$infile['ERROR'];
99
+ $stepspersent=$infile['STEPSPERSENT'];
100
+ $steppersent=$infile['STEPPERSENT'];
101
+ }
102
+ } else {
103
+ $logheader=backwpup_read_logheader(trim($_POST['logfile']));
104
+ $warnings=$logheader['warnings'];
105
+ $errors=$logheader['errors'];
106
+ $stepspersent=100;
107
+ $steppersent=100;
108
+ $log.='<span id="stopworking"></span>';
109
+ }
110
+ $logfilarray=backwpup_read_logfile(trim($_POST['logfile']));
111
+ //for ($i=0;$i<count($logfilarray);$i++)
112
+ for ($i=$_POST['logpos'];$i<count($logfilarray);$i++)
113
+ $log.=$logfilarray[$i];
114
+ echo json_encode(array('logpos'=>count($logfilarray),'LOG'=>$log,'WARNING'=>$warnings,'ERROR'=>$errors,'STEPSPERSENT'=>$stepspersent,'STEPPERSENT'=>$steppersent));
115
+ }
116
+ die();
117
+ ?>
job/wp_export.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?PHP
2
+ if (!defined('BACKWPUP_JOBRUN_FOLDER')) {
3
+ header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
4
+ header("Status: 404 Not Found");
5
+ die();
6
+ }
7
+
8
+ function wp_export() {
9
+ $_SESSION['WORKING']['STEPTODO']=1;
10
+ trigger_error($_SESSION['WORKING']['WP_EXPORT']['STEP_TRY'].'. '.__('Try for wordpress export to XML file...','backwpup'),E_USER_NOTICE);
11
+ need_free_memory(1048576); //1MB free memory
12
+ if (function_exists('curl_exec')) {
13
+ $ch = curl_init();
14
+ curl_setopt($ch, CURLOPT_URL, substr($_SESSION['STATIC']['JOBRUNURL'],0,-11).'wp_export_generate.php');
15
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
16
+ curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
17
+ curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
18
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
19
+ $return=curl_exec($ch);
20
+ if (!$return) {
21
+ trigger_error(__('cURL:','backwpup').' '.curl_error($ch),E_USER_ERROR);
22
+ } else {
23
+ file_put_contents($_SESSION['STATIC']['TEMPDIR'].preg_replace( '/[^a-z0-9_\-]/', '', strtolower($_SESSION['WP']['BLOGNAME'])).'.wordpress.'.date( 'Y-m-d' ).'.xml', $return);
24
+ }
25
+ curl_close($ch);
26
+ }
27
+ //add XML file to backupfiles
28
+ if (is_readable($_SESSION['STATIC']['TEMPDIR'].preg_replace( '/[^a-z0-9_\-]/', '', strtolower($_SESSION['WP']['BLOGNAME'])).'.wordpress.'.date( 'Y-m-d' ).'.xml')) {
29
+ $filestat=stat($_SESSION['STATIC']['TEMPDIR'].preg_replace( '/[^a-z0-9_\-]/', '', strtolower($_SESSION['WP']['BLOGNAME'])).'.wordpress.'.date( 'Y-m-d' ).'.xml');
30
+ trigger_error(__('Add XML export to backup list:','backwpup').' '.preg_replace( '/[^a-z0-9_\-]/', '', strtolower($_SESSION['WP']['BLOGNAME'])).'.wordpress.'.date( 'Y-m-d' ).'.xml '.formatbytes(