pouët.net

Go to bottom

Random line of code thread

category: code [glöplog]
Code:@panic ; oh god oh fuck ld hl,DS_TempSP ld a,[hl] inc l ld h,[hl] ld l,a ld sp,hl jp DevSound_StopMusic

actually 9 lines but whatever
added on the 2021-04-21 00:28:34 by DevEd DevEd
One-liner which plays DRM protected content from Audible using ffplay, ffprobe & rainbowcrack:
Code:ffplay -activation_bytes $(./rcrack . -h $(ffprobe $1 2>&1 | grep 'file checksum == ' | awk -F ' == ' '{print $2}') | grep 'hex:' | awk -F ':' '{print $2}') $1
added on the 2021-04-21 23:47:42 by pintcat pintcat
Oh and it's inAudible-NG's build of rainbowcrack I was referring to. It contains pre-generated rainbow tables to retrieve your Audible activation code.
added on the 2021-04-22 00:42:06 by pintcat pintcat
LODA assembly language where bitwise xor/and/or is tricky, but gcd is a builtin instruction. Here is the factorial function.
Code:; A000142: Factorial numbers: n! = 1*2*3*4*...*n. ; 1,1,2,6,24,120,720,5040,40320,362880,3628800 mov $1,1 lpb $0 mul $1,$0 sub $0,1 lpe
added on the 2021-04-22 13:18:48 by neoneye neoneye
Code:lea $180+PatchCodeSize_NTSC(a0),a2
added on the 2021-05-11 09:52:16 by StingRay StingRay
Code:#include <Windows.h> #include <set> int __stdcall WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { std::set<int> rates; DEVMODE mode, current; EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &current); int i = 0; while (EnumDisplaySettings(NULL, i++, &mode)) { if (mode.dmPelsWidth == current.dmPelsWidth && mode.dmPelsHeight == current.dmPelsHeight && mode.dmBitsPerPel == current.dmBitsPerPel) { rates.insert(mode.dmDisplayFrequency); } } char key = '1'; for (int rate : rates) { RegisterHotKey(NULL, rate, MOD_CONTROL | MOD_ALT | MOD_WIN, key++); } MSG msg; while (GetMessage(&msg, NULL, 0, 0) > 0) { if (msg.message == WM_HOTKEY) { int rate = static_cast<int>(msg.wParam); if (rates.count(rate)) { EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &current); current.dmDisplayFrequency = rate; ChangeDisplaySettings(&current, CDS_UPDATEREGISTRY); } } } return 0; }
added on the 2021-05-13 12:35:17 by Blueberry Blueberry
Code://https://stackoverflow.com/questions/277772/avoid-trailing-zeroes-in-print f //adapted from paxdiablo (removed truncating) char StringForDouble[50]; char *PointerInString; void PrintDouble(double number) { sprintf(StringForDouble,"%.10f",number); // convert number to string PointerInString=strchr(&StringForDouble[0],'.'); // find decimal point, if any if(PointerInString!=NULL) { PointerInString=strchr(&PointerInString[0],'\0'); // find end of string PointerInString--; while(PointerInString[0]=='0') { // remove trailing zeros PointerInString[0]='\0'; PointerInString--; } if (PointerInString[0]=='.') { PointerInString[0]='\0'; } // if all decimals were zeros, remove "." } fprintf(filep,"%s",&StringForDouble[0]); }
added on the 2021-05-26 19:42:33 by baah baah
Code:int pos=(int(sin(y/80.0-n*10)*100+sin(-y/50.0+n-frameCount/23.0)*100+200)+frameCount *8)%256;
added on the 2021-05-27 07:21:07 by Marq Marq
When looking back at it this morning. Is it any better?
Code://https://stackoverflow.com/questions/277772/avoid-trailing-zeroes-in-print f //adapted from paxdiablo (removed truncating) char StringForDouble[50]; char *PointerInString; void PrintDouble (double number) { sprintf(StringForDouble,"%.10f",number); // convert number to string PointerInString=strchr(&StringForDouble[0],'.'); // find decimal point, if any if(PointerInString!=NULL) { PointerInString=strchr(&PointerInString[0],'\0'); // find end of string do{ PointerInString--; } while(PointerInString[0]=='0'); // remove trailing zeros if (PointerInString[0]=='.') { // if all decimals were zeros, remove "." PointerInString[0]='\0'; } else { PointerInString[1]='\0'; //otherwise put EOS after the first non zero char } } printf("%s",&StringForDouble[0]); }
added on the 2021-05-27 09:43:01 by baah baah
col -= foo(vec2(s*0.000000000000000000000674022 * uv.yx));
added on the 2021-05-27 19:50:50 by BSC BSC
Code:char I[1<<28];size_t K=0,H;long J,_,E;double O,L; size_t R(){return I[K++];} long ri(){for(L=_=1,J=0;H=R()-43,H<3&&(_=1-H)||H-5<10&&(J=J*10+ H-5,1);L*=10);return J;} double rf(){O=ri();E=_;H<4?O+=ri()/L:0;return(H-26<33?pow(10,ri()*_):1)*O*E;} int main() { fread(I,1,sizeof I,stdin); // use ri()*_ to read longs or rf() to read doubles }
Code:cmp.w C64TimerAValue(a6),d0
added on the 2021-05-29 12:24:16 by StingRay StingRay

login

Go to top