EPOC Virus Tutorial |
|||||||||||||||||||||
If you haven't heard of EPOC before, then I'll give you the background for it first. The EPOC OS was developed by a company called 'Symbian' and was used on Psion's handheld devices, these days Symbian have now started developing their Operating System for smartphones for example the Nokia 3650. OPL is a lanuage used on epoc for programming, and I see it as the same as the Basic lanuage on PC's. These days, programming for Symbian's new system requires you to know C++, like Cabair was coded in. All the code written in this tutorial, was used on a Psion Revo, using EPOC Release 5, Twiddlebit's OPL+ compiler and IDE software. When you compile your code under OPL+, and then use on other devices we need too
define the OPL application, we can do this by using the following function.
uid& is the application's UID. In the OPL32 Manual it tells us that official reserved UIDs must be used, but this is not the case. UID's are used as a application ID in the menu. So if we say app1 has the UID of 10, and your program app2 has the same, then your program will overwrite app1 in the menu. When you compile your application using the APP function, it automaticly places your
program to the folder C:\System\Apps\YOUAPPNAME\youappname.app and as doing so
will add a shortcut to the menu. Now we have abit of knowledge of OPL lets start
coding.
All code has to be in functions, which tells the compiler where the code start and ends, and this can be done with PROC with the name which in the example above I have named it Main and used ENDP to end it. The command ONERR is self-explanatory, if an error happens than it goto Next:: If you compile a simple app in opl, when it is run it always displays a console. We of course don't want this and so to get pass this 'slight' problem we can the use gVISIBLE OFF. This will hide the console window and only show the message box or any other GUI window we wish to display. You should be-able to figure the next part of the example code. It starts to look for
the folder which if you define, and if its there it'll display a message, but if not the app
will create a new folder and copy itself to it. As I mentioned before, to display the app
in the menu, it needs to in the 'C:\System\App\YouAppName\' folder which it will do.
Displaying message boxes isn't as easy as say the MessageBox command in cpp. All
that the sample code below does is display a message box, and as you can see it's
quite lengthy.
dTEXT - The first parameter, can be left as null its not needed, but the second line is
the text in which we want displayed in the message. The third parameter is used for
line info. $202 tells the compile that it's the last line we want to display. If you add
the number lines to each parameter.
|
|||||||||||||||||||||
by Retro |