Posts Tagged beta

GTA: SA Censor Remover Online AKA Conversion Hell

I often get requests for versions of my tools that will work on non-Windows operating systems, such as Linux and MacOSX.
Because I use delphi, which is primarily a Windows programming tool, this often isn’t practical or even possible.

A few months ago I set about thinking of ways I could provide the same tools and abilities to those who don’t run Windows or have restrictions set on what they can download. I eventually decided to recreate one of my more popular tools, GTA: SA Censor Remover, in an online edition.

This wasn’t as easy a task as I had first assumed, my PHP skills were a little rusty from years of neglect in favour of Windows application development and PHP is an inherently poor language for working with binary files. I could have deviated from my original intention and written the online version in Perl, but I’m not that much of a masochist and I’m much more familiar with PHP.
After a few hours I was able to knock up a basic version that worked fine with PS2 and PC saves, even with PHP’s poor file handling routines, but came against a huge stumbling block with the Xbox saves.

Xbox saves are protected by a digital signature, change even one byte and the signature is invalidated and the save will not load. Of course I know how to fix this signature but this is where PHP let me down immensly.

PHP is a loosely type language, this means it’s great for beginners but sometimes you need to be able to control the language and it’s variables precisely, which is exactly what I needed to do. For reference, Delphi is a strongly typed language and is much better for it in my opinion. I can also access raw memory directly with Delphi which makes creating digital signatures a breeze.

I spent hours trying different ways of representing the binary data I needed to fix the digital signature in the save, I trawled the PHP manual for hints and comments. I even asked an experienced PHP programmer who writes scripts for a living daily and he was unable to help me or offer anything I hadn’t tried already.
Eventually I gave up, I’d chosen the wrong tool for the job and had paid bitterly for it.

Last night I was intrigued to see that the makers of Delphi, Codegear, are planning a “Delphi for PHP” and this rekindled my interest in PHP. Looking for a project to start I remembered about the work I had done on GTA: SA Censor Remover Online and how I had left it to rot on my dev machine.
I decided that I couldn’t let this go to waste and was a perfect challenge to get my PHP skills back on track, after all if I couldn’t find the answer from the manual and experienced users of PHP than I’d have to find it myself.
Eventually after a few tests, all producing the wrong digital signature, I commented out all the existing code and returned to the basic task: Create a binary representation of a series of bytes and pipe this along with the raw file data to the required function.

It was a matter of minutes before I had a working function. I spent a few hours tweaking the code and making sure it worked properly, again having to fight PHP’s poor file handling tooth and nail, until the final product was ready for release.

It’s been a hellish struggle and at times I wondered if the task was even possible given the poor performance of PHP in this area and lack of information out there, even from PHP experts. I won’t be retro-fitting any of my other tools at this time but if the need arises, or another prgram is created that would bendfit from an online version, I’ve got a solid groundwork to enable access to my software to everyone, regardless of what operating system they use.

Tags: , , , , , ,

Adsense in Blogger Beta templates

The Inside AdSense team have just released an Activation Demo showing you how to add AdSense code to your Blogger/Blogspot template however they insist you revert to a classic template to do this.

This isn’t practical or desirable for some, including myself, so I’ll show you how to do it in the new and funky Beta templates, as seen on this very blog.

Although the beta tools allow you to add a block of AdSense Ads to the template in a nice web 2.0 style, you cannot add them to certain sections, for example between the post header and body text, as seen on this blog. For that level of control you need to manually edit the template itself and that’s what I’m going to demonstrate today.

First you need to generate your AdSense code, for this example I’m going to add a banner to the top of my blog, just underneath the page header/title.

First go to the settings screen of your blog and hit the template tab. We want to be editing the html, so hit the link. For ease of use you might want to download the template to your PC but in this example we’ll use the online editor.
Expand the widget templates (this allows you to put the AdSense anywhere on your blog) code and locate the header section like so:

Now scroll down to the last </div> and paste your AdSense code:

Now here comes the magic! (So to speak.) If you try to use the template like this most of the AdSense code will be stripped away and your ads will not show at all!
This is because AdSense makes use of the html comment marker and html comments are stripped out in the beta templates, taking the majority of our AdSense code with it!
To get round this (and so we don’t have to revert our template) we change the < and > of the AdSense code that uses the html comment marker into their respective HTML entities: &lt; and &gt; as seen highlighted in red in the picture:

Now hit the preview button to check on the brand new ads you’ve just installed:

Ok, so the positioning could do with a tweak, as could the colour scheme, but now you know the hardest part, getting the ads to show, you can tweak it til your hearts content! Don’t forget to save your template once you have positioned the ads to your liking.

Tags: , ,

GTA: SA Censor Remover Online

I’ve been doing some work to make the ever so popular GTA: SA Censor Remover available as an online tool, opening it’s abilities to everyone rather than just Windows users.

It’s a cut down version, it lacks many of the advanced features of the full program but does it’s basic task with honours.

It’s currently in development stage, I have the PS2 and PC save support in and working but the Xbox code is giving me some troubles, mainly due to trying to do everything in PHP, definitely a case of the wrong tool for the job.

I’ll post a beta link when I’ve tidied the code up a bit, with any luck I’ll have the Xbox code working by then too.

Tags: , , ,