2013-02-27 32 views
0

我想從可執行文件中獲取加密方法。我已解包並開始使用IDA Pro進行分析。推送在程序中的偏移量?

我遇到了一個我無法以任何方式理解的代碼。以下是asm代碼塊。

___:00A11B6F 008     mov  eax, [ebp+DecryptedBytes] 
___:00A11B72 008     push eax 
___:00A11B73 00C     push 100h 
___:00A11B78 010     push offset CI_StrCmp 
___:00A11B7D 014     mov  ecx, [ebp+LengthValueOfBytes] 
___:00A11B80 014     push ecx 
___:00A11B81 018     mov  edx, [ebp+Bytes] 
___:00A11B84 018     add  edx, 4 
___:00A11B87 018     push edx 
___:00A11B88 01C     call rijndaelDecrypt 

而且僞的是這樣的:

*(_DWORD *)DecryptResult = rijndaelDecrypt(Bytes + 4, LengthValueOfBytes, (int)CI_StrCmp, 0x100u, DecryptedBytes); 

CI_StrCmp是不區分大小寫字符串比較器功能。 rijndaelDecrypt函數讀取該參數的16個字節。我認爲這是一個關鍵。

以下是rijndaelDecrypt函數。

void *__cdecl rijndaelDecrypt(int Bytes, unsigned int Length, int Key, unsigned int BitSize, int a5) 
{ 
    void *DecryptedBytes; // [email protected] 
    void *result; // [email protected] 
    unsigned int v7; // [sp+Ch] [bp-118h]@2 
    unsigned int v8; // [sp+10h] [bp-114h]@2 
    unsigned int v9; // [sp+14h] [bp-110h]@2 
    unsigned int v10; // [sp+18h] [bp-10Ch]@2 
    char v11; // [sp+1Ch] [bp-108h]@1 

    DecryptedBytes = malloc_2(Length); 
    memset(&v11, 0, 0x108u); 
    if ((signed int)BitSize >= 16) 
    { 
    v7 = *(_DWORD *)Key; 
    v8 = *(_DWORD *)(Key + 4); 
    v9 = *(_DWORD *)(Key + 8); 
    v10 = *(_DWORD *)(Key + 12); 
    } 
    else 
    { 
    v7 = 0x12121212u; 
    v8 = 0x12121212u; 
    v9 = 0x12121212u; 
    v10 = 0x12121212u; 
    memcpy(&v7, (const void *)Key, BitSize); 
    } 
    if (rijndaelSetupDecrypt((int)&v7, 16, (int)&v11) == 1) 
    { 
    sub_A125B0(Bytes, Length, DecryptedBytes, (int)&v11, a5); 
    result = DecryptedBytes; 
    } 
    else 
    { 
    result = 0; 
    } 
    return result; 
} 

我的問題是將程序的偏移量發送到另一個程序的含義是什麼。對我來說完全是無稽之談。

p.s.對不起,我的英語不好。

回答

0

好吧,我得到它..他們使用CL_StrCmp(1)的實際代碼作爲密鑰(2)來進行解密。 代碼由版權保護,爲了讓您在自己的程序中解密數據,您必須包含代碼爲CL_StrCmp,因此您侵犯了他們的版權 - IE違法。

(1)函數的實際編譯指令。

(2)認爲public \ private key。

0

如果你的意思是「發送偏移過程的」你的意思是這個說法push offset CI_StrCmp

它傳遞的strcmp函數的地址到解密程序,以便解密可以調用它。

我猜解密的函數原型是這樣的......

DWORD rijndaelDecrypt (const void *pData, size_t SizeOfData, int CmpFuncAddress, int Value, DWORD *pDecryptCount); 

更準確地說它應該是這樣的......

typedef int COMPARE_FUNCTION (const char *, const char *); 
DWORD rijndaelDecrypt (const void *pData, size_t SizeOfData, COMPARE_FUNCTION *, int Value, DWORD *pDecryptCount); 
+0

Nop。 3.參數必須是字節數組,並且數組的長度必須等於或大於16。 – turksauron 2013-02-27 20:45:39