void QWSSharedMemSurface::setPermanentState(const QByteArray &data) { int memId; int width; int height; int lockId; QImage::Format format; SurfaceFlags flags; const int *ptr = reinterpret_cast<const int*>(data.constData()); memId = ptr[0]; width = ptr[1]; height = ptr[2]; lockId = ptr[3]; format = QImage::Format(ptr[4]); flags = SurfaceFlags(ptr[5]); setSurfaceFlags(flags); setMemory(memId); setLock(lockId); #ifdef QT_QWS_CLIENTBLIT uchar *base = static_cast<uchar*>(mem.address()) + sizeof(uint); #else uchar *base = static_cast<uchar*>(mem.address()); #endif const int bpl = nextMulOf4(bytesPerPixel(format) * width); QWSMemorySurface::img = QImage(base, width, height, bpl, format); }
bool mutation_test() { uint32 memory_temp[1] = {0x0ABBCFF1}; setMemory(memory_temp, 1); uint32 result = kuuga(0); return (result == 0x0ABBCFF1); }
bool generated_and_test() { uint32 mem_temp[87] = { 0x1384c004, 0x1304d008, 0x1405000c, 0x1344b010, 0x12c50014, 0x12c4b018, 0x1304c01c, 0x1344d020, 0x1104c024, 0x1304d028, 0x1585602c, 0x1344b030, 0x12c56034, 0x12c4b038, 0x1304c03c, 0x1344d040, 0x118500d8, 0x10c4c048, 0x1304d04c, 0x14451050, 0x1344b054, 0x12c51058, 0x12c4b05c, 0x1304c060, 0x1344d064, 0x1104c068, 0x1304d06c, 0x14852070, 0x1344b074, 0x12c52078, 0x12c4b07c, 0x1304c080, 0x1344d084, 0x14c47088, 0x11c5308c, 0x11c47090, 0x13c510c0, 0x13c520cc, 0x1184709c, 0x11c530a0, 0x11c470a4, 0x10c470a8, 0x11c430ac, 0x11c470b0, 0x110470b4, 0x11c440b8, 0x11c470bc, 0x11445040, 0x150540c4, 0x14454094, 0x150540a4, 0x154550d0, 0x14855098, 0x154550a4, 0x10c430dc, 0x14c4b0e0, 0x12c430e4, 0x12c4b0e8, 0x110440ec, 0x1584b0f0, 0x12c440f4, 0x12c4b0f8, 0x140500fc, 0x14451100, 0x14852104, 0x14c53108, 0x00000001, 0xCFFFFFFF, 0x0000025F, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000021, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }; setMemory(mem_temp, 87); uint32 result = kuuga(67); return (result == 0x25F && memory[68] == 0x25F); }
bool generated_asr64_test() { uint32 mem_temp[93] = { 0x12c57004, 0x15c4a008, 0x15c5700c, 0x13858010, 0x16059014, 0x14050018, 0x1645a01c, 0x16850020, 0x1685a024, 0x16058028, 0x1645902c, 0x13058030, 0x16059034, 0x15856038, 0x1645a03c, 0x16856040, 0x1685a044, 0x16058048, 0x1645904c, 0x16c500e4, 0x12058054, 0x16059058, 0x1445105c, 0x1645a060, 0x16851064, 0x1685a068, 0x1605806c, 0x16459070, 0x13058074, 0x16059078, 0x1485207c, 0x1645a080, 0x16852084, 0x1685a088, 0x1605808c, 0x16459090, 0x14c57094, 0x15c53098, 0x15c5709c, 0x13c510cc, 0x13c520d8, 0x16c570a8, 0x15c530ac, 0x15c570b0, 0x120570b4, 0x15c480b8, 0x15c570bc, 0x130570c0, 0x15c4c0c4, 0x15c570c8, 0x1705c04c, 0x150540d0, 0x144540a0, 0x150540b0, 0x154550dc, 0x148550a4, 0x154550b0, 0x120480e8, 0x14c5a0ec, 0x168480f0, 0x1685a0f4, 0x1304c0f8, 0x1585a0fc, 0x1684c100, 0x1685a104, 0x14050108, 0x1445110c, 0x14852110, 0x14c53114, 0x00000001, 0x00000014, 0x00000022, 0x00000055, 0x00000750, 0x00000050, 0x00000008, 0x0000003f, 0x0000001F, 0x00000021, 0x80000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000001, 0x00000000 }; setMemory(mem_temp, 93); kuuga(0); return (memory[72] == 0x15); }
/* * push命令 * スタックフレーム + 現在のスタックポインタ + プッシュ回数分だけずらした位置にメモリを配置する。 */ void VMDriver::_push(){ size_t stackFrame = currentAssembly()->stackFrame(); Memory& m = this->createOrGetMemory(); Memory& set = getLocal( stackFrame + m_push + m_localAddr ); m_push++; setMemory( set , m ); }
void testCheckMem() { GameProperties testGame; testGame = getGame(NULL); setMemory(0); addMemory(10); sput_fail_unless(checkMem(10,testGame) == 1,"boundary Testing enough memory"); useMemory(testGame,10); sput_fail_unless(checkMem(50,testGame) == 0,"Testing not enough memory"); addMemory(100); sput_fail_unless(checkMem(100,testGame) == 1,"Testing enough memory"); setMemory(0); test_KillAnEnemy(); sput_fail_unless(getAvailableMemory() > 0, "Valid: More memory available after killing an enemy"); freeAllEnemies(); }
Player::Player() : stop_(false) #ifdef USE_HASH ,hash_(20) ,ehash_(20) #endif { setMemory(256); g_deltaPosCounter = new DeltaPosCounter; g_betweenMasks = new BetweenMask(g_deltaPosCounter); g_distanceCounter = new DistanceCounter; g_movesTable = new MovesTable; g_figureDir = new FigureDir; g_pawnMasks_ = new PawnMasks; for (int i = 0; i < sizeof(scontexts_)/sizeof(SearchContext); ++i) { #ifdef USE_HASH scontexts_[i].eval_.initialize(&scontexts_[i].board_, &ehash_); #else scontexts_[i].eval_.initialize(&scontexts_[i].board_, 0); #endif scontexts_[i].board_.set_MovesTable(g_movesTable); scontexts_[i].board_.set_FigureDir(g_figureDir); scontexts_[i].board_.set_DeltaPosCounter(g_deltaPosCounter); scontexts_[i].board_.set_DistanceCounter(g_distanceCounter); scontexts_[i].board_.set_BetweenMask(g_betweenMasks); scontexts_[i].board_.set_PawnMasks(g_pawnMasks_); } }
status_t BnQService::onTransact( uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags) { // IPC should be from mediaserver only IPCThreadState* ipc = IPCThreadState::self(); const int callerPid = ipc->getCallingPid(); const int callerUid = ipc->getCallingUid(); const bool permission = (callerUid == AID_MEDIA); switch(code) { case CONNECT: { CHECK_INTERFACE(IQService, data, reply); sp<IQClient> client = interface_cast<IQClient>(data.readStrongBinder()); connect(client); return NO_ERROR; } break; case SETMEM: { CHECK_INTERFACE(IQService, data, reply); sp<IMemory> sharedBuffer = interface_cast<IMemory>(data.readStrongBinder()); setMemory(sharedBuffer); return NO_ERROR; } break; default: return BBinder::onTransact(code, data, reply, flags); } }
/* * 否定演算 */ void VMDriver::_not(){ bool result = false; Memory& src = this->createOrGetMemory(); if( src.value == 0 ){ result = true; } setMemory( src , Memory( result , "" ) ); }
int32_t OTPassword::setMemory(const OTData& data) { const uint32_t dataSize = data.GetSize(); uint32_t returnedSize = dataSize; bool memorySet = setMemory(data.GetPointer(), returnedSize); // TODO maybe we should check for truncation? return memorySet; }
bool generated_divu_test() { uint32 mem_temp[7] = { 0x01805004, 0x00000001, 0x00000010, 0x00000025, 0x00000007, 0x80000000, 0x00000001 }; setMemory(mem_temp, 7); kuuga(0); return (memory[5] == 0x7FFFFFFF && memory[6] == 0x1); }
bool generated_atoi_test() { uint32 mem_temp[9] = { 0x01c08004, 0x02004008, 0x0200800c, 0x00000001, 0x00000050, 0x00000020, 0x00000025, 0x00000010, 0x00000000 }; setMemory(mem_temp, 9); kuuga(0); return (memory[4] == 0x60 && memory[7] == 0x10); }
bool generated_add_mp_test() { uint32 mem_temp[7] = { 0x01406004, 0x01804008, 0x0180600c, 0x00000001, 0x00000020, 0x00000025, 0x00000000 }; setMemory(mem_temp, 7); kuuga(0); return (memory[4] == 0x45 && memory[5] == 0x25); }
// --------------------------------------------------------- OTPassword::OTPassword(const void * vInput, uint32_t nInputSize, OTPassword::BlockSize theBlockSize/*=DEFAULT_SIZE*/) : m_nPasswordSize(0), m_bIsText(false), m_bIsBinary(true), m_bIsPageLocked(false), m_theBlockSize(theBlockSize) // The buffer has this size+1 as its static size. { setMemory(vInput, nInputSize); }
bool subleq_test() { uint32 mem_temp[4] = { 0x00803004, 0x00000001, 0x00000004, 0x00000005 }; setMemory(mem_temp, 4); uint32 result = kuuga(3); return (result == 0x00000001); }
// (FYI, truncates if nAppendSize + getPasswordSize() is larger than // getBlockSize.) // Returns number of bytes appended, or -1 for error. // int32_t OTPassword::addMemory(const void* vAppend, uint32_t nAppendSize) { OT_ASSERT(nullptr != vAppend); // const char * szFunc = "OTPassword::addMemory"; if (0 == nAppendSize) return 0; // If I'm currently at a 0 size, then call setMemory instead. // if (size_ == 0) return setMemory(vAppend, nAppendSize); // // By this point, I know I already have some memory allocated, // and I'm actually appending some other memory onto the end of it. // // Should already be set from the above setMemory call. OT_ASSERT(isBinary_); // Make sure total new size isn't larger than our block size // if ((nAppendSize + size_) > getBlockSize()) { // Truncated password beyond max size. nAppendSize = (getBlockSize() - size_); } // OT_ASSERT(nAppendSize >= 0); if (0 == nAppendSize) return 0; // By this point, I know nAppendSize is larger than 0, AND that appending it // onto the // existing memory of this object will not exceed the total allowed block // size. // // Because we use setMemory when empty, and only use addMemory when we KNOW // something // is already there, therefore we know the page is already locked, so no // need to go // trying to lock it again. OTPassword::safe_memcpy(static_cast<void*>(&(data_[size_])), nAppendSize, // dest size is based on the source // size, but guaranteed to be >0 and // <=getBlockSize vAppend, nAppendSize); // Since dest size is // known to be src size or // less (and >0) we use it // as src size. (We may // have truncated... and // we certainly don't want // to copy beyond our own // truncation.) size_ += nAppendSize; return nAppendSize; }
/* * 論理演算 && , || * logはLogic Operation(論理演算)から * 評価値 srcとdestのANDもしくはORの演算を行う。 * AND ... srcとdestが双方偽でないならば真 * OR ... srcとdestどちらかが偽でないならば真 */ void VMDriver::_log( int logType ){ bool result = 0; Memory& src = this->createOrGetMemory(); Memory& dest = this->createOrGetMemory(); switch( logType ){ case EMnemonic::LogOr : result = ( ( src != 0 ) || ( dest != 0 ) ); break; case EMnemonic::LogAnd : result = ( ( src != 0 ) && ( dest != 0 ) ); break; } setMemory( src , Memory( result , "" ) ); }
bool generated_sub_test() { uint32 mem_temp[11] = { 0x00c02004, 0x00000001, 0x000000054, 0x00000032, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }; setMemory(mem_temp, 11); uint32 result = kuuga(2); return (result == 0x22 && memory[3] == 0x00000032); }
bool generated_move_test() { uint32 mem_temp[14] = { 0x01405004, 0x0180d008, 0x0340500c, 0x0340d010, 0x00000001, 0x00000025, 0x00000032, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }; setMemory(mem_temp, 14); uint32 result = kuuga(5); return (result == 0x00000032); }
DataManager::DataManager() { Current_Slice_Index = 0; //setDataBase(); InitFile(); setMemory(); setDefaultValues(); ReadSEGYData(); //GetSurface(800); }
bool generated_int64eq_test() { uint32 mem_temp[16] = { 0x01809004, 0x02408008, 0x0240900c, 0x00000001, 0x0000000a, 0x0000000b, 0x0000000c, 0x00000567, 0xFFFFFFF7, 0x00000000 }; setMemory(mem_temp, 10); kuuga(0); return (memory[8] == 0x3); }
bool generated_add_test() { uint32 mem_temp[13] = { 0x01408004, 0x02004008, 0x0200800c, 0x00000001, 0x00000025, 0x00000032, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }; setMemory(mem_temp, 13); uint32 result = kuuga(4); return (result == 0x00000057 && memory[5] == 0x00000032); }
bool generated_utsa_var_args_test() { uint32 mem_temp[15] = { 0x0240c004, 0x0300e008, 0x0380c00c, 0x0380e010, 0x0300e014, 0x0380c018, 0x0380e01c, 0x0280c020, 0x00000001, 0x00000010, 0x00000020, 0x00000079, 0x00000004, 0x00000002, 0x00000000 }; setMemory(mem_temp, 15); kuuga(0); return (memory[12] == 0xFFFFFFB0); }
OTPassword::OTPassword(const void* vInput, uint32_t nInputSize, OTPassword::BlockSize theBlockSize) : size_(0) , isText_(false) , isBinary_(true) , isPageLocked_(false) , blockSize_(theBlockSize) // The buffer has this size+1 as its static size. { setMemory(vInput, nInputSize); }
bool add_test() { uint32 mem_temp[8] = { 0x00401010, 0x4F55AA32, 0xFFFFFFFF, 0xFFFFFFFA, 0x00C01014, 0x00402018, 0x0040101C, 0x00000001 }; setMemory(mem_temp, 8); uint32 result = kuuga(2); return (result == 0xFFFFFFF9 && memory[3] == 0xFFFFFFFA); }
bool generated_not_test() { uint32 mem_temp[16] = { 0x0200c004, 0x0280c008, 0x0200800c, 0x0300f010, 0x03c08014, 0x03c0f018, 0x0300c01c, 0x00000001, 0x00000025, 0x00000000, 0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }; setMemory(mem_temp, 16); uint32 result = kuuga(8); return (result == 0xFFFFFFDA); }
void setMemory(uint offset, char *buffer) { HINSTANCE hLib = LoadLibrary("CCAPI.DLL"); __cSetMemory setMemory = (__cSetMemory)GetProcAddress(hLib, "CCAPISetMemory"); __cNotify notifyPS3 = (__cNotify)GetProcAddress(hLib, "CCAPIVshNotify"); setMemory(0x1C1947C , "11"); // test //setMemory(offset, buffer); notifyPS3(PROGRESS, "Prestige changed !"); }
bool generated_asl64_test() { uint32 mem_temp[18] = { 0x0380f004, 0x03c10008, 0x0340d00c, 0x04011010, 0x0440d014, 0x04411018, 0x03c0f01c, 0x04010020, 0x02c0d024, 0x00000001, 0x00000025, 0x00000004, 0x00000013, 0x00000000, 0x00000020, 0x00000000, 0x00000000, 0x00000000 }; setMemory(mem_temp, 18); kuuga(0); return (memory[13] == 0x1C && memory[11] == 0x4); }
bool generated_copy_test() { uint32 mem_temp[13] = { 0x0240b004, 0x02c0a008, 0x02c0b00c, 0x03006010, 0x00000001, 0x00000006, 0x00000007, 0x00000010, 0x00000050, 0x0000000c, 0x00000050, 0x00000000, 0x00000001 }; setMemory(mem_temp, 13); kuuga(0); return (memory[6] == 0x6); }
OTPassword& OTPassword::operator=(const OTPassword& rhs) { if (rhs.isPassword()) { setPassword_uint8(rhs.getPassword_uint8(), rhs.getPasswordSize()); } else if (rhs.isMemory()) { setMemory(rhs.getMemory_uint8(), rhs.getMemorySize()); } return *this; }