Thread Tools Display Modes
07-16-10, 01:50 PM   #1
Kookie
A Murloc Raider
Join Date: Jul 2010
Posts: 7
Trojo - Doing it right from the start

With alot of addons going to have to be updated and worked out again. I am just waiting for the new API to be released with all sorts of neat new calls and everything. I have a suggestion.

Awhile back, there was an amazing idea. Elements. Earth Lib, Water lib, Air Lib. Awesome. Libraries to do different things. Then came more classes and libraries to help aid in development. I want to take it a step further.

Trojo.


Trojo is going to be a module based framework. With the ability to load on demand, and update on demand. Trojo is an addon, much like a suite, which developers create plugins for. Trojo is a raid addon, or its a bar addon, or its a buff addon...or its a... you get the point.

I have tested with my work group many of different ways to do asynchronous loading as well as updating live. I know that WoW becomes a sandbox... but there are ways around this.

Trojo will be the only core addon that gets updated. Trojo will have a list of addons that are allowed, as well as a developers key which is a compiled LUA code to protect from malicious attacks.

Here is an example of how the update works:


Trojo -> Mojo(Unit Frame library built in) -> User A is using v1.0 -> Join TrojoUpdate.channel

Channel Broadcast: User B has Trojo v1.1A and Developer Key xxxxxxxxxx was fired off.

User A Trojo <-- Fire popup: Would you like to update Trojo?
User A Hits YES!
User A gets a channel ping: USERA,ChannelID
USERA, Trojo A joins Channel ID, Trojo B joins.
Trojo B sends Line by line update chat 2 lines per 3 seconds.

Trojo A Update complete.
Trojo A has code stored in cache text. Trojo now has a new addon.

-----------

My goal is to create a way for users to say.. hey man we really need you to have XXX addon. Ok, send it to me. Bam. You get it.

Trojo testing will start as soon as the UI is allowed in Cataclysm. Currently the working copy of Trojo is limited to what it can do, as alot of the code is staying opened until we know for sure whats in Cataclsym.

I will be making a development set, as well as a plugin system as soon as we are ready for developers to port addons to the Trojo system.

I hope this explains everything that I am working on. If you have questions about this please ensure to contact me on PvP realm Beta US Horde. My name is Trojo
 
07-16-10, 02:13 PM   #2
Shadowed
...
Premium Member
Featured
Join Date: Feb 2006
Posts: 387
You can't load compiled binary code into WoW, you would need some sort of public/private key setup. OpenRDX has done this sort of update system, but if I remember right it's small scale updates.

Letting an entire addon live in the SV would kill your load times, and you'd likely hit the limit on SavedVariables for a large addon. You would also need to distribute the entire addon to do this, which is slow over the addon comms channel. Better off telling someone to use an addon updater.

It's interesting from an implementation standpoint, but what you want to do is impractical.

Last edited by Shadowed : 07-16-10 at 02:17 PM. Reason: Corrected loading/compiling Lua
 
07-16-10, 02:29 PM   #3
IQgryn
A Cyclonian
AddOn Author - Click to view addons
Join Date: Jul 2008
Posts: 46
Agreed on the impracticality, but the SavedVars limit is pretty large. It will hold, for example, the text of every item pre-ICC (yes, I test my limits ).

However, there is no "you can't put more here" error. If an addon's SavedVars file gets too large, it will be deleted the next time the addon loads.

The load times wouldn't be a whole lot worse than a normal addon. Either way, you're still loading and executing. Stored in SavedVars, you're loading a string, then executing the string, which lua handles fairly efficiently if you do it all as one string (not line by line and concatenating it together). As long as you store each lua file as its own string it shouldn't be too bad.

I still think the current model is better for most uses; while I would love the ability to send someone an addon, the reality is that they'd almost always need to go get Trojo first anyway. May as well just have them get the addon. Also, you'd have all the settings for all the Trojo addons stored together, so if one of them corrupted itself, all of them would be at risk.

Finally, security would be a nightmare. I prefer having the code somewhere I (or WOWI ) can read it first.

That said, if you can come up with a macro that will allow receiving of an addon for quick-and-dirty testing/whatever, you may have a use-case. I wouldn't make them persistent though. Instead, make Trojo send a URL with each addon and save the URLs so they can see where to get the full version.
 
07-16-10, 03:06 PM   #4
Kookie
A Murloc Raider
Join Date: Jul 2010
Posts: 7
Originally Posted by Shadowed View Post
You can't load compiled binary code into WoW, you would need some sort of public/private key setup. OpenRDX has done this sort of update system, but if I remember right it's small scale updates.

Letting an entire addon live in the SV would kill your load times, and you'd likely hit the limit on SavedVariables for a large addon. You would also need to distribute the entire addon to do this, which is slow over the addon comms channel. Better off telling someone to use an addon updater.

It's interesting from an implementation standpoint, but what you want to do is impractical.
You can distribute compiled code and execute it in WoW. Carbonite when it was closed source has proven this. Using the LUA -c parser will allow you pass an 'encoded' version so that it cannot be reversed.

The Saved Variables will be kind of...adjusted.

If you get a chance look at Tweet Craft, and how it works. Allowing updated information in realtime to go from WoW to Twitter, and Back. Though an ExE will not be needed because were not uploading to a source destination.

Modules is something that is a little tough, which is why Trojo will have all the required libraries which are load on demand.

Dynamics are stored in Variables. The AutoUpdater is for players that are on and raiding.. or playing and want to update or pull addons they never heard of written for Trojo.

It may be something you need to see. I will be glad to show you in the coming weeks. :-)
 
07-16-10, 03:44 PM   #5
pixelxeno
A Deviate Faerie Dragon
Join Date: Feb 2009
Posts: 11
Originally Posted by Kookie View Post
You can distribute compiled code and execute it in WoW. Carbonite when it was closed source has proven this. Using the LUA -c parser will allow you pass an 'encoded' version so that it cannot be reversed.
Wrong. Carbonite was never compiled. It was heavily obfuscated, decrypting itself over and over using loadstring(), until the low level obfuscation layer was attained. But the code itself was never compiled, just heavily obfuscated.

Note: I'm saying "compiled" as in "compiled in byte code", not "compiled into an horribly obfuscated version", which would be against the new EULA from Blizzard anyway.


If you don't believe me, load the Wow.exe into a disassembler such as IDA pro free: http://www.hex-rays.com/idapro/idadownfreeware.htm, and go to 00856190 (valid as of the latest 3.3.5 binary). If you know the Lua Virtual Machine, you'll recognize the f_parser function here, which sourcecode is:

Code:
static void f_parser (lua_State *L, void *ud) {
  int i;
  Proto *tf;
  Closure *cl;
  struct SParser *p = cast(struct SParser *, ud);
  int c = luaZ_lookahead(p->z);
  luaC_checkGC(L);
  tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z,
                                                             &p->buff, p->name);
  cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L)));
  cl->l.p = tf;
  for (i = 0; i < tf->nups; i++)  /* initialize eventual upvalues */
    cl->l.upvals[i] = luaF_newupval(L);
  setclvalue(L, L->top, cl);
  incr_top(L);
}
Look at 008561BC: the call here is luaY_parser, and you'll notice that the luaU_undump call from the conditional call is missing. The whole signature reading, condition on signature comparison, and call to the lua vm are being removed here, thus leaving only the ability to load non-precompiled, plain text binaries.

In all cases, I don't see how pre-compiling the addon would protect against anything. Only a key/signature check could. Nothing would prevent me from distributing a pre-compiled malicious piece of code. So that's redundant and irrelevant protection here.


Also, I hope you don't even think of "adjusting" the maximum size of the saved variable by modifying the Wow.exe binary. That, again, would be against the EULA, and probably detected by Warden as a cheat attempt, if you can even pass the authentication with a modified binary that is.


All in all, I too believe this is a bad idea overall. Several reasons:

-) This will drastically explode the size of the saved variables.
-) Circumventing that max size will probably cause troubles.
-) The CPU load to do a signature check will be insane in plain Lua.
-) The overall loading time for players will be insane.
-) The scalability of this kind of distribution method is probably going to make the Blizzard servers crying for their lost bandwidth.


Oh and, several other things "against" pre-compiled Lua code:

-) The bytecode is ridiculously easy to understand and reverse. Thus your "it can not be reversed" argument is void. See http://luadec.luaforge.net/
-) The bytecode is machine dependant. World of Warcraft still runs on powerpc machines. Loading pre-compiled lua wouldn't work, because you'd most likely load a little-endian bytecode whereas PPC is big endian.

Last edited by pixelxeno : 07-16-10 at 04:28 PM. Reason: Adding a few lines about why pre-compilation of Lua is bad.
 
07-16-10, 08:36 PM   #6
yssaril
A Warpwood Thunder Caller
 
yssaril's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2007
Posts: 96
also if you are running everything from an SV file how are you going to deal with errors since there wont be any decent trace of the error (no meaning full line numbers).
 
07-17-10, 01:07 AM   #7
pixelxeno
A Deviate Faerie Dragon
Join Date: Feb 2009
Posts: 11
Without even actually talking about the fact this would potentially work only for Lua code, and not for any other kind of file addons may have.
 
07-17-10, 01:33 AM   #8
unlimit
Lookin' Good
 
unlimit's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 484
Originally Posted by Shadowed View Post
OpenRDX has done this sort of update system, but if I remember right it's small scale updates.
OpenRDX is an emule system for objects and packages only, which is basically the content... raidframes, unitframes, scripts, threat meters, damage meters, and so on and so forth.

OpenRDX does NOT update the framework or actual coding of the addon through this emule system, however.
__________________


kúdan: im playing pantheon
JRCapablanca: no youre not
** Pantheon has been Banned. **

Last edited by unlimit : 07-17-10 at 01:36 AM.
 
07-20-10, 04:11 AM   #9
sigg
Featured Artist
 
sigg's Avatar
Featured
Join Date: Aug 2008
Posts: 1,251
There is no limit on the size of the object we can share with OpenRDX.

But we do not share code LUA directly. We share some definitions, it is like you are sharing a profile ace for example.

OpenRDX will generate code on the fly base on this definition.

Definition, could be a player frame, a damage meter frame etc ...

Cheers
Sigg
 
 

WoWInterface » AddOns, Compilations, Macros » Cataclysm Beta » Trojo - Doing it right from the start

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off