Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
lua
08-06-2013, 06:48 PM (This post was last modified: 08-07-2013 10:52 AM by TrioxX.)
Post: #1
lua
Hi Angel

Is there anyone, who's experienced in lua? I have a function that seems like a "decoding" mechanism:

---

And i have an encoded file (see attachments). However, i'm not experienced in lua, so i have no clue how to do that.

So... If there's anyone who could try to decode it for me, i would be very thankful.

And yes... I'm real!
Find all posts by this user
Quote this message in a reply
08-06-2013, 07:23 PM
Post: #2
RE: lua
Hi

I am unfamiliar with 'lua' and I have not downloaded your file, but the code you have posted seems to me can be easily converted to PHP:

e.g.

Code:
if i == 1 and t == "AAA" then
xyzon = true
t = ""
elseif i == 1 then
xyzon = false
end

would probably be:

PHP Code:
if ($i == && $t == "AAA") {
$xyzon true;
$t "";
} elseif (
$i == 1) {
$xyzon false;


And for the functions you don't understand refer to http://www.lua.org/manual/5.2/ (select version) and php.net (for equivalents).

Once you have the code in PHP I am sure you will be able to understand it better and can work from there.
Find all posts by this user
Quote this message in a reply
08-06-2013, 07:41 PM
Post: #3
RE: lua
Hey TriloxX,

first greetz from ScriptDevilz.

Your code does not look complete, so this is not possible to decode with the snippets.
Find all posts by this user
Quote this message in a reply
08-06-2013, 08:07 PM (This post was last modified: 08-06-2013 09:15 PM by TrioxX.)
Post: #4
RE: lua
@Cyko

I was thinking about converting it to PHP.

@Macro

Which one? The attached one? Both codes are untouched Big Grin I took it from a World of Warcraft Addon. So... If anyone has an idea how to decode that stuff, i can also post the whole addon here.

EDIT:

Tried to port to PHP, but i guess i failed:

PHP Code:
function dec($t) {
    
$textd '';
    
$data 0;
    
$k 3;
    
    for (
$j=1$j<strlen($t); $j++) { //???
        
$c substr($t$j$j);
        
$cb chr($c{1});
        
$chard '';
        
        if (
$cb < (128 $k)) {
            
$chard ord($cb $k);
        } else if (
$db 192) {
            
$joined = (63 $cb) | $data;
            
$joined += $k;
            
$upper2 = ((192 $joined) >> 6) | 192;
            
$lower2 = (63 $joined) | 128;
            
$chard ord($upper2) . ord($lower2);
        } else if (
$cb 224 && $cb 193) {
            
$data = ($cb) << 6;
        } else {
            die(
'Range Err');
        }
        
        
$textd .= $chard;
    }
    
    return 
$textd;


Whatever i try to decode, this is the result:

Code:
515151515151515151515151515151515151515151515151515151515151515.....
Find all posts by this user
Quote this message in a reply
08-07-2013, 08:46 AM (This post was last modified: 08-07-2013 08:51 AM by Macro2k13.)
Post: #5
RE: lua
Nach dem ich deinen Script noch mal angesehen habe, habe ich folgendes raus bekommen:
After review your code and the lua scripts, i get following:

Quote:N Please Read! |N|This achievement is done as a level 84-85 in Twilight Highlands. The mobs that you will encounter come in packs of 2-4, so being under 84 in not advisable.|

R Twilight Highlands |N|Travel to Twilight Highlands (52.5, 28.0)| |Z|700|

K Korthalon |N|Slay Korthalon (52.5, 28.0), he is down in the Cellar.| |Z|700| |AID|5481| |AC|4| |NPC|47171|
K Karkrog the Exterminator |N|Slay Karkrog the Exterminator (51.2, 33.7)| |Z|700| |AID|5481| |AC|2| |NPC|46756|
K Warlord Halthar |N|Slay Warlord Halthar (49.0, 37.1)| |Z|700| |AID|5481| |AC|1| |NPC|46493|
K Black Recluse |N|Slay Black Recluse (46.0, 32.5), down in the cellar.| |Z|700| |AID|5481| |AC|3| |NPC|47115|

N Guide Complete



Hier dein angepasster Quellcode:
Your fixed code:

TrioxX you dont fail Wink only the wrong functions on the right place Wink

PHP Code:
<?php

/**
 * @author MacroBerg
 * @copyright 2013
 */

function dec($t) {
    
$textd '';
    
$data 0;
    
$k 3;
    for (
$j=1$j<strlen($t); $j++) { //???
        
$c substr($t$j$j);
        
$cb ord($c{1});
        
$chard '';

        if (
$cb < (128 $k)) {
            
$chard chr($cb $k);
        } else if (
$db 192) {
            
$joined = (63 $cb) | $data;
            
$joined += $k;
            
$upper2 = ((192 $joined) >> 6) | 192;
            
$lower2 = (63 $joined) | 128;
            
$chard chr($upper2) . chr($lower2);
        } else if (
$cb 224 && $cb 193) {
            
$data = ($cb) << 6;
        } else {
            die(
'Range Err');
        }

        
$textd .= $chard;
    }
    return 
$textd;
}

echo 
"<pre>";

echo 
dec('AAA

KMib^pbOb^ayKyQefp^`efbsbjbkqfpalkb^p^ibsbi51*52fkQtfifdeqEfdei^ka​p+Qebjl_pqe^qvlrtfiibk`lrkqbo`ljbfkm^`hplc/*1)pl_bfkdrkabo51fkklq^asfp^_ib+y

OQtfifdeqEfdei^kapyKyQo^sbiqlQtfifdeqEfdei^kap%2/+2)/5+-&yyWy4--y

HHloqe^ilkyKyPi^vHloqe^ilk%2/+2)/5+-&)ebfpaltkfkqeb@bii^o+yyWy4--yy>FAy215.yy>@y1yyKM@y14.4.y
HH^oholdqebBuqbojfk^qloyKyPi^vH^oholdqebBuqbojfk^qlo%2.+/)00+4&yyWy4--yy>FAy215.yy>@y/yyKM@y13423y
HT^oiloaE^iqe^oyKyPi^vT^oiloaE^iqe^o%16+-)04+.&yyWy4--yy>FAy215.yy>@y.yyKM@y13160y
H?i^`hOb`irpbyKyPi^v?i^`hOb`irpb%13+-)0/+2&)altkfkqeb`bii^o+yyWy4--yy>FAy215.yy>@y0yyKM@y14..2y

KDrfab@ljmibqb

'
);

?>
Find all posts by this user
Quote this message in a reply
08-07-2013, 10:30 AM
Post: #6
RE: lua
Yeah, you are right. I just inverted ord() and chr() Big Grin Thank you for pointing that out.
Find all posts by this user
Quote this message in a reply
08-07-2013, 10:49 AM
Post: #7
RE: lua
You're welcome.
Find all posts by this user
Quote this message in a reply
10-28-2013, 08:03 AM
Post: #8
RE: lua
no real tricks in lua,
you can mostly port it straight to php
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us | Homepage | Return to Top | Return to Content | Lite (Archive) Mode | RSS Syndication