Kekik 1.7.5__py3-none-any.whl → 1.7.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of Kekik might be problematic. Click here for more details.
- Kekik/Sifreleme/Packer.py +158 -21
- {Kekik-1.7.5.dist-info → kekik-1.7.6.dist-info}/METADATA +6 -1
- {Kekik-1.7.5.dist-info → kekik-1.7.6.dist-info}/RECORD +7 -7
- {Kekik-1.7.5.dist-info → kekik-1.7.6.dist-info}/WHEEL +1 -1
- {Kekik-1.7.5.dist-info → kekik-1.7.6.dist-info}/LICENSE +0 -0
- {Kekik-1.7.5.dist-info → kekik-1.7.6.dist-info}/entry_points.txt +0 -0
- {Kekik-1.7.5.dist-info → kekik-1.7.6.dist-info}/top_level.txt +0 -0
Kekik/Sifreleme/Packer.py
CHANGED
|
@@ -4,9 +4,49 @@ import re
|
|
|
4
4
|
|
|
5
5
|
class Packer:
|
|
6
6
|
"""
|
|
7
|
-
P.A.C.K.E.R. sıkıştırma ve çözme işlemleri için bir sınıf.
|
|
7
|
+
P.A.C.K.E.R. sıkıştırma ve çözme işlemleri için kapsamlı bir sınıf.
|
|
8
8
|
! » https://github.com/beautifier/js-beautify/blob/main/python/jsbeautifier/unpackers/packer.py
|
|
9
9
|
"""
|
|
10
|
+
|
|
11
|
+
# Regex kalıpları - daha gevşek, farklı varyasyonları yakalayabilecek şekilde
|
|
12
|
+
PACKED_PATTERN = re.compile(
|
|
13
|
+
r"\}\s*\(\s*['\"](.*?)['\"],\s*(\d+),\s*(\d+),\s*['\"](.+?)['\"]\.split\(['\"]\\?\|['\"]\)",
|
|
14
|
+
re.IGNORECASE | re.MULTILINE | re.DOTALL
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
# Alternatif regex pattern, farklı formatlarda paketlenmiş kodu yakalamak için
|
|
18
|
+
ALTERNATIVE_PATTERNS = [
|
|
19
|
+
# Standart pattern
|
|
20
|
+
re.compile(
|
|
21
|
+
r"\}\('(.*)',\s*(\d+),\s*(\d+),\s*'(.*?)'\.split\('\|'\)",
|
|
22
|
+
re.IGNORECASE | re.MULTILINE | re.DOTALL
|
|
23
|
+
),
|
|
24
|
+
# Daha gevşek pattern
|
|
25
|
+
re.compile(
|
|
26
|
+
r"\}\s*\(\s*['\"](.*?)['\"],\s*(\d+),\s*(\d+),\s*['\"](.+?)['\"]\.split\(['\"]\\?\|['\"]\)",
|
|
27
|
+
re.IGNORECASE | re.MULTILINE | re.DOTALL
|
|
28
|
+
),
|
|
29
|
+
# Eval formatı
|
|
30
|
+
re.compile(
|
|
31
|
+
r"eval\(function\(p,a,c,k,e,(?:r|d|)\)\{.*?return p\}(.*?\.split\('\|'\))",
|
|
32
|
+
re.IGNORECASE | re.MULTILINE | re.DOTALL
|
|
33
|
+
)
|
|
34
|
+
]
|
|
35
|
+
|
|
36
|
+
# Kelime değiştirme deseni
|
|
37
|
+
REPLACE_PATTERN = re.compile(
|
|
38
|
+
r"\b\w+\b",
|
|
39
|
+
re.IGNORECASE | re.MULTILINE
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
# Alfabeler
|
|
43
|
+
ALPHABET = {
|
|
44
|
+
52: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP",
|
|
45
|
+
54: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQR",
|
|
46
|
+
62: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
|
47
|
+
95: " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"
|
|
48
|
+
}
|
|
49
|
+
|
|
10
50
|
@staticmethod
|
|
11
51
|
def clean_escape_sequences(source: str) -> str:
|
|
12
52
|
"""Kaçış dizilerini temizler."""
|
|
@@ -18,45 +58,142 @@ class Packer:
|
|
|
18
58
|
@staticmethod
|
|
19
59
|
def extract_arguments(source: str) -> tuple[str, list[str], int, int]:
|
|
20
60
|
"""P.A.C.K.E.R. formatındaki kaynak koddan argümanları çıkarır."""
|
|
21
|
-
|
|
61
|
+
# Önce standart pattern ile dene
|
|
62
|
+
match = Packer.PACKED_PATTERN.search(source)
|
|
63
|
+
|
|
64
|
+
# Eğer bulunamazsa, alternatif pattern'leri dene
|
|
65
|
+
if not match:
|
|
66
|
+
for pattern in Packer.ALTERNATIVE_PATTERNS:
|
|
67
|
+
match = pattern.search(source)
|
|
68
|
+
if match:
|
|
69
|
+
break
|
|
22
70
|
|
|
23
71
|
if not match:
|
|
24
|
-
|
|
72
|
+
# Son çare: daha serbest bir string arama
|
|
73
|
+
if "'.split('|')" in source or '".split("|")' in source:
|
|
74
|
+
# Manuel olarak parçalama işlemi yap
|
|
75
|
+
try:
|
|
76
|
+
# Basit bir yaklaşım, çoğu vakada çalışır
|
|
77
|
+
parts = re.findall(r"\((['\"](.*?)['\"],\s*(\d+),\s*(\d+),\s*['\"](.*?)['\"]\.split", source)
|
|
78
|
+
if parts:
|
|
79
|
+
payload, radix, count, symtab = parts[0][1:]
|
|
80
|
+
return payload, symtab.split("|"), int(radix), int(count)
|
|
81
|
+
except Exception:
|
|
82
|
+
pass
|
|
83
|
+
|
|
84
|
+
raise ValueError("Invalid P.A.C.K.E.R. source format. Pattern not found.")
|
|
25
85
|
|
|
26
|
-
|
|
86
|
+
# Eval formatını işle
|
|
87
|
+
if len(match.groups()) == 1:
|
|
88
|
+
# Eval formatı yakalandı, içeriği çıkar
|
|
89
|
+
eval_content = match.group(1)
|
|
90
|
+
if inner_match := re.search(r"\('(.*)',(\d+),(\d+),'(.*)'\)", eval_content):
|
|
91
|
+
payload, radix, count, symtab = inner_match.groups()
|
|
92
|
+
else:
|
|
93
|
+
raise ValueError("Cannot extract arguments from eval pattern")
|
|
94
|
+
else:
|
|
95
|
+
# Standart format yakalandı
|
|
96
|
+
payload, radix, count, symtab = match.groups()
|
|
27
97
|
|
|
28
98
|
return payload, symtab.split("|"), int(radix), int(count)
|
|
29
99
|
|
|
30
100
|
@staticmethod
|
|
31
|
-
def
|
|
32
|
-
"""
|
|
33
|
-
|
|
101
|
+
def unbase(value: str, base: int) -> int:
|
|
102
|
+
"""
|
|
103
|
+
Verilen değeri belirtilen tabandan ondalık sayıya dönüştürür.
|
|
104
|
+
Geniş taban desteği (2-95 arası) sağlar.
|
|
105
|
+
"""
|
|
106
|
+
# Standart Python taban dönüşümü (2-36 arası)
|
|
107
|
+
if 2 <= base <= 36:
|
|
108
|
+
try:
|
|
109
|
+
return int(value, base)
|
|
110
|
+
except ValueError:
|
|
111
|
+
return 0
|
|
34
112
|
|
|
35
|
-
|
|
113
|
+
# Geniş taban desteği (37-95 arası)
|
|
114
|
+
if base > 95:
|
|
115
|
+
raise ValueError(f"Desteklenmeyen taban: {base}")
|
|
36
116
|
|
|
117
|
+
# Uygun alfabeyi seç
|
|
118
|
+
if base > 62:
|
|
119
|
+
selector = 95
|
|
120
|
+
elif base > 54:
|
|
121
|
+
selector = 62
|
|
122
|
+
elif base > 52:
|
|
123
|
+
selector = 54
|
|
124
|
+
else:
|
|
125
|
+
selector = 52
|
|
126
|
+
|
|
127
|
+
# Alfabeden karakter-indeks sözlüğü oluştur
|
|
128
|
+
char_dict = {char: idx for idx, char in enumerate(Packer.ALPHABET[selector])}
|
|
129
|
+
|
|
130
|
+
# Değeri dönüştür
|
|
131
|
+
result = 0
|
|
132
|
+
for index, char in enumerate(reversed(value)):
|
|
133
|
+
digit = char_dict.get(char, 0)
|
|
134
|
+
result += digit * (base ** index)
|
|
135
|
+
|
|
136
|
+
return result
|
|
137
|
+
|
|
37
138
|
@staticmethod
|
|
38
139
|
def lookup_symbol(match: re.Match, symtab: list[str], radix: int) -> str:
|
|
39
140
|
"""Sembolleri arar ve yerine koyar."""
|
|
40
|
-
word
|
|
141
|
+
word = match[0]
|
|
142
|
+
|
|
143
|
+
try:
|
|
144
|
+
index = Packer.unbase(word, radix)
|
|
145
|
+
if 0 <= index < len(symtab):
|
|
146
|
+
replacement = symtab[index]
|
|
147
|
+
return replacement or word
|
|
148
|
+
except (ValueError, IndexError):
|
|
149
|
+
pass
|
|
41
150
|
|
|
42
|
-
return
|
|
151
|
+
return word
|
|
43
152
|
|
|
44
153
|
@staticmethod
|
|
45
154
|
def unpack(source: str) -> str:
|
|
46
|
-
"""
|
|
155
|
+
"""
|
|
156
|
+
P.A.C.K.E.R. formatındaki sıkıştırılmış bir JavaScript kodunu çözer.
|
|
157
|
+
Birden fazla format ve varyasyonu destekler.
|
|
158
|
+
"""
|
|
159
|
+
# Kaçış dizilerini temizle
|
|
47
160
|
source = Packer.clean_escape_sequences(source)
|
|
48
161
|
|
|
49
|
-
|
|
162
|
+
# Argümanları çıkar
|
|
163
|
+
try:
|
|
164
|
+
payload, symtab, radix, count = Packer.extract_arguments(source)
|
|
50
165
|
|
|
51
|
-
|
|
52
|
-
|
|
166
|
+
# Sembol tablosunun doğruluğunu kontrol et (ancak sıkı değil)
|
|
167
|
+
if len(symtab) != count:
|
|
168
|
+
print(f"Uyarı: Sembol tablosu sayısı ({len(symtab)}) ile belirtilen sayı ({count}) eşleşmiyor, ancak devam ediliyor.")
|
|
53
169
|
|
|
54
|
-
|
|
170
|
+
# Kelimeleri değiştir ve sonucu döndür
|
|
171
|
+
return Packer.REPLACE_PATTERN.sub(
|
|
172
|
+
lambda match: Packer.lookup_symbol(match, symtab, radix),
|
|
173
|
+
payload
|
|
174
|
+
)
|
|
175
|
+
except Exception as e:
|
|
176
|
+
# Detaylı hata mesajı
|
|
177
|
+
raise ValueError(f"Unpacking failed: {str(e)}\nSource preview: {source[:100]}...")
|
|
55
178
|
|
|
56
179
|
@staticmethod
|
|
57
|
-
def
|
|
58
|
-
"""
|
|
59
|
-
#
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
180
|
+
def detect_packed(source: str) -> bool:
|
|
181
|
+
"""Verilen kodun P.A.C.K.E.R. formatında sıkıştırılmış olup olmadığını kontrol eder."""
|
|
182
|
+
# Standart pattern'i kontrol et
|
|
183
|
+
if Packer.PACKED_PATTERN.search(source):
|
|
184
|
+
return True
|
|
185
|
+
|
|
186
|
+
# Alternatif pattern'leri kontrol et
|
|
187
|
+
for pattern in Packer.ALTERNATIVE_PATTERNS:
|
|
188
|
+
if pattern.search(source):
|
|
189
|
+
return True
|
|
190
|
+
|
|
191
|
+
# Yaygın belirteçleri kontrol et
|
|
192
|
+
indicators = [
|
|
193
|
+
".split('|')",
|
|
194
|
+
'.split("|")',
|
|
195
|
+
"function(p,a,c,k,e,",
|
|
196
|
+
"function(p, a, c, k, e, "
|
|
197
|
+
]
|
|
198
|
+
|
|
199
|
+
return any(indicator in source for indicator in indicators)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: Kekik
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.6
|
|
4
4
|
Summary: İşlerimizi kolaylaştıracak fonksiyonların el altında durduğu kütüphane..
|
|
5
5
|
Home-page: https://github.com/keyiflerolsun/Kekik
|
|
6
6
|
Author: keyiflerolsun
|
|
@@ -316,6 +316,11 @@ var played = 0;
|
|
|
316
316
|
eval_jwSetup = re.compile(r'\};\s*(eval\(function[\s\S]*?)var played = \d+;').findall(veri)[0]
|
|
317
317
|
print(Packer.unpack(Packer.unpack(eval_jwSetup)))
|
|
318
318
|
# jwSetup.sources=[{"default":true,"file":"\x68\x74\x74\x70\x73\x3a\x2f\x2f\x64\x32\x2e\x69\x6d\x61\x67\x65\x73\x70\x6f\x74\x2e\x62\x75\x7a\x7a\x2f\x66\x32\x2f\x4e\x74\x4f\x31\x4e\x51\x5a\x6a\x44\x51\x41\x6b\x78\x6c\x58\x45\x47\x33\x6c\x62\x66\x62\x30\x31\x79\x74\x70\x57\x66\x4e\x30\x66\x62\x66\x50\x58\x5a\x55\x31\x6a\x50\x77\x5a\x6d\x48\x71\x58\x41\x37\x6c\x6d\x6d\x4b\x67\x47\x59\x31\x66\x47\x42\x6d\x6c\x38\x68\x32\x7a\x33\x4f\x5a\x69\x4f\x63\x4c\x6b\x51\x70\x7a\x57\x78\x4b\x45\x4c\x57\x42\x63\x79\x4d\x74\x75\x55\x44\x57\x46\x4e\x6c\x69\x64\x70\x46\x46\x65\x6e\x65\x64\x66\x48\x30\x69\x74\x66\x59\x67\x38\x52\x47\x41\x6b\x38\x6c\x76\x72\x31","label":"0","type":"hls","preload":"none"}];var mu=getLocation(jwSetup.sources[0].file);
|
|
319
|
+
|
|
320
|
+
# ! Veya
|
|
321
|
+
|
|
322
|
+
while Packer.detect_packed(veri):
|
|
323
|
+
veri = Packer.unpack(veri)
|
|
319
324
|
```
|
|
320
325
|
|
|
321
326
|
### **[CryptoJS](https://github.com/keyiflerolsun/Kekik/blob/main/Kekik/Sifreleme/CryptoJS.py)**
|
|
@@ -27,16 +27,16 @@ Kekik/Sifreleme/AESManager.py,sha256=eYgbHANtYrWFJgLeUuj63tlL0Yn8gyPCJYbXfWlpNbo
|
|
|
27
27
|
Kekik/Sifreleme/CryptoJS.py,sha256=qDlgTaSXcs5jF4DNmjuwK5CL3VL1P7xyJzDTof1--As,3126
|
|
28
28
|
Kekik/Sifreleme/HexCodec.py,sha256=fB1ZGBYCQLUUiZNXqn0sxYhEMhxPoyC1BPYkRJ5G7hY,900
|
|
29
29
|
Kekik/Sifreleme/NaysHash.py,sha256=CJVlyHCXSv8JN8fitF2LQHLcd-opY6zergcgmX3pj_Y,2234
|
|
30
|
-
Kekik/Sifreleme/Packer.py,sha256=
|
|
30
|
+
Kekik/Sifreleme/Packer.py,sha256=o4jkoKdI0UOg9jqGsCg2H82vLbfsuYQnWFYS1DzRWrU,7290
|
|
31
31
|
Kekik/Sifreleme/StringCodec.py,sha256=5kmFLN7g2c_ENxD491lAlH0AGtW7tIy5h5KPHEuTzyM,1426
|
|
32
32
|
Kekik/Sifreleme/__init__.py,sha256=IDSVFP4xshnpPLyCX2ndY_N9cYIzikqu5LFi_E-3-5Q,284
|
|
33
33
|
Kekik/kisi_ver/__init__.py,sha256=gH613YZC3ziE7f67dViefRSuwDwsHyVvXHpM5CzZ2q4,1386
|
|
34
34
|
Kekik/kisi_ver/biyografiler.py,sha256=5Xv1ixaDGHGtl5Nf92jo9dPgF3jDXOGEPmWgoEsn9j8,189486
|
|
35
35
|
Kekik/kisi_ver/isimler.py,sha256=zHVimWL_4TvoLE3qzWQslDBc8-IJZSB02s0vRwsVM1g,88066
|
|
36
36
|
Kekik/kisi_ver/soyisimler.py,sha256=YQJYp2SjENgwOaCa9mmShxPYeeUll2cq8Vox-d8_kB8,78485
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
kekik-1.7.6.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
|
|
38
|
+
kekik-1.7.6.dist-info/METADATA,sha256=JvFV1keoUUEnJsFFS7arJX4NzkUA-hSZAX2B_4_dkEs,44493
|
|
39
|
+
kekik-1.7.6.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
40
|
+
kekik-1.7.6.dist-info/entry_points.txt,sha256=yjBifxtRlqfg8lPkH4Bu-urSa5ecptCHsuth-DcyWcg,59
|
|
41
|
+
kekik-1.7.6.dist-info/top_level.txt,sha256=NotddscfgxawvuRyAa7xkgnMhyteFDcBxb5aU5GY3BM,6
|
|
42
|
+
kekik-1.7.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|