COM Ports Access Functions.

List of functions to access COM ports.

Read the full post »

XML Descriptor

Each script is collection of couple files. But it must have XML descriptor.

XML descriptor is plain xml-structured text file which contains references to all other files of this script. XML descriptor must be placed in folder “extensions” or its any subfolder and have file extension “.xml”. All references to other files are relative to location of XML descriptor, do not use absolute pathes.

You can use next tags:

<menu> – just container for all others

<section> – optional tag which contains name of the section where link will be placed. There are couple recognized sections: “calc, find, edit,export,navi, others”. If name does not match predefined it will be placed as subsection of “others”.

<script> – tag must exists. Contains name of the main script’s file with lua code. If it contains path it have to be related to position of the XML descriptor (no absolute pathes). If this file cannot be found SmartViewer will ignore script totally.

<form> – optional tag, contains name of the main UI QML file. Some additional naming rules like name’s case may apply, see QML documentation.

<button> – tag container which has visible to user link. Have to be at least 1 in file. Each such tag will be displayed as additional option in menu.

<name> – must exisits. Text shown to user.

<shortcut> – optional tag with keyboard shortcut. Use it carefull because other scripts may use same shortcut. Additional info.

<icon> – optional tag, allows to add icon to the menu. Contains image file name.

<callparam> – optional tag, anything contained here will be passed to script as global value CallParam when user selects this <button> from menu. So same script can have couple working modes.

<hint> – optional tag, contains text shown in status bar.

Sample:

<menu>
<section>find</section>
<script>find.lua</script>

<button>
<name>Text Search (case insensitive)</name>
<shortcut>ctrl+F</shortcut>
<icon>afind.png</icon>
<callparam>t</callparam>
</button>

<button>
<name>Binary Search</name>
<shortcut>ctrl+alt+F</shortcut>
<icon>hfind.png</icon>
<callparam>b</callparam>
</button>
</menu>

Introduction to Smart Viewer Extensions

I was self-using Smart Sniffer for more than 8 years already. During this years I made a lot of changes, added a lot of algorithms inside but it was not enough each time. For almost each new project or customer I had to make changes into internal code. It made me crazy. Code was not optimal, had new bugs, etc…

Fortunately in the beginning I decided to split recording module and viewer module, that gave me some chance to avoid “blue death” in most cases but it was not enough still. Last year I met “long time loading” problem with huge records (over 10Mb) because dump was shown as text (could you load faster 20mb of the text into ms word??). It’s enough I decide.

Now I represent new SmartViewer 5 which is written from scratch. It maintains compatibility with last recording module SmartSniffer, which is renamed to version 5 as well (I plan to rewrite it too though soon).

Basically SmartViewer module just loads recorded data stream and splits into data blocks in memory. It can show it immediatlly as a table 1 block per 1 raw. Now it uses delayed loading by user request, so “long time loading” should not be a problem any more.

Anything else you can imagine you need is moved out into extern scripts. Scripts are plain text files written using powerfull language LUA. Of course SmartViewer supplies some minimal API (functions, which extend lua) to allow access to recorded data, COM ports, user interaction, etc.

API may be extended in time by my needs or by your requests.

How it works ?

Script is at least one text file containing code. To be loaded by SmartViewer it must have XML descriptor stored somewhere into predefined folder “extensions” or you can set additional custom folder. According to XML descriptor SmartViewer will load code files, icon files, user UI files etc. Yes, I’m not mistaken – you are able to extend SmartViewer UI by own code using QML language, but let’s speak about later.

SmartViewer just loads recorded stream, parses it into blocks and serves as a host for extern scripts which can change visual appearence, modify data, export data, calculate checksums/hashes, extract plain data out of transmission protocols, communicate to device etc. – all in 1 without need to compile extern programs using complex languages like Delphi or C.

LUA is interpreted language so each script runs into Virtual Machine. When SmartViewer starts it enumerates all XML files and loads related scripts into own VM. However, scripts are loaded only. It will be executed by direct user request (menu mouse click). All globals are kept in memory between script launches. Since each script has own VM they don’t share global data.

Virtual Machine(s) will be destroyed if:

  1. SmartViewer closed.
  2. User requested reload.
  3. Not handled error occured caused by script.

Script may have additional UI, in such case, script is loaded, next UI is loaded and when user clicks it to run –  hosting tab for UI is created and script executed.

You may read RUSSIAN decription, however it maybe not current.

Test locked

some test post

 

Read the full post »

Windows 7 UAC and file names

Did you know, that windows 7 controls you according to the file names?

Simple test: get any exe like calculator and rename it into “updater.exe”. You will see “shield” on it’s icon. Next time you will try to run program – system will ask if you want to.

If you develop something like “update-over-inet” be carefull choosing the name for exe. Most likelly this applies for other names like “installer”, I didn’t check.

Here is same just compiled empty exe as it is shown by Windows (just renamed):

Voice dial from PC

Today I was asked to do simple task: having phone number into Access DB dial it by connected mobile phone in 1 click, so user can pickup it and speak, i.e. eleminate key pressing on mobile keyboard.

According to documentation dialing can be done by single AT comand

ATD<number>

Furthemore, Windows has embedded “dialer.exe” which can do. Both ways failed.

Mobile was trying to esatblish “data” connection like modem, so user couldn’t speak. I spent couple hours browsing phone’s menus, trying to emulate keyboard, switching modes … and finally! TA-DAAA..

Semicolon! Just add semicolon after number to make voice call, that’s all. Simple.

ATD<number>;

That is difference between old land-line wired modems and modern mobiles.

 

Just Network Clipboard

Share your clipboard across network with Linux and Windows users.

Just Network Clipboard

Use “Just Network Clipboard” to quick and easy send and share clipboard content across network. No matter what’s your business or occupation, even if you’re a modern Home User with a small network, share texts, images and data with just one click !

Read the full post »

Change log

27-Feb-2012

SmartViewer updated to 5.0.0.4. Latest LUA 5.1.5 is compiled in. Added 1 more convinient GETFILENAME option, so API is 101 now.

21-Oct-2011

Site revised. Something were changed from old to new. Added API reference. Uploaded exe 5.0.0.3 of the Viewer, however installer supplies old still. New exe has a link to API reference.

05-Oct-2011

New version 5.0.02 released. Viewer made from scratch. Now most of its functions will come as plain text files and can be added more (open source in fact). EULA changed, so anybody can use sniffer without limits. Site updates are coming.

29-Aug-2010

Now version is 4.0.10.219

Fixed annoyed “access violation” on port selection into viewer.

Fixed basic scripting into viewer.

“Data optimization”  is OFF by default now and can be switched manually.

29-Apr-2010

Now version is 4.0.10.218

Fixed bug with loader for some logs. Everything touched is recompiled (VPMachine, MPSLViewer etc.).

26-Apr-2010

Now version is 4.0.10.217

Fixed bug of USB recording in stealth mode.

05-Apr-2010

Now version is 4.0.10.216

Added “Stealth Mode” which hides Sniffer from detection by other software.

Viewer can calculate CRC24.

During recording you can use auto-inserted bookmarks (used if you do own program for debugging).

06-Mar-2010

Now version is 4.0.10.215

Fixed “emulation and recording is not going” if last rule was not ended by “new-line”.

01-Mar-2010

Now version is 4.0.10.214

VPMachine is optimized to work with very big records. Installer now has inside com0com emulator.

28-Feb-2010

Now version is 4.0.10.212

Added warning if huge record is loaded. You can cancel that and just make export into other formats like binary or html. Loader is optimized.

12-Feb-2010

Now version is 4.0.10.211

Copy-protection system is totally removed and now Sniffer can go on all Windowses. It was tested on Xp/Vista/W7  during last year.

Smart Sniffer is “subscriptionware” from now.

Minor changes to UI. Viewer will have LUA-scripting engine soon.

Now Sniffer can do “emulation and recording” which allows replace/modify incoming packets from device.

Help systems for programs are revised and changed to CHM format.

Online update and website are modified.

12-Oct-2006

Now sniffer’s version is 4.0.8. Viewer’s version is 3.06.

Fixed smal leak which was stopping from logging COM numbers greater than 10.

For everybody 40% discount is avail till 1st-Jan-2007, just enter next code during ordering process: 842-SHR-23JT

12-Sep-2006

Now sniffer’s version is 4.0.7. Viewer’s version is 3.05.

UI of Viewer has been revised and changed. UI of the Sniffer has minor changes.

28-Aug-2006

Now sniffer’s version is 4.0.6.

UI is changed to match XP-style. Added utility to remove all installed drivers safelly so rare dead-locks can be resolved now in seconds. USB module can wait until device will become avail. So you can start sniffing even on unplugged devices.

04-Aug-2006

Sniffer’s version is 4.0.4 and viwer’s is 3.0.3.

Fixed bug during recording OVERLAPPED sessions of COM/LPT. Viewer generates timings during binary export. It can be used to accurate replaying of logs.

21-Jul-2006

Sniffer’s version is 4.0.2 and viewer’s ver. is 3.0.1.

Copy-protection is hardly revised, now program is much stable and supports HT and dual-core systems.

Revised COM port’s access,it don’t say “Can’t open port” on some COM-mapped USB devices any more.

IO ports (accessed by IN/OUT asm commands) monitoring is in progress.

Minor changes to viewer. Added support for future IO monitor.

29-Jun-2006

We had to change supporting email address because of tons of spam. We cannot use filters because they can sort out some of your emails. Now it is supp[SIGN]smartsniff.com. All emails to the old support@smartsniff.com will be black holed.

14-Jun-2006

Now version is 3.2.5. MPSLViewer is 2.5.5

Fixed bug which might double USB recorded data in some cases. HWID is recorded too from now. Russian speaking people have discounts.

19-May-2006

Now version is 3.2.3. MPSLViewer is 2.5.2.

GUI of Sniffer & Viewer was extended. Ability of COM & LPT recording on NT systems was extended too.

12-May-2006

Now version is 3.2.1.

Marks ability was added. Starting from this release you can mark-up log during recording process.

Minor error was fixed which might prevent from saving USB-log on some PCs.

27-Mar-2006

Now version is 3.1.7. All programs have UI changes. This new site is launched. Old is still available.

Program is known as Smart Sniffer now.

Help file for MPSLViewer is upgraded by most-common questions.

MPSLViewer now can visually show DCB structure (it’s serial port configuration data). The HASH list which can be calculated is extended by SHA1

  • Login