• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

my first release(about chinese flyff)

Newbie Spellweaver
Joined
Dec 2, 2007
Messages
18
Reaction score
7
First of all, I come from China. This article is translated by Google, because my English is not good
Thank you

wdf file:
No file names, only the hash (like md5, only 4 bytes, it may be to reduce the wdf file size, etc.)
config.wdf
There are many configuration files. Most of lua ( ) compiled files (temporarily called "luac file")
But luac file is encrypted, decrypted as follows:):
Code:
BYTE * pLuac; / / luac data
int nLen; / / luac file size
BYTE * pDecrypted; / / decrypted data, the size is nLen +1
for (int i = 0; i <nLen; i + +)
{
BYTE byTemp = (~ pLuac [i]) | 0x3D;
pLuac [i] = (byTemp <<4) | (byTemp>> 4);
}
pDecrypted [0] = 0x1B; / / reference to lua source
pDecrypted [1-3] = "Lua"; / / shorthand
memcpy (pDecrypted +4, pLuac +3, nLen-3); / / copy the remaining data
pDecrypted become standard luac

But ...
Chinese flyff modified lua source of opcodes
Add "and or not shl shr" The five opcodes
Here is the order of opcodes
Code:
typedef enum {
/*------------------------------------------------ ----------------------
name args description
-------------------------------------------------- ----------------------*/
OP_MOVE = 7, / * A B R (A): = R (B) * /
OP_LOADK = 8, / * A Bx R (A): = Kst (Bx) * /
OP_LOADBOOL = 9, / * ABC R (A): = (Bool) B; if (C) pc + + * /
OP_LOADNIL = 10, / * AB R (A): = ...: = R (B): = nil * /
OP_GETUPVAL = 11, / * A B R (A): = UpValue [B] * /

OP_GETGLOBAL = 0, / * A Bx R (A): = Gbl [Kst (Bx)] * /
OP_GETTABLE = 1, / * ABC R (A): = R (B) [RK (C)] * /

OP_SETGLOBAL = 2, / * A Bx Gbl [Kst (Bx)]: = R (A) * /
OP_SETUPVAL = 3, / * A B UpValue [B]: = R (A) * /
OP_SETTABLE = 4, / * ABC R (A) [RK (B)]: = RK (C) * /

OP_NEWTABLE = 5, / * ABC R (A): = {} (size = B, C) * /

OP_SELF = 6, / * ABC R (A +1): = R (B); R (A): = R (B) [RK (C)] * /

OP_ADD = 29, / * A B C R (A): = RK (B) + RK (C) * /
OP_SUB = 30, / * A B C R (A): = RK (B) - RK (C) * /
OP_MUL = 31, / * A B C R (A): = RK (B) * RK (C) * /
OP_DIV = 32, / * A B C R (A): = RK (B) / RK (C) * /
OP_MOD = 33, / * A B C R (A): = RK (B)% RK (C) * /
OP_POW = 34, / * A B C R (A): = RK (B) ^ RK (C) * /
OP_UNM = 35, / * A B R (A): =-R (B) * /
OP_NOT = 36, / * A B R (A): = not R (B) * /
OP_LEN = 37, / * A B R (A): = length of R (B) * /

OP_AND = 38, / * and ABC R (A): = RK (B) & RK (C) * /
OP_OR = 39, / * or A B C R (A): = RK (B) | RK (C) * /
OP_XOR = 40, / * xor ABC R (A): = RK (B) ^ RK (C) * /
OP_SHL = 41, / * shl ABC R (A): = RK (B) <<RK (C) * /
OP_SHR = 42, / * shr ABC R (A): = RK (B)>> RK (C) * /
OP_INY = 43, / * not A B R (A): = ~ R (B) * /

OP_CONCAT = 12, / * ABC R (A): = R (B) .. ... .. R (C) * /

OP_JMP = 13, / * sBx pc + = sBx * /

OP_EQ = 14, / * ABC if ((RK (B) == RK (C)) ~ = A) then pc + + * /
OP_LT = 15, / * ABC if ((RK (B) <RK (C)) ~ = A) then pc + + * /
OP_LE = 16, / * ABC if ((RK (B) <= RK (C)) ~ = A) then pc + + * /

OP_TEST = 17, / * AC if not (R (A) <=> C) then pc + + * /
OP_TESTSET = 18, / * ABC if (R (B) <=> C) then R (A): = R (B) else pc + + * /

OP_CALL = 19, / * ABC R (A), ..., R (A + C-2): = R (A) (R (A +1), ..., R (A + B-1) ) * /
OP_TAILCALL = 20, / * ABC return R (A) (R (A +1), ..., R (A + B-1)) * /
OP_RETURN = 21, / * AB return R (A), ..., R (A + B-2) (see note) * /

OP_FORLOOP = 22, / * A sBx R (A) + = R (A +2);
if R (A) <? = R (A +1) then {pc + = sBx; R (A +3) = R (A)} * /
OP_FORPREP = 23, / * A sBx R (A) -= R (A +2); pc + = sBx * /

OP_TFORLOOP = 24, / * AC R (A +3), ..., R (A +2 + C): = R (A) (R (A +1), R (A +2));
                        if R (A +3) ~ = nil then R (A +2) = R (A +3) else pc + + * /
OP_SETLIST = 25, / * ABC R (A) [(C-1) * FPF + i]: = R (A + i), 1 <= i <= B * /

OP_CLOSE = 26, / * A close all variables in the stack up to (> =) R (A) * /
OP_CLOSURE = 27, / * A Bx R (A): = closure (KPROTO [Bx], R (A), ..., R (A + n)) * /

OP_VARARG = 28 / * AB R (A), R (A +1), ..., R (A + B-1) = vararg * /
} OpCode;
////////////////////////////////////////////////// ////////////////////////
# Define NUM_OPCODES (cast (int, OP_INY) + 1)

Tired, rest a while...
Can I continue to write it in Chinese?:blush:
 
Initiate Mage
Joined
Sep 7, 2011
Messages
2
Reaction score
0
Can you explain the tools?
I can't understand something
 
Master Summoner
Joined
Oct 22, 2010
Messages
502
Reaction score
72
Could't get the whole things translated....
Some more instructions would be nice
 
Last edited:
One word! Im Fawkin Pro!
Loyal Member
Joined
Jul 1, 2010
Messages
1,254
Reaction score
359
thing is a really nice contribution and about time haha,

got one question thought, is it able to open other wdf than config?

(downloading cflyff now to check it out.. will take some time tho)

Can I continue to write it in Chinese?:blush:

Even thought I wouldn't care if you continues in chinese, mods and other people will go against it.. so if you do want to continue, you better keep on using the translator :p
 
Last edited:
Experienced Elementalist
Joined
Nov 30, 2009
Messages
251
Reaction score
45
thing is a really nice contribution and about time haha,

got one question thought, is it able to open other wdf than config?

(downloading cflyff now to check it out.. will take some time tho)



Even thought I wouldn't care if you continues in chinese, mods and other people will go against it.. so if you do want to continue, you better keep on using the translator :p

:3 I agree. This is a nice piece of information about cFlyff. Seems like be able to run a cFlyff server may be possible. xD
 
Back
Top