Guest User

Untitled

a guest
Feb 27th, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. <?php
  2. /*
  3. *
  4. * @ This file is created by http://DeZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 3.5.0.0
  8. * @ Author : DeZender
  9. * @ Release on : 22.06.2018
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. $type = (!empty($_GET['gatepay']) ? $_GET['gatepay'] : '');
  15. $action = (!empty($_GET['action']) ? $_GET['action'] : '');
  16. $root_dir = $_SERVER['DOCUMENT_ROOT'];
  17. $ketnoi = mysqli_connect($dbhost, $dbusername, $dbpassword, $dbname) or exit('Kiem tra lai thong tin mysql');
  18. mysqli_set_charset($ketnoi, 'utf8');
  19.  
  20. try {
  21. $db = new PDO('mysql:host=localhost;dbname=' . $dbname, $dbusername, $dbpassword);
  22. $db->exec('set names utf8');
  23. } catch (PDOException $e) {
  24. exit('Loi ket noi');
  25. }
  26.  
  27. if (file_exists($root_dir . '/key_gatepay.txt')) {
  28. $getkey = fopen($root_dir . '/key_gatepay.txt', 'r');
  29. $key = fread($getkey, filesize($root_dir . '/key_gatepay.txt'));
  30. $data_send = array('key' => $key);
  31. $curl = curl_init();
  32. curl_setopt_array($curl, array(CURLOPT_URL => 'https://api.gatepay.vn/api/license/active-license', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => json_encode($data_send), CURLOPT_HTTPHEADER => array('Content-Type: application/json', 'Accept' => 'application/json')));
  33. $response = curl_exec($curl);
  34. curl_close($curl);
  35. $data = json_decode($response, true);
  36.  
  37. if ($data['status'] == 200) {
  38. function get_rkey($length)
  39. {
  40. $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
  41. $size = strlen($chars);
  42. $str = '';
  43.  
  44. for ($i = 0; $i < $length; $i++) {
  45. $str .= $chars[rand(0, $size - 1)];
  46. }
  47.  
  48. return $str;
  49. }
  50.  
  51. function encryptDecrypt($data, $key, $mode = 'ENCRYPT')
  52. {
  53. if (strlen($key) < 32) {
  54. $key = str_pad($key, 32, 'x');
  55. }
  56.  
  57. $key = substr($key, 0, 32);
  58. $iv = pack('C*', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  59.  
  60. if ($mode === 'ENCRYPT') {
  61. return base64_encode(openssl_encrypt($data, 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv));
  62. }
  63.  
  64. return openssl_decrypt(base64_decode($data), 'AES-256-CBC', $key, OPENSSL_RAW_DATA, $iv);
  65. }
  66.  
  67. function get_microtime()
  68. {
  69. return floor(microtime(true) * 1000);
  70. }
  71.  
  72. function get_checksum($data, $type)
  73. {
  74. $checkSumSyntax = $data['phone'] . get_microtime() . '000000' . $type . get_microtime() / 1000000000000 . 'E12';
  75.  
  76. return encryptDecrypt($checkSumSyntax, encryptDecrypt($data['setupkey'], $data['ohash'], 'DECRYPT'));
  77. }
  78.  
  79. function get_pHash($data)
  80. {
  81. $pHashSyntax = $data['imei'] . '|' . $data['password'];
  82.  
  83. return encryptDecrypt($pHashSyntax, encryptDecrypt($data['setupkey'], $data['ohash'], 'DECRYPT'));
  84. ............................................................................
  85. ..............................................
  86. .................
Add Comment
Please, Sign In to add comment