Recently a customer asked me to debug some problems on their Joomla!/PHP site that had interoperability issues after some long time for unknown reasons. The site was using some commercial plugins which producer was long time gone and unreachable and worst of all they were all obfuscated. So even searching for some basic string that was displayed on the screen on error to understand what’s going on was not a straight forward exercise and going through the code was a mess.
Apart from changing the code in a logical way, for example by adding intermediate variables or splitting variable assignations into more operations and so on, the first most annoying part of PHP obfuscators is that they modify most of the characters in the strings values with their respective hexadecimal (format \xXX) or octal (\XXX) values and eliminate any line feeds or code structure. Once you get rid of this the code stays quite very messy but is, at least in the cases I analyzed, quite readable and just needs a little more bookkeeping with automatically named vars to go through.
Getting rid at least of this confusing representation is quite straightforward on the command line with a few tricks.
pyargocat is a small simple Python script that can be used to program the catalogs of the Argo Navis Digital Telescope Computer from a machine with a recent Python interpreter installed using the RS232 cable that you can either buy or easily construct yourself. pyargocat can manage, that is insert to the device, all three types of catalogs in the device (asteroids, comets and user defined objects), report the number of objects present, report available space and delete previously flashed catalogs. It can be used on any machine with a Python >= 2.7 installed and it has been tested on Linux and Windows machines.
The imported catalogs have to be in the standard format Argo Navis uses (please refeer to the Argo Navis manual for the details and for links to useful resources). As an example and as a possible useful addition for your advanced observing sessions you can download this sample file I created that I often use as a basis: fede-general.txt. (the file contains all the Abell planetaries, the complete ARP catalog of Peculiar galaxies, the Hickinson galaxy groups catalog, most of the PK Planetary Nebula catalog and a selection of particullar globular clusters such as the Palomars and Terzans). Also a comet database file is given as an example with the most interesting comet objects data at the time of writing: Comets.txt
coolc is a limited class use COOL (Classroom Object Oriented Language) compiler written in C using LEX and YACC. coolc will perform an almost complete static type-check on the given file and generate the intermediate code in a three-address language for a limited subset of the COOL constructs. The three-address code will then be interpreted by the built-in interpreter and the output displayed to the user.
coolc doesn’t fully support all the COOL language constructs. coolc main features are centered around the developing of the dispatch construct of COOL:
Therefore, briefly, coolc is able to handle:
- definition of classes without inheritance
- definition of attributes of various types in classes
- definition of methods in classes
- definition of dispatching methods in methods body without parameters and without a return value