Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int[int] m;
- file_to_map("mt_rand 1 to 170 first 1000000 seeds.txt",m);
- int c;
- boolean b;
- void butt(int d, int[int] x ,int r){
- //clear(m);
- print("seeds where mt_rand 1 to 170 is "+r+":");
- for i from 1 to (500000){
- if((m[i]) == r){
- c = 0;
- b = true;
- for j from 0 to (count(x)-1){
- b = b && (m[i+c] == m[i+c+x[j]]);
- c += x[j];
- }
- if(b){
- print(i+" = "+d+" * " + (i/d) + " + " + (i%d) );
- //abort("we did it");
- }
- }
- }
- print("====================");
- /*
- print("seeds where glibc rand 0 to 2147483647 is "+r+":");
- file_to_map("glibc rand 0 to 2147483647 first 1000000 seeds mod 170 plus 1.txt",m);
- for i from 1 to (500000){
- if((m[i]) == r){
- c = 0;
- b = true;
- for j from 0 to (count(x)-1){
- b = b && (m[i+c] == m[i+c+x[j]]);
- c += x[j];
- }
- if(b){
- print(i+" = "+d+" * " + (i/d) + " + " + (i%d) );
- abort("we did it");
- }
- }
- }
- print("====================");
- */
- /*
- print("seeds where mt_rand mod 170 is "+r+":");
- clear(m);
- file_to_map("mt_rand mod 170.txt",m);
- for i from 1 to (500000){
- if((m[i]+1) == r){
- c = 0;
- b = true;
- for j from 0 to (count(x)-1){
- b = b && (m[i+c] == m[i+c+x[j]]);
- c += x[j];
- }
- if(b){
- print(i+" = "+d+" * " + (i/d) + " + " + (i%d) );
- abort("we did it.");
- }
- }
- }
- print("====================");
- */
- }
- //152 = 19*2^3
- //245 = 5*7*7
- int[int] but = {152*3,245*3,451*3};
- /*these have precisely the first enchantment for class 1 path 1.
- 532 804245262
- 777 697647321
- 1331 718230343
- 3066 401867098
- 4667 933430014
- 6959 195097050
- 8180 121809700
- with differences:
- 245
- 554
- 1735
- 1601
- 2292
- 1221
- */
- /*these have precisely the second enchantment for class 1 path 1.
- 94 606216746
- 1275 121934420
- 2839 122462796
- 3519 767266958
- 4191 851515177
- 4472 218609014
- 6041 452627138
- 9839 880434260
- with differences:
- 1181
- 1564
- 680
- 672
- 281
- 1569
- 3798
- */
- /* items with precisely first modifier for class 2 sign 1
- 191
- 1779
- 3508
- 4442
- 7541
- 9576
- */
- /* items with precisely first modifier for class 3 sign 1
- 696
- 1933
- 2835
- 2959
- 3314
- 4180
- 4265
- */
- /* items with precisely first modifier for class 1 sign 2
- 3093
- 4751
- 4958
- 5956
- 6929
- 7752
- */
- /* items with precisely first modifier for class 3 sign 4
- 149
- 2892
- 4590
- 4681
- */
- for ii from 50 to 50{
- //but = {152*ii,245*ii,451*ii,103*ii};
- //but = {245*ii,554*ii,1735*ii,1601*ii,2292*ii,1221*ii};
- //but = {1181*ii,1564*ii,680*ii,672*ii,281*ii,1569*ii,3798*ii};
- //but = {245*ii,554*ii,1735*ii,1601*ii,2292*ii,1221*ii};
- //but = {(1779-191)*ii,(3508-1779)*ii,(4442-3508)*ii,(7541-4442)*ii,(9576-7541)*ii};
- //but = {(1933-696)*ii,(2835-1933)*ii,(2959-2835)*ii,(3314-2959)*ii,(4180-3314)*ii,(4265-4180)*ii};
- //but = {(4751-3093)*ii,(4958-4751)*ii,(5956-4958)*ii,(6929-5956)*ii,(7752-6929)*ii};
- but = {(2892-149)*ii,(4590-2892)*ii,(4681-4590)*ii};
- print(ii);
- for i from 1 to 170{
- //butt(532,but,i);
- //butt(3093,but,i);
- butt(149,but,i);
- }
- }
- //success for but = {1520,2450,4510}:
- //seeds where glibc rand 0 to 2147483647 is 3:
- //13841 = 380 * 36 + 161
- //thus seeds for items 380, 532, 777, and 1228 are 13841, 15361, 17811, and 22321 respectively for seal clubber under mongoose?
- //this is likely a false positive; the pattern doesn't hold for the next item in the sequence.
- //I think the reason is that some of the items had multiple modifiers. we'll exclude those in future tests.
- //success for but = {12250,27700,86750,80050,114600,61050}:
- //seeds where mt_rand 1 to 170 is 168:
- //138955 = 532 * 261 + 103
- /*thus seeds for items
- 532
- 777
- 1331
- 3066
- 4667
- 6959
- 8180
- are
- 138955
- 151205
- 178905
- 265655
- 345705
- 460305
- 521355
- respectively.
- */
- //horrifyingly, that suggests 18 + 50*itemID + 112337 as the argument for mt_srand().
- //but = {1181*ii,1564*ii,680*ii,672*ii,281*ii,1569*ii,3798*ii} produces this, too:
- //seeds where mt_rand 1 to 170 is 167:
- //117055 = 94 * 1245 + 25
- //which has an identical seeding function, thus we really did it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement