mirror of
https://github.com/amnezia-vpn/config-decoder.git
synced 2026-10-13 21:35:08 +00:00
[GH-ISSUE #1] дешифровщик строки впн под пхп #1
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amnezia-vpn/config-decoder#1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zak20090 on GitHub (Oct 23, 2024).
Original GitHub issue: https://github.com/amnezia-vpn/config-decoder/issues/1
как переписать дешифровщик строки впн под пхп?
`
// Step 1: Remove the "vpn://" prefix
$data = str_replace("vpn://", "", $input);
echo "Step 1: Data after removing 'vpn://':\n";
echo $data . "\n\n";
// Step 2: Base64 decode the data (convert URL-safe Base64 to standard Base64)
$data = str_replace(['-', '_'], ['+', '/'], $data); // Convert Base64 URL encoding to standard Base64
//$data = str_replace(['-', '_'], ['+', '/'], $input);
// Step 2: Add padding if necessary
$mod4 = strlen($data) % 4;
if ($mod4) {
$data .= str_repeat('=', 4 - $mod4);
}
$decodedData = base64_decode($data, true);
if ($decodedData === false) {
echo "Step 2: Error - Base64 decoding failed.\n";
exit;
} else {
echo "Step 2: Base64 decoded data:\n";
echo $decodedData . "\n\n"; // Output as hex to visualize raw data
}
// Step 3: Attempt to uncompress the decoded data
$uncompressedData = @gzdeflate($decodedData);`
на step 3 выдает false
@Darlez commented on GitHub (Nov 2, 2024):
Нужно удалить первые четыре байта $decodedData https://forum.qt.io/topic/123304/uncompressing-data-python-which-is-compressed-using-qt-quncompress-function/2
На питоне код выглядит так: