全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:2064
推到 Plurk!
推到 Facebook!

FlashFXP的密碼編碼方式

 
chtai
高階會員


發表:68
回覆:238
積分:116
註冊:2004-05-21

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-05-23 01:45:37 IP:140.113.xxx.xxx 未訂閱
之前小弟正好在研究如何快速產生一些知名的FTP Cilent軟體的站台檔 (如 CuteFTP Pro, FlashFXP, FTP Voyager 之類) 好讓使用者只要輸入一堆依一定格式的資料, 就可產生一個站台檔,以便讓Client import。
當時無意間在網路上發現FlashFXP密碼的編碼方式,出處我也忘了 就貼上來跟大家分享,或許有人需要也說不一定. 就個人嘗試結果,在FlashFXP v2.x 還是可以使用的.
open the SITE.DAT file with any texteditor, and there you'll find stuff like this: [kz] IP=ipip User=klefz Pass=034D3F4342097B <- encrypted pass Port=21 Options=3003333000
Pass=034D3F4342097B <- encrypted pass
     ^^ = first magic number
Pass=034D3F4342097B <- encrypted pass
       ^^ = first encrypted char in pass
Pass=034D3F4342097B <- encrypted pass
         ^^ = second encrypted pass
etc
the calculations is simple.. first char in pass is calculated like this: magic buffer: 79 41 33 36 7A 41 34 38-64 45 68 66 72 76 67 68 yA36zA48dEhfrvgh 47 52 67 35 37 68 35 55-6C 44 76 33 00 00 00 00 GRg57h5UlDv3
0x4D XOR 0x79 (first char in magic buffer) = 0x34 0x34-0x03 (magic number) = 0x31 (1) that's the first char in our password
0x3F XOR 0x41 (second char in magic buffer) = 0x7E 0x7E-0x4D (first encrypted char) = 0x31 (1) second char of the pass
0x43 XOR 0x33 (third char in magic buffer, think you get it now ;) = 0x70 0x70-0x3F (second encrypted char) = 0x31 (1)
0x42 XOR 0x36 = 0x74 0x74-0x43=0x31 (1)
0x09 XOR 0x7A = 0x73 0x73-0x42=0x31 (1)
so the password is 111111 ... not that hard ;) NOTE if password is longer than 28 the pointer to the magic buffer=1 again and if a char is > 0xFF then do like this: 0x5B XOR 0x41 = 0x1A 0x1A-0xE8 = 0xFFFFFF32 (all wrong here :) 0xFFFFFF32-0xFFFFFF01 = 0x31 (1) right answer ;)
順便獻醜一下,貼出小弟把明碼轉成密碼的方法。
char Enc_Pass[70] = "";    // global變數,存放密碼用
void FlashFXP( char *Pass )
{
        char Magic_Buf[] = "yA36zA48dEhfrvghGRg57h5UlDv3";
        char buf[] = "FF";
        int  Magic_Num = 0xFF;   // 偷個懶,將magic num定死為0xFF            strcpy( Enc_Pass, buf );
        for( size_t i = 0; i < strlen(Pass); i   )
        {
                if( Pass[i]   Magic_Num > 0xFF )
                        Magic_Num = (Pass[i] Magic_Num-0xFF)^Magic_Buf[i(];
                else
                        Magic_Num = (Pass[i] Magic_Num)^Magic_Buf[i(];
                sprintf(buf, "X", Magic_Num);
                strcat( Enc_Pass, buf );
        }
}

另好奇問一下,有哪位大大知道UltraFXP的編碼方式嗎? 我想把FlashFXP的站台檔轉成UltraFXP的站台檔. (
------
My Web: http://nelson.csie.us
My Blog: http://blog.nelson.csie.us
ericyu54
一般會員


發表:1
回覆:2
積分:0
註冊:2002-04-15

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-12-02 14:25:42 IP:210.243.xxx.xxx 未訂閱
String encrypt = "FF"; int Magic_Num = 0xFF; // 偷懶把MagicNumber寫死了:p 原作者將 Magic_Num 寫死了, 不太能套用, 我雞婆改寫一下: String encrypt = ""; int Magic_Num; if (StrLen(Pass) > 0) { Magic_Num = Pass[1] ^ 0x32; encrypt.cat_sprintf("X", Magic_Num); for( unsigned int i = 0; i < StrLen(Pass); i ) { /* 原作者的 bug 我已修正了, 試試看, 對你有幫助的 */ Magic_Num = ((Pass[i] Magic_Num) % 0x100)^FlashFXP_Key[i(]; encrypt.cat_sprintf("X", Magic_Num); } }
ericyu54
一般會員


發表:1
回覆:2
積分:0
註冊:2002-04-15

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-12-02 14:30:35 IP:210.243.xxx.xxx 未訂閱
對不起 Magic_Num = Pass[1] ^ 0x32; 是錯的.. 應該是 Magic_Num = Pass[0] ^ 0x32; 才對
系統時間:2024-05-03 15:50:42
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!