Monday, May 30, 2011

Dump a file in hexadecimal directly in the browser

Direct URL

This webapp reads the selected file and displays the content in hexadecimal. The prefix, suffix, separator and line length is configurable. You can generate hex dumps to be used directly in C/C++ by setting "0x" as prefix and "," as separator.

This will work in browsers supporting HTML5 FileReader API and typed arrays.
Tested with Firefox 4 and Google Chrome 11.

Thursday, May 26, 2011

Online PE (Portable Executable, .EXE, .DLL) header viewer, no upload needed

Direct URL

This webapp reads the selected executable file with the HTML5 FileReader and displays the PE headers.

The most important information is the "Import directory" where you can check what dlls are used by the application and see the functions imported from the dlls.

This will work in browsers supporting HTML5 FileReader API and typed arrays.
Tested with Firefox 4 and Google Chrome 11.

Friday, May 6, 2011

Inclinometer in Python, for Symbian phones with accelerometer

An example of a simple inclinometer (tilt meter, tilt indicator, slope alert, slope gauge, gradient meter, gradiometer, level gauge, level meter, declinometer, and pitch & roll indicator).

But first you need to install Python for Symbian S60. This can be installed on phones with Symbian OS 3rd or 5th edition. Download PyS60 binaries and install the runtime and the shell (copy the .sis files to phone and launch to install or install with your phones software).
The setup for Windows OS is for creation of installable packages from your Python application.

The code is the following:

from sensor import *
import e32
from appuifw import *
from random import randint

print "Accelorometer by Lazar Laszlo (c) 2009"

# Define exit function
def quit():
    App_lock.signal()
app.exit_key_handler = quit
 
app.screen = 'large' # Screen size set to 'large'
c = Canvas()
app.body = c
s1,s2=app.layout(EScreen)
mx = s1[0]
my = s1[1]
m2x = mx/2
m2y = my/2
sleep = e32.ao_sleep

# Function which draws circle with given radius at given co-ordinate
def circle(x,y,radius=5, outline=0, fill=0xffff00, width=1):
  c.ellipse((x-radius, y-radius, x+radius, y+radius), outline, fill, width)
 

class Inclinometer():
    def __init__(self):
        self.accelerometer = \
            AccelerometerXYZAxisData(data_filter=LowPassFilter())
        self.accelerometer.set_callback(data_callback=self.sensor_callback)
        self.counter = 0

    def sensor_callback(self):
        # reset inactivity watchdog at every 20th read
        if self.counter % 20 == 0:
            e32.reset_inactivity()

        # redraw at every 5th read
        if self.counter % 5 == 0:
            c.clear()
            circle(m2x+self.accelerometer.x*2, 160-self.accelerometer.y*2, 7, fill=0x0000ff)
            if self.accelerometer.z > 0:
                c.rectangle((0,m2y,15,m2y+self.accelerometer.z*2),fill=0x00ff00)
            if self.accelerometer.z < 0:
                c.rectangle((0,m2y+self.accelerometer.z*2,15,m2y),fill=0x00ff00)
            c.line((0,m2y,mx,m2y),outline=0,width=1)
            c.line((m2x,0,m2x,my),outline=0,width=1)
        self.counter = self.counter + 1

    def run(self):
        self.accelerometer.start_listening()

if __name__ == '__main__':
    d = Inclinometer()
    d.run()
    App_lock = e32.Ao_lock()
    App_lock.wait()  # Wait for exit event
    d.accelerometer.stop_listening()
    print "Exiting Accelorometer"


The appuifw module contains the functions and objects for the graphical user interface. You can set the applications window size with the app.screen variable. To use the whole screen as a drawing canvas set app.screen = 'large' and set the application body to the Canvas object.

The application gets the accelerometer data through a callback. In order to do not redraw the screen at every read, a simple counter is used. I doubled the accelerometers values to increase the circles movement. The x and y values are displayed as a circle centered to the screens center. The z value is displayed as a green bar.

I reset the phones inactivity watchdog with the e32.reset_inactivity() function to keep the back-light on while the application is running.

If your phone has a magnetometer (compass) you can switch the sensor from AccelerometerXYZAxisData to MagnetometerXYZAxisData and the self.accelerometer variables to self.magnetometer to display the direction to North.

To run the application just save the code to a text file with .py extension, copy the file to the phones \DATA\PYTHON directory (or into the \PYTHON directory in the phone memory).

Screen shots from my Nokia E52:








Feel free to use and play with this small code.

Thursday, April 14, 2011

Online AES-256 file and text crypter, at client side in javascript

Direct URL

A simple file and text encrypter using AES-256 implemented in javascript. The cypher implementation is from HERE.

If your browser supports HTML5 file-api you can encrypt/decrypt local files without uploading to a server.

The upper Encrypt/Decrypt buttons are for file encryption. The file size is limited to a few megabytes because of the data-URL saving. The file is read directly with the FileAPI. The encrypted file is padded up to a multiple of 16 bytes, but the original file size is saved in the first 4 bytes, so at decryption will be truncated to the original size.

The lower buttons are for text encryption/decryption. The action is applied to the upper text box. The encrypted text is displayed in hexadecimal. The same format must be used for decryption. The text is padded with spaces up to a multiple of 16 characters.

The password (key) is padded with zeros up to 32 bytes.

Direct URL

Wednesday, March 30, 2011

Online EXIF reader without uploading



Read EXIF data without uploading the photo to a server. Works only with FileAPI capable browsers (Firefox, Chrome).
I used the EXIF data reader from Nihilogic and modified to read data from the FileAPI.

Try it bellow:



EXIF data:

Wednesday, March 23, 2011

lazarbackup

A simple open source backup utility.


After installation a new item will be added to the "Send To" folder. First select a backup folder with the "Set backup folder" command from the "Lazar Backup" start menu.


To archive a folder right click on the folder or on a file from that folder and select "Send To / Lazar Backup". The utility will archive the selected folder in a ZIP file saved to the selected backup folder. The archive name is composed from the archived folder name, date and an ID.

The archived files can be filtered by the extension. Two type of filter can be set:
- Include filter, will archive only files with the selected extensions
- Exclude filter, will archive all the files excluding the selected extensions
Only one of the filters can be active. Include filter will disable the exclude filter.
To set the filter select the "Set exclude filter" or "Set include filter" from the start menu and write the file extensions with "." prefix and separated with spaces. Sample: .bak .pdb

A general password can be configured for the created ZIP files.

Saturday, March 19, 2011

lazarcrypter

A simple open source file encrypter/decrypter using the AES-256 encryption standard. The installer will add a shell extension (a new entry in the Right Click menu from any file browser).

DOWNLOAD

The utility is used by right clicking a file and selecting an action from the Lazar Crypter menu.

You can encrypt and copy or move a file (or files) by selecting the "Cut" or "Copy" and the "Paste" in the destination folder. The "Cut" and "Copy" is active only on files. If you select "Paste" on a file, the files parent folder will be used as destination. To encrypt and securely delete a file select the "Encrypt" menu. The tool will encrypt the file and overwrite the original files data with random data then delete it. The encrypted files extension is .LCR .

To decrypt, select an encrypted file and if you want to copy or cut then use the corresponding menu and the "Paste" or directly the "Decrypt" menu.

The .LCR extension is automatically associated with the tool and if you open an encrypted file the tool will decrypt to the temporary folder and open with the associated application.

You can check the integrity of the encrypted file by selecting the "Integrity check" menu.

Friday, March 18, 2011

SetExifDate

A tool that will set an image files date and time according to the date and time from the EXIF information.


Exchangeable image file format (Exif) is a specification for the image file format used by digital cameras (including smartphones) and scanners.

Can happen that the image files date and time will be lost by copying or archiving the file. This tool will restore the date and time when the photo was created.

It's a command line tool with the following parameters:

SetExifDate [-r] PATH

PATH is the path to the folder where the .jpg files are
-r is to go into directories recursively

screen

A tool to show some frequently used dimensions by displaying a transparent rectangle for some standard sizes (640x480, 800x600, 1024x768, 1280x1024, etc.).
The transparent window can be set to be top most, can be rotated and the color can be switched between white and black.

pumasviewer

Image viewer with minimal user interface and advanced capabilities.
Shows the image floating on the screen without any border.


Features:

  • Easy browsing between images with cursor keys or mouse
  • Commenting parts of image with border and label
  • Show thumbnails, directly from EXIF if available.
  • Resize
  • Zooming, full screen, 1:1
  • Rotate left, right
  • Print
  • Show all EXIF tags
  • Brightness, contrast, saturation, gamma setting
  • AForge image filters: gray scale, invert, median, smooth, sharpen, blur, oil painting, sepia, pixelate, jitter, edge detection, rotate colors
  • Apply filters on selected parts or whole image
  • Histogram