yocky12k

Bruteforce StringFog

Jun 12th, 2024
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.07 KB | None | 0 0
  1. <?php
  2. function dec($str1, $str2) {
  3.     $bytes1 = base64_decode($str1);
  4.     $bytes2 = base64_decode($str2);
  5.     $length = strlen($bytes1);
  6.     $length2 = strlen($bytes2);
  7.     $result_bytes = '';
  8.     for ($i = 0; $i < $length; $i++) {
  9.         $result_bytes .= $bytes1[$i] ^ $bytes2[$i % $length2];
  10.     }
  11.     return $result_bytes;
  12. }
  13. function parseAllFunctionCalls($text) {
  14.     // Mencari semua pola a.a("string1", "string2") di dalam teks
  15.     preg_match_all('/a\.a\("([^"]+)",\s*"([^"]+)"\)/', $text, $matches, PREG_SET_ORDER);
  16.    
  17.     $results = [];
  18.     foreach ($matches as $match) {
  19.         if (count($match) === 3) {
  20.             $results[] = [$match[1], $match[2]];
  21.         }
  22.     }
  23.    
  24.     return $results;
  25. }
  26.  
  27. // Contoh penggunaan
  28. $text = <<<EOT
  29. Isi program codingan java
  30. EOT;
  31.  
  32. $parsedArrays = parseAllFunctionCalls($text);
  33.  
  34. foreach ($parsedArrays as $parsedArray) {
  35.     echo "Array 1: " . $parsedArray[0] . "\nArray 2: " . $parsedArray[1] . "\n";
  36.     echo "Hasil Dec: ".dec($parsedArray[0], $parsedArray[1])."\n";
  37.     echo str_repeat('~',55)."\n";
  38. }
  39. ?>
  40.  
Add Comment
Please, Sign In to add comment