ODRLLicense::ODRLLicense(ODRLLicense& right) { //intiialize the attributes OlMemMan::construct(&m_ODRLStream); OlMemMan::construct(&m_Key); //now copy the attributes setBytes(right.m_ODRLStream); setKey(right.m_Key); }
bool bytesTest() { std::cout << "\nbytesTest:\n"; std::cout << "setBytes:\n"; BYTE a[4] = {0x8e, 0x73, 0xb0, 0xf7}; testUtils::printArray(a, 4, 4); std::cout << "\nresult is " << setBytes(a) << '\n'; std::cout << "getBytes:\n"; DWORD d = 0x6452c810; std::cout << "for 0x6452c810 result is\n"; getBytes(d, a); testUtils::printArray(a, 4, 4); std::cout << '\n'; return true; }
/* Handler de INT 80h */ void int_80(int systemCall, int fd, char *buffer, int count) { int i, j; if (systemCall == WRITE) //write { if (fd == STDOUT) //PANTALL { setBytes(vidmem + videoPos, buffer, count); } else if (fd == PIC1) _out(0x20, buffer[0]); } else if (systemCall == READ) //read { if (fd == KEYBOARD) buffer[0] = _in(0x60); } }
L2Game_CharacterDelete::L2Game_CharacterDelete( const unsigned char *bytes, unsigned int length ) { _initNull(); setBytes( bytes, length ); }
L2Game_CharDeleteSuccess::L2Game_CharDeleteSuccess( const unsigned char *bytes, unsigned int length ) { _initNull(); setBytes( bytes, length ); }
//----------------------------------------------------------------------------- void CCSDS::PACKET::Packet::setAbsTime(size_t p_bytePos, uint32_t p_timeCode, const UTIL::AbsTime& p_time) throw(UTIL::Exception) //----------------------------------------------------------------------------- { // convert from AbsTime time to CUC time CCSDS::CUC::Time cucTime = CCSDS::CUC::convert(p_time, (CCSDS::CUC::TimeCode) p_timeCode); // write only relevant bytes into buffer switch(p_timeCode) { case CCSDS::CUC::L1_TIME_4_0: setBytes(p_bytePos, 5, &cucTime); break; case CCSDS::CUC::L1_TIME_4_1: setBytes(p_bytePos, 6, &cucTime); break; case CCSDS::CUC::L1_TIME_4_2: setBytes(p_bytePos, 7, &cucTime); break; case CCSDS::CUC::L1_TIME_4_3: setBytes(p_bytePos, 8, &cucTime); break; case CCSDS::CUC::L2_TIME_4_0: setBytes(p_bytePos, 5, &cucTime); break; case CCSDS::CUC::L2_TIME_4_1: setBytes(p_bytePos, 6, &cucTime); break; case CCSDS::CUC::L2_TIME_4_2: setBytes(p_bytePos, 7, &cucTime); break; case CCSDS::CUC::L2_TIME_4_3: setBytes(p_bytePos, 8, &cucTime); break; case CCSDS::CUC::T1_TIME_4_0: setBytes(p_bytePos, 4, &cucTime.m_tCoarse0); break; case CCSDS::CUC::T1_TIME_4_1: setBytes(p_bytePos, 5, &cucTime.m_tCoarse0); break; case CCSDS::CUC::T1_TIME_4_2: setBytes(p_bytePos, 6, &cucTime.m_tCoarse0); break; case CCSDS::CUC::T1_TIME_4_3: setBytes(p_bytePos, 7, &cucTime.m_tCoarse0); break; case CCSDS::CUC::T2_TIME_4_0: setBytes(p_bytePos, 4, &cucTime.m_tCoarse0); break; case CCSDS::CUC::T2_TIME_4_1: setBytes(p_bytePos, 5, &cucTime.m_tCoarse0); break; case CCSDS::CUC::T2_TIME_4_2: setBytes(p_bytePos, 6, &cucTime.m_tCoarse0); break; case CCSDS::CUC::T2_TIME_4_3: setBytes(p_bytePos, 7, &cucTime.m_tCoarse0); break; default: throw UTIL::Exception("invalid time code for CUC time"); } }
TxMessage::TxMessage(unsigned char arr[]) : Message() { bytes = new unsigned char[TX_SIZE]; setBytes(arr); }
ByteSize::ByteSize(qint64 units, ByteSize unitSize) { setBytes(units * unitSize.bytes()); }
ByteSize::ByteSize(qint64 units, qint64 unitSize) { setBytes(units * unitSize); }
ByteSize::ByteSize(qint64 bytes) { setBytes(bytes); }
ByteSize::ByteSize() { setBytes(0); }
bool shiftRows_test() { std::cout << "\nshiftRows_test:\n"; BYTE a[4][4] = { {1, 2, 3, 4}, {5, 6, 7, 8}, {9, 10, 11, 12}, {13, 14, 15, 16}, }; DWORD d[4] = { setBytes(a[0]), setBytes(a[1]), setBytes(a[2]), setBytes(a[3]), }; testUtils::printArray(a); BYTE arrState[4][c_bBlockSize] = {0}; setToState(d, arrState); std::cout << "\nshiftRows\n"; shiftRows(arrState); getFromState(d, arrState); a[0][0] = getByte(d[0], 0); a[0][1] = getByte(d[0], 1); a[0][2] = getByte(d[0], 2); a[0][3] = getByte(d[0], 3); a[1][0] = getByte(d[1], 0); a[1][1] = getByte(d[1], 1); a[1][2] = getByte(d[1], 2); a[1][3] = getByte(d[1], 3); a[2][0] = getByte(d[2], 0); a[2][1] = getByte(d[2], 1); a[2][2] = getByte(d[2], 2); a[2][3] = getByte(d[2], 3); a[3][0] = getByte(d[3], 0); a[3][1] = getByte(d[3], 1); a[3][2] = getByte(d[3], 2); a[3][3] = getByte(d[3], 3); testUtils::printArray(a); std::cout << "\ninvShiftRows\n"; invShiftRows(arrState); getFromState(d, arrState); a[0][0] = getByte(d[0], 0); a[0][1] = getByte(d[0], 1); a[0][2] = getByte(d[0], 2); a[0][3] = getByte(d[0], 3); a[1][0] = getByte(d[1], 0); a[1][1] = getByte(d[1], 1); a[1][2] = getByte(d[1], 2); a[1][3] = getByte(d[1], 3); a[2][0] = getByte(d[2], 0); a[2][1] = getByte(d[2], 1); a[2][2] = getByte(d[2], 2); a[2][3] = getByte(d[2], 3); a[3][0] = getByte(d[3], 0); a[3][1] = getByte(d[3], 1); a[3][2] = getByte(d[3], 2); a[3][3] = getByte(d[3], 3); testUtils::printArray(a); return true; }
L2Game_NewCharacterSuccess::L2Game_NewCharacterSuccess( const unsigned char *bytes, unsigned int length ) { _initNull(); setBytes( bytes, length ); }