Author Topic: Roundcube Mod Markup Language  (Read 6827 times)

Offline jonsjava

  • Jr. Member
  • **
  • Posts: 11
Roundcube Mod Markup Language
« on: November 04, 2008, 03:58:13 PM »
RCMML (RoudCube Modification Markup Language) is a project I've been working on for the past couple days.  currently it allows you to replace a line, add a line before a line, or after a line.  You can modify as many files/lines as you like, but the language is new, and rudimentary. It's XML-based, so it should't be too hard to pickup.

Here's an example script:
Code: [Select]
<rcmod>
<version>0.0.1</version>
<rcversion>0.1-rc1</rcversion>
<file>
<filename>program/include/rcube_contacts.inc</filename>
<line>
<action>addbefore</action>
<linenumber>3</linenumber>
<newline>JON WAS HERE</newline>
</line>
<line>
<action>addafter</action>
<linenumber>25</linenumber>
<newline>/* a comment field */</newline>
</line>
<line>
<action>replaceline</action>
<linenumber>10</linenumber>
<newline>\$how_to_use = \&quot;escape all strings, please\&quot;;\n\t//You can multi-line things this way as well</newline>
</line>
</file>
<file>
<filename>program/include/main.inc</filename>
<line>
<action>addbefore</action>
<linenumber>3</linenumber>
<newline>JON WAS HERE</newline>
</line>
<line>
<action>addafter</action>
<linenumber>25</linenumber>
<newline>/* a comment field */</newline>
</line>
<line>
<action>replaceline</action>
<linenumber>10</linenumber>
<newline>\$how_to_use = \&quot;escape all strings, please\&quot;;\n\t//You can multi-line things this way as well</newline>
</line>
</file>
</rcmod>


you must know the linenumber, and you must escape your strings (exploits won't work. no database query involved, so you can try if you like, but all you'll get back is a junk tar.gz file)

This language is a method of creating mod packs that are easy to integrate in a new install.  I've taken the time to download all versions of roundcube (back to the first one, and ending with the most recent trunk release) for you to modify. So, if you want to give it a go, please post here any issues you find with the script.  For now (until I feel satisfied with the script) I will be keeping this closed-source, but completely free to use.

If you are interested on working on the project with me, please let me know.

I'll be posting the link to the script as soon as I've tightened down my firewall.

EDIT*The link is: http://dev.jonsjava.com/modder
« Last Edit: November 04, 2008, 04:15:04 PM by jonsjava »

Offline jonsjava

  • Jr. Member
  • **
  • Posts: 11
A more in-depth explination
« Reply #1 on: November 05, 2008, 12:05:09 AM »
I came up with this idea so people who are wanting a single mod (for now, I will build on this so it can handle more than one mod, or add the ability to modify a version that has already been modded) can grab a "mod pack" and head over to the site, and run the pack, and get a compressed ready-to-go version of roundcube with the desired mod in place.

The syntax is simple enough.  

Code: [Select]
<rcmod><rcmod>
This merely declares that this is a rcmod package

Code: [Select]
VERSION NUMBER
This is the RCMML version. This tells the system which markup language to use.  I plan to add extensibility to the system later (soon), but this is only day 3 of the code being in existence, and day 1 of it working.

Code: [Select]
VERSION NUMBER
The RoundCube version your mod is for.  For example:
roundcubemail-0.1-rc1 would be 0.1-rc1
roundcubemail-trunk-20070728 would be trunk-20070728

Code: [Select]

This declares the beginning the modification of a file

Code: [Select]
FILE NAME
This is the actual filename, relative to the location in the directory tree.
Example:
/roundcube/program/include/main.inc
would be
program/include/main.inc

Code: [Select]

This declares that you are beginning a modification on a line.

Code: [Select]
ACTION
You place the action to be taken here.  You have 3 choices:
  • addbefore
  • addafter
  • replaceline

These are relative to the line number, so you must know line numbers. Furthermore, if this mod is not the first mod to the file, you must take in to account the lines you've added already, and add those lines to the line number. a good example would be a file that contained this data:

Code: [Select]
phpinfo();
?>


If I were to add a line after line 2 (phpinfo), that line would become line 3, and the ?> would become line 4, so if I wanted to add another line, after my last mod, I would need to take into account the placement change. The easiest solution would be to start the mod from the bottom of the page, and work up from there.  You would essentially bypass the whole miscount issue.

Code: [Select]
NUMBER
This has already been covered, but to review, this is the line number that you are modifying (or a reference point if you are adding before this line or after it)

Code: [Select]

This is where you put the data for the new line(s).
For now, I ask that you escape your characters (\$ instead of $ and \" instead of " , for example).  It's not an exploit, I just haven't created a handler for un-escaped data yet.


You can add multiple lines to modify per file, and multiple files per mod pack.  I am hoping on having a better version by this time next week (or 2 or 3 better versions), but in order to do so, I will need feedback.