AndroidInsight-Kali 12.4__tar.gz
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.
- androidinsight_kali-12.4/LICENSE +117 -0
- androidinsight_kali-12.4/MANIFEST.in +53 -0
- androidinsight_kali-12.4/MIA_Core/Cimport/mia_core.c +134 -0
- androidinsight_kali-12.4/MIA_Core/Cimport/mia_core.h +63 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/__init__.py +3 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/__init__.py +3 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/boot.py +463 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/dtbo.py +186 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/gz.py +288 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/lk.py +201 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/logo.py +144 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/md1.py +175 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/mi_ext.py +149 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/odm_dlkm.py +166 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/preloader_raw.py +83 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/product.py +289 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/scp.py +227 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/spmfw.py +126 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/sspm.py +125 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/system.py +304 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/system_dlkm.py +151 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/system_ext.py +150 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/tee.py +235 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/vbmeta.py +273 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/vbmeta_system.py +279 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/vbmeta_vendor.py +279 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/vendor.py +534 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/vendor_boot.py +251 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/img/vendor_dlkm.py +288 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/info_img.py +396 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/main.py +197 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/payload_parser.py +40 -0
- androidinsight_kali-12.4/MIA_Core/Cpython/ui.py +40 -0
- androidinsight_kali-12.4/MIA_Core/__init__.py +3 -0
- androidinsight_kali-12.4/MIA_Core/plugin/mia/miatool.py +5929 -0
- androidinsight_kali-12.4/MIA_Core/plugin/mia/test/at_auth_unlock_unittest.py +519 -0
- androidinsight_kali-12.4/MIA_Core/plugin/mia/test/avbtool_signing_helper_test.py +80 -0
- androidinsight_kali-12.4/MIA_Core/plugin/mia/test/avbtool_signing_helper_with_files_test.py +80 -0
- androidinsight_kali-12.4/MIA_Core/plugin/mia/test/image_handler_unittest.py +211 -0
- androidinsight_kali-12.4/MIA_Core/plugin/mia/tools/at_auth_unlock.py +546 -0
- androidinsight_kali-12.4/MIA_Core/plugin/mia/tools/at_write_persistent_digest.py +152 -0
- androidinsight_kali-12.4/MIA_Core/plugin/mia/tools/transparency/pixel_factory_image_verify.py +397 -0
- androidinsight_kali-12.4/MiaUI/AndroidInsight_Kali.egg-info/PKG-INFO +28 -0
- androidinsight_kali-12.4/MiaUI/AndroidInsight_Kali.egg-info/SOURCES.txt +139 -0
- androidinsight_kali-12.4/MiaUI/AndroidInsight_Kali.egg-info/dependency_links.txt +1 -0
- androidinsight_kali-12.4/MiaUI/AndroidInsight_Kali.egg-info/entry_points.txt +5 -0
- androidinsight_kali-12.4/MiaUI/AndroidInsight_Kali.egg-info/not-zip-safe +1 -0
- androidinsight_kali-12.4/MiaUI/AndroidInsight_Kali.egg-info/top_level.txt +8 -0
- androidinsight_kali-12.4/MiaUI/games/Wind_Fighter.py +1404 -0
- androidinsight_kali-12.4/MiaUI/games/X.py +1707 -0
- androidinsight_kali-12.4/MiaUI/games/__init__.py +0 -0
- androidinsight_kali-12.4/MiaUI/games/cyber_defender.py +520 -0
- androidinsight_kali-12.4/MiaUI/games/data/__init__.py +0 -0
- androidinsight_kali-12.4/MiaUI/games/dino.py +861 -0
- androidinsight_kali-12.4/MiaUI/games/main.py +287 -0
- androidinsight_kali-12.4/MiaUI/games/maze.py +870 -0
- androidinsight_kali-12.4/MiaUI/games/shake.py +832 -0
- androidinsight_kali-12.4/MiaUI/games/telegram/__init__.py +0 -0
- androidinsight_kali-12.4/MiaUI/games/telegram/gift_bot.py +388 -0
- androidinsight_kali-12.4/MiaUI/games/telegram/main.py +335 -0
- androidinsight_kali-12.4/MiaUI/games/telegram/pin_manager.py +179 -0
- androidinsight_kali-12.4/MiaUI/games/telegram/sonyacloud.py +559 -0
- androidinsight_kali-12.4/MiaUI/games/telegram/tg_manager.py +353 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/__init__.py +0 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/cli.py +244 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/help/__init__.py +0 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/help/ai.py +179 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/help/help.py +34 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/help/help.txt +121 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/help/help_ru.txt +121 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/help/version.txt +19 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/__init__.py +0 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/engine.py +51 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/files.py +56 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/heuristics.py +24 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/network.py +41 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/persistence.py +60 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/process.py +52 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/Makefile +214 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/__init__.py +0 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/include/__init__.py +0 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/include/camera_info.h +203 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/include/color.h +412 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/include/common.h +494 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/include/hardware_info.h +395 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/include/network_info.h +349 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/include/process_info.h +401 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/include/safe_read.h +445 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/include/sensor_info.h +418 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/include/system_info.h +593 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/src/__init__.py +0 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/src/camera_info.c +559 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/src/hardware_info.c +544 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/src/main.c +821 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/src/network_info.c +507 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/src/process_info.c +646 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/src/sensor_info.c +887 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/pypass/src/system_info.c +1112 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi/security/ui.py +46 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi_plus/__init__.py +0 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi_plus/security_core.c +76 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi_plus/security_core.h +65 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi_plus/system_info.c +1290 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi_pro/Color.lua +32 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi_pro/Color.txt +142 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi_pro/__init__.py +0 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi_pro/anim.lua +282 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi_pro/full_palette.lua +143 -0
- androidinsight_kali-12.4/MiaUI/miaui_mi_pro/import.lua +241 -0
- androidinsight_kali-12.4/MiaUI/report/__init__.py +0 -0
- androidinsight_kali-12.4/MiaUI/report/bot.py +363 -0
- androidinsight_kali-12.4/PKG-INFO +28 -0
- androidinsight_kali-12.4/README.md +87 -0
- androidinsight_kali-12.4/README_ru.md +78 -0
- androidinsight_kali-12.4/bash/PS1.sh +205 -0
- androidinsight_kali-12.4/bash/banners/1.txt +13 -0
- androidinsight_kali-12.4/bash/banners/10.txt +12 -0
- androidinsight_kali-12.4/bash/banners/11.txt +12 -0
- androidinsight_kali-12.4/bash/banners/12.txt +19 -0
- androidinsight_kali-12.4/bash/banners/13.txt +26 -0
- androidinsight_kali-12.4/bash/banners/14.txt +14 -0
- androidinsight_kali-12.4/bash/banners/15.txt +15 -0
- androidinsight_kali-12.4/bash/banners/16.txt +12 -0
- androidinsight_kali-12.4/bash/banners/17.txt +32 -0
- androidinsight_kali-12.4/bash/banners/18.txt +21 -0
- androidinsight_kali-12.4/bash/banners/19.txt +19 -0
- androidinsight_kali-12.4/bash/banners/2.txt +10 -0
- androidinsight_kali-12.4/bash/banners/20.txt +12 -0
- androidinsight_kali-12.4/bash/banners/21.txt +19 -0
- androidinsight_kali-12.4/bash/banners/3.txt +28 -0
- androidinsight_kali-12.4/bash/banners/4.txt +22 -0
- androidinsight_kali-12.4/bash/banners/5.txt +25 -0
- androidinsight_kali-12.4/bash/banners/6.txt +15 -0
- androidinsight_kali-12.4/bash/banners/7.txt +13 -0
- androidinsight_kali-12.4/bash/banners/8.txt +11 -0
- androidinsight_kali-12.4/bash/banners/9.txt +17 -0
- androidinsight_kali-12.4/bash/colors.sh +43 -0
- androidinsight_kali-12.4/bash/main.sh +294 -0
- androidinsight_kali-12.4/pyproject.toml +3 -0
- androidinsight_kali-12.4/setup.cfg +4 -0
- androidinsight_kali-12.4/setup.py +106 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
ETHERIUM USAGE LICENSE (EUL)
|
|
2
|
+
Version 2.0
|
|
3
|
+
Copyright (c) 2007–2026 Alia Ether 𖤍
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
1. DEFINITIONS
|
|
9
|
+
|
|
10
|
+
“Product” means the software, source code, binaries, scripts,
|
|
11
|
+
AI models, datasets, documentation and related materials.
|
|
12
|
+
|
|
13
|
+
“You” means any individual or legal entity using the Product.
|
|
14
|
+
|
|
15
|
+
“Use” means executing, studying, modifying, or running the Product.
|
|
16
|
+
|
|
17
|
+
2. PERMITTED USE (OPEN USE)
|
|
18
|
+
|
|
19
|
+
You are allowed to:
|
|
20
|
+
|
|
21
|
+
• Use the Product for personal, educational, and research purposes
|
|
22
|
+
• Study and modify the source code for private use
|
|
23
|
+
• Run the Product in your own environment
|
|
24
|
+
• Share small excerpts of code for educational discussion
|
|
25
|
+
|
|
26
|
+
3. RESTRICTED USE (CONTROLLED)
|
|
27
|
+
|
|
28
|
+
Without explicit written permission from the Author, you may NOT:
|
|
29
|
+
|
|
30
|
+
• Sell or commercially exploit the Product
|
|
31
|
+
• Redistribute the full Product or modified versions
|
|
32
|
+
• Publish forks or mirrors (GitHub, GitLab, etc.)
|
|
33
|
+
• Rebrand or present the Product as your own
|
|
34
|
+
• Provide the Product as a service (SaaS, API, hosting)
|
|
35
|
+
• Create competing products based on the Product
|
|
36
|
+
|
|
37
|
+
4. MODIFICATIONS
|
|
38
|
+
|
|
39
|
+
You may modify the Product for private use only.
|
|
40
|
+
|
|
41
|
+
If permission is granted to publish modifications:
|
|
42
|
+
|
|
43
|
+
• Original authorship must be preserved
|
|
44
|
+
• Changes must be clearly documented
|
|
45
|
+
• This License must remain attached
|
|
46
|
+
|
|
47
|
+
5. ATTRIBUTION
|
|
48
|
+
|
|
49
|
+
Any allowed public reference must include:
|
|
50
|
+
|
|
51
|
+
• Author: Alia Ether
|
|
52
|
+
• Project name: MIA
|
|
53
|
+
• Link to official source (if provided)
|
|
54
|
+
|
|
55
|
+
You must not remove or alter attribution notices.
|
|
56
|
+
|
|
57
|
+
6. THIRD-PARTY COMPONENTS
|
|
58
|
+
|
|
59
|
+
Parts of the Product may include third-party software
|
|
60
|
+
(e.g. Android Verified Boot tools by Google).
|
|
61
|
+
|
|
62
|
+
Such components are governed by their own licenses,
|
|
63
|
+
which must be respected separately.
|
|
64
|
+
|
|
65
|
+
7. AI / SECURITY DISCLAIMER
|
|
66
|
+
|
|
67
|
+
If the Product includes AI, OSINT, or security tools:
|
|
68
|
+
|
|
69
|
+
• You are fully responsible for usage and consequences
|
|
70
|
+
• You must comply with all applicable laws
|
|
71
|
+
• The Author is not liable for misuse
|
|
72
|
+
|
|
73
|
+
8. DISCLAIMER OF WARRANTY
|
|
74
|
+
|
|
75
|
+
THE PRODUCT IS PROVIDED “AS IS” WITHOUT WARRANTIES OF ANY KIND.
|
|
76
|
+
|
|
77
|
+
The Author does not guarantee:
|
|
78
|
+
|
|
79
|
+
• correctness
|
|
80
|
+
• security
|
|
81
|
+
• stability
|
|
82
|
+
• legality of usage
|
|
83
|
+
|
|
84
|
+
9. LIMITATION OF LIABILITY
|
|
85
|
+
|
|
86
|
+
The Author is not liable for:
|
|
87
|
+
|
|
88
|
+
• any damages
|
|
89
|
+
• data loss
|
|
90
|
+
• legal consequences
|
|
91
|
+
• misuse of the Product
|
|
92
|
+
|
|
93
|
+
Use is at your own risk.
|
|
94
|
+
|
|
95
|
+
10. TERMINATION
|
|
96
|
+
|
|
97
|
+
This License terminates automatically upon violation.
|
|
98
|
+
|
|
99
|
+
Upon termination you must:
|
|
100
|
+
|
|
101
|
+
• stop using the Product
|
|
102
|
+
• delete all copies
|
|
103
|
+
|
|
104
|
+
11. GOVERNING LAW
|
|
105
|
+
|
|
106
|
+
This License is governed by the laws of the Author’s jurisdiction.
|
|
107
|
+
|
|
108
|
+
12. GENERAL PROVISIONS
|
|
109
|
+
|
|
110
|
+
• If any part is invalid, the rest remains valid
|
|
111
|
+
• This is the complete agreement
|
|
112
|
+
• No rights are granted unless explicitly stated
|
|
113
|
+
|
|
114
|
+
The Product is intended for educational, research,
|
|
115
|
+
and controlled usage only.
|
|
116
|
+
|
|
117
|
+
Commercial use requires explicit permission.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
include README.md
|
|
2
|
+
include README_ru.md
|
|
3
|
+
include LICENSE
|
|
4
|
+
|
|
5
|
+
# pypass файлы для сборки
|
|
6
|
+
recursive-include MiaUI/miaui_mi/security/pypass/src *
|
|
7
|
+
recursive-include MiaUI/miaui_mi/security/pypass/include *
|
|
8
|
+
include MiaUI/miaui_mi/security/pypass/Makefile
|
|
9
|
+
include MiaUI/miaui_mi/security/pypass/*.c
|
|
10
|
+
include MiaUI/miaui_mi/security/pypass/*.h
|
|
11
|
+
|
|
12
|
+
# Help файлы
|
|
13
|
+
include MiaUI/miaui_mi/help/*.txt
|
|
14
|
+
include MiaUI/miaui_mi/help/*.json
|
|
15
|
+
|
|
16
|
+
# Bash папка (в корне проекта!)
|
|
17
|
+
recursive-include bash *.sh
|
|
18
|
+
recursive-include bash *.txt
|
|
19
|
+
include bash/banners/*.txt
|
|
20
|
+
|
|
21
|
+
# Игры
|
|
22
|
+
recursive-include MiaUI/games *.py
|
|
23
|
+
|
|
24
|
+
# Lua скрипты
|
|
25
|
+
recursive-include MiaUI/miaui_mi_pro *.lua
|
|
26
|
+
include MiaUI/miaui_mi_pro/*.txt
|
|
27
|
+
|
|
28
|
+
# C исходники для расширений
|
|
29
|
+
include MiaUI/miaui_mi_plus/*.c
|
|
30
|
+
include MiaUI/miaui_mi_plus/*.h
|
|
31
|
+
include MIA_Core/Cimport/*.c
|
|
32
|
+
include MIA_Core/Cimport/*.h
|
|
33
|
+
|
|
34
|
+
# MIA_Core файлы
|
|
35
|
+
recursive-include MIA_Core/plugin *.py
|
|
36
|
+
recursive-include MIA_Core/Cpython *.py
|
|
37
|
+
recursive-include MIA_Core/Cpython/img *.py
|
|
38
|
+
include MIA_Core/Cimport/*.c
|
|
39
|
+
include MIA_Core/Cimport/*.h
|
|
40
|
+
|
|
41
|
+
# MIA_Core файлы
|
|
42
|
+
recursive-include MIA_Core/plugin *.py
|
|
43
|
+
recursive-include MIA_Core/Cpython *.py
|
|
44
|
+
recursive-include MIA_Core/Cpython/img *.py
|
|
45
|
+
|
|
46
|
+
# Исключить ненужное
|
|
47
|
+
global-exclude *.pyc
|
|
48
|
+
global-exclude *.pyo
|
|
49
|
+
global-exclude *.so
|
|
50
|
+
global-exclude *.o
|
|
51
|
+
global-exclude __pycache__
|
|
52
|
+
global-exclude .DS_Store
|
|
53
|
+
global-exclude *.db
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
|
|
2
|
+
//╔═══════════════════════════════════════════════════════════════╗
|
|
3
|
+
//║ Project: MIA Core ║
|
|
4
|
+
//║ Link: t.me/FrontendVSCode ║
|
|
5
|
+
//║ Author: Frontend & LED (𝙰𝚕𝚒𝚊 𝙴𝚝𝚑𝚎𝚛 𖤍) 🌷 ║
|
|
6
|
+
//║ lang: C ║
|
|
7
|
+
//║ [MIA-HASH-01] ΞΩ77Λβ99PPHD8A71 ║
|
|
8
|
+
//║ build: 3.10.15 ║
|
|
9
|
+
//║ files: mia_core.c ║
|
|
10
|
+
//╚═══════════════════════════════════════════════════════════════╝
|
|
11
|
+
|
|
12
|
+
#include <stdio.h>
|
|
13
|
+
#include <string.h>
|
|
14
|
+
#include <stdlib.h>
|
|
15
|
+
#include <stdint.h>
|
|
16
|
+
#include <stdbool.h>
|
|
17
|
+
#include <Python.h>
|
|
18
|
+
|
|
19
|
+
// ============================================
|
|
20
|
+
// MIA FUNCTIONS IMPLEMENTATION
|
|
21
|
+
// ============================================
|
|
22
|
+
|
|
23
|
+
// Функция для проверки vbmeta
|
|
24
|
+
static int mia_verify_vbmeta_impl(const char* path) {
|
|
25
|
+
FILE* fp = fopen(path, "rb");
|
|
26
|
+
if (!fp) return 0;
|
|
27
|
+
|
|
28
|
+
// Проверка магии MIA
|
|
29
|
+
uint8_t magic[4];
|
|
30
|
+
fread(magic, 1, 4, fp);
|
|
31
|
+
fclose(fp);
|
|
32
|
+
|
|
33
|
+
// "MIA0" магия
|
|
34
|
+
return (magic[0] == 'A' && magic[1] == 'V' &&
|
|
35
|
+
magic[2] == 'B' && magic[3] == '0');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Функция для получения информации
|
|
39
|
+
static int mia_get_info_impl(const char* path, uint64_t* rollback_index) {
|
|
40
|
+
FILE* fp = fopen(path, "rb");
|
|
41
|
+
if (!fp) return 0;
|
|
42
|
+
|
|
43
|
+
// Пропускаем магию (4 байта) + версию (8 байт) + заголовок
|
|
44
|
+
fseek(fp, 64, SEEK_SET);
|
|
45
|
+
|
|
46
|
+
// Читаем rollback_index (8 байт)
|
|
47
|
+
fread(rollback_index, sizeof(uint64_t), 1, fp);
|
|
48
|
+
|
|
49
|
+
fclose(fp);
|
|
50
|
+
return 1;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ============================================
|
|
54
|
+
// PYTHON C-API WRAPPER (ЭКСПОРТИРУЕМЫЕ ФУНКЦИИ)
|
|
55
|
+
// ============================================
|
|
56
|
+
|
|
57
|
+
static PyObject* py_verify_vbmeta(PyObject* self, PyObject* args) {
|
|
58
|
+
const char* path;
|
|
59
|
+
|
|
60
|
+
if (!PyArg_ParseTuple(args, "s", &path))
|
|
61
|
+
return NULL;
|
|
62
|
+
|
|
63
|
+
int result = mia_verify_vbmeta_impl(path);
|
|
64
|
+
|
|
65
|
+
if (result)
|
|
66
|
+
Py_RETURN_TRUE;
|
|
67
|
+
else
|
|
68
|
+
Py_RETURN_FALSE;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
static PyObject* py_get_vbmeta_info(PyObject* self, PyObject* args) {
|
|
72
|
+
const char* path;
|
|
73
|
+
|
|
74
|
+
if (!PyArg_ParseTuple(args, "s", &path))
|
|
75
|
+
return NULL;
|
|
76
|
+
|
|
77
|
+
uint64_t rollback_index = 0;
|
|
78
|
+
int result = mia_get_info_impl(path, &rollback_index);
|
|
79
|
+
|
|
80
|
+
if (!result) {
|
|
81
|
+
Py_RETURN_NONE;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return Py_BuildValue("{s:K,s:i}",
|
|
85
|
+
"rollback_index", rollback_index,
|
|
86
|
+
"verified", 1);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
static PyObject* py_verify_chain(PyObject* self, PyObject* args) {
|
|
90
|
+
const char* vbmeta_path;
|
|
91
|
+
const char* boot_path;
|
|
92
|
+
|
|
93
|
+
if (!PyArg_ParseTuple(args, "ss", &vbmeta_path, &boot_path))
|
|
94
|
+
return NULL;
|
|
95
|
+
|
|
96
|
+
int vbmeta_ok = mia_verify_vbmeta_impl(vbmeta_path);
|
|
97
|
+
int boot_ok = mia_verify_vbmeta_impl(boot_path);
|
|
98
|
+
|
|
99
|
+
if (vbmeta_ok && boot_ok)
|
|
100
|
+
Py_RETURN_TRUE;
|
|
101
|
+
else
|
|
102
|
+
Py_RETURN_FALSE;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// ============================================
|
|
106
|
+
// МЕТОДЫ МОДУЛЯ
|
|
107
|
+
// ============================================
|
|
108
|
+
|
|
109
|
+
static PyMethodDef AvbCoreMethods[] = {
|
|
110
|
+
{"verify_vbmeta", py_verify_vbmeta, METH_VARARGS, "Проверить vbmeta подпись"},
|
|
111
|
+
{"get_vbmeta_info", py_get_vbmeta_info, METH_VARARGS, "Получить информацию из vbmeta"},
|
|
112
|
+
{"verify_chain", py_verify_chain, METH_VARARGS, "Проверить цепочку vbmeta -> boot"},
|
|
113
|
+
{NULL, NULL, 0, NULL}
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// ============================================
|
|
117
|
+
// ОПРЕДЕЛЕНИЕ МОДУЛЯ
|
|
118
|
+
// ============================================
|
|
119
|
+
|
|
120
|
+
static struct PyModuleDef mia_core_module = {
|
|
121
|
+
PyModuleDef_HEAD_INIT,
|
|
122
|
+
"mia_core_native", // Имя модуля
|
|
123
|
+
"MIA Core native module", // Описание
|
|
124
|
+
-1,
|
|
125
|
+
AvbCoreMethods
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
// ============================================
|
|
129
|
+
// ИНИЦИАЛИЗАЦИЯ МОДУЛЯ (ГЛАВНАЯ ФУНКЦИЯ)
|
|
130
|
+
// ============================================
|
|
131
|
+
|
|
132
|
+
PyMODINIT_FUNC PyInit_mia_core_native(void) {
|
|
133
|
+
return PyModule_Create(&mia_core_module);
|
|
134
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
//╔═══════════════════════════════════════════════════════════════╗
|
|
2
|
+
//║ Project: MIA Core ║
|
|
3
|
+
//║ Link: t.me/FrontendVSCode ║
|
|
4
|
+
//║ Author: Frontend & LED (𝙰𝚕𝚒𝚊 𝙴𝚝𝚑𝚎𝚛 𖤍) 🌷 ║
|
|
5
|
+
//║ lang: C ║
|
|
6
|
+
//║ [MIA-HASH-01] ΞΩ77Λβ99PPHD8A71 ║
|
|
7
|
+
//║ build: 3.10.15 ║
|
|
8
|
+
//║ files: mia_core.h, mia_core.c ║
|
|
9
|
+
//╚═══════════════════════════════════════════════════════════════╝
|
|
10
|
+
|
|
11
|
+
#ifndef MIA_CORE_H
|
|
12
|
+
#define MIA_CORE_H
|
|
13
|
+
|
|
14
|
+
#include <stdbool.h>
|
|
15
|
+
#include <stdint.h>
|
|
16
|
+
#include <Python.h>
|
|
17
|
+
|
|
18
|
+
// ============================================
|
|
19
|
+
// MIA STRUCTURES (из libmia)
|
|
20
|
+
// ============================================
|
|
21
|
+
|
|
22
|
+
typedef struct {
|
|
23
|
+
uint64_t rollback_index;
|
|
24
|
+
uint32_t flags;
|
|
25
|
+
uint32_t rollback_index_location;
|
|
26
|
+
} AvbVBMetaHeader;
|
|
27
|
+
|
|
28
|
+
// ============================================
|
|
29
|
+
// MIA FUNCTIONS DECLARATIONS
|
|
30
|
+
// ============================================
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @brief Проверить vbmeta образ
|
|
34
|
+
* @param path Путь к vbmeta файлу
|
|
35
|
+
* @return 1 если подпись верна, 0 если нет
|
|
36
|
+
*/
|
|
37
|
+
int mia_verify_vbmeta(const char* path);
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @brief Получить информацию из vbmeta
|
|
41
|
+
* @param path Путь к файлу
|
|
42
|
+
* @param header Указатель на структуру для заполнения
|
|
43
|
+
* @return 1 если успешно, 0 если ошибка
|
|
44
|
+
*/
|
|
45
|
+
int mia_get_vbmeta_info(const char* path, AvbVBMetaHeader* header);
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @brief Проверить цепочку доверия MIA
|
|
49
|
+
* @param vbmeta_path Путь к vbmeta
|
|
50
|
+
* @param boot_path Путь к boot.img
|
|
51
|
+
* @return 1 если верификация пройдена
|
|
52
|
+
*/
|
|
53
|
+
int mia_verify_chain(const char* vbmeta_path, const char* boot_path);
|
|
54
|
+
|
|
55
|
+
// ============================================
|
|
56
|
+
// PYTHON C-API WRAPPER DECLARATIONS
|
|
57
|
+
// ============================================
|
|
58
|
+
|
|
59
|
+
static PyObject* py_mia_verify_vbmeta(PyObject* self, PyObject* args);
|
|
60
|
+
static PyObject* py_mia_get_vbmeta_info(PyObject* self, PyObject* args);
|
|
61
|
+
static PyObject* py_mia_verify_chain(PyObject* self, PyObject* args);
|
|
62
|
+
|
|
63
|
+
#endif // MIA_CORE_H
|