Click here to Skip to main content
15,881,248 members
Articles / Desktop Programming / MFC
Article

Sharp YO Series Communication Class

Rate me:
Please Sign up or sign in to vote.
4.71/5 (8 votes)
23 Sep 2001 168.9K   1.1K   16   34
Class for performing a backup/restore to a Sharp YO series organizer.

Disclaimer

This communication class is conducted by experimenting with a commercially available product by Sharp Electronics Corp. Sharp Electronics Corp. is in no way involved in this research and assumes no liability, express or implied. The software may contain bugs and may not work with any given organizer; I do not take responsibility. Use the information herein at your own risk. You've been warned.

Introduction

The SharpComm class has been written as a result of my research on the protocol used by the Sharp YO series organizers. The protocol for the backup and restore procedures has been hacked through using Portmon, an excellent tool from SysInternals; since Sharp has denied my request to obtain the official documents describing the protocol.

As of now, the class has been tested using my Sharp YO-190 organizer, with 256KB of RAM. It's not as fancy as the Palm Pilots, but it's cheap (as low as $30 from Best Buy) and it's exactly what I need. This probably works with other models, as well.

Features:

  • Memory: 256KB (254KB user area)
  • PC Link: cable & software included
  • Display: 19 x 5 characters dot matrix display with backlight
  • Weight: 9.5 oz (270 g)

This may not be a technical masterpiece, but is smarter than my old 11KB Canon organizer :-)

Class description

Method Description
SharpComm()Initializes the COM port to COM1 and allocates memory for the communication buffer.
~SharpComm()Deallocates memory for the communication buffer and closes the COM port used.
void Initialize(void)Opens the selected COM port and sets the communication parameters (9600 baud, 8N1), then purges the queue. This method must be called before performing a backup or a restore operation.
bool IsInitialized()Returns true if the communication port has been successfully opened.
void SetComPort(int Port)Sets the desired COM port. The Port parameter must have one of the following values: COM1, COM2, COM3, COM4. To be effective, this method must be called before Initialize.
void SetFileName(char *szFileName)Establishes the name of the file used for backup and restore operations. To be effective, this method must be called before Initialize.
void DoBackup()Backups the contents of the organizer in the file specified by SetFileName.
void DoRestore()Restores the contents of the organizer from a file specified by SetFileName.
void Shutdown()Closes the selected communication port.

Usage

The SharpComm class is fairly easy to use, there is no special setup needed, just the requirement that your organizer be connected to the computer using the included cable.

// SharpComm class instance
SharpComm device;
try {
// Set port to COM1
device.SetComPort(COM1);
// Initialize communication
device.Initialize();
// Set file name
device.SetFileName("c:\\SharpYO190.bin");
printf("Waiting for organizer...\r\n");
// Perform backup or restore (device.DoRestore())
device.DoBackup();
}
catch(DeviceException *ex)
{
// Catch exception, something has happened
printf("ERROR: %s\r\n", ex->GetMessage());
delete ex;
}

Known Issues

  1. The backup and restore operations are not implemented using threads, so there's no elegant way to cancel the operation or to add a progress bar to a GUI. The class is very simple and I leave the chore of adding multithreading to whoever is interested.
  2. The checksum computation is a simple 16 bit addition, but the first and the last data blocks seem to follow a different rule. The implementation of GetCheckSum is done experimenting, so I am not sure if the results are stable.
  3. The sample utility provided is extremely simple therefore minimal error checking is performed. Don't blame me if your computer explodes or goes on strike :-)

A word about Sharp's backup files (*.bke)

The backup files generated by the original program that comes with the organizer seem to be encrypted. I say "seem", because the encryption schema used is so weak that I could decrypt the files within minutes after I saw them. For those who are used to working with files at a low level, all you have to do is apply XOR FFh to each byte from offset 8 onwards. That's all. In addition, if you do that, the password of your organizer can be found at offset 112h. For those who don't understand a word of what I am saying, here is the English version :-)

Don't store sensitive information in your organizer!!! Even protected by the password, your data and password can be easily revealed using the simple class presented in this article. Also, remember that even after a reset, the memory is not completely erased, just marked as erased. Take out the batteries for a few minutes to wipe out any trace of your data from the organizer. Most importantly, do not store the backup files where they can be easily reached by others.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Architect
Romania Romania
I am a software engineer based in Timișoara, Romania and currently hold the position of software architect for one of the largest companies in the world.

I invented a dialect of the Forth programming language and implemented the first Forth compiler for the .NET platform. I reverse-engineered the communication protocol of some GPS trackers and wrote from scratch a vehicle tracking system that is currently used to track my two cars. I hold a PhD in computer science and I am the author of several papers and a book chapter. In the 90s I wrote several computer viruses in assembly language for my own research and I was the first to devise a technique to deter heuristic virus scanners. In short, a humble man.

Comments and Discussions

 
Generalneed to decrypt the .bke file Pin
7-Nov-01 15:01
suss7-Nov-01 15:01 
GeneralRe: need to decrypt the .bke file Pin
Valer BOCAN7-Nov-01 21:10
Valer BOCAN7-Nov-01 21:10 
GeneralRe: need to decrypt the .bke file Pin
8-Nov-01 15:14
suss8-Nov-01 15:14 
GeneralRe: need to decrypt the .bke file Pin
9-Nov-01 3:10
suss9-Nov-01 3:10 
GeneralRe: need to decrypt the .bke file Pin
Valer BOCAN19-Nov-01 19:46
Valer BOCAN19-Nov-01 19:46 
GeneralRe: need to decrypt the .bke file Pin
Anonymous13-Oct-03 17:27
Anonymous13-Oct-03 17:27 
GeneralRe: need to decrypt the .bke file Pin
tga.tim28-Sep-04 7:35
tga.tim28-Sep-04 7:35 
GeneralRe: need to decrypt the .bke file Pin
Anonymous25-Jan-05 10:16
Anonymous25-Jan-05 10:16 
Hi! I ´ve adquire an YO-190 (ZQ190) whit secret area actived, but don´t have the password.. So, after read all this article, and posted replys, i´ll found this : http://www.sharp.net.au/download_files/orgsw.htm[^]

At this URL , you can download an BKE Viewer.

Thanks !!
GeneralRe: need to decrypt the .bke file Pin
Anonymous23-Mar-05 11:58
Anonymous23-Mar-05 11:58 
GeneralRe: need to decrypt the .bke file Pin
fixit guy21-Apr-05 18:45
fixit guy21-Apr-05 18:45 
GeneralRe: need to decrypt the .bke file Pin
sureshchandar30-Aug-05 4:32
sureshchandar30-Aug-05 4:32 
GeneralRe: need to decrypt the .bke file Pin
slyop25-Sep-05 11:44
slyop25-Sep-05 11:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.