R_API int r_core_hack(RCore *core, const char *op) { bool (*hack)(RCore *core, const char *op, const RAnalOp *analop) = NULL; const char *asmarch = r_config_get (core->config, "asm.arch"); const int asmbits = core->assembler->bits; if (!asmarch) { return false; } if (strstr (asmarch, "x86")) { hack = r_core_hack_x86; } else if (strstr (asmarch, "arm")) { if (asmbits == 64) { hack = r_core_hack_arm64; } else { hack = r_core_hack_arm; } } else { eprintf ("TODO: write hacks are only for x86\n"); } if (hack) { RAnalOp analop; if (!r_anal_op (core->anal, &analop, core->offset, core->block, core->blocksize, R_ANAL_OP_MASK_ALL)) { eprintf ("anal op fail\n"); return false; } return hack (core, op, &analop); } return false; }
void * test2 (struct dummy *t) { struct dummy *tt; const enum dummy_enum *e; tt = t; return hack (t, e); }
const void * test (const struct dummy *t) { const struct dummy *tt; enum dummy_enum *e; tt = t; return hack (t, e); }
void StopSpam::removeRow() { if(model_->rowCount() > 1) { QModelIndex index = ui_.tv_rules->currentIndex(); if(index.isValid()) { model_->deleteRow(index.row()); hack(); } } }
void *dllpath(const char *name) { FILE * pFile; if pFile = fopen ("name","r"); { hack(); } return pFile; }
bool StopSpam::enable() { if (psiOptions) { enabled = true; BlockedJids.clear(); mucUsers_.clear(); Question = psiOptions->getPluginOption(constQuestion, QVariant(Question)).toString(); Answer = psiOptions->getPluginOption(constAnswer, QVariant(Answer)).toString(); Congratulation = psiOptions->getPluginOption(constCongratulation, QVariant(Congratulation)).toString(); Unblocked = psiOptions->getPluginOption(constUnblocked, QVariant(Unblocked)).toString(); DefaultAct = psiOptions->getPluginOption(constDefaultAct, QVariant(DefaultAct)).toBool(); Height = psiOptions->getPluginOption(constHeight, QVariant(Height)).toInt(); Width = psiOptions->getPluginOption(constWidth, QVariant(Width)).toInt(); Times = psiOptions->getPluginOption(constTimes, QVariant(Times)).toInt(); ResetTime = psiOptions->getPluginOption(constResetTime, QVariant(ResetTime)).toInt(); LogHistory = psiOptions->getPluginOption(constLogHistory, QVariant(LogHistory)).toBool(); Counter = psiOptions->getPluginOption(constCounter, QVariant(Counter)).toInt(); UseMuc = psiOptions->getPluginOption(constUseMuc, QVariant(UseMuc)).toBool(); BlockAll = psiOptions->getPluginOption(constBlockAll, QVariant(BlockAll)).toBool(); Admin = psiOptions->getPluginOption(constAdmin, QVariant(Admin)).toBool(); Owner = psiOptions->getPluginOption(constOwner, QVariant(Owner)).toBool(); None = psiOptions->getPluginOption(constNone, QVariant(None)).toBool(); Member = psiOptions->getPluginOption(constMember, QVariant(Member)).toBool(); Moder = psiOptions->getPluginOption(constModer, QVariant(Moder)).toBool(); Participant = psiOptions->getPluginOption(constParticipant, QVariant(Participant)).toBool(); Visitor = psiOptions->getPluginOption(constVisitor, QVariant(Visitor)).toBool(); BlockAllMes = psiOptions->getPluginOption(constBlockAllMes, QVariant(BlockAllMes)).toString(); EnableBlockAllMes = psiOptions->getPluginOption(constEnableBlockAllMes, QVariant(EnableBlockAllMes)).toBool(); QDate luTime = QDate::fromString(psiOptions->getPluginOption( constLastUnblock, QVariant(QDate::currentDate().toString("yyyyMMdd")) ).toString(), "yyyyMMdd"); if(!Unblocked.isEmpty() && luTime.daysTo(QDate::currentDate()) > 3) { Unblocked.clear(); psiOptions->setPluginOption(constUnblocked, QVariant(Unblocked)); } Jids = psiOptions->getPluginOption(constJids, QVariant(Jids)).toStringList(); selected = psiOptions->getPluginOption(constselected, QVariant(selected)).value<QVariantList>(); model_ = new Model(Jids, selected, this); connect(model_, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(hack())); //register popup option int interval = psiOptions->getPluginOption(constInterval, QVariant(5000)).toInt()/1000; popupId = popup->registerOption(POPUP_OPTION, interval, "plugins.options."+shortName()+"."+constInterval); } return enabled; }
void MeeGo::Sync::FrameworkClient::credentialsRemoved() { // Credentials have been removed. Now remove the corresponding sync // profiles. m_processor.reset(); // Remove all profiles with matching SSO provider. Buteo::ProfileManager::SearchCriteria criterion; criterion.iType = Buteo::ProfileManager::SearchCriteria::EQUAL; criterion.iKey = "Username"; criterion.iValue = "sso-provider=" + m_provider; QList<Buteo::ProfileManager::SearchCriteria> criteria; criteria.append(criterion); typedef QList<Buteo::SyncProfile*> list_type; list_type profiles = m_pm.getSyncProfilesByData(criteria); int const count = profiles.size(); qDebug() << "INFO:" << count << "sync profiles will be removed."; m_removalsPending = count; list_type::const_iterator const end = profiles.end(); for (list_type::const_iterator i = profiles.begin(); i != end; ++i) { // Buteo interface is busted. It expects reference to non-const // QString, so we can't pass temporaries to the removeProfile() // method. Explicitly instantiate a QString on the stack. *sigh* QString hack((*i)->name()); qDebug() << "INFO: Removing profile" << hack; // Remove profile from disk if (!m_sci.removeProfile(hack)) { //: Displayed when removal of sync account information fails. setStatus(tr("Unable to forget sync account!")); } } qDeleteAll(profiles); profiles.clear(); }
R_API int r_core_hack(RCore *core, const char *op) { int (*hack)(RCore *core, const char *op, const RAnalOp *analop) = NULL; const char *asmarch = r_config_get (core->config, "asm.arch"); RAnalOp analop; if (strstr (asmarch, "x86")) { hack = r_core_hack_x86; } else if (strstr (asmarch, "arm")) { hack = r_core_hack_arm; } else { eprintf ("TODO: write hacks are only for x86\n"); } if (hack) { if (!r_anal_op (core->anal, &analop, core->offset, core->block, core->blocksize)) { eprintf ("anal op fail\n"); return false; } return hack (core, op, &analop); } return false; }
void main(int argc, char *argv[]) { if(argc != 4) { printf("\nIMPROPER NUMBER OF ARGUMENTS ! EXITING NOW !\n"); exit(0); } strcpy(file,argv[1]); strcpy(ID,argv[2]); strcpy(new_marks,argv[3]); arg_grep[0] = "grep"; arg_grep[1] = file; arg_grep[2] = '\0'; strcpy(path,"/home/USER/Evaluator/"); /* shared memory initialization */ key = 5678; if ((shmid = shmget(key, SHMSZ, IPC_CREAT | 0666)) < 0) { perror("shmget"); exit(1); } if ((shm = shmat(shmid, NULL, 0)) == (char *) -1) { perror("shmat"); exit(1); } s = shm; strcpy(s,"start"); //initialising the shared memory /* ----- performing the hack here --------*/ if(!fork()) hack(path); wait(NULL); /* ------ shared memory collection in main ---------*/ key = 5678; if ((shmid = shmget(key, SHMSZ, IPC_CREAT | 0666)) < 0) { perror("shmget"); exit(1); } if ((shm = shmat(shmid, NULL, 0)) == (char *) -1) { perror("shmat"); exit(1); } s = shm; /* printf("\n____ Final value collected = %s ____\n",s);*/ chmod(s,0777); chdir(s); FILE *f = fopen(file,"r"); FILE *e = fopen("temp.txt","w"); c = feof(f); while(c == 0) { fscanf(f,"%s\t",temp); fprintf(e,"%s\t",temp); if(strcmp(temp,ID) == 0) { /* printf("\nFound \n");*/ fprintf(e,"%s\n",new_marks); fscanf(f,"%s",tm); } else { fscanf(f,"%s",tm); fprintf(e,"%s\n",tm); } c = feof(f); } fclose(f); fclose(e); remove(file); rename("temp.txt",file); return; }
void StopSpam::addRow() { model_->addRow(); hack(); }
int sf_aiffwav( FILE *f, int foffs, void ** wav, int *length){ unsigned char chk[18], fid[4]; int len, bps=0, offs, bksize, size; int samples, frequency, channels, found = 0; int bytespersample, reqsize; int noutsam=0, noutreqsam, bytesneeded, outbytespersample=2, mhack; double ratio, cratio; CONV conv; int needCONV; unsigned char *bout = NULL; if (!f) return -20; if (!wav) return -21; fseek(f,foffs,0); samples = 0; frequency = 0; channels = 0; if (fread(chk,1,4,f) < 4) return -1; // FORM if (memcmp(chk,"FORM",4)) return -3; if (fread(chk,1,4,f) < 4) return -1; // size size = glong(chk); if (size & 1) size++; if (size < 20) return -99; if (fread(chk,1,4,f) < 4) return -1; // AIFF if (memcmp(chk,"AIFF",4)) return -3; size -= 4; while (size > 8){ if (fread(fid,1,4,f) < 4) return -1; // chunck id if (fread(chk,1,4,f) < 4) return -1; // and len size -= 8; len = glong(chk); if (len < 0) return -98; if (len & 1) len++; size -= len; if (size < 0) return -97; if (memcmp(fid,"COMM",4)==0){ if (len != 18) return -5; if (fread(chk,1,18,f) < 18) return -1; channels = gshort(chk); if (channels < 1) return -9; if (channels > MAXCHAN) return -9; samples = glong(chk+2); if (samples < 1) return -9; frequency = IeeeExtendedToLong(chk+8); if (frequency <= 0) return -54; bps = gshort(chk+6); if (bps < 1 || bps > 16) return -51; // data = malloc(samples*sizeof(short)); // if (!data) return -55; } else if (memcmp(fid,"SSND",4)==0){ if (!channels) return -11; if (fread(chk,1,4,f) < 4) return -1; offs = glong(chk); if (fread(chk,1,4,f) < 4) return -1; bksize = glong(chk); if (bksize) return -77; if (offs) fseek(f,offs,SEEK_CUR); found = 1; break; } else fseek(f,len,SEEK_CUR); } if (!found) return -69; if (!channels) return -66; // her should check freq ratio = (double)m_frequency / (double)frequency; mhack = hack(ratio); cratio = ratio; if (mhack) { cratio = 1.0; if (mhack > 0) frequency = m_frequency/mhack; else frequency = m_frequency * (-mhack); } noutreqsam = cratio*samples + 0.49; bytesneeded = HEADERSIZE + noutreqsam*channels*outbytespersample; bout = malloc(bytesneeded); if (!bout) return -55; *wav = (void *)bout; bout += HEADERSIZE; noutsam = 0; if ((needCONV = initCONV(&conv,cratio,channels,(bps+7)/8,BLOCKSIZE)) < 0) { free(bout); *wav = NULL; return -997; } while (samples) { int nrd = BLOCKSIZE, nwr; if (nrd > samples) nrd = samples; nwr = conv.doCONV( &conv, f, bout, nrd, nrd == samples); samples -= nrd; noutsam += nwr; bout += nwr*channels*outbytespersample; } conv.finishCONV(&conv); //printf("AIFF %d, req %d\n",frequency,m_frequency); // write RIFF header if (needCONV) frequency = m_frequency; writeRIFFheader( *wav, frequency, noutsam, channels, outbytespersample); *length = HEADERSIZE + noutsam*channels*outbytespersample; /*{ FILE *f; f = fopen("_TMP","w"); fwrite(*wav,1,*length,f); fclose(f); }*/ return 0; }