|
SASC-NG
DVBSoftCAM
|
#include <alloca.h>Go to the source code of this file.
Classes | |
| class | cLineBuff |
| class | cSimpleItem |
| class | cSimpleListBase |
| class | cSimpleList< T > |
Defines | |
| #define | WORD(buffer, index, mask) (((buffer[(index)]<<8) + buffer[(index)+1]) & mask) |
| #define | SCT_LEN(sct) (3+(((sct)[1]&0x0f)<<8)+(sct)[2]) |
| #define | MBC(a, b) (((a)<<8)+(b)) |
| #define | ADDC3(ab, c) ((ab)+((c)<<16)) |
| #define | MBC3(a, b, c) ADDC3(MBC((a),(b)),(c)) |
| #define | C2(x) (((x)>>8)&0xFF) |
| #define | C3(x) (((x)>>16)&0xFF) |
| #define | C2MASK 0xFFFF |
| #define | AUTOARRAY(type, size) (type *)alloca(sizeof(type)*(size)) |
| #define | AUTOMEM(size) (unsigned char *)alloca(size) |
| #define | KeyStr(str, key) HexStr(str,key,8) |
| #define | Bin2Int(mem, len) ((int)Bin2LongLong((mem),(len))) |
Functions | |
| const char * | HexStr (char *str, const unsigned char *mem, int len) |
| void | SetSctLen (unsigned char *data, int len) |
| int | GetHex (const char *&line, unsigned char *store, int count, bool fixedLen=true) |
| int | GetHexAsc (const char *&line, unsigned char *store, int count) |
| int | GetChar (const char *&line, int *store, int count) |
| unsigned long long | Bin2LongLong (unsigned char *mem, int len) |
| bool | CheckNull (const unsigned char *data, int len) |
| bool | CheckFF (const unsigned char *data, int len) |
| unsigned char | XorSum (const unsigned char *mem, int len) |
| unsigned int | crc32_le (unsigned int crc, unsigned char const *p, int len) |
| char * | bprintf (const char *fmt,...) __attribute__((format(printf |
| #define ADDC3 | ( | ab, | |
| c | |||
| ) | ((ab)+((c)<<16)) |
Definition at line 31 of file misc.h.
Referenced by cPlainKeySeca::Parse(), cPlainKeyNagra::Parse(), cSystemNagra::ProcessECM(), and cSystemNagra::ProcessEMM().
| #define AUTOARRAY | ( | type, | |
| size | |||
| ) | (type *)alloca(sizeof(type)*(size)) |
Definition at line 38 of file misc.h.
Referenced by cRC6::SetKey(), cCaDescr::ToString(), and cEcmData::ToString().
| #define AUTOMEM | ( | size | ) | (unsigned char *)alloca(size) |
Definition at line 39 of file misc.h.
Referenced by cCardCryptoworks::Assemble(), cProviderViaccess::Assemble(), BN_complement(), cSmartCardViaccess::Decode(), cCryptoworks::DecryptRSA(), cBN::GetLE(), cPlainKeySeca::Parse(), cSmartCardDataNagra::Parse(), cPlainKeyCryptoworks::Parse(), cEcmData::Parse(), cBNKey::Print(), cSystemSeca::ProcessECM(), cSystemNagra::ProcessECM(), cCardClientCCcam2::ProcessECM(), cCardClientCCcam::ProcessECM(), cCardClientCommon::ProcessECM(), cSystemSeca::ProcessEMM(), cSystemIrd2::ProcessEMM(), cSystemIrd::ProcessEMM(), cCardClientCommon::ProcessEMM(), cCardClientAroureos::ProcessEMM(), cBN::Put(), cCardClientCamd35::SendBlock(), cCardClientCommon::SendMsg(), cSmartCardViaccess::Update(), and cSmartCardSlot::Write().
| #define Bin2Int | ( | mem, | |
| len | |||
| ) | ((int)Bin2LongLong((mem),(len))) |
Definition at line 52 of file misc.h.
Referenced by cSmartCardViaccess::Init(), cSmartCardCryptoworks::Init(), cPlainKeyVia::Parse(), cPlainKeySeca::Parse(), cPlainKeyNagra::Parse(), cPlainKeyIrd::Parse(), cPlainKeyCryptoworks::Parse(), cPlainKeyConstCw::Parse(), cPlainKeyStd::Parse(), and cPlainKeyDummy::Parse().
| #define C2 | ( | x | ) | (((x)>>8)&0xFF) |
Definition at line 33 of file misc.h.
Referenced by cPlainKeySeca::Parse(), and cPlainKeyNagra::PrintKeyNr().
| #define C2MASK 0xFFFF |
Definition at line 35 of file misc.h.
Referenced by cPlainKeySeca::IsBNKey(), cPlainKeyNagra::IsBNKey(), and cPlainKeyNagra::PrintKeyNr().
| #define C3 | ( | x | ) | (((x)>>16)&0xFF) |
Definition at line 34 of file misc.h.
Referenced by cPlainKeyVia::PrintKeyNr(), and cPlainKeySeca::PrintKeyNr().
| #define KeyStr | ( | str, | |
| key | |||
| ) | HexStr(str,key,8) |
Definition at line 44 of file misc.h.
Referenced by cSystemIrd::ProcessEMM(), and cIrdCardInfos::Update().
Definition at line 30 of file misc.h.
Referenced by Emm(), cPlainKeySeca::IsBNKey(), cPlainKeyNagra::IsBNKey(), cPlainKeyNagra::Parse(), cN2Prov4101::PostProcAU(), cSystemSeca::ProcessECM(), cSystemNagra2::ProcessECM(), cSystemNagra2::ProcessEMM(), and cSystemNagra::ProcessEMM().
Definition at line 32 of file misc.h.
Referenced by cTpsKeys::GetV2Key(), cPlainKeyVia::Parse(), cPlainKeyVia::PrintKeyNr(), cSystemNagra::ProcessECM(), cSystemSeca::ProcessEMM(), cSystemNagra::ProcessEMM(), cPlainKeyVia::SetBinKey(), and cPlainKeyVia::SetKey().
| #define SCT_LEN | ( | sct | ) | (3+(((sct)[1]&0x0f)<<8)+(sct)[2]) |
Definition at line 28 of file misc.h.
Referenced by cCardCryptoworks::Assemble(), cProviderViaccess::Assemble(), cSmartCard::CheckSctLen(), cSmartCardViaccess::Decode(), cSmartCardIrdeto::Decode(), main(), cParseNDS::PayloadSize(), cTpsAuHook::Process(), cEcmHandler::Process(), cLogger::Process(), cHookManager::Process(), cSystemViaccess::ProcessECM(), cSystemSeca::ProcessECM(), cSystemFakeNDS::ProcessECM(), cSystemNagra2::ProcessECM(), cSystemIrd2::ProcessECM(), cSystemCryptoworks::ProcessECM(), cCardClientRadegast::ProcessECM(), cCardClientNewCamd::ProcessECM(), cCardClientGbox::ProcessECM(), cCardClientCCcam2::ProcessECM(), cSystemCardClient::ProcessECM(), cCardClientCamd35::ProcessECM(), cCardClientCommon::ProcessECM(), cCardClientAroureos::ProcessECM(), cSystemViaccess::ProcessEMM(), cSystemNagra2::ProcessEMM(), cSystemNagra::ProcessEMM(), cSystemIrd2::ProcessEMM(), cSystemIrd::ProcessEMM(), cCardClientRadegast::ProcessEMM(), cCardClientNewCamd::ProcessEMM(), cCardClientCCcam2::ProcessEMM(), cCardClientCamd35::ProcessEMM(), cCardClientCommon::ProcessEMM(), cCardClientAroureos::ProcessEMM(), cSmartCardViaccess::Update(), and cSmartCardIrdeto::Update().
| #define WORD | ( | buffer, | |
| index, | |||
| mask | |||
| ) | (((buffer[(index)]<<8) + buffer[(index)+1]) & mask) |
Definition at line 27 of file misc.h.
Referenced by cSystem::CheckECM(), cSystem::CheckECMResult(), cSmartCardVideoGuard2::Init(), cLogChain::Parse(), cSystemViaccess::ParseCADescriptor(), cSystemScViaccess::ParseCADescriptor(), cSystem::ParseCADescriptor(), cSystem::ParseCAT(), cCardClientGbox::ProcessECM(), and cSystemIrd::ProcessEMM().
| unsigned long long Bin2LongLong | ( | unsigned char * | mem, |
| int | len | ||
| ) |
Definition at line 96 of file misc.c.
Referenced by cSmartCardViaccess::Init(), cSmartCardSeca::Init(), cProviderNDS::ProvId(), cProviderCryptoworks::ProvId(), and cProviderConax::ProvId().
| char* bprintf | ( | const char * | fmt, |
| ... | |||
| ) |
| bool CheckFF | ( | const unsigned char * | data, |
| int | len | ||
| ) |
Definition at line 109 of file misc.c.
Referenced by cCardClientCamd35::HandleEMMRequest().
{
while(--len>=0) if(data[len]!=0xFF) return false;
return true;
}
| bool CheckNull | ( | const unsigned char * | data, |
| int | len | ||
| ) |
Definition at line 103 of file misc.c.
Referenced by cShare::CheckAddProv(), cCardClientCamd35::HandleEMMRequest(), cCardClientCamd33::HandleEMMRequest(), cSmartCardConax::Init(), cCardClientNewCamd::Login(), cPlainKeyNagra::Parse(), cCardClientRadegast::ProcessECM(), cCardClientNewCamd::ProcessECM(), cCardClientCCcam2::ProcessECM(), cCardClientCamd35::ProcessECM(), cCardClientCommon::ProcessECM(), cCardClientAroureos::ProcessECM(), cSystemSeca::ProcessEMM(), cSystemIrd::ProcessEMM(), and cDeCSA::SetDescr().
{
while(--len>=0) if(data[len]) return false;
return true;
}
| unsigned int crc32_le | ( | unsigned int | crc, |
| unsigned char const * | p, | ||
| int | len | ||
| ) |
Definition at line 146 of file misc.c.
References CRCPOLY_LE, and i.
Referenced by cCardCryptoworks::Assemble(), cMsgCache::Get(), cCardClientCamd35::HandleEMMRequest(), cTpsKeys::ParseLinePlain(), cCardClientCamd35::ParseUserConfig(), cTpsKeys::PostSave(), cCardClientCamd35::RecvBlock(), cCardClientCamd35::SendBlock(), and cTpsKey::ToString().
{
crc^=0xffffffff; // zlib mod
while(len--) {
crc^=*p++;
for(int i=0; i<8; i++)
crc=(crc&1) ? (crc>>1)^CRCPOLY_LE : (crc>>1);
}
crc^=0xffffffff; // zlib mod
return crc;
}
| int GetChar | ( | const char *& | line, |
| int * | store, | ||
| int | count | ||
| ) |
Definition at line 44 of file misc.c.
References skipspace().
Referenced by cPlainKeyVia::Parse(), cPlainKeySeca::Parse(), cPlainKeyNagra::Parse(), cPlainKeyIrd::Parse(), cPlainKeyCryptoworks::Parse(), cPlainKeyConstCw::Parse(), cPlainKeyConax::Parse(), cPlainKeyStd::Parse(), and cPlainKeyDummy::Parse().
| int GetHex | ( | const char *& | line, |
| unsigned char * | store, | ||
| int | count, | ||
| bool | fixedLen = true |
||
| ) |
Definition at line 86 of file misc.c.
References GetHexBase().
Referenced by cCardClientNewCamd::Init(), cCardClientCCcam2::Init(), cViaccessCardInfo::Parse(), cPlainKeyVia::Parse(), cSecaCardInfo::Parse(), cPlainKeySeca::Parse(), cSmartCardDataVideoGuard2::Parse(), cSmartCardDataViaccess::Parse(), cSmartCardDataNagra::Parse(), cSmartCardDataIrdeto::Parse(), cSmartCardDataCryptoworks::Parse(), cSmartCardDataConax::Parse(), cPlainKeyNagra::Parse(), cIrdCardInfo::Parse(), cPlainKeyIrd::Parse(), cPlainKeyCryptoworks::Parse(), cPlainKeyConstCw::Parse(), cPlainKeyConax::Parse(), cPlainKeyStd::Parse(), cPlainKeyDummy::Parse(), cEcmData::Parse(), cCardClientCommon::ParseKeyConfig(), and cTpsKeys::ParseLinePlain().
{
return GetHexBase(line,store,count,fixedLen,false);
}
| int GetHexAsc | ( | const char *& | line, |
| unsigned char * | store, | ||
| int | count | ||
| ) |
Definition at line 91 of file misc.c.
References GetHexBase().
{
return GetHexBase(line,store,count/2,true,true)*2;
}
| const char* HexStr | ( | char * | str, |
| const unsigned char * | mem, | ||
| int | len | ||
| ) |
Definition at line 32 of file misc.c.
References i.
Referenced by cCardClientCamd35::HandleEMMRequest(), cSmartCardVideoGuard2::Init(), cSmartCardSeca::Init(), cSmartCardCryptoworks::Init(), cSmartCardConax::Init(), cCardClientNewCamd::Init(), cCardClientNewCamd::Login(), cTpsKeys::PostSave(), cBNKey::Print(), cHexKey::Print(), cSystemViaccess::ProcessEMM(), cSystemSeca::ProcessEMM(), cTpsKey::ToString(), cIrdCardInfo::ToString(), cEcmData::ToString(), and cIrdCardInfos::Update().
| void SetSctLen | ( | unsigned char * | data, |
| int | len | ||
| ) |
Definition at line 115 of file misc.c.
Referenced by cParseNDS::Assemble(), cCardCryptoworks::Assemble(), cProviderViaccess::Assemble(), cCardClientGbox::ProcessECM(), cCardClientCamd35::ProcessEMM(), and cRewriterNagraBeta::Rewrite().
| unsigned char XorSum | ( | const unsigned char * | mem, |
| int | len | ||
| ) |
Definition at line 121 of file misc.c.
References cs.
Referenced by cSmartCardSlotSerial::DevicePTS(), cTripleDes::PadMessage(), and cSmartCardSlot::ParseAtr().