Skip to content

Commit 25a4d8f

Browse files
committed
✨ Add Keyauth Module
1 parent d321197 commit 25a4d8f

25 files changed

Lines changed: 782 additions & 24 deletions
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Keyauth
2+
3+
TBD.
4+
5+
full implementation of api https://docs.keyauth.cc except seller api.

examples/ext/mixed.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
"""
2+
____ ____ __ __
3+
/ __ \\ __ __ / __ \\ _____ ____ / /_ ___ _____ / /_
4+
/ /_/ // / / // /_/ // ___// __ \\ / __// _ \\ / ___// __/
5+
/ ____// /_/ // ____// / / /_/ // /_ / __// /__ / /_
6+
/_/ \\__, //_/ /_/ \\____/ \\__/ \\___/ \\___/ \\__/
7+
/____/
8+
9+
Made With ❤️ By Ghoul & Marci
10+
"""
11+
12+
from pathlib import Path
13+
from threading import Thread
14+
15+
from pyprotector import PythonProtector
16+
from pyprotector.keyauth import Keyauth
17+
from pyprotector.keyauth.utils import getchecksum
18+
19+
# -- Define Constants
20+
LOGGING_PATH = (
21+
Path.home() / "AppData/Roaming/PythonProtector/logs/[Security].log"
22+
) # -- This can be any path
23+
24+
# -- Construct Class
25+
security = PythonProtector(
26+
debug=True,
27+
modules=[
28+
"AntiProcess",
29+
"AntiVM",
30+
"Miscellaneous",
31+
"AntiDLL",
32+
"AntiAnalysis",
33+
"AntiDump",
34+
],
35+
logs_path=LOGGING_PATH,
36+
webhook_url="",
37+
on_detect=["Report", "Exit", "Screenshot"],
38+
)
39+
40+
auth = Keyauth(
41+
name="",
42+
ownerid="",
43+
secret="",
44+
version="",
45+
file_hash=getchecksum())
46+
47+
# -- Example Event
48+
49+
50+
@security.event.obs.on("process_running")
51+
def on_process_running(text: str, module: str, process):
52+
print(f"{module} - {text}\nProcess Name: {process.name()}")
53+
print(security.user)
54+
auth.ban()
55+
# Free To Do Whatever You Want Here...
56+
57+
58+
# -- Main Code
59+
if __name__ == "__main__":
60+
SecurityThread = Thread(
61+
name="Python Protector", target=security.start
62+
) # -- Start Before Any Other Code Is Run
63+
SecurityThread.start()
64+
auth.initialize()
65+
# Other Code

examples/keyauth.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""
2+
____ ____ __ __
3+
/ __ \\ __ __ / __ \\ _____ ____ / /_ ___ _____ / /_
4+
/ /_/ // / / // /_/ // ___// __ \\ / __// _ \\ / ___// __/
5+
/ ____// /_/ // ____// / / /_/ // /_ / __// /__ / /_
6+
/_/ \\__, //_/ /_/ \\____/ \\__/ \\___/ \\___/ \\__/
7+
/____/
8+
9+
Made With ❤️ By Ghoul & Marci
10+
"""
11+
12+
from pyprotector.keyauth import Keyauth
13+
from pyprotector.keyauth.utils import getchecksum
14+
15+
auth = Keyauth(
16+
name="",
17+
ownerid="",
18+
secret="",
19+
version="",
20+
file_hash=getchecksum())
21+
22+
app = auth.initialize()
23+
print(app) # "Keyauth App ({self.version}) with {self.users} users, {self.keys} keys and {self.onlineUsers} online users"
24+
25+
license = auth.license("LICENSE")
26+
print(license.current_subscription)
27+
print(license.last_login)
28+
print(license.expiry)
29+
30+
### All Other Functions are documented.

mkdocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ nav:
7575
- Miscellaneous:
7676
- Method Reference: configuration/Modules/Miscellaneous/index.md
7777
- Event Reference: configuration/Modules/Miscellaneous/events.md
78+
- Ext:
79+
- Keyauth: configuration/Ext/Keyauth/index.md
7880
- Intro To Events: configuration/Events/index.md
7981
- Frequently Asked Questions: faq.md
8082
- License: license.md

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[tool.ruff]
2+
extend-select = ["C4", "SIM"]
3+
ignore = []

pyprotector/abc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ def __init__(self, webhook, logger, exit, report, event) -> None:
2525
@abstractmethod
2626
def name(self) -> str:
2727
pass
28-
28+
2929
@property
3030
@abstractmethod
3131
def version(self) -> float:
32-
pass
32+
pass

pyprotector/constants.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ class Lists:
134134
"extremedumper",
135135
"zed",
136136
"exeinfope",
137-
"dnspy",
138137
"titanHide",
139138
"ilspy",
140139
"titanhide",

pyprotector/keyauth/__init__.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
"""
2+
____ ____ __ __
3+
/ __ \\ __ __ / __ \\ _____ ____ / /_ ___ _____ / /_
4+
/ /_/ // / / // /_/ // ___// __ \\ / __// _ \\ / ___// __/
5+
/ ____// /_/ // ____// / / /_/ // /_ / __// /__ / /_
6+
/_/ \\__, //_/ /_/ \\____/ \\__/ \\___/ \\___/ \\__/
7+
/____/
8+
9+
Made With ❤️ By Ghoul & Marci
10+
"""
11+
12+
from .utils import *
13+
from .keyauth import Keyauth

pyprotector/keyauth/_constants.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""
2+
____ ____ __ __
3+
/ __ \\ __ __ / __ \\ _____ ____ / /_ ___ _____ / /_
4+
/ /_/ // / / // /_/ // ___// __ \\ / __// _ \\ / ___// __/
5+
/ ____// /_/ // ____// / / /_/ // /_ / __// /__ / /_
6+
/_/ \\__, //_/ /_/ \\____/ \\__/ \\___/ \\___/ \\__/
7+
/____/
8+
9+
Made With ❤️ By Ghoul & Marci
10+
"""
11+
12+
from typing import Final, final
13+
14+
15+
@final
16+
class API:
17+
BASE_URL: Final[str] = "https://keyauth.win/api/1.2/"

pyprotector/keyauth/exceptions.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""
2+
____ ____ __ __
3+
/ __ \\ __ __ / __ \\ _____ ____ / /_ ___ _____ / /_
4+
/ /_/ // / / // /_/ // ___// __ \\ / __// _ \\ / ___// __/
5+
/ ____// /_/ // ____// / / /_/ // /_ / __// /__ / /_
6+
/_/ \\__, //_/ /_/ \\____/ \\__/ \\___/ \\___/ \\__/
7+
/____/
8+
9+
Made With ❤️ By Ghoul & Marci
10+
"""
11+
12+
class KeyauthException(BaseException):
13+
"""
14+
Base Class of All Keyauth Issues
15+
"""
16+
17+
class NewVersionAvailable(KeyauthException):
18+
def __init__(self, message: str) -> None:
19+
super().__init__(message)
20+
21+
22+
class ApplicationNotFound(KeyauthException):
23+
def __init__(self, message: str) -> None:
24+
super().__init__(message)
25+
26+
27+
class RequestError(KeyauthException):
28+
def __init__(self, message: str) -> None:
29+
super().__init__(message)
30+
31+
32+
class NotInitialized(KeyauthException):
33+
def __init__(self, message: str) -> None:
34+
super().__init__(message)

0 commit comments

Comments
 (0)