diff --git a/Cargo.lock b/Cargo.lock index a7265d7..9098c55 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,13 +18,22 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli 0.28.1", +] + [[package]] name = "addr2line" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli", + "gimli 0.29.0", ] [[package]] @@ -33,41 +42,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aead" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" -dependencies = [ - "crypto-common", - "generic-array", -] - -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "aes-gcm" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" -dependencies = [ - "aead", - "aes", - "cipher", - "ctr", - "ghash", - "subtle", -] - [[package]] name = "ahash" version = "0.8.11" @@ -81,12 +55,27 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + [[package]] name = "allocator-api2" version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "ambient-authority" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9d4ee0d472d1cd2e28c97dfa124b3d8d992e10eb0a035f33f5d12e3a177ba3b" + [[package]] name = "android-activity" version = "0.6.0" @@ -138,6 +127,12 @@ dependencies = [ "num-traits", ] +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" + [[package]] name = "arrayref" version = "0.3.7" @@ -165,6 +160,17 @@ dependencies = [ "libloading 0.7.4", ] +[[package]] +name = "async-trait" +version = "0.1.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + [[package]] name = "atk-sys" version = "0.18.0" @@ -195,12 +201,12 @@ version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" dependencies = [ - "addr2line", + "addr2line 0.22.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.35.0", "rustc-demangle", ] @@ -210,6 +216,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "bincode" version = "2.0.0-rc.3" @@ -268,6 +280,15 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + [[package]] name = "block2" version = "0.5.1" @@ -357,6 +378,107 @@ dependencies = [ "wayland-client", ] +[[package]] +name = "cap-fs-ext" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc2d2954524be4866aaa720f008fba9995de54784957a1b0e0119992d6d5e52" +dependencies = [ + "cap-primitives", + "cap-std", + "io-lifetimes", + "windows-sys 0.52.0", +] + +[[package]] +name = "cap-primitives" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00172660727e2d7f808e7cc2bfffd093fdb3ea2ff2ef819289418a3c3ffab5ac" +dependencies = [ + "ambient-authority", + "fs-set-times", + "io-extras", + "io-lifetimes", + "ipnet", + "maybe-owned", + "rustix", + "windows-sys 0.52.0", + "winx", +] + +[[package]] +name = "cap-rand" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "270f1d341a2afc62604f8f688bee4e444d052b7a74c1458dd3aa7efb47d4077f" +dependencies = [ + "ambient-authority", + "rand", +] + +[[package]] +name = "cap-std" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cd9187bb3f7478a4c135ea10473a41a5f029d2ac800c1adf64f35ec7d4c8603" +dependencies = [ + "cap-primitives", + "io-extras", + "io-lifetimes", + "rustix", +] + +[[package]] +name = "cap-time-ext" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91666f31e30c85b1d2ee8432c90987f752c45f5821f5638027b41e73e16a395b" +dependencies = [ + "ambient-authority", + "cap-primitives", + "iana-time-zone", + "once_cell", + "rustix", + "winx", +] + +[[package]] +name = "capnp" +version = "0.19.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de71387912cac7dd3cb7c219e09628411620a18061bba58c71453c26ae7bf66a" +dependencies = [ + "embedded-io 0.6.1", +] + +[[package]] +name = "capnpc" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c75ba30e0f08582d53c2f3710cf4bb65ff562614b1ba86906d7391adffe189ec" +dependencies = [ + "capnp", +] + +[[package]] +name = "cbindgen" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da6bc11b07529f16944307272d5bd9b22530bc7d05751717c9d416586cedab49" +dependencies = [ + "heck 0.4.1", + "indexmap 1.9.3", + "log", + "proc-macro2", + "quote", + "serde", + "serde_json", + "syn 1.0.109", + "tempfile", + "toml 0.5.11", +] + [[package]] name = "cc" version = "1.0.99" @@ -402,16 +524,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - [[package]] name = "clipboard-win" version = "5.3.1" @@ -451,6 +563,12 @@ dependencies = [ "x11rb", ] +[[package]] +name = "cobs" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" + [[package]] name = "codespan-reporting" version = "0.11.1" @@ -578,6 +696,15 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "cpp_demangle" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8227005286ec39567949b33df9896bcadfa6051bccca2488129f108ca23119" +dependencies = [ + "cfg-if", +] + [[package]] name = "cpufeatures" version = "0.2.12" @@ -587,6 +714,116 @@ dependencies = [ "libc", ] +[[package]] +name = "cranelift-bforest" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29daf137addc15da6bab6eae2c4a11e274b1d270bf2759508e62f6145e863ef6" +dependencies = [ + "cranelift-entity", +] + +[[package]] +name = "cranelift-codegen" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de619867d5de4c644b7fd9904d6e3295269c93d8a71013df796ab338681222d4" +dependencies = [ + "bumpalo", + "cranelift-bforest", + "cranelift-codegen-meta", + "cranelift-codegen-shared", + "cranelift-control", + "cranelift-entity", + "cranelift-isle", + "gimli 0.28.1", + "hashbrown 0.14.5", + "log", + "regalloc2", + "rustc-hash", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-codegen-meta" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29f5cf277490037d8dae9513d35e0ee8134670ae4a964a5ed5b198d4249d7c10" +dependencies = [ + "cranelift-codegen-shared", +] + +[[package]] +name = "cranelift-codegen-shared" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3e22ecad1123343a3c09ac6ecc532bb5c184b6fcb7888df0ea953727f79924" + +[[package]] +name = "cranelift-control" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53ca3ec6d30bce84ccf59c81fead4d16381a3ef0ef75e8403bc1e7385980da09" +dependencies = [ + "arbitrary", +] + +[[package]] +name = "cranelift-entity" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eabb8d36b0ca8906bec93c78ea516741cac2d7e6b266fa7b0ffddcc09004990" +dependencies = [ + "serde", + "serde_derive", +] + +[[package]] +name = "cranelift-frontend" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44b42630229e49a8cfcae90bdc43c8c4c08f7a7aa4618b67f79265cd2f996dd2" +dependencies = [ + "cranelift-codegen", + "log", + "smallvec", + "target-lexicon", +] + +[[package]] +name = "cranelift-isle" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "918d1e36361805dfe0b6cdfd5a5ffdb5d03fa796170c5717d2727cbe623b93a0" + +[[package]] +name = "cranelift-native" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75aea85a0d7e1800b14ce9d3f53adf8ad4d1ee8a9e23b0269bdc50285e93b9b3" +dependencies = [ + "cranelift-codegen", + "libc", + "target-lexicon", +] + +[[package]] +name = "cranelift-wasm" +version = "0.108.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dac491fd3473944781f0cf9528c90cc899d18ad438da21961a839a3a44d57dfb" +dependencies = [ + "cranelift-codegen", + "cranelift-entity", + "cranelift-frontend", + "itertools", + "log", + "smallvec", + "wasmparser", + "wasmtime-types", +] + [[package]] name = "crc32fast" version = "1.4.2" @@ -634,7 +871,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", - "rand_core", "typenum", ] @@ -644,15 +880,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f791803201ab277ace03903de1594460708d2d54df6053f2d9e82f592b19e3b" -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - [[package]] name = "cursor-icon" version = "1.1.0" @@ -676,13 +903,62 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c297a1c74b71ae29df00c3e22dd9534821d60eb9af5a0192823fa2acea70c2a" +[[package]] +name = "debugid" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef552e6f588e446098f6ba40d89ac146c8c7b64aade83c051ee00bb5d2bc18d" +dependencies = [ + "uuid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys 0.3.7", +] + [[package]] name = "dirs" version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "dirs-sys", + "dirs-sys 0.4.1", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", ] [[package]] @@ -697,6 +973,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -768,6 +1055,27 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + +[[package]] +name = "encoding_rs" +version = "0.8.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +dependencies = [ + "cfg-if", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -825,6 +1133,77 @@ dependencies = [ "zune-inflate", ] +[[package]] +name = "extism" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772bff1d1a09e26152a7fc08d44bad463a69ae29d85e652dc851a9a2ebc5b7f1" +dependencies = [ + "anyhow", + "cbindgen", + "extism-convert", + "extism-manifest", + "glob", + "libc", + "serde", + "serde_json", + "sha2", + "toml 0.8.14", + "tracing", + "tracing-subscriber", + "ureq", + "url", + "uuid", + "wasi-common", + "wasmtime", +] + +[[package]] +name = "extism-convert" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e5a978634c28e4b150213cc8265c211f24421a8ee5dea4126ece0dc60cbc709" +dependencies = [ + "anyhow", + "base64 0.22.1", + "bytemuck", + "extism-convert-macros", + "prost", + "rmp-serde", + "serde", + "serde_json", +] + +[[package]] +name = "extism-convert-macros" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c40464260bcb3982b9e1967e2446ebea4a4637772c1b39f29b6410f555367092" +dependencies = [ + "manyhow", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "extism-manifest" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a60b6ea31edc0831e28665b4e808175dd5acd4602bfcc5d31f09c97f334238d1" +dependencies = [ + "base64 0.22.1", + "serde", + "serde_json", +] + +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fast-srgb8" version = "1.0.0" @@ -837,6 +1216,17 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +[[package]] +name = "fd-lock" +version = "4.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" +dependencies = [ + "cfg-if", + "rustix", + "windows-sys 0.52.0", +] + [[package]] name = "fdeflate" version = "0.3.4" @@ -846,16 +1236,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "flatbuffers" -version = "24.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8add37afff2d4ffa83bc748a70b4b1370984f6980768554182424ef71447c35f" -dependencies = [ - "bitflags 1.3.2", - "rustc_version", -] - [[package]] name = "flate2" version = "1.0.30" @@ -940,6 +1320,26 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs-set-times" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" +dependencies = [ + "io-lifetimes", + "rustix", + "windows-sys 0.52.0", +] + [[package]] name = "futures" version = "0.3.30" @@ -1030,6 +1430,28 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "fxprof-processed-profile" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" +dependencies = [ + "bitflags 2.5.0", + "debugid", + "fxhash", + "serde", + "serde_json", +] + [[package]] name = "gdk-pixbuf-sys" version = "0.18.0" @@ -1091,16 +1513,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "ghash" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" -dependencies = [ - "opaque-debug", - "polyval", -] - [[package]] name = "gif" version = "0.12.0" @@ -1121,6 +1533,17 @@ dependencies = [ "weezl", ] +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator", + "indexmap 2.2.6", + "stable_deref_trait", +] + [[package]] name = "gimli" version = "0.29.0" @@ -1167,6 +1590,12 @@ dependencies = [ "system-deps", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "glow" version = "0.13.1" @@ -1251,7 +1680,7 @@ checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ "bitflags 2.5.0", "gpu-descriptor-types", - "hashbrown", + "hashbrown 0.14.5", ] [[package]] @@ -1301,6 +1730,21 @@ dependencies = [ "crunchy", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.14.5" @@ -1326,6 +1770,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + [[package]] name = "heck" version = "0.5.0" @@ -1344,10 +1794,33 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "iced" version = "0.13.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=6c1027af8d54ad21e282337b53097eb196d62c00#6c1027af8d54ad21e282337b53097eb196d62c00" +source = "git+https://github.com/iced-rs/iced?rev=978327f9e7f68d3e5bc280faa0617487d8eabc57#978327f9e7f68d3e5bc280faa0617487d8eabc57" dependencies = [ "iced_core", "iced_futures", @@ -1361,7 +1834,7 @@ dependencies = [ [[package]] name = "iced_core" version = "0.13.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=6c1027af8d54ad21e282337b53097eb196d62c00#6c1027af8d54ad21e282337b53097eb196d62c00" +source = "git+https://github.com/iced-rs/iced?rev=978327f9e7f68d3e5bc280faa0617487d8eabc57#978327f9e7f68d3e5bc280faa0617487d8eabc57" dependencies = [ "bitflags 2.5.0", "bytes", @@ -1379,7 +1852,7 @@ dependencies = [ [[package]] name = "iced_futures" version = "0.13.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=6c1027af8d54ad21e282337b53097eb196d62c00#6c1027af8d54ad21e282337b53097eb196d62c00" +source = "git+https://github.com/iced-rs/iced?rev=978327f9e7f68d3e5bc280faa0617487d8eabc57#978327f9e7f68d3e5bc280faa0617487d8eabc57" dependencies = [ "futures", "iced_core", @@ -1393,7 +1866,7 @@ dependencies = [ [[package]] name = "iced_graphics" version = "0.13.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=6c1027af8d54ad21e282337b53097eb196d62c00#6c1027af8d54ad21e282337b53097eb196d62c00" +source = "git+https://github.com/iced-rs/iced?rev=978327f9e7f68d3e5bc280faa0617487d8eabc57#978327f9e7f68d3e5bc280faa0617487d8eabc57" dependencies = [ "bitflags 2.5.0", "bytemuck", @@ -1414,7 +1887,7 @@ dependencies = [ [[package]] name = "iced_renderer" version = "0.13.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=6c1027af8d54ad21e282337b53097eb196d62c00#6c1027af8d54ad21e282337b53097eb196d62c00" +source = "git+https://github.com/iced-rs/iced?rev=978327f9e7f68d3e5bc280faa0617487d8eabc57#978327f9e7f68d3e5bc280faa0617487d8eabc57" dependencies = [ "iced_graphics", "iced_tiny_skia", @@ -1426,7 +1899,7 @@ dependencies = [ [[package]] name = "iced_runtime" version = "0.13.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=6c1027af8d54ad21e282337b53097eb196d62c00#6c1027af8d54ad21e282337b53097eb196d62c00" +source = "git+https://github.com/iced-rs/iced?rev=978327f9e7f68d3e5bc280faa0617487d8eabc57#978327f9e7f68d3e5bc280faa0617487d8eabc57" dependencies = [ "bytes", "iced_core", @@ -1438,7 +1911,7 @@ dependencies = [ [[package]] name = "iced_tiny_skia" version = "0.13.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=6c1027af8d54ad21e282337b53097eb196d62c00#6c1027af8d54ad21e282337b53097eb196d62c00" +source = "git+https://github.com/iced-rs/iced?rev=978327f9e7f68d3e5bc280faa0617487d8eabc57#978327f9e7f68d3e5bc280faa0617487d8eabc57" dependencies = [ "bytemuck", "cosmic-text", @@ -1454,7 +1927,7 @@ dependencies = [ [[package]] name = "iced_wgpu" version = "0.13.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=6c1027af8d54ad21e282337b53097eb196d62c00#6c1027af8d54ad21e282337b53097eb196d62c00" +source = "git+https://github.com/iced-rs/iced?rev=978327f9e7f68d3e5bc280faa0617487d8eabc57#978327f9e7f68d3e5bc280faa0617487d8eabc57" dependencies = [ "bitflags 2.5.0", "bytemuck", @@ -1474,7 +1947,7 @@ dependencies = [ [[package]] name = "iced_widget" version = "0.13.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=6c1027af8d54ad21e282337b53097eb196d62c00#6c1027af8d54ad21e282337b53097eb196d62c00" +source = "git+https://github.com/iced-rs/iced?rev=978327f9e7f68d3e5bc280faa0617487d8eabc57#978327f9e7f68d3e5bc280faa0617487d8eabc57" dependencies = [ "iced_renderer", "iced_runtime", @@ -1487,7 +1960,7 @@ dependencies = [ [[package]] name = "iced_winit" version = "0.13.0-dev" -source = "git+https://github.com/iced-rs/iced?rev=6c1027af8d54ad21e282337b53097eb196d62c00#6c1027af8d54ad21e282337b53097eb196d62c00" +source = "git+https://github.com/iced-rs/iced?rev=978327f9e7f68d3e5bc280faa0617487d8eabc57#978327f9e7f68d3e5bc280faa0617487d8eabc57" dependencies = [ "iced_futures", "iced_graphics", @@ -1503,6 +1976,22 @@ dependencies = [ "winit", ] +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "image" version = "0.24.9" @@ -1527,6 +2016,16 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "029d73f573d8e8d63e6d5020011d3255b28c3ba85d6cf870a07184ed23de9284" +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] + [[package]] name = "indexmap" version = "2.2.6" @@ -1534,16 +2033,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown", -] - -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", + "hashbrown 0.14.5", + "serde", ] [[package]] @@ -1555,6 +2046,28 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "io-extras" +version = "0.18.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9f046b9af244f13b3bd939f55d16830ac3a201e8a9ba9661bfcb03e2be72b9b" +dependencies = [ + "io-lifetimes", + "windows-sys 0.52.0", +] + +[[package]] +name = "io-lifetimes" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a611371471e98973dbcab4e0ec66c31a10bc356eeb4d54a0e05eac8158fe38c" + +[[package]] +name = "ipnet" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + [[package]] name = "is-docker" version = "0.2.0" @@ -1574,6 +2087,41 @@ dependencies = [ "once_cell", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" + +[[package]] +name = "ittapi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b996fe614c41395cdaedf3cf408a9534851090959d90d54a535f675550b64b1" +dependencies = [ + "anyhow", + "ittapi-sys", + "log", +] + +[[package]] +name = "ittapi-sys" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52f5385394064fa2c886205dba02598013ce83d3e92d33dbdc0c52fe0e7bf4fc" +dependencies = [ + "cc", +] + [[package]] name = "jni" version = "0.21.1" @@ -1668,6 +2216,18 @@ dependencies = [ "smallvec", ] +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + [[package]] name = "lebe" version = "0.5.2" @@ -1761,6 +2321,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3262e75e648fce39813cb56ac41f3c3e3f65217ebf3844d818d1f9398cfb0dc" +[[package]] +name = "mach2" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" +dependencies = [ + "libc", +] + [[package]] name = "malloc_buf" version = "0.0.6" @@ -1770,12 +2339,59 @@ dependencies = [ "libc", ] +[[package]] +name = "manyhow" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02bc2a348104913df6d14170bedef54faf224a0970ec7b1f8750748ab94fcd52" +dependencies = [ + "manyhow-macros", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "manyhow-macros" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "532aa12d5846b38a524b3acd99fb74dc8a5f193b33e65dac142ef92bd60f9416" +dependencies = [ + "proc-macro-utils", + "proc-macro2", + "quote", +] + +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "maybe-owned" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" + [[package]] name = "memchr" version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memfd" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" +dependencies = [ + "rustix", +] + [[package]] name = "memmap2" version = "0.8.0" @@ -1794,6 +2410,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +dependencies = [ + "autocfg", +] + [[package]] name = "metal" version = "0.27.0" @@ -1835,7 +2460,7 @@ dependencies = [ "bitflags 2.5.0", "codespan-reporting", "hexf-parse", - "indexmap", + "indexmap 2.2.6", "log", "num-traits", "rustc-hash", @@ -1884,6 +2509,16 @@ dependencies = [ "jni-sys", ] +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -2166,6 +2801,18 @@ dependencies = [ "objc", ] +[[package]] +name = "object" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8dd6c0cdf9429bce006e1362bfce61fa1bfd8c898a643ed8d2b471934701d3d" +dependencies = [ + "crc32fast", + "hashbrown 0.14.5", + "indexmap 2.2.6", + "memchr", +] + [[package]] name = "object" version = "0.35.0" @@ -2181,12 +2828,6 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" -[[package]] -name = "opaque-debug" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" - [[package]] name = "open" version = "5.1.4" @@ -2213,6 +2854,12 @@ dependencies = [ "libredox 0.0.2", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "owned_ttf_parser" version = "0.21.0" @@ -2439,15 +3086,14 @@ dependencies = [ ] [[package]] -name = "polyval" -version = "0.6.2" +name = "postcard" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +checksum = "a55c51ee6c0db07e68448e336cf8ea4131a620edefebf9893e759b2d793420f8" dependencies = [ - "cfg-if", - "cpufeatures", - "opaque-debug", - "universal-hash", + "cobs", + "embedded-io 0.4.0", + "serde", ] [[package]] @@ -2471,6 +3117,17 @@ dependencies = [ "toml_edit 0.21.1", ] +[[package]] +name = "proc-macro-utils" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f59e109e2f795a5070e69578c4dc101068139f74616778025ae1011d4cd41a8" +dependencies = [ + "proc-macro2", + "quote", + "smallvec", +] + [[package]] name = "proc-macro2" version = "1.0.85" @@ -2487,21 +3144,55 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" [[package]] -name = "pumpbin" -version = "0.3.0" +name = "prost" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "psm" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" +dependencies = [ + "cc", +] + +[[package]] +name = "pumpbin" +version = "1.0.0" dependencies = [ - "aes-gcm", "anyhow", "bincode", - "dirs", - "flatbuffers", + "capnp", + "capnpc", + "dirs 5.0.1", + "extism", "iced", "memchr", "open", "rand", "rfd", + "serde", + "serde_json", "tempfile", - "tokio", "winresource", ] @@ -2654,6 +3345,63 @@ dependencies = [ "thiserror", ] +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", +] + +[[package]] +name = "regex" +version = "1.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.4", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + [[package]] name = "renderdoc-sys" version = "1.1.0" @@ -2709,6 +3457,43 @@ dependencies = [ "bytemuck", ] +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rmp" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "228ed7c16fa39782c3b3468e974aec2795e9089153cd08ee2e9aefb3613334c4" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e599a477cf9840e92f2cde9a7189e67b42c57532749bf90aea6ec10facd4db" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + [[package]] name = "roxmltree" version = "0.18.1" @@ -2736,15 +3521,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - [[package]] name = "rustix" version = "0.38.34" @@ -2753,11 +3529,44 @@ checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", "errno", + "itoa", "libc", "linux-raw-sys 0.4.14", + "once_cell", "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + +[[package]] +name = "rustls-webpki" +version = "0.102.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "rustybuzz" version = "0.10.0" @@ -2791,6 +3600,12 @@ dependencies = [ "unicode-script", ] +[[package]] +name = "ryu" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" + [[package]] name = "same-file" version = "1.0.6" @@ -2857,6 +3672,17 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "serde_json" +version = "1.0.120" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +dependencies = [ + "itoa", + "ryu", + "serde", +] + [[package]] name = "serde_spanned" version = "0.6.6" @@ -2866,6 +3692,35 @@ dependencies = [ "serde", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shellexpand" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ccc8076840c4da029af4f87e4e8daeb0fca6b87bbb02e10cb60b791450e11e4" +dependencies = [ + "dirs 4.0.0", +] + [[package]] name = "simd-adler32" version = "0.3.7" @@ -2896,6 +3751,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "slice-group-by" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" + [[package]] name = "slotmap" version = "1.0.7" @@ -2910,6 +3771,9 @@ name = "smallvec" version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +dependencies = [ + "serde", +] [[package]] name = "smithay-client-toolkit" @@ -3007,6 +3871,18 @@ dependencies = [ "bitflags 2.5.0", ] +[[package]] +name = "sptr" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b9b39299b249ad65f3b7e96443bad61c02ca5cd3589f46cb6d610a0fd6c0d6a" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3093,12 +3969,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e535eb8dded36d55ec13eddacd30dec501792ff23a0b1682c38601b8cf2349" dependencies = [ "cfg-expr", - "heck", + "heck 0.5.0", "pkg-config", "toml 0.8.14", "version-compare", ] +[[package]] +name = "system-interface" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b858526d22750088a9b3cf2e3c2aacebd5377f13adeec02860c30d09113010a6" +dependencies = [ + "bitflags 2.5.0", + "cap-fs-ext", + "cap-std", + "fd-lock", + "io-lifetimes", + "rustix", + "windows-sys 0.52.0", + "winx", +] + [[package]] name = "target-lexicon" version = "0.12.14" @@ -3146,6 +4038,16 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + [[package]] name = "tiff" version = "0.9.1" @@ -3222,6 +4124,15 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml" version = "0.7.8" @@ -3261,7 +4172,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -3274,7 +4185,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap", + "indexmap 2.2.6", "toml_datetime", "winnow 0.5.40", ] @@ -3285,7 +4196,7 @@ version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ - "indexmap", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -3298,6 +4209,7 @@ version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3321,6 +4233,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] @@ -3377,6 +4319,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" +[[package]] +name = "unicode-normalization" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-properties" version = "0.1.1" @@ -3414,13 +4365,37 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] -name = "universal-hash" -version = "0.5.1" +name = "untrusted" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d11a831e3c0b56e438a28308e7c810799e3c118417f342d30ecec080105395cd" dependencies = [ - "crypto-common", - "subtle", + "base64 0.22.1", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "rustls-webpki", + "url", + "webpki-roots", +] + +[[package]] +name = "url" +version = "2.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", ] [[package]] @@ -3429,7 +4404,7 @@ version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c51daa774fe9ee5efcf7b4fec13019b8119cda764d9a8b5b06df02bb1445c656" dependencies = [ - "base64", + "base64 0.21.7", "log", "pico-args", "usvg-parser", @@ -3484,6 +4459,21 @@ dependencies = [ "tiny-skia-path", ] +[[package]] +name = "uuid" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" +dependencies = [ + "getrandom", +] + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "version-compare" version = "0.2.0" @@ -3518,6 +4508,32 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi-common" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f1ff7fb4a1ce516d349598c62cc95e077b7016a2cc6471548ab066cc3849078" +dependencies = [ + "anyhow", + "bitflags 2.5.0", + "cap-fs-ext", + "cap-rand", + "cap-std", + "cap-time-ext", + "fs-set-times", + "io-extras", + "io-lifetimes", + "log", + "once_cell", + "rustix", + "system-interface", + "thiserror", + "tracing", + "wasmtime", + "wiggle", + "windows-sys 0.52.0", +] + [[package]] name = "wasm-bindgen" version = "0.2.92" @@ -3584,6 +4600,24 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +[[package]] +name = "wasm-encoder" +version = "0.207.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d996306fb3aeaee0d9157adbe2f670df0236caf19f6728b221e92d0f27b3fe17" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasm-encoder" +version = "0.212.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501940df4418b8929eb6d52f1aade1fdd15a5b86c92453cb696e3c906bd3fc33" +dependencies = [ + "leb128", +] + [[package]] name = "wasm-timer" version = "0.2.5" @@ -3599,6 +4633,313 @@ dependencies = [ "web-sys", ] +[[package]] +name = "wasmparser" +version = "0.207.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e19bb9f8ab07616da582ef8adb24c54f1424c7ec876720b7da9db8ec0626c92c" +dependencies = [ + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap 2.2.6", + "semver", +] + +[[package]] +name = "wasmprinter" +version = "0.207.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c2d8a7b4dabb460208e6b4334d9db5766e84505038b2529e69c3d07ac619115" +dependencies = [ + "anyhow", + "wasmparser", +] + +[[package]] +name = "wasmtime" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f92a1370c66a0022e6d92dcc277e2c84f5dece19569670b8ce7db8162560d8b6" +dependencies = [ + "addr2line 0.21.0", + "anyhow", + "async-trait", + "bumpalo", + "cc", + "cfg-if", + "encoding_rs", + "fxprof-processed-profile", + "gimli 0.28.1", + "hashbrown 0.14.5", + "indexmap 2.2.6", + "ittapi", + "libc", + "libm", + "log", + "mach2", + "memfd", + "memoffset", + "object 0.33.0", + "once_cell", + "paste", + "postcard", + "psm", + "rayon", + "rustix", + "semver", + "serde", + "serde_derive", + "serde_json", + "smallvec", + "sptr", + "target-lexicon", + "wasm-encoder 0.207.0", + "wasmparser", + "wasmtime-asm-macros", + "wasmtime-cache", + "wasmtime-component-macro", + "wasmtime-component-util", + "wasmtime-cranelift", + "wasmtime-environ", + "wasmtime-fiber", + "wasmtime-jit-debug", + "wasmtime-jit-icache-coherence", + "wasmtime-slab", + "wasmtime-versioned-export-macros", + "wasmtime-winch", + "wat", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-asm-macros" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dee8679c974a7f258c03d60d3c747c426ed219945b6d08cbc77fd2eab15b2d1" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "wasmtime-cache" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b00103ffaf7ee980f4e750fe272b6ada79d9901659892e457c7ca316b16df9ec" +dependencies = [ + "anyhow", + "base64 0.21.7", + "directories-next", + "log", + "postcard", + "rustix", + "serde", + "serde_derive", + "sha2", + "toml 0.8.14", + "windows-sys 0.52.0", + "zstd", +] + +[[package]] +name = "wasmtime-component-macro" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cae30035f1cf97dcc6657c979cf39f99ce6be93583675eddf4aeaa5548509c" +dependencies = [ + "anyhow", + "proc-macro2", + "quote", + "syn 2.0.66", + "wasmtime-component-util", + "wasmtime-wit-bindgen", + "wit-parser", +] + +[[package]] +name = "wasmtime-component-util" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7ae611f08cea620c67330925be28a96115bf01f8f393a6cbdf4856a86087134" + +[[package]] +name = "wasmtime-cranelift" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2909406a6007e28be964067167890bca4574bd48a9ff18f1fa9f4856d89ea40" +dependencies = [ + "anyhow", + "cfg-if", + "cranelift-codegen", + "cranelift-control", + "cranelift-entity", + "cranelift-frontend", + "cranelift-native", + "cranelift-wasm", + "gimli 0.28.1", + "log", + "object 0.33.0", + "target-lexicon", + "thiserror", + "wasmparser", + "wasmtime-environ", + "wasmtime-versioned-export-macros", +] + +[[package]] +name = "wasmtime-environ" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40e227f9ed2f5421473723d6c0352b5986e6e6044fde5410a274a394d726108f" +dependencies = [ + "anyhow", + "cpp_demangle", + "cranelift-entity", + "gimli 0.28.1", + "indexmap 2.2.6", + "log", + "object 0.33.0", + "postcard", + "rustc-demangle", + "serde", + "serde_derive", + "target-lexicon", + "wasm-encoder 0.207.0", + "wasmparser", + "wasmprinter", + "wasmtime-component-util", + "wasmtime-types", +] + +[[package]] +name = "wasmtime-fiber" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42edb392586d07038c1638e854382db916b6ca7845a2e6a7f8dc49e08907acdd" +dependencies = [ + "anyhow", + "cc", + "cfg-if", + "rustix", + "wasmtime-asm-macros", + "wasmtime-versioned-export-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-jit-debug" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b26ef7914af0c0e3ca811bdc32f5f66fbba0fd21e1f8563350e8a7951e3598" +dependencies = [ + "object 0.33.0", + "once_cell", + "rustix", + "wasmtime-versioned-export-macros", +] + +[[package]] +name = "wasmtime-jit-icache-coherence" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afe088f9b56bb353adaf837bf7e10f1c2e1676719dd5be4cac8e37f2ba1ee5bc" +dependencies = [ + "anyhow", + "cfg-if", + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "wasmtime-slab" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ff75cafffe47b04b036385ce3710f209153525b0ed19d57b0cf44a22d446460" + +[[package]] +name = "wasmtime-types" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f2fa462bfea3220711c84e2b549f147e4df89eeb49b8a2a3d89148f6cc4a8b1" +dependencies = [ + "cranelift-entity", + "serde", + "serde_derive", + "smallvec", + "wasmparser", +] + +[[package]] +name = "wasmtime-versioned-export-macros" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4cedc5bfef3db2a85522ee38564b47ef3b7fc7c92e94cacbce99808e63cdd47" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "wasmtime-winch" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97b27054fed6be4f3800aba5766f7ef435d4220ce290788f021a08d4fa573108" +dependencies = [ + "anyhow", + "cranelift-codegen", + "gimli 0.28.1", + "object 0.33.0", + "target-lexicon", + "wasmparser", + "wasmtime-cranelift", + "wasmtime-environ", + "winch-codegen", +] + +[[package]] +name = "wasmtime-wit-bindgen" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c936a52ce69c28de2aa3b5fb4f2dbbb2966df304f04cccb7aca4ba56d915fda0" +dependencies = [ + "anyhow", + "heck 0.4.1", + "indexmap 2.2.6", + "wit-parser", +] + +[[package]] +name = "wast" +version = "35.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ef140f1b49946586078353a453a1d28ba90adfc54dde75710bc1931de204d68" +dependencies = [ + "leb128", +] + +[[package]] +name = "wast" +version = "212.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4606a05fb0aae5d11dd7d8280a640d88a63ee019360ba9be552da3d294b8d1f5" +dependencies = [ + "bumpalo", + "leb128", + "memchr", + "unicode-width", + "wasm-encoder 0.212.0", +] + +[[package]] +name = "wat" +version = "1.212.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c74ca7f93f11a5d6eed8499f2a8daaad6e225cab0151bc25a091fff3b987532f" +dependencies = [ + "wast 212.0.0", +] + [[package]] name = "wayland-backend" version = "0.3.4" @@ -3728,6 +5069,15 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki-roots" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "weezl" version = "0.1.8" @@ -3770,7 +5120,7 @@ dependencies = [ "bitflags 2.5.0", "cfg_aliases 0.1.1", "codespan-reporting", - "indexmap", + "indexmap 2.2.6", "log", "naga", "once_cell", @@ -3847,6 +5197,48 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" +[[package]] +name = "wiggle" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89ea6f74ece6d1cfbd089783006b8eb69a0219ca83cad22068f0d9fa9df3f91" +dependencies = [ + "anyhow", + "async-trait", + "bitflags 2.5.0", + "thiserror", + "tracing", + "wasmtime", + "wiggle-macro", +] + +[[package]] +name = "wiggle-generate" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36beda94813296ecaf0d91b7ada9da073fd41865ba339bdd3b7764e2e785b8e9" +dependencies = [ + "anyhow", + "heck 0.4.1", + "proc-macro2", + "quote", + "shellexpand", + "syn 2.0.66", + "witx", +] + +[[package]] +name = "wiggle-macro" +version = "21.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b47d2b4442ce93106dba5d1a9c59d5f85b5732878bb3d0598d3c93c0d01b16b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", + "wiggle-generate", +] + [[package]] name = "winapi" version = "0.3.9" @@ -3878,6 +5270,23 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "winch-codegen" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dc69899ccb2da7daa4df31426dcfd284b104d1a85e1dae35806df0c46187f87" +dependencies = [ + "anyhow", + "cranelift-codegen", + "gimli 0.28.1", + "regalloc2", + "smallvec", + "target-lexicon", + "wasmparser", + "wasmtime-cranelift", + "wasmtime-environ", +] + [[package]] name = "window_clipboard" version = "0.4.1" @@ -4195,6 +5604,46 @@ dependencies = [ "version_check", ] +[[package]] +name = "winx" +version = "0.36.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9643b83820c0cd246ecabe5fa454dd04ba4fa67996369466d0747472d337346" +dependencies = [ + "bitflags 2.5.0", + "windows-sys 0.52.0", +] + +[[package]] +name = "wit-parser" +version = "0.207.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c83dab33a9618d86cfe3563cc864deffd08c17efc5db31a3b7cd1edeffe6e1" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.2.6", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "witx" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e366f27a5cabcddb2706a78296a40b8fcc451e1a6aba2fc1d94b4a01bdaaef4b" +dependencies = [ + "anyhow", + "log", + "thiserror", + "wast 35.0.2", +] + [[package]] name = "x11-dl" version = "2.21.0" @@ -4302,6 +5751,40 @@ dependencies = [ "syn 2.0.66", ] +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" + +[[package]] +name = "zstd" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.11+zstd.1.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" +dependencies = [ + "cc", + "pkg-config", +] + [[package]] name = "zune-inflate" version = "0.2.54" diff --git a/Cargo.toml b/Cargo.toml index dfa084f..08e153f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pumpbin" -version = "0.3.0" +version = "1.0.0" authors = ["b1n "] edition = "2021" description = "PumpBin is an Implant Generation Platform." @@ -19,19 +19,20 @@ path = "src/bin/maker.rs" [dependencies] rfd = { version = "0.14.1", default-features = false , features = ["gtk3"]} dirs = "5.0.1" -flatbuffers = "24.3.25" open = "5.1.4" bincode = { version = "2.0.0-rc.3", default-features = false , features = ["alloc", "derive", "std"]} anyhow = "1.0.86" rand = "0.8.5" memchr = "2.7.4" -aes-gcm = "0.10.3" -tokio = { version = "1.38.0", default-features = false , features = ["time"]} +capnp = "0.19" +extism = "1.4.1" +serde = { version = "1.0.203", features = ["derive"] } +serde_json = "1.0.120" [dependencies.iced] version = "0.13.0-dev" git = "https://github.com/iced-rs/iced" -rev = "6c1027af8d54ad21e282337b53097eb196d62c00" +rev = "978327f9e7f68d3e5bc280faa0617487d8eabc57" default-features = false features = ["advanced", "svg", "tokio", "wgpu", "image"] @@ -44,6 +45,9 @@ winresource = "0.1.17" [dev-dependencies] tempfile = "3.10.1" +[build-dependencies] +capnpc = "0.19" + [profile.release] strip = true opt-level = 3 diff --git a/build.rs b/build.rs index 24550ad..e154a9e 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,16 @@ +fn build_capnp() { + capnpc::CompilerCommand::new() + .src_prefix("capnp") + .file("capnp/plugin.capnp") + .output_path("capnp") + .run() + .expect("schema compiler command"); +} + fn main() { + #[cfg(debug_assertions)] + build_capnp(); + #[cfg(target_os = "windows")] { let mut res = winresource::WindowsResource::new(); diff --git a/capnp/plugin.capnp b/capnp/plugin.capnp new file mode 100644 index 0000000..45df1f4 --- /dev/null +++ b/capnp/plugin.capnp @@ -0,0 +1,40 @@ +@0x96d5aac4519892f3; + +struct Plugin { + version @0 : Text; + info @1 :PluginInfo; + replace @2 :PluginReplace; + bins @3 :PluginBins; + plugins @4 :PluginPlugins; + + struct PluginInfo{ + pluginName @0 :Text; + author @1 :Text; + version @2 :Text; + desc @3 :Text; + } + + struct PluginReplace { + srcPrefix @0 :Data; + sizeHolder @1 :Data; + maxLen @2 :UInt64; + } + + struct PluginBins { + windows @0 :Bins; + linux @1 :Bins; + darwin @2 :Bins; + + struct Bins { + executable @0 :Data; + dynamicLibrary @1 :Data; + } + } + + struct PluginPlugins { + encryptShellcode @0 :Data; + formatEncryptedShellcode @1 :Data; + formatUrlRemote @2 :Data; + uploadFinalShellcodeRemote @3 :Data; + } +} diff --git a/capnp/plugin_capnp.rs b/capnp/plugin_capnp.rs new file mode 100644 index 0000000..d616b1d --- /dev/null +++ b/capnp/plugin_capnp.rs @@ -0,0 +1,1890 @@ +// @generated by the capnpc-rust plugin to the Cap'n Proto schema compiler. +// DO NOT EDIT. +// source: plugin.capnp + + +pub mod plugin { + #[derive(Copy, Clone)] + pub struct Owned(()); + impl ::capnp::introspect::Introspect for Owned { fn introspect() -> ::capnp::introspect::Type { ::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } } + impl ::capnp::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; } + impl ::capnp::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; } + impl ::capnp::traits::Pipelined for Owned { type Pipeline = Pipeline; } + + pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> } + impl <'a,> ::core::marker::Copy for Reader<'a,> {} + impl <'a,> ::core::clone::Clone for Reader<'a,> { + fn clone(&self) -> Self { *self } + } + + impl <'a,> ::capnp::traits::HasTypeId for Reader<'a,> { + const TYPE_ID: u64 = _private::TYPE_ID; + } + impl <'a,> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a,> { + fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self { + Self { reader, } + } + } + + impl <'a,> ::core::convert::From> for ::capnp::dynamic_value::Reader<'a> { + fn from(reader: Reader<'a,>) -> Self { + Self::Struct(::capnp::dynamic_struct::Reader::new(reader.reader, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>}))) + } + } + + impl <'a,> ::core::fmt::Debug for Reader<'a,> { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> { + core::fmt::Debug::fmt(&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self), f) + } + } + + impl <'a,> ::capnp::traits::FromPointerReader<'a> for Reader<'a,> { + fn get_from_pointer(reader: &::capnp::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result { + ::core::result::Result::Ok(reader.get_struct(default)?.into()) + } + } + + impl <'a,> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a,> { + fn into_internal_struct_reader(self) -> ::capnp::private::layout::StructReader<'a> { + self.reader + } + } + + impl <'a,> ::capnp::traits::Imbue<'a> for Reader<'a,> { + fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) { + self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table)) + } + } + + impl <'a,> Reader<'a,> { + pub fn reborrow(&self) -> Reader<'_,> { + Self { .. *self } + } + + pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { + self.reader.total_size() + } + #[inline] + pub fn get_version(self) -> ::capnp::Result<::capnp::text::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None) + } + #[inline] + pub fn has_version(&self) -> bool { + !self.reader.get_pointer_field(0).is_null() + } + #[inline] + pub fn get_info(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(1), ::core::option::Option::None) + } + #[inline] + pub fn has_info(&self) -> bool { + !self.reader.get_pointer_field(1).is_null() + } + #[inline] + pub fn get_replace(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(2), ::core::option::Option::None) + } + #[inline] + pub fn has_replace(&self) -> bool { + !self.reader.get_pointer_field(2).is_null() + } + #[inline] + pub fn get_bins(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(3), ::core::option::Option::None) + } + #[inline] + pub fn has_bins(&self) -> bool { + !self.reader.get_pointer_field(3).is_null() + } + #[inline] + pub fn get_plugins(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(4), ::core::option::Option::None) + } + #[inline] + pub fn has_plugins(&self) -> bool { + !self.reader.get_pointer_field(4).is_null() + } + } + + pub struct Builder<'a> { builder: ::capnp::private::layout::StructBuilder<'a> } + impl <'a,> ::capnp::traits::HasStructSize for Builder<'a,> { + const STRUCT_SIZE: ::capnp::private::layout::StructSize = ::capnp::private::layout::StructSize { data: 0, pointers: 5 }; + } + impl <'a,> ::capnp::traits::HasTypeId for Builder<'a,> { + const TYPE_ID: u64 = _private::TYPE_ID; + } + impl <'a,> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a,> { + fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self { + Self { builder, } + } + } + + impl <'a,> ::core::convert::From> for ::capnp::dynamic_value::Builder<'a> { + fn from(builder: Builder<'a,>) -> Self { + Self::Struct(::capnp::dynamic_struct::Builder::new(builder.builder, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>}))) + } + } + + impl <'a,> ::capnp::traits::ImbueMut<'a> for Builder<'a,> { + fn imbue_mut(&mut self, cap_table: &'a mut ::capnp::private::layout::CapTable) { + self.builder.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table)) + } + } + + impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> { + fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self { + builder.init_struct(::STRUCT_SIZE).into() + } + fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result { + ::core::result::Result::Ok(builder.get_struct(::STRUCT_SIZE, default)?.into()) + } + } + + impl <'a,> ::capnp::traits::SetterInput> for Reader<'a,> { + fn set_pointer_builder(mut pointer: ::capnp::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::capnp::Result<()> { pointer.set_struct(&value.reader, canonicalize) } + } + + impl <'a,> Builder<'a,> { + pub fn into_reader(self) -> Reader<'a,> { + self.builder.into_reader().into() + } + pub fn reborrow(&mut self) -> Builder<'_,> { + Builder { builder: self.builder.reborrow() } + } + pub fn reborrow_as_reader(&self) -> Reader<'_,> { + self.builder.as_reader().into() + } + + pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { + self.builder.as_reader().total_size() + } + #[inline] + pub fn get_version(self) -> ::capnp::Result<::capnp::text::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None) + } + #[inline] + pub fn set_version(&mut self, value: impl ::capnp::traits::SetterInput<::capnp::text::Owned>) { + ::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false).unwrap() + } + #[inline] + pub fn init_version(self, size: u32) -> ::capnp::text::Builder<'a> { + self.builder.get_pointer_field(0).init_text(size) + } + #[inline] + pub fn has_version(&self) -> bool { + !self.builder.is_pointer_field_null(0) + } + #[inline] + pub fn get_info(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(1), ::core::option::Option::None) + } + #[inline] + pub fn set_info(&mut self, value: crate::plugin_capnp::plugin::plugin_info::Reader<'_>) -> ::capnp::Result<()> { + ::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(1), value, false) + } + #[inline] + pub fn init_info(self, ) -> crate::plugin_capnp::plugin::plugin_info::Builder<'a> { + ::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(1), 0) + } + #[inline] + pub fn has_info(&self) -> bool { + !self.builder.is_pointer_field_null(1) + } + #[inline] + pub fn get_replace(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(2), ::core::option::Option::None) + } + #[inline] + pub fn set_replace(&mut self, value: crate::plugin_capnp::plugin::plugin_replace::Reader<'_>) -> ::capnp::Result<()> { + ::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(2), value, false) + } + #[inline] + pub fn init_replace(self, ) -> crate::plugin_capnp::plugin::plugin_replace::Builder<'a> { + ::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(2), 0) + } + #[inline] + pub fn has_replace(&self) -> bool { + !self.builder.is_pointer_field_null(2) + } + #[inline] + pub fn get_bins(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(3), ::core::option::Option::None) + } + #[inline] + pub fn set_bins(&mut self, value: crate::plugin_capnp::plugin::plugin_bins::Reader<'_>) -> ::capnp::Result<()> { + ::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(3), value, false) + } + #[inline] + pub fn init_bins(self, ) -> crate::plugin_capnp::plugin::plugin_bins::Builder<'a> { + ::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(3), 0) + } + #[inline] + pub fn has_bins(&self) -> bool { + !self.builder.is_pointer_field_null(3) + } + #[inline] + pub fn get_plugins(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(4), ::core::option::Option::None) + } + #[inline] + pub fn set_plugins(&mut self, value: crate::plugin_capnp::plugin::plugin_plugins::Reader<'_>) -> ::capnp::Result<()> { + ::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(4), value, false) + } + #[inline] + pub fn init_plugins(self, ) -> crate::plugin_capnp::plugin::plugin_plugins::Builder<'a> { + ::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(4), 0) + } + #[inline] + pub fn has_plugins(&self) -> bool { + !self.builder.is_pointer_field_null(4) + } + } + + pub struct Pipeline { _typeless: ::capnp::any_pointer::Pipeline } + impl ::capnp::capability::FromTypelessPipeline for Pipeline { + fn new(typeless: ::capnp::any_pointer::Pipeline) -> Self { + Self { _typeless: typeless, } + } + } + impl Pipeline { + pub fn get_info(&self) -> crate::plugin_capnp::plugin::plugin_info::Pipeline { + ::capnp::capability::FromTypelessPipeline::new(self._typeless.get_pointer_field(1)) + } + pub fn get_replace(&self) -> crate::plugin_capnp::plugin::plugin_replace::Pipeline { + ::capnp::capability::FromTypelessPipeline::new(self._typeless.get_pointer_field(2)) + } + pub fn get_bins(&self) -> crate::plugin_capnp::plugin::plugin_bins::Pipeline { + ::capnp::capability::FromTypelessPipeline::new(self._typeless.get_pointer_field(3)) + } + pub fn get_plugins(&self) -> crate::plugin_capnp::plugin::plugin_plugins::Pipeline { + ::capnp::capability::FromTypelessPipeline::new(self._typeless.get_pointer_field(4)) + } + } + mod _private { + pub static ENCODED_NODE: [::capnp::Word; 108] = [ + ::capnp::word(0, 0, 0, 0, 5, 0, 6, 0), + ::capnp::word(92, 101, 1, 68, 164, 204, 248, 159), + ::capnp::word(13, 0, 0, 0, 1, 0, 0, 0), + ::capnp::word(243, 146, 152, 81, 196, 170, 213, 150), + ::capnp::word(5, 0, 7, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(21, 0, 0, 0, 162, 0, 0, 0), + ::capnp::word(29, 0, 0, 0, 71, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(89, 0, 0, 0, 31, 1, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(112, 108, 117, 103, 105, 110, 46, 99), + ::capnp::word(97, 112, 110, 112, 58, 80, 108, 117), + ::capnp::word(103, 105, 110, 0, 0, 0, 0, 0), + ::capnp::word(16, 0, 0, 0, 1, 0, 1, 0), + ::capnp::word(210, 52, 175, 111, 107, 161, 231, 161), + ::capnp::word(25, 0, 0, 0, 90, 0, 0, 0), + ::capnp::word(158, 39, 107, 47, 97, 247, 34, 130), + ::capnp::word(25, 0, 0, 0, 114, 0, 0, 0), + ::capnp::word(110, 60, 225, 90, 70, 139, 64, 208), + ::capnp::word(25, 0, 0, 0, 90, 0, 0, 0), + ::capnp::word(72, 146, 45, 0, 197, 146, 163, 230), + ::capnp::word(25, 0, 0, 0, 114, 0, 0, 0), + ::capnp::word(80, 108, 117, 103, 105, 110, 73, 110), + ::capnp::word(102, 111, 0, 0, 0, 0, 0, 0), + ::capnp::word(80, 108, 117, 103, 105, 110, 82, 101), + ::capnp::word(112, 108, 97, 99, 101, 0, 0, 0), + ::capnp::word(80, 108, 117, 103, 105, 110, 66, 105), + ::capnp::word(110, 115, 0, 0, 0, 0, 0, 0), + ::capnp::word(80, 108, 117, 103, 105, 110, 80, 108), + ::capnp::word(117, 103, 105, 110, 115, 0, 0, 0), + ::capnp::word(20, 0, 0, 0, 3, 0, 4, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(125, 0, 0, 0, 66, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(120, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(132, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(1, 0, 0, 0, 1, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 1, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(129, 0, 0, 0, 42, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(124, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(136, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(2, 0, 0, 0, 2, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 2, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(133, 0, 0, 0, 66, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(128, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(140, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(3, 0, 0, 0, 3, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 3, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(137, 0, 0, 0, 42, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(132, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(144, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(4, 0, 0, 0, 4, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 4, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(141, 0, 0, 0, 66, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(136, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(148, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(118, 101, 114, 115, 105, 111, 110, 0), + ::capnp::word(12, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(12, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(105, 110, 102, 111, 0, 0, 0, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(210, 52, 175, 111, 107, 161, 231, 161), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(114, 101, 112, 108, 97, 99, 101, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(158, 39, 107, 47, 97, 247, 34, 130), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(98, 105, 110, 115, 0, 0, 0, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(110, 60, 225, 90, 70, 139, 64, 208), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(112, 108, 117, 103, 105, 110, 115, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(72, 146, 45, 0, 197, 146, 163, 230), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ]; + pub fn get_field_types(index: u16) -> ::capnp::introspect::Type { + match index { + 0 => <::capnp::text::Owned as ::capnp::introspect::Introspect>::introspect(), + 1 => ::introspect(), + 2 => ::introspect(), + 3 => ::introspect(), + 4 => ::introspect(), + _ => panic!("invalid field index {}", index), + } + } + pub fn get_annotation_types(child_index: Option, index: u32) -> ::capnp::introspect::Type { + panic!("invalid annotation indices ({:?}, {}) ", child_index, index) + } + pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema = ::capnp::introspect::RawStructSchema { + encoded_node: &ENCODED_NODE, + nonunion_members: NONUNION_MEMBERS, + members_by_discriminant: MEMBERS_BY_DISCRIMINANT, + members_by_name: MEMBERS_BY_NAME, + }; + pub static NONUNION_MEMBERS : &[u16] = &[0,1,2,3,4]; + pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[]; + pub static MEMBERS_BY_NAME : &[u16] = &[3,1,4,2,0]; + pub const TYPE_ID: u64 = 0x9ff8_cca4_4401_655c; + } + + pub mod plugin_info { + #[derive(Copy, Clone)] + pub struct Owned(()); + impl ::capnp::introspect::Introspect for Owned { fn introspect() -> ::capnp::introspect::Type { ::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } } + impl ::capnp::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; } + impl ::capnp::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; } + impl ::capnp::traits::Pipelined for Owned { type Pipeline = Pipeline; } + + pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> } + impl <'a,> ::core::marker::Copy for Reader<'a,> {} + impl <'a,> ::core::clone::Clone for Reader<'a,> { + fn clone(&self) -> Self { *self } + } + + impl <'a,> ::capnp::traits::HasTypeId for Reader<'a,> { + const TYPE_ID: u64 = _private::TYPE_ID; + } + impl <'a,> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a,> { + fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self { + Self { reader, } + } + } + + impl <'a,> ::core::convert::From> for ::capnp::dynamic_value::Reader<'a> { + fn from(reader: Reader<'a,>) -> Self { + Self::Struct(::capnp::dynamic_struct::Reader::new(reader.reader, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>}))) + } + } + + impl <'a,> ::core::fmt::Debug for Reader<'a,> { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> { + core::fmt::Debug::fmt(&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self), f) + } + } + + impl <'a,> ::capnp::traits::FromPointerReader<'a> for Reader<'a,> { + fn get_from_pointer(reader: &::capnp::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result { + ::core::result::Result::Ok(reader.get_struct(default)?.into()) + } + } + + impl <'a,> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a,> { + fn into_internal_struct_reader(self) -> ::capnp::private::layout::StructReader<'a> { + self.reader + } + } + + impl <'a,> ::capnp::traits::Imbue<'a> for Reader<'a,> { + fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) { + self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table)) + } + } + + impl <'a,> Reader<'a,> { + pub fn reborrow(&self) -> Reader<'_,> { + Self { .. *self } + } + + pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { + self.reader.total_size() + } + #[inline] + pub fn get_plugin_name(self) -> ::capnp::Result<::capnp::text::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None) + } + #[inline] + pub fn has_plugin_name(&self) -> bool { + !self.reader.get_pointer_field(0).is_null() + } + #[inline] + pub fn get_author(self) -> ::capnp::Result<::capnp::text::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(1), ::core::option::Option::None) + } + #[inline] + pub fn has_author(&self) -> bool { + !self.reader.get_pointer_field(1).is_null() + } + #[inline] + pub fn get_version(self) -> ::capnp::Result<::capnp::text::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(2), ::core::option::Option::None) + } + #[inline] + pub fn has_version(&self) -> bool { + !self.reader.get_pointer_field(2).is_null() + } + #[inline] + pub fn get_desc(self) -> ::capnp::Result<::capnp::text::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(3), ::core::option::Option::None) + } + #[inline] + pub fn has_desc(&self) -> bool { + !self.reader.get_pointer_field(3).is_null() + } + } + + pub struct Builder<'a> { builder: ::capnp::private::layout::StructBuilder<'a> } + impl <'a,> ::capnp::traits::HasStructSize for Builder<'a,> { + const STRUCT_SIZE: ::capnp::private::layout::StructSize = ::capnp::private::layout::StructSize { data: 0, pointers: 4 }; + } + impl <'a,> ::capnp::traits::HasTypeId for Builder<'a,> { + const TYPE_ID: u64 = _private::TYPE_ID; + } + impl <'a,> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a,> { + fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self { + Self { builder, } + } + } + + impl <'a,> ::core::convert::From> for ::capnp::dynamic_value::Builder<'a> { + fn from(builder: Builder<'a,>) -> Self { + Self::Struct(::capnp::dynamic_struct::Builder::new(builder.builder, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>}))) + } + } + + impl <'a,> ::capnp::traits::ImbueMut<'a> for Builder<'a,> { + fn imbue_mut(&mut self, cap_table: &'a mut ::capnp::private::layout::CapTable) { + self.builder.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table)) + } + } + + impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> { + fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self { + builder.init_struct(::STRUCT_SIZE).into() + } + fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result { + ::core::result::Result::Ok(builder.get_struct(::STRUCT_SIZE, default)?.into()) + } + } + + impl <'a,> ::capnp::traits::SetterInput> for Reader<'a,> { + fn set_pointer_builder(mut pointer: ::capnp::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::capnp::Result<()> { pointer.set_struct(&value.reader, canonicalize) } + } + + impl <'a,> Builder<'a,> { + pub fn into_reader(self) -> Reader<'a,> { + self.builder.into_reader().into() + } + pub fn reborrow(&mut self) -> Builder<'_,> { + Builder { builder: self.builder.reborrow() } + } + pub fn reborrow_as_reader(&self) -> Reader<'_,> { + self.builder.as_reader().into() + } + + pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { + self.builder.as_reader().total_size() + } + #[inline] + pub fn get_plugin_name(self) -> ::capnp::Result<::capnp::text::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None) + } + #[inline] + pub fn set_plugin_name(&mut self, value: impl ::capnp::traits::SetterInput<::capnp::text::Owned>) { + ::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false).unwrap() + } + #[inline] + pub fn init_plugin_name(self, size: u32) -> ::capnp::text::Builder<'a> { + self.builder.get_pointer_field(0).init_text(size) + } + #[inline] + pub fn has_plugin_name(&self) -> bool { + !self.builder.is_pointer_field_null(0) + } + #[inline] + pub fn get_author(self) -> ::capnp::Result<::capnp::text::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(1), ::core::option::Option::None) + } + #[inline] + pub fn set_author(&mut self, value: impl ::capnp::traits::SetterInput<::capnp::text::Owned>) { + ::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(1), value, false).unwrap() + } + #[inline] + pub fn init_author(self, size: u32) -> ::capnp::text::Builder<'a> { + self.builder.get_pointer_field(1).init_text(size) + } + #[inline] + pub fn has_author(&self) -> bool { + !self.builder.is_pointer_field_null(1) + } + #[inline] + pub fn get_version(self) -> ::capnp::Result<::capnp::text::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(2), ::core::option::Option::None) + } + #[inline] + pub fn set_version(&mut self, value: impl ::capnp::traits::SetterInput<::capnp::text::Owned>) { + ::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(2), value, false).unwrap() + } + #[inline] + pub fn init_version(self, size: u32) -> ::capnp::text::Builder<'a> { + self.builder.get_pointer_field(2).init_text(size) + } + #[inline] + pub fn has_version(&self) -> bool { + !self.builder.is_pointer_field_null(2) + } + #[inline] + pub fn get_desc(self) -> ::capnp::Result<::capnp::text::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(3), ::core::option::Option::None) + } + #[inline] + pub fn set_desc(&mut self, value: impl ::capnp::traits::SetterInput<::capnp::text::Owned>) { + ::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(3), value, false).unwrap() + } + #[inline] + pub fn init_desc(self, size: u32) -> ::capnp::text::Builder<'a> { + self.builder.get_pointer_field(3).init_text(size) + } + #[inline] + pub fn has_desc(&self) -> bool { + !self.builder.is_pointer_field_null(3) + } + } + + pub struct Pipeline { _typeless: ::capnp::any_pointer::Pipeline } + impl ::capnp::capability::FromTypelessPipeline for Pipeline { + fn new(typeless: ::capnp::any_pointer::Pipeline) -> Self { + Self { _typeless: typeless, } + } + } + impl Pipeline { + } + mod _private { + pub static ENCODED_NODE: [::capnp::Word; 79] = [ + ::capnp::word(0, 0, 0, 0, 5, 0, 6, 0), + ::capnp::word(210, 52, 175, 111, 107, 161, 231, 161), + ::capnp::word(20, 0, 0, 0, 1, 0, 0, 0), + ::capnp::word(92, 101, 1, 68, 164, 204, 248, 159), + ::capnp::word(4, 0, 7, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(21, 0, 0, 0, 250, 0, 0, 0), + ::capnp::word(33, 0, 0, 0, 7, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(29, 0, 0, 0, 231, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(112, 108, 117, 103, 105, 110, 46, 99), + ::capnp::word(97, 112, 110, 112, 58, 80, 108, 117), + ::capnp::word(103, 105, 110, 46, 80, 108, 117, 103), + ::capnp::word(105, 110, 73, 110, 102, 111, 0, 0), + ::capnp::word(0, 0, 0, 0, 1, 0, 1, 0), + ::capnp::word(16, 0, 0, 0, 3, 0, 4, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(97, 0, 0, 0, 90, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(96, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(108, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(1, 0, 0, 0, 1, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 1, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(105, 0, 0, 0, 58, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(100, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(112, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(2, 0, 0, 0, 2, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 2, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(109, 0, 0, 0, 66, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(104, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(116, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(3, 0, 0, 0, 3, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 3, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(113, 0, 0, 0, 42, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(108, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(120, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(112, 108, 117, 103, 105, 110, 78, 97), + ::capnp::word(109, 101, 0, 0, 0, 0, 0, 0), + ::capnp::word(12, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(12, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(97, 117, 116, 104, 111, 114, 0, 0), + ::capnp::word(12, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(12, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(118, 101, 114, 115, 105, 111, 110, 0), + ::capnp::word(12, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(12, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(100, 101, 115, 99, 0, 0, 0, 0), + ::capnp::word(12, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(12, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ]; + pub fn get_field_types(index: u16) -> ::capnp::introspect::Type { + match index { + 0 => <::capnp::text::Owned as ::capnp::introspect::Introspect>::introspect(), + 1 => <::capnp::text::Owned as ::capnp::introspect::Introspect>::introspect(), + 2 => <::capnp::text::Owned as ::capnp::introspect::Introspect>::introspect(), + 3 => <::capnp::text::Owned as ::capnp::introspect::Introspect>::introspect(), + _ => panic!("invalid field index {}", index), + } + } + pub fn get_annotation_types(child_index: Option, index: u32) -> ::capnp::introspect::Type { + panic!("invalid annotation indices ({:?}, {}) ", child_index, index) + } + pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema = ::capnp::introspect::RawStructSchema { + encoded_node: &ENCODED_NODE, + nonunion_members: NONUNION_MEMBERS, + members_by_discriminant: MEMBERS_BY_DISCRIMINANT, + members_by_name: MEMBERS_BY_NAME, + }; + pub static NONUNION_MEMBERS : &[u16] = &[0,1,2,3]; + pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[]; + pub static MEMBERS_BY_NAME : &[u16] = &[1,3,0,2]; + pub const TYPE_ID: u64 = 0xa1e7_a16b_6faf_34d2; + } + } + + pub mod plugin_replace { + #[derive(Copy, Clone)] + pub struct Owned(()); + impl ::capnp::introspect::Introspect for Owned { fn introspect() -> ::capnp::introspect::Type { ::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } } + impl ::capnp::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; } + impl ::capnp::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; } + impl ::capnp::traits::Pipelined for Owned { type Pipeline = Pipeline; } + + pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> } + impl <'a,> ::core::marker::Copy for Reader<'a,> {} + impl <'a,> ::core::clone::Clone for Reader<'a,> { + fn clone(&self) -> Self { *self } + } + + impl <'a,> ::capnp::traits::HasTypeId for Reader<'a,> { + const TYPE_ID: u64 = _private::TYPE_ID; + } + impl <'a,> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a,> { + fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self { + Self { reader, } + } + } + + impl <'a,> ::core::convert::From> for ::capnp::dynamic_value::Reader<'a> { + fn from(reader: Reader<'a,>) -> Self { + Self::Struct(::capnp::dynamic_struct::Reader::new(reader.reader, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>}))) + } + } + + impl <'a,> ::core::fmt::Debug for Reader<'a,> { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> { + core::fmt::Debug::fmt(&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self), f) + } + } + + impl <'a,> ::capnp::traits::FromPointerReader<'a> for Reader<'a,> { + fn get_from_pointer(reader: &::capnp::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result { + ::core::result::Result::Ok(reader.get_struct(default)?.into()) + } + } + + impl <'a,> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a,> { + fn into_internal_struct_reader(self) -> ::capnp::private::layout::StructReader<'a> { + self.reader + } + } + + impl <'a,> ::capnp::traits::Imbue<'a> for Reader<'a,> { + fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) { + self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table)) + } + } + + impl <'a,> Reader<'a,> { + pub fn reborrow(&self) -> Reader<'_,> { + Self { .. *self } + } + + pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { + self.reader.total_size() + } + #[inline] + pub fn get_src_prefix(self) -> ::capnp::Result<::capnp::data::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None) + } + #[inline] + pub fn has_src_prefix(&self) -> bool { + !self.reader.get_pointer_field(0).is_null() + } + #[inline] + pub fn get_size_holder(self) -> ::capnp::Result<::capnp::data::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(1), ::core::option::Option::None) + } + #[inline] + pub fn has_size_holder(&self) -> bool { + !self.reader.get_pointer_field(1).is_null() + } + #[inline] + pub fn get_max_len(self) -> u64 { + self.reader.get_data_field::(0) + } + } + + pub struct Builder<'a> { builder: ::capnp::private::layout::StructBuilder<'a> } + impl <'a,> ::capnp::traits::HasStructSize for Builder<'a,> { + const STRUCT_SIZE: ::capnp::private::layout::StructSize = ::capnp::private::layout::StructSize { data: 1, pointers: 2 }; + } + impl <'a,> ::capnp::traits::HasTypeId for Builder<'a,> { + const TYPE_ID: u64 = _private::TYPE_ID; + } + impl <'a,> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a,> { + fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self { + Self { builder, } + } + } + + impl <'a,> ::core::convert::From> for ::capnp::dynamic_value::Builder<'a> { + fn from(builder: Builder<'a,>) -> Self { + Self::Struct(::capnp::dynamic_struct::Builder::new(builder.builder, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>}))) + } + } + + impl <'a,> ::capnp::traits::ImbueMut<'a> for Builder<'a,> { + fn imbue_mut(&mut self, cap_table: &'a mut ::capnp::private::layout::CapTable) { + self.builder.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table)) + } + } + + impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> { + fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self { + builder.init_struct(::STRUCT_SIZE).into() + } + fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result { + ::core::result::Result::Ok(builder.get_struct(::STRUCT_SIZE, default)?.into()) + } + } + + impl <'a,> ::capnp::traits::SetterInput> for Reader<'a,> { + fn set_pointer_builder(mut pointer: ::capnp::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::capnp::Result<()> { pointer.set_struct(&value.reader, canonicalize) } + } + + impl <'a,> Builder<'a,> { + pub fn into_reader(self) -> Reader<'a,> { + self.builder.into_reader().into() + } + pub fn reborrow(&mut self) -> Builder<'_,> { + Builder { builder: self.builder.reborrow() } + } + pub fn reborrow_as_reader(&self) -> Reader<'_,> { + self.builder.as_reader().into() + } + + pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { + self.builder.as_reader().total_size() + } + #[inline] + pub fn get_src_prefix(self) -> ::capnp::Result<::capnp::data::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None) + } + #[inline] + pub fn set_src_prefix(&mut self, value: ::capnp::data::Reader<'_>) { + self.builder.reborrow().get_pointer_field(0).set_data(value); + } + #[inline] + pub fn init_src_prefix(self, size: u32) -> ::capnp::data::Builder<'a> { + self.builder.get_pointer_field(0).init_data(size) + } + #[inline] + pub fn has_src_prefix(&self) -> bool { + !self.builder.is_pointer_field_null(0) + } + #[inline] + pub fn get_size_holder(self) -> ::capnp::Result<::capnp::data::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(1), ::core::option::Option::None) + } + #[inline] + pub fn set_size_holder(&mut self, value: ::capnp::data::Reader<'_>) { + self.builder.reborrow().get_pointer_field(1).set_data(value); + } + #[inline] + pub fn init_size_holder(self, size: u32) -> ::capnp::data::Builder<'a> { + self.builder.get_pointer_field(1).init_data(size) + } + #[inline] + pub fn has_size_holder(&self) -> bool { + !self.builder.is_pointer_field_null(1) + } + #[inline] + pub fn get_max_len(self) -> u64 { + self.builder.get_data_field::(0) + } + #[inline] + pub fn set_max_len(&mut self, value: u64) { + self.builder.set_data_field::(0, value); + } + } + + pub struct Pipeline { _typeless: ::capnp::any_pointer::Pipeline } + impl ::capnp::capability::FromTypelessPipeline for Pipeline { + fn new(typeless: ::capnp::any_pointer::Pipeline) -> Self { + Self { _typeless: typeless, } + } + } + impl Pipeline { + } + mod _private { + pub static ENCODED_NODE: [::capnp::Word; 66] = [ + ::capnp::word(0, 0, 0, 0, 5, 0, 6, 0), + ::capnp::word(158, 39, 107, 47, 97, 247, 34, 130), + ::capnp::word(20, 0, 0, 0, 1, 0, 1, 0), + ::capnp::word(92, 101, 1, 68, 164, 204, 248, 159), + ::capnp::word(2, 0, 7, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(21, 0, 0, 0, 18, 1, 0, 0), + ::capnp::word(37, 0, 0, 0, 7, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(33, 0, 0, 0, 175, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(112, 108, 117, 103, 105, 110, 46, 99), + ::capnp::word(97, 112, 110, 112, 58, 80, 108, 117), + ::capnp::word(103, 105, 110, 46, 80, 108, 117, 103), + ::capnp::word(105, 110, 82, 101, 112, 108, 97, 99), + ::capnp::word(101, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 1, 0, 1, 0), + ::capnp::word(12, 0, 0, 0, 3, 0, 4, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(69, 0, 0, 0, 82, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(68, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(80, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(1, 0, 0, 0, 1, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 1, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(77, 0, 0, 0, 90, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(76, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(88, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(2, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 2, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(85, 0, 0, 0, 58, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(80, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(92, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(115, 114, 99, 80, 114, 101, 102, 105), + ::capnp::word(120, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(115, 105, 122, 101, 72, 111, 108, 100), + ::capnp::word(101, 114, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(109, 97, 120, 76, 101, 110, 0, 0), + ::capnp::word(9, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(9, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ]; + pub fn get_field_types(index: u16) -> ::capnp::introspect::Type { + match index { + 0 => <::capnp::data::Owned as ::capnp::introspect::Introspect>::introspect(), + 1 => <::capnp::data::Owned as ::capnp::introspect::Introspect>::introspect(), + 2 => ::introspect(), + _ => panic!("invalid field index {}", index), + } + } + pub fn get_annotation_types(child_index: Option, index: u32) -> ::capnp::introspect::Type { + panic!("invalid annotation indices ({:?}, {}) ", child_index, index) + } + pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema = ::capnp::introspect::RawStructSchema { + encoded_node: &ENCODED_NODE, + nonunion_members: NONUNION_MEMBERS, + members_by_discriminant: MEMBERS_BY_DISCRIMINANT, + members_by_name: MEMBERS_BY_NAME, + }; + pub static NONUNION_MEMBERS : &[u16] = &[0,1,2]; + pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[]; + pub static MEMBERS_BY_NAME : &[u16] = &[2,1,0]; + pub const TYPE_ID: u64 = 0x8222_f761_2f6b_279e; + } + } + + pub mod plugin_bins { + #[derive(Copy, Clone)] + pub struct Owned(()); + impl ::capnp::introspect::Introspect for Owned { fn introspect() -> ::capnp::introspect::Type { ::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } } + impl ::capnp::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; } + impl ::capnp::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; } + impl ::capnp::traits::Pipelined for Owned { type Pipeline = Pipeline; } + + pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> } + impl <'a,> ::core::marker::Copy for Reader<'a,> {} + impl <'a,> ::core::clone::Clone for Reader<'a,> { + fn clone(&self) -> Self { *self } + } + + impl <'a,> ::capnp::traits::HasTypeId for Reader<'a,> { + const TYPE_ID: u64 = _private::TYPE_ID; + } + impl <'a,> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a,> { + fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self { + Self { reader, } + } + } + + impl <'a,> ::core::convert::From> for ::capnp::dynamic_value::Reader<'a> { + fn from(reader: Reader<'a,>) -> Self { + Self::Struct(::capnp::dynamic_struct::Reader::new(reader.reader, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>}))) + } + } + + impl <'a,> ::core::fmt::Debug for Reader<'a,> { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> { + core::fmt::Debug::fmt(&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self), f) + } + } + + impl <'a,> ::capnp::traits::FromPointerReader<'a> for Reader<'a,> { + fn get_from_pointer(reader: &::capnp::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result { + ::core::result::Result::Ok(reader.get_struct(default)?.into()) + } + } + + impl <'a,> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a,> { + fn into_internal_struct_reader(self) -> ::capnp::private::layout::StructReader<'a> { + self.reader + } + } + + impl <'a,> ::capnp::traits::Imbue<'a> for Reader<'a,> { + fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) { + self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table)) + } + } + + impl <'a,> Reader<'a,> { + pub fn reborrow(&self) -> Reader<'_,> { + Self { .. *self } + } + + pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { + self.reader.total_size() + } + #[inline] + pub fn get_windows(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None) + } + #[inline] + pub fn has_windows(&self) -> bool { + !self.reader.get_pointer_field(0).is_null() + } + #[inline] + pub fn get_linux(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(1), ::core::option::Option::None) + } + #[inline] + pub fn has_linux(&self) -> bool { + !self.reader.get_pointer_field(1).is_null() + } + #[inline] + pub fn get_darwin(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(2), ::core::option::Option::None) + } + #[inline] + pub fn has_darwin(&self) -> bool { + !self.reader.get_pointer_field(2).is_null() + } + } + + pub struct Builder<'a> { builder: ::capnp::private::layout::StructBuilder<'a> } + impl <'a,> ::capnp::traits::HasStructSize for Builder<'a,> { + const STRUCT_SIZE: ::capnp::private::layout::StructSize = ::capnp::private::layout::StructSize { data: 0, pointers: 3 }; + } + impl <'a,> ::capnp::traits::HasTypeId for Builder<'a,> { + const TYPE_ID: u64 = _private::TYPE_ID; + } + impl <'a,> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a,> { + fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self { + Self { builder, } + } + } + + impl <'a,> ::core::convert::From> for ::capnp::dynamic_value::Builder<'a> { + fn from(builder: Builder<'a,>) -> Self { + Self::Struct(::capnp::dynamic_struct::Builder::new(builder.builder, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>}))) + } + } + + impl <'a,> ::capnp::traits::ImbueMut<'a> for Builder<'a,> { + fn imbue_mut(&mut self, cap_table: &'a mut ::capnp::private::layout::CapTable) { + self.builder.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table)) + } + } + + impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> { + fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self { + builder.init_struct(::STRUCT_SIZE).into() + } + fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result { + ::core::result::Result::Ok(builder.get_struct(::STRUCT_SIZE, default)?.into()) + } + } + + impl <'a,> ::capnp::traits::SetterInput> for Reader<'a,> { + fn set_pointer_builder(mut pointer: ::capnp::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::capnp::Result<()> { pointer.set_struct(&value.reader, canonicalize) } + } + + impl <'a,> Builder<'a,> { + pub fn into_reader(self) -> Reader<'a,> { + self.builder.into_reader().into() + } + pub fn reborrow(&mut self) -> Builder<'_,> { + Builder { builder: self.builder.reborrow() } + } + pub fn reborrow_as_reader(&self) -> Reader<'_,> { + self.builder.as_reader().into() + } + + pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { + self.builder.as_reader().total_size() + } + #[inline] + pub fn get_windows(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None) + } + #[inline] + pub fn set_windows(&mut self, value: crate::plugin_capnp::plugin::plugin_bins::bins::Reader<'_>) -> ::capnp::Result<()> { + ::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(0), value, false) + } + #[inline] + pub fn init_windows(self, ) -> crate::plugin_capnp::plugin::plugin_bins::bins::Builder<'a> { + ::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(0), 0) + } + #[inline] + pub fn has_windows(&self) -> bool { + !self.builder.is_pointer_field_null(0) + } + #[inline] + pub fn get_linux(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(1), ::core::option::Option::None) + } + #[inline] + pub fn set_linux(&mut self, value: crate::plugin_capnp::plugin::plugin_bins::bins::Reader<'_>) -> ::capnp::Result<()> { + ::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(1), value, false) + } + #[inline] + pub fn init_linux(self, ) -> crate::plugin_capnp::plugin::plugin_bins::bins::Builder<'a> { + ::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(1), 0) + } + #[inline] + pub fn has_linux(&self) -> bool { + !self.builder.is_pointer_field_null(1) + } + #[inline] + pub fn get_darwin(self) -> ::capnp::Result> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(2), ::core::option::Option::None) + } + #[inline] + pub fn set_darwin(&mut self, value: crate::plugin_capnp::plugin::plugin_bins::bins::Reader<'_>) -> ::capnp::Result<()> { + ::capnp::traits::SetterInput::set_pointer_builder(self.builder.reborrow().get_pointer_field(2), value, false) + } + #[inline] + pub fn init_darwin(self, ) -> crate::plugin_capnp::plugin::plugin_bins::bins::Builder<'a> { + ::capnp::traits::FromPointerBuilder::init_pointer(self.builder.get_pointer_field(2), 0) + } + #[inline] + pub fn has_darwin(&self) -> bool { + !self.builder.is_pointer_field_null(2) + } + } + + pub struct Pipeline { _typeless: ::capnp::any_pointer::Pipeline } + impl ::capnp::capability::FromTypelessPipeline for Pipeline { + fn new(typeless: ::capnp::any_pointer::Pipeline) -> Self { + Self { _typeless: typeless, } + } + } + impl Pipeline { + pub fn get_windows(&self) -> crate::plugin_capnp::plugin::plugin_bins::bins::Pipeline { + ::capnp::capability::FromTypelessPipeline::new(self._typeless.get_pointer_field(0)) + } + pub fn get_linux(&self) -> crate::plugin_capnp::plugin::plugin_bins::bins::Pipeline { + ::capnp::capability::FromTypelessPipeline::new(self._typeless.get_pointer_field(1)) + } + pub fn get_darwin(&self) -> crate::plugin_capnp::plugin::plugin_bins::bins::Pipeline { + ::capnp::capability::FromTypelessPipeline::new(self._typeless.get_pointer_field(2)) + } + } + mod _private { + pub static ENCODED_NODE: [::capnp::Word; 66] = [ + ::capnp::word(0, 0, 0, 0, 5, 0, 6, 0), + ::capnp::word(110, 60, 225, 90, 70, 139, 64, 208), + ::capnp::word(20, 0, 0, 0, 1, 0, 0, 0), + ::capnp::word(92, 101, 1, 68, 164, 204, 248, 159), + ::capnp::word(3, 0, 7, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(21, 0, 0, 0, 250, 0, 0, 0), + ::capnp::word(33, 0, 0, 0, 23, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(41, 0, 0, 0, 175, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(112, 108, 117, 103, 105, 110, 46, 99), + ::capnp::word(97, 112, 110, 112, 58, 80, 108, 117), + ::capnp::word(103, 105, 110, 46, 80, 108, 117, 103), + ::capnp::word(105, 110, 66, 105, 110, 115, 0, 0), + ::capnp::word(4, 0, 0, 0, 1, 0, 1, 0), + ::capnp::word(198, 25, 55, 83, 10, 246, 121, 196), + ::capnp::word(1, 0, 0, 0, 42, 0, 0, 0), + ::capnp::word(66, 105, 110, 115, 0, 0, 0, 0), + ::capnp::word(12, 0, 0, 0, 3, 0, 4, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(69, 0, 0, 0, 66, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(64, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(76, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(1, 0, 0, 0, 1, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 1, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(73, 0, 0, 0, 50, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(68, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(80, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(2, 0, 0, 0, 2, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 2, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(77, 0, 0, 0, 58, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(72, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(84, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(119, 105, 110, 100, 111, 119, 115, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(198, 25, 55, 83, 10, 246, 121, 196), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(108, 105, 110, 117, 120, 0, 0, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(198, 25, 55, 83, 10, 246, 121, 196), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(100, 97, 114, 119, 105, 110, 0, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(198, 25, 55, 83, 10, 246, 121, 196), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(16, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ]; + pub fn get_field_types(index: u16) -> ::capnp::introspect::Type { + match index { + 0 => ::introspect(), + 1 => ::introspect(), + 2 => ::introspect(), + _ => panic!("invalid field index {}", index), + } + } + pub fn get_annotation_types(child_index: Option, index: u32) -> ::capnp::introspect::Type { + panic!("invalid annotation indices ({:?}, {}) ", child_index, index) + } + pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema = ::capnp::introspect::RawStructSchema { + encoded_node: &ENCODED_NODE, + nonunion_members: NONUNION_MEMBERS, + members_by_discriminant: MEMBERS_BY_DISCRIMINANT, + members_by_name: MEMBERS_BY_NAME, + }; + pub static NONUNION_MEMBERS : &[u16] = &[0,1,2]; + pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[]; + pub static MEMBERS_BY_NAME : &[u16] = &[2,1,0]; + pub const TYPE_ID: u64 = 0xd040_8b46_5ae1_3c6e; + } + + pub mod bins { + #[derive(Copy, Clone)] + pub struct Owned(()); + impl ::capnp::introspect::Introspect for Owned { fn introspect() -> ::capnp::introspect::Type { ::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } } + impl ::capnp::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; } + impl ::capnp::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; } + impl ::capnp::traits::Pipelined for Owned { type Pipeline = Pipeline; } + + pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> } + impl <'a,> ::core::marker::Copy for Reader<'a,> {} + impl <'a,> ::core::clone::Clone for Reader<'a,> { + fn clone(&self) -> Self { *self } + } + + impl <'a,> ::capnp::traits::HasTypeId for Reader<'a,> { + const TYPE_ID: u64 = _private::TYPE_ID; + } + impl <'a,> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a,> { + fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self { + Self { reader, } + } + } + + impl <'a,> ::core::convert::From> for ::capnp::dynamic_value::Reader<'a> { + fn from(reader: Reader<'a,>) -> Self { + Self::Struct(::capnp::dynamic_struct::Reader::new(reader.reader, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>}))) + } + } + + impl <'a,> ::core::fmt::Debug for Reader<'a,> { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> { + core::fmt::Debug::fmt(&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self), f) + } + } + + impl <'a,> ::capnp::traits::FromPointerReader<'a> for Reader<'a,> { + fn get_from_pointer(reader: &::capnp::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result { + ::core::result::Result::Ok(reader.get_struct(default)?.into()) + } + } + + impl <'a,> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a,> { + fn into_internal_struct_reader(self) -> ::capnp::private::layout::StructReader<'a> { + self.reader + } + } + + impl <'a,> ::capnp::traits::Imbue<'a> for Reader<'a,> { + fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) { + self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table)) + } + } + + impl <'a,> Reader<'a,> { + pub fn reborrow(&self) -> Reader<'_,> { + Self { .. *self } + } + + pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { + self.reader.total_size() + } + #[inline] + pub fn get_executable(self) -> ::capnp::Result<::capnp::data::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None) + } + #[inline] + pub fn has_executable(&self) -> bool { + !self.reader.get_pointer_field(0).is_null() + } + #[inline] + pub fn get_dynamic_library(self) -> ::capnp::Result<::capnp::data::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(1), ::core::option::Option::None) + } + #[inline] + pub fn has_dynamic_library(&self) -> bool { + !self.reader.get_pointer_field(1).is_null() + } + } + + pub struct Builder<'a> { builder: ::capnp::private::layout::StructBuilder<'a> } + impl <'a,> ::capnp::traits::HasStructSize for Builder<'a,> { + const STRUCT_SIZE: ::capnp::private::layout::StructSize = ::capnp::private::layout::StructSize { data: 0, pointers: 2 }; + } + impl <'a,> ::capnp::traits::HasTypeId for Builder<'a,> { + const TYPE_ID: u64 = _private::TYPE_ID; + } + impl <'a,> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a,> { + fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self { + Self { builder, } + } + } + + impl <'a,> ::core::convert::From> for ::capnp::dynamic_value::Builder<'a> { + fn from(builder: Builder<'a,>) -> Self { + Self::Struct(::capnp::dynamic_struct::Builder::new(builder.builder, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>}))) + } + } + + impl <'a,> ::capnp::traits::ImbueMut<'a> for Builder<'a,> { + fn imbue_mut(&mut self, cap_table: &'a mut ::capnp::private::layout::CapTable) { + self.builder.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table)) + } + } + + impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> { + fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self { + builder.init_struct(::STRUCT_SIZE).into() + } + fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result { + ::core::result::Result::Ok(builder.get_struct(::STRUCT_SIZE, default)?.into()) + } + } + + impl <'a,> ::capnp::traits::SetterInput> for Reader<'a,> { + fn set_pointer_builder(mut pointer: ::capnp::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::capnp::Result<()> { pointer.set_struct(&value.reader, canonicalize) } + } + + impl <'a,> Builder<'a,> { + pub fn into_reader(self) -> Reader<'a,> { + self.builder.into_reader().into() + } + pub fn reborrow(&mut self) -> Builder<'_,> { + Builder { builder: self.builder.reborrow() } + } + pub fn reborrow_as_reader(&self) -> Reader<'_,> { + self.builder.as_reader().into() + } + + pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { + self.builder.as_reader().total_size() + } + #[inline] + pub fn get_executable(self) -> ::capnp::Result<::capnp::data::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None) + } + #[inline] + pub fn set_executable(&mut self, value: ::capnp::data::Reader<'_>) { + self.builder.reborrow().get_pointer_field(0).set_data(value); + } + #[inline] + pub fn init_executable(self, size: u32) -> ::capnp::data::Builder<'a> { + self.builder.get_pointer_field(0).init_data(size) + } + #[inline] + pub fn has_executable(&self) -> bool { + !self.builder.is_pointer_field_null(0) + } + #[inline] + pub fn get_dynamic_library(self) -> ::capnp::Result<::capnp::data::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(1), ::core::option::Option::None) + } + #[inline] + pub fn set_dynamic_library(&mut self, value: ::capnp::data::Reader<'_>) { + self.builder.reborrow().get_pointer_field(1).set_data(value); + } + #[inline] + pub fn init_dynamic_library(self, size: u32) -> ::capnp::data::Builder<'a> { + self.builder.get_pointer_field(1).init_data(size) + } + #[inline] + pub fn has_dynamic_library(&self) -> bool { + !self.builder.is_pointer_field_null(1) + } + } + + pub struct Pipeline { _typeless: ::capnp::any_pointer::Pipeline } + impl ::capnp::capability::FromTypelessPipeline for Pipeline { + fn new(typeless: ::capnp::any_pointer::Pipeline) -> Self { + Self { _typeless: typeless, } + } + } + impl Pipeline { + } + mod _private { + pub static ENCODED_NODE: [::capnp::Word; 51] = [ + ::capnp::word(0, 0, 0, 0, 5, 0, 6, 0), + ::capnp::word(198, 25, 55, 83, 10, 246, 121, 196), + ::capnp::word(31, 0, 0, 0, 1, 0, 0, 0), + ::capnp::word(110, 60, 225, 90, 70, 139, 64, 208), + ::capnp::word(2, 0, 7, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(21, 0, 0, 0, 34, 1, 0, 0), + ::capnp::word(37, 0, 0, 0, 7, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(33, 0, 0, 0, 119, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(112, 108, 117, 103, 105, 110, 46, 99), + ::capnp::word(97, 112, 110, 112, 58, 80, 108, 117), + ::capnp::word(103, 105, 110, 46, 80, 108, 117, 103), + ::capnp::word(105, 110, 66, 105, 110, 115, 46, 66), + ::capnp::word(105, 110, 115, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 1, 0, 1, 0), + ::capnp::word(8, 0, 0, 0, 3, 0, 4, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(41, 0, 0, 0, 90, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(40, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(52, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(1, 0, 0, 0, 1, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 1, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(49, 0, 0, 0, 122, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(48, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(60, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(101, 120, 101, 99, 117, 116, 97, 98), + ::capnp::word(108, 101, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(100, 121, 110, 97, 109, 105, 99, 76), + ::capnp::word(105, 98, 114, 97, 114, 121, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ]; + pub fn get_field_types(index: u16) -> ::capnp::introspect::Type { + match index { + 0 => <::capnp::data::Owned as ::capnp::introspect::Introspect>::introspect(), + 1 => <::capnp::data::Owned as ::capnp::introspect::Introspect>::introspect(), + _ => panic!("invalid field index {}", index), + } + } + pub fn get_annotation_types(child_index: Option, index: u32) -> ::capnp::introspect::Type { + panic!("invalid annotation indices ({:?}, {}) ", child_index, index) + } + pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema = ::capnp::introspect::RawStructSchema { + encoded_node: &ENCODED_NODE, + nonunion_members: NONUNION_MEMBERS, + members_by_discriminant: MEMBERS_BY_DISCRIMINANT, + members_by_name: MEMBERS_BY_NAME, + }; + pub static NONUNION_MEMBERS : &[u16] = &[0,1]; + pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[]; + pub static MEMBERS_BY_NAME : &[u16] = &[1,0]; + pub const TYPE_ID: u64 = 0xc479_f60a_5337_19c6; + } + } + } + + pub mod plugin_plugins { + #[derive(Copy, Clone)] + pub struct Owned(()); + impl ::capnp::introspect::Introspect for Owned { fn introspect() -> ::capnp::introspect::Type { ::capnp::introspect::TypeVariant::Struct(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types, annotation_types: _private::get_annotation_types }).into() } } + impl ::capnp::traits::Owned for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; } + impl ::capnp::traits::OwnedStruct for Owned { type Reader<'a> = Reader<'a>; type Builder<'a> = Builder<'a>; } + impl ::capnp::traits::Pipelined for Owned { type Pipeline = Pipeline; } + + pub struct Reader<'a> { reader: ::capnp::private::layout::StructReader<'a> } + impl <'a,> ::core::marker::Copy for Reader<'a,> {} + impl <'a,> ::core::clone::Clone for Reader<'a,> { + fn clone(&self) -> Self { *self } + } + + impl <'a,> ::capnp::traits::HasTypeId for Reader<'a,> { + const TYPE_ID: u64 = _private::TYPE_ID; + } + impl <'a,> ::core::convert::From<::capnp::private::layout::StructReader<'a>> for Reader<'a,> { + fn from(reader: ::capnp::private::layout::StructReader<'a>) -> Self { + Self { reader, } + } + } + + impl <'a,> ::core::convert::From> for ::capnp::dynamic_value::Reader<'a> { + fn from(reader: Reader<'a,>) -> Self { + Self::Struct(::capnp::dynamic_struct::Reader::new(reader.reader, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>}))) + } + } + + impl <'a,> ::core::fmt::Debug for Reader<'a,> { + fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::result::Result<(), ::core::fmt::Error> { + core::fmt::Debug::fmt(&::core::convert::Into::<::capnp::dynamic_value::Reader<'_>>::into(*self), f) + } + } + + impl <'a,> ::capnp::traits::FromPointerReader<'a> for Reader<'a,> { + fn get_from_pointer(reader: &::capnp::private::layout::PointerReader<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result { + ::core::result::Result::Ok(reader.get_struct(default)?.into()) + } + } + + impl <'a,> ::capnp::traits::IntoInternalStructReader<'a> for Reader<'a,> { + fn into_internal_struct_reader(self) -> ::capnp::private::layout::StructReader<'a> { + self.reader + } + } + + impl <'a,> ::capnp::traits::Imbue<'a> for Reader<'a,> { + fn imbue(&mut self, cap_table: &'a ::capnp::private::layout::CapTable) { + self.reader.imbue(::capnp::private::layout::CapTableReader::Plain(cap_table)) + } + } + + impl <'a,> Reader<'a,> { + pub fn reborrow(&self) -> Reader<'_,> { + Self { .. *self } + } + + pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { + self.reader.total_size() + } + #[inline] + pub fn get_encrypt_shellcode(self) -> ::capnp::Result<::capnp::data::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(0), ::core::option::Option::None) + } + #[inline] + pub fn has_encrypt_shellcode(&self) -> bool { + !self.reader.get_pointer_field(0).is_null() + } + #[inline] + pub fn get_format_encrypted_shellcode(self) -> ::capnp::Result<::capnp::data::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(1), ::core::option::Option::None) + } + #[inline] + pub fn has_format_encrypted_shellcode(&self) -> bool { + !self.reader.get_pointer_field(1).is_null() + } + #[inline] + pub fn get_format_url_remote(self) -> ::capnp::Result<::capnp::data::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(2), ::core::option::Option::None) + } + #[inline] + pub fn has_format_url_remote(&self) -> bool { + !self.reader.get_pointer_field(2).is_null() + } + #[inline] + pub fn get_upload_final_shellcode_remote(self) -> ::capnp::Result<::capnp::data::Reader<'a>> { + ::capnp::traits::FromPointerReader::get_from_pointer(&self.reader.get_pointer_field(3), ::core::option::Option::None) + } + #[inline] + pub fn has_upload_final_shellcode_remote(&self) -> bool { + !self.reader.get_pointer_field(3).is_null() + } + } + + pub struct Builder<'a> { builder: ::capnp::private::layout::StructBuilder<'a> } + impl <'a,> ::capnp::traits::HasStructSize for Builder<'a,> { + const STRUCT_SIZE: ::capnp::private::layout::StructSize = ::capnp::private::layout::StructSize { data: 0, pointers: 4 }; + } + impl <'a,> ::capnp::traits::HasTypeId for Builder<'a,> { + const TYPE_ID: u64 = _private::TYPE_ID; + } + impl <'a,> ::core::convert::From<::capnp::private::layout::StructBuilder<'a>> for Builder<'a,> { + fn from(builder: ::capnp::private::layout::StructBuilder<'a>) -> Self { + Self { builder, } + } + } + + impl <'a,> ::core::convert::From> for ::capnp::dynamic_value::Builder<'a> { + fn from(builder: Builder<'a,>) -> Self { + Self::Struct(::capnp::dynamic_struct::Builder::new(builder.builder, ::capnp::schema::StructSchema::new(::capnp::introspect::RawBrandedStructSchema { generic: &_private::RAW_SCHEMA, field_types: _private::get_field_types::<>, annotation_types: _private::get_annotation_types::<>}))) + } + } + + impl <'a,> ::capnp::traits::ImbueMut<'a> for Builder<'a,> { + fn imbue_mut(&mut self, cap_table: &'a mut ::capnp::private::layout::CapTable) { + self.builder.imbue(::capnp::private::layout::CapTableBuilder::Plain(cap_table)) + } + } + + impl <'a,> ::capnp::traits::FromPointerBuilder<'a> for Builder<'a,> { + fn init_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, _size: u32) -> Self { + builder.init_struct(::STRUCT_SIZE).into() + } + fn get_from_pointer(builder: ::capnp::private::layout::PointerBuilder<'a>, default: ::core::option::Option<&'a [::capnp::Word]>) -> ::capnp::Result { + ::core::result::Result::Ok(builder.get_struct(::STRUCT_SIZE, default)?.into()) + } + } + + impl <'a,> ::capnp::traits::SetterInput> for Reader<'a,> { + fn set_pointer_builder(mut pointer: ::capnp::private::layout::PointerBuilder<'_>, value: Self, canonicalize: bool) -> ::capnp::Result<()> { pointer.set_struct(&value.reader, canonicalize) } + } + + impl <'a,> Builder<'a,> { + pub fn into_reader(self) -> Reader<'a,> { + self.builder.into_reader().into() + } + pub fn reborrow(&mut self) -> Builder<'_,> { + Builder { builder: self.builder.reborrow() } + } + pub fn reborrow_as_reader(&self) -> Reader<'_,> { + self.builder.as_reader().into() + } + + pub fn total_size(&self) -> ::capnp::Result<::capnp::MessageSize> { + self.builder.as_reader().total_size() + } + #[inline] + pub fn get_encrypt_shellcode(self) -> ::capnp::Result<::capnp::data::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(0), ::core::option::Option::None) + } + #[inline] + pub fn set_encrypt_shellcode(&mut self, value: ::capnp::data::Reader<'_>) { + self.builder.reborrow().get_pointer_field(0).set_data(value); + } + #[inline] + pub fn init_encrypt_shellcode(self, size: u32) -> ::capnp::data::Builder<'a> { + self.builder.get_pointer_field(0).init_data(size) + } + #[inline] + pub fn has_encrypt_shellcode(&self) -> bool { + !self.builder.is_pointer_field_null(0) + } + #[inline] + pub fn get_format_encrypted_shellcode(self) -> ::capnp::Result<::capnp::data::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(1), ::core::option::Option::None) + } + #[inline] + pub fn set_format_encrypted_shellcode(&mut self, value: ::capnp::data::Reader<'_>) { + self.builder.reborrow().get_pointer_field(1).set_data(value); + } + #[inline] + pub fn init_format_encrypted_shellcode(self, size: u32) -> ::capnp::data::Builder<'a> { + self.builder.get_pointer_field(1).init_data(size) + } + #[inline] + pub fn has_format_encrypted_shellcode(&self) -> bool { + !self.builder.is_pointer_field_null(1) + } + #[inline] + pub fn get_format_url_remote(self) -> ::capnp::Result<::capnp::data::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(2), ::core::option::Option::None) + } + #[inline] + pub fn set_format_url_remote(&mut self, value: ::capnp::data::Reader<'_>) { + self.builder.reborrow().get_pointer_field(2).set_data(value); + } + #[inline] + pub fn init_format_url_remote(self, size: u32) -> ::capnp::data::Builder<'a> { + self.builder.get_pointer_field(2).init_data(size) + } + #[inline] + pub fn has_format_url_remote(&self) -> bool { + !self.builder.is_pointer_field_null(2) + } + #[inline] + pub fn get_upload_final_shellcode_remote(self) -> ::capnp::Result<::capnp::data::Builder<'a>> { + ::capnp::traits::FromPointerBuilder::get_from_pointer(self.builder.get_pointer_field(3), ::core::option::Option::None) + } + #[inline] + pub fn set_upload_final_shellcode_remote(&mut self, value: ::capnp::data::Reader<'_>) { + self.builder.reborrow().get_pointer_field(3).set_data(value); + } + #[inline] + pub fn init_upload_final_shellcode_remote(self, size: u32) -> ::capnp::data::Builder<'a> { + self.builder.get_pointer_field(3).init_data(size) + } + #[inline] + pub fn has_upload_final_shellcode_remote(&self) -> bool { + !self.builder.is_pointer_field_null(3) + } + } + + pub struct Pipeline { _typeless: ::capnp::any_pointer::Pipeline } + impl ::capnp::capability::FromTypelessPipeline for Pipeline { + fn new(typeless: ::capnp::any_pointer::Pipeline) -> Self { + Self { _typeless: typeless, } + } + } + impl Pipeline { + } + mod _private { + pub static ENCODED_NODE: [::capnp::Word; 88] = [ + ::capnp::word(0, 0, 0, 0, 5, 0, 6, 0), + ::capnp::word(72, 146, 45, 0, 197, 146, 163, 230), + ::capnp::word(20, 0, 0, 0, 1, 0, 0, 0), + ::capnp::word(92, 101, 1, 68, 164, 204, 248, 159), + ::capnp::word(4, 0, 7, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(21, 0, 0, 0, 18, 1, 0, 0), + ::capnp::word(37, 0, 0, 0, 7, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(33, 0, 0, 0, 231, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(112, 108, 117, 103, 105, 110, 46, 99), + ::capnp::word(97, 112, 110, 112, 58, 80, 108, 117), + ::capnp::word(103, 105, 110, 46, 80, 108, 117, 103), + ::capnp::word(105, 110, 80, 108, 117, 103, 105, 110), + ::capnp::word(115, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 1, 0, 1, 0), + ::capnp::word(16, 0, 0, 0, 3, 0, 4, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(97, 0, 0, 0, 138, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(100, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(112, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(1, 0, 0, 0, 1, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 1, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(109, 0, 0, 0, 202, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(116, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(128, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(2, 0, 0, 0, 2, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 2, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(125, 0, 0, 0, 130, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(124, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(136, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(3, 0, 0, 0, 3, 0, 0, 0), + ::capnp::word(0, 0, 1, 0, 3, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(133, 0, 0, 0, 218, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(140, 0, 0, 0, 3, 0, 1, 0), + ::capnp::word(152, 0, 0, 0, 2, 0, 1, 0), + ::capnp::word(101, 110, 99, 114, 121, 112, 116, 83), + ::capnp::word(104, 101, 108, 108, 99, 111, 100, 101), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(102, 111, 114, 109, 97, 116, 69, 110), + ::capnp::word(99, 114, 121, 112, 116, 101, 100, 83), + ::capnp::word(104, 101, 108, 108, 99, 111, 100, 101), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(102, 111, 114, 109, 97, 116, 85, 114), + ::capnp::word(108, 82, 101, 109, 111, 116, 101, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(117, 112, 108, 111, 97, 100, 70, 105), + ::capnp::word(110, 97, 108, 83, 104, 101, 108, 108), + ::capnp::word(99, 111, 100, 101, 82, 101, 109, 111), + ::capnp::word(116, 101, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(13, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ::capnp::word(0, 0, 0, 0, 0, 0, 0, 0), + ]; + pub fn get_field_types(index: u16) -> ::capnp::introspect::Type { + match index { + 0 => <::capnp::data::Owned as ::capnp::introspect::Introspect>::introspect(), + 1 => <::capnp::data::Owned as ::capnp::introspect::Introspect>::introspect(), + 2 => <::capnp::data::Owned as ::capnp::introspect::Introspect>::introspect(), + 3 => <::capnp::data::Owned as ::capnp::introspect::Introspect>::introspect(), + _ => panic!("invalid field index {}", index), + } + } + pub fn get_annotation_types(child_index: Option, index: u32) -> ::capnp::introspect::Type { + panic!("invalid annotation indices ({:?}, {}) ", child_index, index) + } + pub static RAW_SCHEMA: ::capnp::introspect::RawStructSchema = ::capnp::introspect::RawStructSchema { + encoded_node: &ENCODED_NODE, + nonunion_members: NONUNION_MEMBERS, + members_by_discriminant: MEMBERS_BY_DISCRIMINANT, + members_by_name: MEMBERS_BY_NAME, + }; + pub static NONUNION_MEMBERS : &[u16] = &[0,1,2,3]; + pub static MEMBERS_BY_DISCRIMINANT : &[u16] = &[]; + pub static MEMBERS_BY_NAME : &[u16] = &[0,1,2,3]; + pub const TYPE_ID: u64 = 0xe6a3_92c5_002d_9248; + } + } +} diff --git a/src/bin/maker.rs b/src/bin/maker.rs index 59b4424..3bc09be 100644 --- a/src/bin/maker.rs +++ b/src/bin/maker.rs @@ -1,66 +1,163 @@ #![windows_subsystem = "windows"] -use std::{fs, path::PathBuf, usize}; +use std::{fs, ops::Not, path::PathBuf}; +use anyhow::{anyhow, bail}; use dirs::{desktop_dir, home_dir}; use iced::{ - advanced::Application, - executor, + application, + futures::TryFutureExt, widget::{ button, column, horizontal_rule, pick_list, radio, row, svg::Handle, text, text_editor, - text_input, Svg, + text_input, Column, Svg, }, - Alignment, Length, Renderer, Task, Theme, + Alignment, Length, Size, Task, Theme, }; use pumpbin::{ - error_dialog, - plugin::{Bins, Plugin}, - settings, svg_style, ShellcodeSaveType, JETBRAINS_MONO_FONT, -}; -use pumpbin::{ - plugin::{EncryptType, Platforms}, - show_message, + plugin::{Plugin, PluginInfo, PluginReplace}, + utils::{self, error_dialog, message_dialog}, }; +use pumpbin::{style, ShellcodeSaveType}; use rfd::{AsyncFileDialog, MessageLevel}; +fn main() { + if let Err(e) = try_main() { + error_dialog(e); + } +} + +fn try_main() -> anyhow::Result<()> { + let size = Size::new(1200.0, 800.0); + + let mut window_settings = utils::window_settings(); + window_settings.size = size; + window_settings.min_size = Some(size); + + application("PumpBin Maker", Maker::update, Maker::view) + .settings(utils::settings()) + .window(window_settings) + .theme(Maker::theme) + .run()?; + + Ok(()) +} + +#[derive(Debug, Clone, Copy)] +enum ChooseFileType { + WindowsExe, + WindowsLib, + LinuxExe, + LinuxLib, + DarwinExe, + DarwinLib, + EncryptShellcodePlugin, + FormatEncryptedShellcodePlugin, + FormatUrlRemote, + UploadFinalShellcodeRemote, +} + +#[derive(Debug, Clone)] +enum MakerMessage { + PluginNameChanged(String), + AuthorChanged(String), + VersionChanged(String), + SrcPrefixChanged(String), + MaxLenChanged(String), + ShellcodeSaveTypeChanged(ShellcodeSaveType), + SizeHolderChanged(String), + WindowsExeChanged(String), + WindowsLibChanged(String), + LinuxExeChanged(String), + LinuxLibChanged(String), + DarwinExeChanged(String), + DarwinLibChanged(String), + EncryptShllcodePluginChanged(String), + FormatEncryptedShellcodePluginChanged(String), + FormatUrlRemotePluginChanged(String), + UploadFinalShellcodeRemotePluginChanged(String), + DescAction(text_editor::Action), + GenerateClicked, + GenerateDone(Result<(), String>), + ChooseFileClicked(ChooseFileType), + ChooseFileDone((Option, ChooseFileType)), + B1nClicked, + GithubClicked, + ThemeChanged(Theme), +} + #[derive(Debug)] struct Maker { plugin_name: String, author: String, version: String, - prefix: String, + src_prefix: String, max_len: String, shellcode_save_type: ShellcodeSaveType, size_holder: String, - encrypt_type: EncryptType, windows_exe: String, windows_lib: String, linux_exe: String, linux_lib: String, darwin_exe: String, darwin_lib: String, + encrypt_shellcode_plugin: String, + format_encrypted_shellcode_plugin: String, + format_url_remote_plugin: String, + upload_final_shellcode_remote_plugin: String, desc: text_editor::Content, pumpbin_version: String, selected_theme: Theme, } +impl Maker { + fn check_generate(&self) -> anyhow::Result<()> { + if self.plugin_name.is_empty() { + bail!("Plugin Name is empty."); + } + + if self.src_prefix.is_empty() { + bail!("Prefix is empty."); + } + + let max_len = self.max_len(); + if max_len.is_empty() { + bail!("Max Len is empty."); + } + + if max_len.parse::().is_err() { + bail!("Max Len numeric only."); + }; + + if let ShellcodeSaveType::Local = self.shellcode_save_type() { + if self.size_holder().is_empty() { + bail!("Size Holder is empty."); + } + }; + + anyhow::Ok(()) + } +} + impl Default for Maker { fn default() -> Self { Self { plugin_name: Default::default(), author: Default::default(), version: Default::default(), - prefix: Default::default(), + src_prefix: Default::default(), max_len: Default::default(), - shellcode_save_type: ShellcodeSaveType::Local, + shellcode_save_type: Default::default(), size_holder: Default::default(), - encrypt_type: EncryptType::None, windows_exe: Default::default(), windows_lib: Default::default(), linux_exe: Default::default(), linux_lib: Default::default(), darwin_exe: Default::default(), darwin_lib: Default::default(), + encrypt_shellcode_plugin: Default::default(), + format_encrypted_shellcode_plugin: Default::default(), + format_url_remote_plugin: Default::default(), + upload_final_shellcode_remote_plugin: Default::default(), desc: text_editor::Content::new(), pumpbin_version: env!("CARGO_PKG_VERSION").into(), selected_theme: Theme::CatppuccinMacchiato, @@ -81,8 +178,8 @@ impl Maker { &self.version } - fn prefix(&self) -> &str { - &self.prefix + fn src_prefix(&self) -> &str { + &self.src_prefix } fn max_len(&self) -> &str { @@ -97,14 +194,6 @@ impl Maker { &self.size_holder } - fn encrypt_type(&self) -> &EncryptType { - &self.encrypt_type - } - - fn encrypt_type_mut(&mut self) -> &mut EncryptType { - &mut self.encrypt_type - } - fn windows_exe(&self) -> &str { &self.windows_exe } @@ -129,6 +218,22 @@ impl Maker { &self.darwin_lib } + fn encrypt_shellcode_plugin(&self) -> &str { + &self.encrypt_shellcode_plugin + } + + fn format_encrypted_shellcode_plugin(&self) -> &str { + &self.format_encrypted_shellcode_plugin + } + + fn format_url_remote_plugin(&self) -> &str { + &self.format_url_remote_plugin + } + + fn upload_final_shellcode_remote_plugin(&self) -> &str { + &self.upload_final_shellcode_remote_plugin + } + fn desc(&self) -> &text_editor::Content { &self.desc } @@ -146,399 +251,216 @@ impl Maker { } } -#[derive(Debug, Clone, Copy)] -enum ChooseFileType { - WindowsExe, - WindowsLib, - LinuxExe, - LinuxLib, - DarwinExe, - DarwinLib, -} - -#[derive(Debug, Clone)] -enum MakerMessage { - PluginNameChanged(String), - AuthorChanged(String), - VersionChanged(String), - PrefixChanged(String), - MaxLenChanged(String), - ShellcodeSaveTypeChanged(ShellcodeSaveType), - SizeHolderChanged(String), - EncryptTypeChanged(EncryptType), - XorPassChanged(String), - AesKeyChanged(String), - AesNonceChanged(String), - WindowsExeChanged(String), - WindowsLibChanged(String), - LinuxExeChanged(String), - LinuxLibChanged(String), - DarwinExeChanged(String), - DarwinLibChanged(String), - DescAction(text_editor::Action), - GenerateClicked, - GenerateDone(Result<(), String>), - ChooseFileClicked(ChooseFileType), - WindowsExeChooseDone(Result), - WindowsLibChooseDone(Result), - LinuxExeChooseDone(Result), - LinuxLibChooseDone(Result), - DarwinExeChooseDone(Result), - DarwinLibChooseDone(Result), - B1nClicked, - GithubClicked, - ThemeChanged(Theme), -} - -impl Application for Maker { - type Executor = executor::Default; - type Flags = (); - type Message = MakerMessage; - type Theme = Theme; - type Renderer = Renderer; - - fn new(_flags: Self::Flags) -> (Self, iced::Task) { - (Self::default(), Task::none()) - } - - fn title(&self) -> String { - "PumpBin Maker".to_string() - } - - fn update(&mut self, message: Self::Message) -> iced::Task { +impl Maker { + pub fn update(&mut self, message: MakerMessage) -> iced::Task { match message { - MakerMessage::PluginNameChanged(x) => { - self.plugin_name = x; - Task::none() + MakerMessage::PluginNameChanged(x) => self.plugin_name = x, + MakerMessage::AuthorChanged(x) => self.author = x, + MakerMessage::VersionChanged(x) => self.version = x, + MakerMessage::SrcPrefixChanged(x) => self.src_prefix = x, + MakerMessage::MaxLenChanged(x) => self.max_len = x, + MakerMessage::ShellcodeSaveTypeChanged(x) => self.shellcode_save_type = x, + MakerMessage::SizeHolderChanged(x) => self.size_holder = x, + MakerMessage::WindowsExeChanged(x) => self.windows_exe = x, + MakerMessage::WindowsLibChanged(x) => self.windows_lib = x, + MakerMessage::LinuxExeChanged(x) => self.linux_exe = x, + MakerMessage::LinuxLibChanged(x) => self.linux_lib = x, + MakerMessage::DarwinExeChanged(x) => self.darwin_exe = x, + MakerMessage::DarwinLibChanged(x) => self.darwin_lib = x, + MakerMessage::EncryptShllcodePluginChanged(x) => self.encrypt_shellcode_plugin = x, + MakerMessage::FormatEncryptedShellcodePluginChanged(x) => { + self.format_encrypted_shellcode_plugin = x } - MakerMessage::AuthorChanged(x) => { - self.author = x; - Task::none() - } - MakerMessage::VersionChanged(x) => { - self.version = x; - Task::none() - } - MakerMessage::PrefixChanged(x) => { - self.prefix = x; - Task::none() - } - MakerMessage::MaxLenChanged(x) => { - self.max_len = x; - Task::none() - } - MakerMessage::ShellcodeSaveTypeChanged(x) => { - self.shellcode_save_type = x; - Task::none() - } - MakerMessage::SizeHolderChanged(x) => { - self.size_holder = x; - Task::none() - } - - MakerMessage::EncryptTypeChanged(x) => { - self.encrypt_type = x; - Task::none() - } - MakerMessage::XorPassChanged(x) => { - if let EncryptType::Xor(xor) = self.encrypt_type_mut() { - *xor = x.as_bytes().to_vec(); - } - Task::none() - } - MakerMessage::AesKeyChanged(x) => { - if let EncryptType::AesGcm(aes_gcm) = self.encrypt_type_mut() { - *aes_gcm.key_holder_mut() = x.as_bytes().to_vec(); - } - Task::none() - } - MakerMessage::AesNonceChanged(x) => { - if let EncryptType::AesGcm(aes_gcm) = self.encrypt_type_mut() { - *aes_gcm.nonce_holder_mut() = x.as_bytes().to_vec(); - } - Task::none() - } - MakerMessage::WindowsExeChanged(x) => { - self.windows_exe = x; - Task::none() - } - MakerMessage::WindowsLibChanged(x) => { - self.windows_lib = x; - Task::none() - } - MakerMessage::LinuxExeChanged(x) => { - self.linux_exe = x; - Task::none() - } - MakerMessage::LinuxLibChanged(x) => { - self.linux_lib = x; - Task::none() - } - MakerMessage::DarwinExeChanged(x) => { - self.darwin_exe = x; - Task::none() - } - MakerMessage::DarwinLibChanged(x) => { - self.darwin_lib = x; - Task::none() - } - MakerMessage::DescAction(x) => { - self.desc_mut().perform(x); - Task::none() + MakerMessage::FormatUrlRemotePluginChanged(x) => self.format_url_remote_plugin = x, + MakerMessage::UploadFinalShellcodeRemotePluginChanged(x) => { + self.upload_final_shellcode_remote_plugin = x } + MakerMessage::DescAction(x) => self.desc_mut().perform(x), MakerMessage::GenerateClicked => { - if self.plugin_name().is_empty() { - show_message("Plugin Name is empty.".to_string(), MessageLevel::Error); + if let Err(e) = self.check_generate() { + message_dialog(e.to_string(), MessageLevel::Error); return Task::none(); } - if self.prefix().is_empty() { - show_message("Prefix is empty.".to_string(), MessageLevel::Error); - return Task::none(); - } - - if self.max_len().is_empty() { - show_message("MaxLen is empty.".to_string(), MessageLevel::Error); - return Task::none(); - } - - let max_len; - if let Ok(max) = self.max_len().parse::() { - max_len = max; - } else { - show_message("MaxLen numeric only.".to_string(), MessageLevel::Error); - return Task::none(); - } - - if let ShellcodeSaveType::Local = self.shellcode_save_type() { - if self.size_holder().is_empty() { - show_message("Size Holder is empty.".to_string(), MessageLevel::Error); - return Task::none(); - } - } - - match self.encrypt_type() { - EncryptType::None => (), - EncryptType::Xor(x) => { - if x.is_empty() { - show_message("Xor Pass is empty.".to_string(), MessageLevel::Error); - return Task::none(); - } - } - EncryptType::AesGcm(x) => { - if x.key_holder().is_empty() { - show_message("AesGcm Key is empty.".to_string(), MessageLevel::Error); - return Task::none(); - } else if x.nonce_holder().is_empty() { - show_message("AesGcm Nonce is empty.".to_string(), MessageLevel::Error); - return Task::none(); - } - } - } - - let windows_exe_path = PathBuf::from(self.windows_exe()); - let windows_dll_path = PathBuf::from(self.windows_lib()); - let windows = match ( - windows_exe_path.exists() && windows_exe_path.is_file(), - windows_dll_path.exists() && windows_dll_path.is_file(), - ) { - (false, false) => None, - _ => Some(Bins { - executable: if let Ok(bin) = fs::read(&windows_exe_path) { - Some(bin) - } else { - None + let mut plugin = Plugin { + version: self.pumpbin_version().to_string(), + info: PluginInfo { + plugin_name: self.plugin_name().to_string(), + author: { + let author = self.author().to_string(); + if author.is_empty() { + "None".to_string() + } else { + author + } }, - dynamic_library: if let Ok(bin) = fs::read(&windows_dll_path) { - Some(bin) - } else { - None + version: { + let version = self.version().to_string(); + if version.is_empty() { + "None".to_string() + } else { + version + } }, - }), + desc: { + let desc = self.desc().text(); + if desc.is_empty() { + "None".to_string() + } else { + desc + } + }, + }, + replace: PluginReplace { + src_prefix: self.src_prefix().as_bytes().to_vec(), + size_holder: match self.shellcode_save_type() { + ShellcodeSaveType::Local => { + Some(self.size_holder().as_bytes().to_vec()) + } + ShellcodeSaveType::Remote => None, + }, + max_len: self.max_len().parse().unwrap(), + }, + ..Default::default() }; - let linux_exe_path = PathBuf::from(self.linux_exe()); - let linux_dll_path = PathBuf::from(self.linux_lib()); - let linux = match ( - linux_exe_path.exists() && linux_exe_path.is_file(), - linux_dll_path.exists() && linux_dll_path.is_file(), - ) { - (false, false) => None, - _ => Some(Bins { - executable: if let Ok(bin) = fs::read(&linux_exe_path) { - Some(bin) - } else { - None - }, - dynamic_library: if let Ok(bin) = fs::read(&linux_dll_path) { - Some(bin) - } else { - None - }, - }), - }; + let paths: Vec<(String, ChooseFileType)> = vec![ + (self.windows_exe(), ChooseFileType::WindowsExe), + (self.windows_lib(), ChooseFileType::WindowsLib), + (self.linux_exe(), ChooseFileType::LinuxExe), + (self.linux_lib(), ChooseFileType::LinuxLib), + (self.darwin_exe(), ChooseFileType::DarwinExe), + (self.darwin_lib(), ChooseFileType::DarwinLib), + ( + self.encrypt_shellcode_plugin(), + ChooseFileType::EncryptShellcodePlugin, + ), + ( + self.format_encrypted_shellcode_plugin(), + ChooseFileType::FormatEncryptedShellcodePlugin, + ), + ( + self.format_url_remote_plugin(), + ChooseFileType::FormatUrlRemote, + ), + ( + self.upload_final_shellcode_remote_plugin(), + ChooseFileType::UploadFinalShellcodeRemote, + ), + ] + .into_iter() + .map(|(x, y)| (x.to_string(), y)) + .collect(); - let darwin_exe_path = PathBuf::from(self.darwin_exe()); - let darwin_dll_path = PathBuf::from(self.darwin_lib()); - let darwin = match ( - darwin_exe_path.exists() && darwin_exe_path.is_file(), - darwin_dll_path.exists() && darwin_dll_path.is_file(), - ) { - (false, false) => None, - _ => Some(Bins { - executable: if let Ok(bin) = fs::read(&darwin_exe_path) { - Some(bin) - } else { - None - }, - dynamic_library: if let Ok(bin) = fs::read(&darwin_dll_path) { - Some(bin) - } else { - None - }, - }), - }; - - let plugin = Plugin { - plugin_name: self.plugin_name().to_string(), - author: match self.author().is_empty() { - true => None, - false => Some(self.author().to_string()), - }, - version: match self.version().is_empty() { - true => None, - false => Some(self.version().to_string()), - }, - desc: match self.desc().text().is_empty() { - true => None, - false => Some(self.desc().text()), - }, - prefix: self.prefix().as_bytes().to_vec(), - size_holder: match self.shellcode_save_type() { - ShellcodeSaveType::Local => Some(self.size_holder().as_bytes().to_vec()), - ShellcodeSaveType::Remote => None, - }, - max_len, - encrypt_type: self.encrypt_type().to_owned(), - platforms: Platforms { - windows, - linux, - darwin, - }, - }; - - let plugin_name = self.plugin_name().to_owned(); let make_plugin = async move { + for (path_str, file_type) in paths { + if path_str.is_empty().not() { + let path = PathBuf::from(path_str); + let data = fs::read(path)?; + let bin = match file_type { + ChooseFileType::WindowsExe => plugin.bins.windows.executable_mut(), + ChooseFileType::WindowsLib => { + plugin.bins.windows.dynamic_library_mut() + } + ChooseFileType::LinuxExe => plugin.bins.linux.executable_mut(), + ChooseFileType::LinuxLib => plugin.bins.linux.dynamic_library_mut(), + ChooseFileType::DarwinExe => plugin.bins.darwin.executable_mut(), + ChooseFileType::DarwinLib => { + plugin.bins.darwin.dynamic_library_mut() + } + ChooseFileType::EncryptShellcodePlugin => { + plugin.plugins.encrypt_shellcode_mut() + } + ChooseFileType::FormatEncryptedShellcodePlugin => { + plugin.plugins.format_encrypted_shellcode_mut() + } + ChooseFileType::FormatUrlRemote => { + plugin.plugins.format_url_remote_mut() + } + ChooseFileType::UploadFinalShellcodeRemote => { + plugin.plugins.upload_final_shellcode_remote_mut() + } + }; + *bin = Some(data); + } + } + let file = AsyncFileDialog::new() .set_directory(desktop_dir().unwrap_or(".".into())) - .set_file_name(format!("{}.b1n", plugin_name)) + .set_file_name(format!("{}.b1n", plugin.info().plugin_name())) .set_can_create_directories(true) - .set_title("save plugin") + .set_title("Save generated plugin") .save_file() .await - .ok_or("Canceled plugin saving.".to_string())?; + .ok_or(anyhow!("Canceled the saving of the generated plugin."))?; - plugin - .write_plugin(file.path()) - .map_err(|_| "Write plugin failed.".to_string())?; + fs::write(file.path(), plugin.encode_to_vec()?)?; - Ok(()) - }; + anyhow::Ok(()) + } + .map_err(|e| e.to_string()); - Task::perform(make_plugin, MakerMessage::GenerateDone) + return Task::perform(make_plugin, MakerMessage::GenerateDone); } MakerMessage::GenerateDone(x) => { match x { - Ok(_) => show_message("Generate done.".to_string(), MessageLevel::Info), - Err(e) => show_message(e, MessageLevel::Error), + Ok(_) => message_dialog("Generate done.".to_string(), MessageLevel::Info), + Err(e) => message_dialog(e, MessageLevel::Error), }; - Task::none() } MakerMessage::ChooseFileClicked(x) => { let choose_file = async move { - AsyncFileDialog::new() + let file = AsyncFileDialog::new() .set_directory(home_dir().unwrap_or(".".into())) - .set_title("choose file") + .set_title("Choose file") .pick_file() .await - .map(|x| x.path().to_string_lossy().to_string()) - .ok_or("Canceled file selection.".to_string()) + .map(|x| x.path().to_string_lossy().to_string()); + + (file, x) }; - Task::perform( - choose_file, - match x { - ChooseFileType::WindowsExe => MakerMessage::WindowsExeChooseDone, - ChooseFileType::WindowsLib => MakerMessage::WindowsLibChooseDone, - ChooseFileType::LinuxExe => MakerMessage::LinuxExeChooseDone, - ChooseFileType::LinuxLib => MakerMessage::LinuxLibChooseDone, - ChooseFileType::DarwinExe => MakerMessage::DarwinExeChooseDone, - ChooseFileType::DarwinLib => MakerMessage::DarwinLibChooseDone, - }, - ) + return Task::perform(choose_file, MakerMessage::ChooseFileDone); } - MakerMessage::WindowsExeChooseDone(x) => { - if let Ok(path) = x { - self.windows_exe = path; + MakerMessage::ChooseFileDone((path, choose_type)) => { + if let Some(path) = path { + match choose_type { + ChooseFileType::WindowsExe => self.windows_exe = path, + ChooseFileType::WindowsLib => self.windows_lib = path, + ChooseFileType::LinuxExe => self.linux_exe = path, + ChooseFileType::LinuxLib => self.linux_lib = path, + ChooseFileType::DarwinExe => self.darwin_exe = path, + ChooseFileType::DarwinLib => self.darwin_lib = path, + ChooseFileType::EncryptShellcodePlugin => { + self.encrypt_shellcode_plugin = path + } + ChooseFileType::FormatEncryptedShellcodePlugin => { + self.format_encrypted_shellcode_plugin = path + } + ChooseFileType::FormatUrlRemote => self.format_url_remote_plugin = path, + ChooseFileType::UploadFinalShellcodeRemote => { + self.upload_final_shellcode_remote_plugin = path + } + } } - - Task::none() - } - MakerMessage::WindowsLibChooseDone(x) => { - if let Ok(path) = x { - self.windows_lib = path; - } - - Task::none() - } - MakerMessage::LinuxExeChooseDone(x) => { - if let Ok(path) = x { - self.linux_exe = path; - } - - Task::none() - } - MakerMessage::LinuxLibChooseDone(x) => { - if let Ok(path) = x { - self.linux_lib = path; - } - - Task::none() - } - MakerMessage::DarwinExeChooseDone(x) => { - if let Ok(path) = x { - self.darwin_exe = path; - } - - Task::none() - } - MakerMessage::DarwinLibChooseDone(x) => { - if let Ok(path) = x { - self.darwin_lib = path; - } - - Task::none() } MakerMessage::B1nClicked => { if open::that(env!("CARGO_PKG_HOMEPAGE")).is_err() { - show_message("Open home failed.".into(), MessageLevel::Error); + message_dialog("Open home failed.".into(), MessageLevel::Error); } - Task::none() } MakerMessage::GithubClicked => { if open::that(env!("CARGO_PKG_REPOSITORY")).is_err() { - show_message("Open repo failed.".into(), MessageLevel::Error); + message_dialog("Open repo failed.".into(), MessageLevel::Error); } - Task::none() - } - MakerMessage::ThemeChanged(x) => { - self.selected_theme = x; - Task::none() } + MakerMessage::ThemeChanged(x) => self.selected_theme = x, } + + Task::none() } - fn view(&self) -> iced::Element<'_, Self::Message, Self::Theme, Self::Renderer> { + pub fn view(&self) -> Column { let choose_button = || { button( Svg::new(Handle::from_memory(include_bytes!( @@ -548,23 +470,6 @@ impl Application for Maker { ) }; - let pick_list_handle = || pick_list::Handle::Dynamic { - closed: pick_list::Icon { - font: JETBRAINS_MONO_FONT, - code_point: '', - size: None, - line_height: text::LineHeight::Relative(1.0), - shaping: text::Shaping::Basic, - }, - open: pick_list::Icon { - font: JETBRAINS_MONO_FONT, - code_point: '', - size: None, - line_height: text::LineHeight::Relative(1.0), - shaping: text::Shaping::Basic, - }, - }; - let maker = column![ row![ column![ @@ -584,11 +489,11 @@ impl Application for Maker { .align_items(Alignment::Start), column![ text("Prefix"), - text_input("", self.prefix()).on_input(MakerMessage::PrefixChanged), + text_input("", self.src_prefix()).on_input(MakerMessage::SrcPrefixChanged), ] .align_items(Alignment::Start), column![ - text("MaxLen"), + text("Max Len"), text_input("", self.max_len()).on_input(MakerMessage::MaxLenChanged), ] .align_items(Alignment::Start), @@ -627,42 +532,6 @@ impl Application for Maker { .spacing(20) ] .align_items(Alignment::Start), - column![ - text("Encrypt Type"), - row![pick_list( - EncryptType::all(), - Some(self.encrypt_type()), - MakerMessage::EncryptTypeChanged - ) - .handle(pick_list_handle())] - .push_maybe(match self.encrypt_type() { - EncryptType::None => None, - EncryptType::Xor(x) => Some( - row![ - text("Pass:"), - text_input("", &String::from_utf8_lossy(x)) - .on_input(MakerMessage::XorPassChanged) - ] - .spacing(10) - .align_items(Alignment::Center) - ), - EncryptType::AesGcm(x) => Some( - row![ - text("Key:"), - text_input("", &String::from_utf8_lossy(x.key_holder())) - .on_input(MakerMessage::AesKeyChanged), - text("Nonce:"), - text_input("", &String::from_utf8_lossy(x.nonce_holder())) - .on_input(MakerMessage::AesNonceChanged) - ] - .spacing(10) - .align_items(Alignment::Center) - ), - }) - .spacing(20) - .align_items(Alignment::Center) - ] - .align_items(Alignment::Start), column![ text("Windows"), row![ @@ -713,6 +582,75 @@ impl Application for Maker { .spacing(10) ] .align_items(Alignment::Start), + row![ + column![column![ + text("Encrypt Shellcode Plug-in"), + row![ + text_input("", self.encrypt_shellcode_plugin()) + .on_input(MakerMessage::EncryptShllcodePluginChanged), + choose_button().on_press(MakerMessage::ChooseFileClicked( + ChooseFileType::EncryptShellcodePlugin + )) + ] + .align_items(Alignment::Center) + .spacing(10), + ] + .align_items(Alignment::Start)] + .push_maybe(match self.shellcode_save_type() { + ShellcodeSaveType::Local => None, + ShellcodeSaveType::Remote => Some(column![ + text("Format Url Remote Plug-in"), + row![ + text_input("", self.format_url_remote_plugin()) + .on_input(MakerMessage::FormatUrlRemotePluginChanged), + choose_button().on_press(MakerMessage::ChooseFileClicked( + ChooseFileType::FormatUrlRemote + )) + ] + .align_items(Alignment::Center) + .spacing(10) + ]), + }) + .width(Length::FillPortion(1)) + .align_items(Alignment::Center), + column![column![ + text("Format Encrypted Shellcode Plug-in"), + row![ + text_input("", self.format_encrypted_shellcode_plugin()) + .on_input(MakerMessage::FormatEncryptedShellcodePluginChanged), + choose_button().on_press(MakerMessage::ChooseFileClicked( + ChooseFileType::FormatEncryptedShellcodePlugin + )) + ] + .align_items(Alignment::Center) + .spacing(10), + ] + .align_items(Alignment::Start)] + .push_maybe(match self.shellcode_save_type() { + ShellcodeSaveType::Local => None, + ShellcodeSaveType::Remote => Some( + column![ + text("Upload Final Shellcode Remote Plug-in"), + row![ + text_input("", self.upload_final_shellcode_remote_plugin()) + .on_input( + MakerMessage::UploadFinalShellcodeRemotePluginChanged + ), + choose_button().on_press(MakerMessage::ChooseFileClicked( + ChooseFileType::UploadFinalShellcodeRemote + )) + ] + .align_items(Alignment::Center) + .spacing(10) + ] + .align_items(Alignment::Start) + ), + }) + .width(Length::FillPortion(1)) + .align_items(Alignment::Center) + ] + .align_items(Alignment::Center) + .spacing(10), column![ text("Description"), text_editor(self.desc()) @@ -739,7 +677,7 @@ impl Application for Maker { ))) .width(30) .height(30) - .style(svg_style::svg_primary_base), + .style(style::svg::svg_primary_base), ) .style(button::text) .on_press(MakerMessage::B1nClicked); @@ -749,7 +687,7 @@ impl Application for Maker { ))) .width(30) .height(30) - .style(svg_style::svg_primary_base), + .style(style::svg::svg_primary_base), ) .style(button::text) .on_press(MakerMessage::GithubClicked); @@ -778,24 +716,10 @@ impl Application for Maker { ] .align_items(Alignment::Center); - column![maker, footer].align_items(Alignment::Center).into() + column![maker, footer].align_items(Alignment::Center) } - fn theme(&self) -> Self::Theme { + pub fn theme(&self) -> Theme { self.selected_theme() } } - -fn main() { - match try_main() { - Ok(_) => (), - Err(e) => { - error_dialog(e); - } - } -} - -fn try_main() -> anyhow::Result<()> { - Maker::run(settings())?; - Ok(()) -} diff --git a/src/lib.rs b/src/lib.rs index 01ad36f..1394c54 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,187 +1,28 @@ -mod button_style; pub mod plugin; -pub mod svg_style; +mod plugin_system; +pub mod style; +pub mod utils; +pub mod plugin_capnp { + include!("../capnp/plugin_capnp.rs"); +} -use std::{fmt::Display, fs, iter, ops::Not, path::PathBuf}; +use std::{fmt::Display, fs, ops::Not, path::PathBuf}; +use anyhow::anyhow; use dirs::{desktop_dir, home_dir}; use iced::{ - advanced::{graphics::image::image_rs::ImageFormat, Application}, - executor, + futures::TryFutureExt, widget::{ button, column, container, horizontal_rule, pick_list, row, scrollable, svg::{self, Handle}, - text, text_editor, text_input, vertical_rule, Scrollable, Svg, + text, text_editor, text_input, vertical_rule, Column, Scrollable, Svg, }, - window::{self, Level, Position}, - Alignment, Background, Element, Font, Length, Pixels, Renderer, Settings, Size, Task, Theme, + Alignment, Background, Length, Task, Theme, }; -use memchr::memmem; -use plugin::{EncryptType, Plugin, Plugins}; -use rand::RngCore; -use rfd::{ - AsyncFileDialog, AsyncMessageDialog, MessageButtons, MessageDialog, MessageDialogResult, - MessageLevel, -}; - -pub const JETBRAINS_MONO_FONT: Font = Font::with_name("JetBrainsMono NF"); - -pub fn error_dialog(error: anyhow::Error) { - MessageDialog::new() - .set_buttons(MessageButtons::Ok) - .set_description(error.to_string()) - .set_level(MessageLevel::Error) - .set_title("PumpBin") - .show(); -} - -pub fn show_message(message: String, level: MessageLevel) -> Task { - let dialog = AsyncMessageDialog::new() - .set_buttons(MessageButtons::Ok) - .set_description(message) - .set_level(level) - .set_title("PumpBin") - .show(); - Task::future(dialog) -} - -pub fn settings() -> Settings { - let size = Size::new(1000.0, 600.0); - - Settings { - id: Some(env!("CARGO_PKG_NAME").into()), - window: window::Settings { - size, - position: Position::Centered, - min_size: Some(size), - visible: true, - resizable: true, - decorations: true, - transparent: false, - level: Level::Normal, - icon: match window::icon::from_file_data( - include_bytes!("../logo/icon.png"), - Some(ImageFormat::Png), - ) { - Ok(x) => Some(x), - Err(_) => None, - }, - exit_on_close_request: true, - ..Default::default() - }, - fonts: vec![include_bytes!("../assets/JetBrainsMonoNerdFont-Regular.ttf").into()], - default_font: JETBRAINS_MONO_FONT, - default_text_size: Pixels(13.0), - antialiasing: true, - ..Default::default() - } -} - -#[derive(Debug)] -pub struct Pumpbin { - shellcode_src: String, - shellcode_save_type: ShellcodeSaveType, - supported_binary_types: Vec, - selected_binary_type: Option, - version: String, - supported_platforms: Vec, - selected_platform: Option, - plugins: Plugins, - selected_plugin: Option, - encrypt_type: EncryptType, - plugin_desc: text_editor::Content, - selected_theme: Theme, -} - -impl Default for Pumpbin { - fn default() -> Self { - Self { - shellcode_src: Default::default(), - shellcode_save_type: ShellcodeSaveType::Local, - supported_binary_types: Default::default(), - selected_binary_type: None, - version: env!("CARGO_PKG_VERSION").into(), - supported_platforms: Default::default(), - selected_platform: None, - plugins: if let Ok(plugins) = Plugins::reade_plugins() { - plugins - } else { - Plugins::default() - }, - selected_plugin: None, - encrypt_type: EncryptType::None, - plugin_desc: text_editor::Content::with_text("None"), - selected_theme: Theme::CatppuccinMacchiato, - } - } -} - -impl Pumpbin { - fn random_encrypt_pass(&mut self) { - match self.encrypt_type() { - EncryptType::None => self.encrypt_type = EncryptType::None, - EncryptType::Xor(x) => { - let mut pass = x.clone(); - rand::thread_rng().fill_bytes(&mut pass); - self.encrypt_type = EncryptType::Xor(pass); - } - EncryptType::AesGcm(x) => { - let mut pass = x.clone(); - rand::thread_rng().fill_bytes(pass.key_holder_mut()); - rand::thread_rng().fill_bytes(pass.nonce_holder_mut()); - self.encrypt_type = EncryptType::AesGcm(pass); - } - } - } - - pub fn shellcode_src(&self) -> &str { - &self.shellcode_src - } - - pub fn shellcode_save_type(&self) -> ShellcodeSaveType { - self.shellcode_save_type - } - - pub fn supported_binary_types(&self) -> &[BinaryType] { - &self.supported_binary_types - } - - pub fn selected_binary_type(&self) -> Option { - self.selected_binary_type - } - - pub fn version(&self) -> &str { - &self.version - } - - pub fn supported_platforms(&self) -> &[Platform] { - &self.supported_platforms - } - - pub fn selected_platform(&self) -> Option { - self.selected_platform - } - - pub fn plugins(&self) -> &Plugins { - &self.plugins - } - - pub fn selected_plugin(&self) -> Option<&String> { - self.selected_plugin.as_ref() - } - - pub fn encrypt_type(&self) -> &EncryptType { - &self.encrypt_type - } - - pub fn plugin_desc(&self) -> &text_editor::Content { - &self.plugin_desc - } - - pub fn selected_theme(&self) -> Theme { - self.selected_theme.clone() - } -} +use plugin::{Plugin, Plugins}; +use plugin_system::Pass; +use rfd::{AsyncFileDialog, MessageLevel}; +use utils::{message_dialog, JETBRAINS_MONO_FONT}; #[derive(Debug, Clone)] pub enum Message { @@ -189,7 +30,7 @@ pub enum Message { ChooseShellcodeClicked, ChooseShellcodeDone(Option), EncryptShellcode(Option), - EncryptShellcodeDone(Result<(), String>), + EncryptShellcodeDone(Result<(Vec, String), String>), PlatformChanged(Platform), GenerateClicked, GenerateDone(Result<(), String>), @@ -197,7 +38,7 @@ pub enum Message { AddPluginClicked, AddPluginDone(Result<(u32, u32, Plugins), String>), RemovePlugin(String), - RemovePluginDone(Result<(String, Plugins), String>), + RemovePluginDone(Result), PluginItemClicked(String), EditorAction(text_editor::Action), B1nClicked, @@ -220,8 +61,9 @@ impl Display for BinaryType { } } -#[derive(Debug, Clone, Copy, PartialEq, Eq)] +#[derive(Debug, Default, Clone, Copy, PartialEq, Eq)] pub enum ShellcodeSaveType { + #[default] Local, Remote, } @@ -252,53 +94,138 @@ impl Display for Platform { } } -impl Application for Pumpbin { - type Executor = executor::Default; - type Flags = (); - type Message = Message; - type Theme = Theme; - type Renderer = Renderer; +#[derive(Debug)] +pub struct Pumpbin { + shellcode_src: String, + shellcode_save_type: ShellcodeSaveType, + supported_binary_types: Vec, + selected_binary_type: Option, + supported_platforms: Vec, + selected_platform: Option, + plugins: Plugins, + selected_plugin: Option, + plugin_desc: text_editor::Content, + pass: Vec, + selected_theme: Theme, +} - fn new(_flags: Self::Flags) -> (Self, iced::Task) { - (Self::default(), Task::none()) +impl Default for Pumpbin { + fn default() -> Self { + Self { + shellcode_src: Default::default(), + shellcode_save_type: Default::default(), + supported_binary_types: Default::default(), + selected_binary_type: Default::default(), + supported_platforms: Default::default(), + selected_platform: Default::default(), + plugins: Plugins::reade_plugins().unwrap_or_default(), + selected_plugin: Default::default(), + plugin_desc: Default::default(), + pass: Default::default(), + selected_theme: Theme::CatppuccinMacchiato, + } + } +} + +impl Pumpbin { + fn update_supported_binary_types(&mut self, platform: Platform) { + let bins = self.selected_plugin().unwrap().bins(); + let bin_types = match platform { + Platform::Windows => bins.windows(), + Platform::Linux => bins.linux(), + Platform::Darwin => bins.darwin(), + } + .supported_binary_types(); + + self.selected_binary_type = None; + self.supported_binary_types = bin_types; } - fn title(&self) -> String { - "PumpBin".into() + fn update_supported_platforms(&mut self, plugin: &Plugin) { + let platforms = plugin.bins().supported_plaforms(); + + self.supported_binary_types = Default::default(); + self.selected_binary_type = Default::default(); + self.supported_platforms = platforms; + self.selected_platform = Default::default(); + } +} + +impl Pumpbin { + pub fn shellcode_src(&self) -> &str { + &self.shellcode_src } - fn update(&mut self, message: Self::Message) -> iced::Task { + pub fn shellcode_save_type(&self) -> ShellcodeSaveType { + self.shellcode_save_type + } + + pub fn supported_binary_types(&self) -> &[BinaryType] { + &self.supported_binary_types + } + + pub fn selected_binary_type(&self) -> Option { + self.selected_binary_type + } + + pub fn supported_platforms(&self) -> &[Platform] { + &self.supported_platforms + } + + pub fn selected_platform(&self) -> Option { + self.selected_platform + } + + pub fn plugins(&self) -> &Plugins { + &self.plugins + } + + pub fn selected_plugin(&self) -> Option<&Plugin> { + self.selected_plugin.as_ref() + } + + pub fn plugin_desc(&self) -> &text_editor::Content { + &self.plugin_desc + } + + pub fn pass(&self) -> &[Pass] { + &self.pass + } + + pub fn selected_theme(&self) -> Theme { + self.selected_theme.clone() + } +} + +impl Pumpbin { + pub fn update(&mut self, message: Message) -> iced::Task { match message { - Message::ShellcodeSrcChanged(x) => { - self.shellcode_src = x; - Task::none() - } + Message::ShellcodeSrcChanged(x) => self.shellcode_src = x, Message::ChooseShellcodeClicked => { let choose_shellcode = async { - let file = AsyncFileDialog::new() + AsyncFileDialog::new() .set_directory(home_dir().unwrap_or(".".into())) - .set_title("select shellcode file") + .set_title("Select shellcode file") .pick_file() - .await; - file.map(|x| x.path().to_path_buf()) + .await + .map(|x| x.path().to_path_buf()) }; - Task::perform( + return Task::perform( choose_shellcode, match self.shellcode_save_type() { ShellcodeSaveType::Local => Message::ChooseShellcodeDone, ShellcodeSaveType::Remote => Message::EncryptShellcode, }, - ) + ); } Message::ChooseShellcodeDone(x) => { if let Some(path) = x { self.shellcode_src = path.to_string_lossy().to_string(); } - Task::none() } Message::PlatformChanged(x) => { - // do nothing if selected this one + // do nothing if selected this platform if let Some(selected_platform) = self.selected_platform { if x == selected_platform { return Task::none(); @@ -306,359 +233,175 @@ impl Application for Pumpbin { } self.selected_platform = Some(x); - - // check supported_binary_types - - // unwrap is safe. - // UI implemented strict restrictions. - let mut bin_types = Vec::default(); - let platforms = self - .plugins() - .0 - .get(self.selected_plugin().unwrap()) - .unwrap() - .platforms(); - match x { - Platform::Windows => { - if platforms.windows().unwrap().executable().is_some() { - bin_types.push(BinaryType::Executable); - } - if platforms.windows().unwrap().dynamic_library().is_some() { - bin_types.push(BinaryType::DynamicLibrary); - } - } - Platform::Linux => { - if platforms.linux().unwrap().executable().is_some() { - bin_types.push(BinaryType::Executable); - } - if platforms.linux().unwrap().dynamic_library().is_some() { - bin_types.push(BinaryType::DynamicLibrary); - } - } - Platform::Darwin => { - if platforms.darwin().unwrap().executable().is_some() { - bin_types.push(BinaryType::Executable); - } - if platforms.darwin().unwrap().dynamic_library().is_some() { - bin_types.push(BinaryType::DynamicLibrary); - } - } - } - - self.selected_binary_type = None; - self.supported_binary_types = bin_types; - Task::none() + self.update_supported_binary_types(x); } Message::EncryptShellcode(x) => { - if let Some(path) = x { - let encrypt_type = self.encrypt_type().clone(); + let Some(path) = x else { + return Task::none(); + }; - let write_encrypted = async move { - let encrypted = encrypt_type - .encrypt(&path) - .map_err(|_| "Encrypt shellcode failed.")?; + let plugin = self.selected_plugin().unwrap().to_owned(); + let write_encrypted = async move { + let output = plugin.plugins().run_encrypt_shellcode(&path)?; + let final_shellcode = plugin + .plugins() + .run_format_encrypted_shellcode(output.encrypted())?; + let url = plugin + .plugins() + .run_upload_final_shellcode_remote(final_shellcode.formated_shellcode())? + .url() + .to_string(); + if url.is_empty() { let file = AsyncFileDialog::new() .set_directory(desktop_dir().unwrap_or(".".into())) .set_file_name("shellcode.enc") .set_can_create_directories(true) - .set_title("save encrypted shellcode") + .set_title("Save encrypted shellcode") .save_file() .await - .ok_or("Canceled saving encrypted shellcode.")?; + .ok_or(anyhow!("Canceled the saving of encrypted shellcode."))?; - fs::write(file.path(), encrypted) - .map_err(|_| "Write encrypted shellcode failed.")?; + fs::write(file.path(), final_shellcode.formated_shellcode())?; + } - Ok(()) - }; - return Task::perform(write_encrypted, Message::EncryptShellcodeDone); - }; - Task::none() + anyhow::Ok((output.pass().to_vec(), url)) + } + .map_err(|e| e.to_string()); + + return Task::perform(write_encrypted, Message::EncryptShellcodeDone); } Message::EncryptShellcodeDone(x) => { match x { - Ok(_) => show_message("Saved encrypted shellcode.".into(), MessageLevel::Info), - Err(e) => show_message(e, MessageLevel::Error), + Ok((pass, url)) => { + self.pass = pass; + if url.is_empty().not() { + self.shellcode_src = url; + } + message_dialog("Encrypted shellcode done.".into(), MessageLevel::Info) + } + Err(e) => message_dialog(e, MessageLevel::Error), }; - - Task::none() } Message::GenerateClicked => { - // verify path if local mode - let path = PathBuf::from(self.shellcode_src()); - if self.shellcode_save_type() == ShellcodeSaveType::Local { - if path.exists().not() { - show_message("Shellcode path not exists.".into(), MessageLevel::Error); - return Task::none(); - } else if path.is_file().not() { - show_message("Shellcode path is not a file.".into(), MessageLevel::Error); - return Task::none(); - } - } - // unwrap is safe. // UI implemented strict restrictions. - let plugin = self - .plugins() - .0 - .get(self.selected_plugin().unwrap()) - .unwrap() - .to_owned(); - let encrypt_type = self.encrypt_type().clone(); - let shellcode_save_type = self.shellcode_save_type(); + let plugin = self.selected_plugin().unwrap().to_owned(); let shellcode_src = self.shellcode_src().to_owned(); + let pass = self.pass().to_vec(); // get that binary - let selected_platform = self.selected_platform().unwrap(); - let platforms = plugin.platforms(); - let bin_type = self.selected_binary_type().unwrap(); - let mut bin = match (selected_platform, bin_type) { - (Platform::Windows, BinaryType::Executable) => { - platforms.windows().unwrap().executable().unwrap().to_vec() - } - (Platform::Windows, BinaryType::DynamicLibrary) => platforms - .windows() - .unwrap() - .dynamic_library() - .unwrap() - .to_vec(), - (Platform::Linux, BinaryType::Executable) => { - platforms.linux().unwrap().executable().unwrap().to_vec() - } - (Platform::Linux, BinaryType::DynamicLibrary) => platforms - .linux() - .unwrap() - .dynamic_library() - .unwrap() - .to_vec(), - (Platform::Darwin, BinaryType::Executable) => { - platforms.darwin().unwrap().executable().unwrap().to_vec() - } - (Platform::Darwin, BinaryType::DynamicLibrary) => platforms - .darwin() - .unwrap() - .dynamic_library() - .unwrap() - .to_vec(), - }; + let mut bin = plugin.bins().get_that_binary( + self.selected_platform().unwrap(), + self.selected_binary_type().unwrap(), + ); let generate = async move { - // replace pass - match &encrypt_type { - EncryptType::None => (), - EncryptType::Xor(x) => { - if let EncryptType::Xor(holder) = plugin.encrypt_type() { - let position = memmem::find_iter(bin.as_slice(), holder) - .next() - .ok_or("Can't find the pass placeholder.".to_string())?; - - bin[position..(position + holder.len())] - .copy_from_slice(x.as_slice()); - } - } - EncryptType::AesGcm(x) => { - if let EncryptType::AesGcm(holder) = plugin.encrypt_type() { - let position = - memmem::find_iter(bin.as_slice(), holder.key_holder()) - .next() - .ok_or("Can't find the pass placeholder.".to_string())?; - bin[position..(position + holder.key_holder().len())] - .copy_from_slice(x.key_holder()); - - let position = - memmem::find_iter(bin.as_slice(), holder.nonce_holder()) - .next() - .ok_or("Can't find the pass placeholder.".to_string())?; - bin[position..(position + holder.nonce_holder().len())] - .copy_from_slice(x.nonce_holder()); - } - } - } - - // replace shellcode src - match shellcode_save_type { - ShellcodeSaveType::Local => { - let mut encrypted = encrypt_type - .encrypt(&path) - .map_err(|_| "Encrypt shellcode failed.".to_string())?; - let encrypted_len_bytes = - encrypted.len().to_string().as_bytes().to_vec(); - - // unwrap is safe. - // UI implemented strict restrictions. - let size_holder = plugin.size_holder().unwrap(); - - if encrypted.len() > (plugin.max_len()) { - return Err("Shellcode too long.".into()); - } - - if encrypted_len_bytes.len() > size_holder.len() { - return Err("Shellcode size bytes too long.".into()); - } - - let mut size_bytes = - vec![b'0'; size_holder.len() - encrypted_len_bytes.len()]; - - size_bytes.extend_from_slice(encrypted_len_bytes.as_slice()); - - // replace size holder - let position = memmem::find_iter(bin.as_slice(), size_holder) - .next() - .ok_or("Can't find the size placeholder.".to_string())?; - bin[position..(position + size_holder.len())] - .copy_from_slice(size_bytes.as_slice()); - - let mut random: Vec = iter::repeat(b'0') - .take(plugin.max_len() - encrypted.len()) - .collect(); - rand::thread_rng().fill_bytes(&mut random); - encrypted.extend_from_slice(random.as_slice()); - - // replace shellcode - let position = memmem::find_iter(bin.as_slice(), plugin.prefix()) - .next() - .ok_or("Can't find the shellcode prefix.".to_string())?; - bin[position..(position + plugin.max_len())] - .copy_from_slice(encrypted.as_slice()); - } - ShellcodeSaveType::Remote => { - let mut shellcode_src = shellcode_src.as_bytes().to_owned(); - shellcode_src.push(b'\0'); - - if shellcode_src.len() > plugin.max_len() { - return Err("Shellcode url too long.".into()); - } - - let mut random: Vec = iter::repeat(b'0') - .take(plugin.max_len() - shellcode_src.len()) - .collect(); - rand::thread_rng().fill_bytes(&mut random); - shellcode_src.extend_from_slice(random.as_slice()); - - // replace shellcode url - let position = memmem::find_iter(bin.as_slice(), plugin.prefix()) - .next() - .ok_or("Can't find the shellcode prefix.".to_string())?; - bin[position..(position + plugin.max_len())] - .copy_from_slice(shellcode_src.as_slice()); - } - } + plugin.replace_binary(&mut bin, shellcode_src, pass)?; // write generated binary let file = AsyncFileDialog::new() .set_directory(desktop_dir().unwrap_or(".".into())) .set_file_name("binary.gen") .set_can_create_directories(true) - .set_title("save generated binary") + .set_title("Save generated binary") .save_file() .await - .ok_or("Canceled saving generated binary.".to_string())?; + .ok_or(anyhow!("Canceled the saving of the generated binary."))?; - fs::write(file.path(), bin) - .map_err(|_| "Write generated binary failed.".to_string())?; + fs::write(file.path(), bin)?; - Ok(()) - }; + anyhow::Ok(()) + } + .map_err(|e| e.to_string()); - Task::perform(generate, Message::GenerateDone) + return Task::perform(generate, Message::GenerateDone); } Message::GenerateDone(x) => { match x { - Ok(_) => show_message("Saved generated binary.".into(), MessageLevel::Info), - Err(e) => show_message(e, MessageLevel::Error), + Ok(_) => message_dialog("Generate done.".into(), MessageLevel::Info), + Err(e) => message_dialog(e, MessageLevel::Error), }; - - Task::none() - } - Message::BinaryTypeChanged(x) => { - self.selected_binary_type = Some(x); - Task::none() } + Message::BinaryTypeChanged(x) => self.selected_binary_type = Some(x), Message::AddPluginClicked => { - let mut plugins = self.plugins().to_owned(); + let mut plugins = self.plugins().clone(); let add_plugins = async move { - let paths: Vec = AsyncFileDialog::new() + let files = AsyncFileDialog::new() .add_filter("b1n", &["b1n"]) .set_directory(home_dir().unwrap_or(".".into())) - .set_title("select plugin files") + .set_title("Select plugin files") .pick_files() .await - .map(|x| x.iter().map(|file| file.path().to_owned()).collect()) - .ok_or("Canceled plugin selection.".to_string())?; + .ok_or(anyhow!("Canceled the selection of plugin files."))?; let mut success = 0; let mut failed = 0; - for path in paths { - if let Ok(plugin) = Plugin::reade_plugin(&path) { - let plugin_name = plugin.plugin_name().to_owned(); + for path in files.iter().map(|x| x.path()) { + let Ok(buf) = fs::read(path) else { + failed += 1; + continue; + }; + if let Ok(plugin) = Plugin::decode_from_slice(buf.as_slice()) { + let plugin_name = plugin.info().plugin_name(); - plugins.0.insert(plugin_name, plugin); + plugins.insert(plugin_name.to_string(), buf); success += 1; } else { failed += 1; } } - plugins - .uptade_plugins() - .map_err(|_| "Uptade plugins failed")?; + plugins.uptade_plugins()?; + anyhow::Ok((success, failed, plugins)) + } + .map_err(|e| e.to_string()); - Ok((success, failed, plugins)) - }; - - Task::perform(add_plugins, Message::AddPluginDone) + return Task::perform(add_plugins, Message::AddPluginDone); } Message::AddPluginDone(x) => { match x { Ok((success, failed, plugins)) => { // if selected_plugin, reselect this plugin - if let Some(selected_plugin) = self.selected_plugin().map(|x| x.to_owned()) - { + if let Some(selected_plugin) = self.selected_plugin() { + let plugin_name = selected_plugin.info().plugin_name().to_owned(); + // bypass check self.selected_plugin = None; - self.update(Message::PluginItemClicked(selected_plugin)); + self.update(Message::PluginItemClicked(plugin_name)); } self.plugins = plugins; - show_message( + message_dialog( format!("Added {} plugins, {} failed.", success, failed), MessageLevel::Info, ); } Err(e) => { - show_message(e, MessageLevel::Error); + message_dialog(e, MessageLevel::Error); } } - Task::none() } Message::RemovePlugin(x) => { let mut plugins = self.plugins().clone(); let remove_plugin = async move { - plugins - .0 - .remove(&x) - .ok_or("Plugin not exists.".to_string())?; - plugins - .uptade_plugins() - .map_err(|_| "Update plugins failed.".to_string())?; + plugins.remove(&x); + plugins.uptade_plugins()?; - Ok((x, plugins)) - }; - Task::perform(remove_plugin, Message::RemovePluginDone) + anyhow::Ok(plugins) + } + .map_err(|e| e.to_string()); + + return Task::perform(remove_plugin, Message::RemovePluginDone); } Message::RemovePluginDone(x) => { match x { - Ok((plugin_name, plugins)) => { + Ok(plugins) => { self.plugins = plugins; - let mut names: Vec = - self.plugins().0.keys().map(|x| x.to_owned()).collect(); - names.sort(); - - if let Some(name) = names.first() { + if let Some(name) = self.plugins().get_sorted_names().first() { _ = self.update(Message::PluginItemClicked(name.to_owned())); } else { self.supported_binary_types = Default::default(); @@ -668,96 +411,55 @@ impl Application for Pumpbin { self.selected_plugin = None; self.shellcode_save_type = ShellcodeSaveType::Local; } - show_message( - format!("Removed plugin {}", plugin_name), - MessageLevel::Info, - ); } Err(e) => { - show_message(e, MessageLevel::Error); + message_dialog(e, MessageLevel::Error); } }; - Task::none() } Message::PluginItemClicked(x) => { // unwrap is safe. // UI implemented strict restrictions. - let plugin = self.plugins.0.get(&x).unwrap(); + let plugin = self.plugins().get(&x).unwrap(); if let Some(selected_plugin) = self.selected_plugin() { - if plugin.plugin_name() == selected_plugin { - // random encryption pass - self.random_encrypt_pass(); - show_message( - "Generated new random encryption passwords.".into(), - MessageLevel::Info, - ); + if plugin.info().plugin_name() == selected_plugin.info().plugin_name() { return Task::none(); } } - self.selected_plugin = Some(plugin.plugin_name().to_string()); + self.selected_plugin = Some(plugin.clone()); + self.plugin_desc = text_editor::Content::with_text(plugin.info().desc()); - self.plugin_desc = text_editor::Content::with_text(match plugin.desc() { - Some(desc) => desc.as_str(), - None => "None", - }); - - if plugin.size_holder().is_none() { - self.shellcode_save_type = ShellcodeSaveType::Remote; - } else { + if plugin.replace().size_holder().is_some() { self.shellcode_save_type = ShellcodeSaveType::Local; + } else { + self.shellcode_save_type = ShellcodeSaveType::Remote; } - let mut platforms = Vec::default(); - if plugin.platforms().windows().is_some() { - platforms.push(Platform::Windows); - } - if plugin.platforms().linux().is_some() { - platforms.push(Platform::Linux); - } - if plugin.platforms().darwin().is_some() { - platforms.push(Platform::Darwin); - } - - self.supported_binary_types = Vec::default(); - self.selected_binary_type = None; - self.selected_platform = None; - self.supported_platforms = platforms; - - // random pass - self.encrypt_type = plugin.encrypt_type().clone(); - self.random_encrypt_pass(); - - Task::none() - } - Message::EditorAction(x) => { - match x { - text_editor::Action::Edit(_) => (), - _ => self.plugin_desc.perform(x), - } - Task::none() + self.update_supported_platforms(&plugin); } + Message::EditorAction(x) => match x { + text_editor::Action::Edit(_) => (), + _ => self.plugin_desc.perform(x), + }, Message::B1nClicked => { if open::that(env!("CARGO_PKG_HOMEPAGE")).is_err() { - show_message("Open home failed.".into(), MessageLevel::Error); + message_dialog("Open home failed.".into(), MessageLevel::Error); } - Task::none() } Message::GithubClicked => { if open::that(env!("CARGO_PKG_REPOSITORY")).is_err() { - show_message("Open repo failed.".into(), MessageLevel::Error); + message_dialog("Open repo failed.".into(), MessageLevel::Error); } - Task::none() - } - Message::ThemeChanged(x) => { - self.selected_theme = x; - Task::none() } + Message::ThemeChanged(x) => self.selected_theme = x, } + + Task::none() } - fn view(&self) -> iced::Element<'_, Self::Message, Self::Theme, iced::Renderer> { + pub fn view(&self) -> Column { let padding = 20; let spacing = 20; @@ -853,7 +555,7 @@ impl Application for Pumpbin { .width(Length::Fill) .padding(3); - if self.plugins().0.is_empty() { + if self.plugins().is_empty() { plugin_items = plugin_items.push( row![ Svg::new(Handle::from_memory(include_bytes!( @@ -861,7 +563,7 @@ impl Application for Pumpbin { ))) .width(30) .height(30) - .style(svg_style::svg_primary_base), + .style(style::svg::svg_primary_base), text("Did you see that  sign? 󰁂") .color(self.theme().extended_palette().primary.base.color) ] @@ -870,52 +572,40 @@ impl Application for Pumpbin { ); } - let mut plugin_names: Vec = - self.plugins().0.keys().map(|x| x.to_string()).collect(); - plugin_names.sort(); - let plugin_names = plugin_names; + let plugin_names = self.plugins().get_sorted_names(); // dynamic push plugin item for plugin_name in plugin_names { - let plugin = match self.plugins().0.get(&plugin_name) { - Some(x) => x, - None => continue, + let plugin = match self.plugins().get(&plugin_name) { + Ok(x) => x, + Err(_) => continue, }; let item = button( column![ text!(" {}", plugin_name).width(Length::Fill), row![ - column![text!( - " {}", - match plugin.author() { - Some(x) => x.to_owned(), - None => "None".into(), - } - )] - .width(Length::Fill) - .align_items(Alignment::Start), + column![text!(" {}", plugin.info().author())] + .width(Length::Fill) + .align_items(Alignment::Start), column![row!( text(" ").color(self.theme().extended_palette().primary.base.color), - match plugin.platforms().windows() { - Some(_) => text(" ") - .color(self.theme().extended_palette().success.base.color), - None => text(" ") - .color(self.theme().extended_palette().danger.base.color), + if plugin.bins().windows().is_platform_supported() { + text(" ").color(self.theme().extended_palette().success.base.color) + } else { + text(" ").color(self.theme().extended_palette().danger.base.color) }, text(" ").color(self.theme().extended_palette().primary.base.color), - match plugin.platforms().linux() { - Some(_) => text(" ") - .color(self.theme().extended_palette().success.base.color), - None => text(" ") - .color(self.theme().extended_palette().danger.base.color), + if plugin.bins().linux().is_platform_supported() { + text(" ").color(self.theme().extended_palette().success.base.color) + } else { + text(" ").color(self.theme().extended_palette().danger.base.color) }, text(" ").color(self.theme().extended_palette().primary.base.color), - match plugin.platforms().darwin() { - Some(_) => text(" ") - .color(self.theme().extended_palette().success.base.color), - None => text(" ") - .color(self.theme().extended_palette().danger.base.color), + if plugin.bins().darwin().is_platform_supported() { + text(" ").color(self.theme().extended_palette().success.base.color) + } else { + text(" ").color(self.theme().extended_palette().danger.base.color) } ) .align_items(Alignment::Center)] @@ -928,8 +618,8 @@ impl Application for Pumpbin { ) .width(Length::Fill) .style(match self.selected_plugin() { - Some(x) if x == &plugin_name => button_style::selected, - _ => button_style::unselected, + Some(x) if x.info().plugin_name() == plugin_name => style::button::selected, + _ => style::button::unselected, }) .on_press(Message::PluginItemClicked(plugin_name)); @@ -968,11 +658,7 @@ impl Application for Pumpbin { }; let plugin_info_panel = column![match self.selected_plugin() { - Some(plugin_name) => { - // unwrap is safe. - // UI implemented strict restrictions. - let plugin = self.plugins().0.get(plugin_name).unwrap(); - + Some(plugin) => { row![ column![ row![column![ @@ -981,7 +667,6 @@ impl Application for Pumpbin { plugin_info_title(" Version:"), plugin_info_title("󰰥 Type:"), plugin_info_title(" MaxLen:"), - plugin_info_title("󰒃 Encrypt:"), plugin_info_title(" Windows:"), plugin_info_title(" Linux:"), plugin_info_title(" Darwin:"), @@ -996,65 +681,77 @@ impl Application for Pumpbin { .width(Length::FillPortion(1)) .align_items(Alignment::Start), column![ - text(plugin.plugin_name()).size(16), - text(match plugin.author() { - Some(x) => x.to_string(), - None => "None".to_string(), - }) - .size(16), - text(match plugin.version() { - Some(x) => x.to_string(), - None => "None".to_string(), - }) - .size(16), - text(match plugin.size_holder().is_none() { + text(plugin.info().plugin_name()).size(16), + text(plugin.info().author()).size(16), + text(plugin.info().version()).size(16), + text(match plugin.replace().size_holder().is_none() { true => "Remote", false => "Local", }) .size(16), - text!("{} Bytes", plugin.max_len()).size(16), - text(plugin.encrypt_type().to_string()).size(16), + text!("{} Bytes", plugin.replace().max_len()).size(16), row![ text(BinaryType::Executable.to_string()), - match plugin.platforms().windows() { - Some(bins) if bins.executable().is_some() => binary_type_some(), - _ => binary_type_none(), + { + let bins = plugin.bins().windows(); + if bins.executable().is_some() { + binary_type_some() + } else { + binary_type_none() + } }, text(BinaryType::DynamicLibrary.to_string()), - match plugin.platforms().windows() { - Some(bins) if bins.dynamic_library().is_some() => - binary_type_some(), - _ => binary_type_none(), + { + let bins = plugin.bins().windows(); + if bins.dynamic_library().is_some() { + binary_type_some() + } else { + binary_type_none() + } } ] .spacing(3) .align_items(Alignment::Center), row![ text(BinaryType::Executable.to_string()), - match plugin.platforms().linux() { - Some(bins) if bins.executable().is_some() => binary_type_some(), - _ => binary_type_none(), + { + let bins = plugin.bins().linux(); + if bins.executable().is_some() { + binary_type_some() + } else { + binary_type_none() + } }, text(BinaryType::DynamicLibrary.to_string()), - match plugin.platforms().linux() { - Some(bins) if bins.dynamic_library().is_some() => - binary_type_some(), - _ => binary_type_none(), + { + let bins = plugin.bins().linux(); + if bins.dynamic_library().is_some() { + binary_type_some() + } else { + binary_type_none() + } } ] .spacing(3) .align_items(Alignment::Center), row![ text(BinaryType::Executable.to_string()), - match plugin.platforms().darwin() { - Some(bins) if bins.executable().is_some() => binary_type_some(), - _ => binary_type_none(), + { + let bins = plugin.bins().darwin(); + if bins.executable().is_some() { + binary_type_some() + } else { + binary_type_none() + } }, text(BinaryType::DynamicLibrary.to_string()), - match plugin.platforms().darwin() { - Some(bins) if bins.dynamic_library().is_some() => - binary_type_some(), - _ => binary_type_none(), + { + let bins = plugin.bins().darwin(); + if bins.dynamic_library().is_some() { + binary_type_some() + } else { + binary_type_none() + } } ] .spacing(3) @@ -1091,7 +788,7 @@ impl Application for Pumpbin { ))) .width(20) .height(Length::Fill) - .style(svg_style::svg_primary_base) + .style(style::svg::svg_primary_base) ) .on_press(Message::AddPluginClicked) .style(button::text), @@ -1102,11 +799,11 @@ impl Application for Pumpbin { ))) .width(20) .height(Length::Fill) - .style(svg_style::svg_primary_base) + .style(style::svg::svg_primary_base) ) .on_press_maybe( self.selected_plugin() - .map(|x| Message::RemovePlugin(x.to_string())) + .map(|x| Message::RemovePlugin(x.info().plugin_name().to_string())) ) .style(|theme: &Theme, status| { let palette = theme.extended_palette(); @@ -1147,7 +844,7 @@ impl Application for Pumpbin { .width(Length::Fill) .height(Length::Fill); - let version = text(format!("PumpBin  v{}", self.version())) + let version = text(format!("PumpBin  v{}", env!("CARGO_PKG_VERSION"))) .color(self.theme().extended_palette().primary.base.color); let b1n = button( @@ -1156,7 +853,7 @@ impl Application for Pumpbin { ))) .width(30) .height(30) - .style(svg_style::svg_primary_base), + .style(style::svg::svg_primary_base), ) .style(button::text) .on_press(Message::B1nClicked); @@ -1166,7 +863,7 @@ impl Application for Pumpbin { ))) .width(30) .height(30) - .style(svg_style::svg_primary_base), + .style(style::svg::svg_primary_base), ) .style(button::text) .on_press(Message::GithubClicked); @@ -1195,20 +892,19 @@ impl Application for Pumpbin { ] .align_items(Alignment::Center); - let home: Element<_> = column![ + let home = column![ column![setting_panel, plugin_panel] .padding(padding) .align_items(Alignment::Center) .spacing(spacing), footer ] - .align_items(Alignment::Center) - .into(); + .align_items(Alignment::Center); home } - fn theme(&self) -> Self::Theme { + pub fn theme(&self) -> Theme { self.selected_theme() } } diff --git a/src/main.rs b/src/main.rs index 800a66c..30caf80 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,15 +4,16 @@ use std::{fs, ops::Not}; use anyhow::anyhow; use dirs::data_dir; -use iced::advanced::Application; -use pumpbin::{error_dialog, plugin::CONFIG_FILE_PATH, settings, Pumpbin}; +use iced::application; +use pumpbin::{ + plugin::CONFIG_FILE_PATH, + utils::{self, error_dialog}, + Pumpbin, +}; fn main() { - match try_main() { - Ok(_) => (), - Err(e) => { - error_dialog(e); - } + if let Err(e) = try_main() { + error_dialog(e); } } @@ -34,6 +35,10 @@ fn try_main() -> anyhow::Result<()> { .set(config_path) .map_err(|_| anyhow!("Set CONFIG_FILE_PATH failed."))?; - Pumpbin::run(settings())?; + application("PumpBin", Pumpbin::update, Pumpbin::view) + .settings(utils::settings()) + .window(utils::window_settings()) + .theme(Pumpbin::theme) + .run()?; Ok(()) } diff --git a/src/plugin.rs b/src/plugin.rs index b323183..e4f9a99 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -1,104 +1,102 @@ use std::{ collections::HashMap, - fmt::Display, - fs, + fs, iter, + ops::Not, path::{Path, PathBuf}, sync::OnceLock, }; -use aes_gcm::{aead::Aead, Aes256Gcm, Key, KeyInit, Nonce}; -use anyhow::anyhow; +use anyhow::{anyhow, bail}; use bincode::{decode_from_slice, encode_to_vec, Decode, Encode}; +use capnp::{ + message::{self, ReaderOptions}, + serialize_packed, +}; + +use crate::{ + plugin_capnp, + plugin_system::{ + run_plugin, EncryptShellcodeInput, EncryptShellcodeOutput, FormatEncryptedShellcodeInput, + FormatEncryptedShellcodeOutput, FormatUrlRemoteInput, FormatUrlRemoteOutput, Pass, + UploadFinalShellcodeRemoteInput, UploadFinalShellcodeRemoteOutput, + }, + utils, BinaryType, Platform, ShellcodeSaveType, +}; -// 500 MiB -const LIMIT: usize = 1024 * 1024 * 500; -pub const BINCODE_PLUGIN_CONFIG: bincode::config::Configuration< - bincode::config::LittleEndian, - bincode::config::Varint, - bincode::config::Limit, -> = bincode::config::standard().with_limit(); const BINCODE_PLUGINS_CONFIG: bincode::config::Configuration = bincode::config::standard(); - pub static CONFIG_FILE_PATH: OnceLock = OnceLock::new(); -#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)] -pub struct AesGcmPass { - key_holder: Vec, - nonce_holder: Vec, +#[derive(Debug, Default, Clone)] +pub struct PluginInfo { + pub plugin_name: String, + pub author: String, + pub version: String, + pub desc: String, } -impl AesGcmPass { - pub fn key_holder(&self) -> &[u8] { - &self.key_holder +impl PluginInfo { + pub fn plugin_name(&self) -> &str { + &self.plugin_name } - pub fn key_holder_mut(&mut self) -> &mut Vec { - &mut self.key_holder + pub fn author(&self) -> &str { + &self.author } - pub fn nonce_holder(&self) -> &[u8] { - &self.nonce_holder + pub fn version(&self) -> &str { + &self.version } - pub fn nonce_holder_mut(&mut self) -> &mut Vec { - &mut self.nonce_holder + pub fn desc(&self) -> &str { + &self.desc } } -#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)] -pub enum EncryptType { - None, - Xor(Vec), - AesGcm(AesGcmPass), +#[derive(Debug, Default, Clone)] +pub struct PluginReplace { + pub src_prefix: Vec, + pub size_holder: Option>, + pub max_len: u64, } -impl Display for EncryptType { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - EncryptType::None => write!(f, "None"), - EncryptType::Xor(_) => write!(f, "Xor"), - EncryptType::AesGcm(_) => write!(f, "AesGcm"), - } +impl PluginReplace { + pub fn src_prefix(&self) -> &[u8] { + &self.src_prefix + } + + pub fn size_holder(&self) -> Option<&Vec> { + self.size_holder.as_ref() + } + + pub fn max_len(&self) -> usize { + self.max_len as usize } } -impl EncryptType { - pub const fn all() -> [EncryptType; 3] { - [ - EncryptType::None, - EncryptType::Xor(vec![]), - EncryptType::AesGcm(AesGcmPass { - key_holder: vec![], - nonce_holder: vec![], - }), - ] - } - pub fn encrypt(&self, path: &Path) -> anyhow::Result> { - let data = fs::read(path)?; - - match self { - EncryptType::None => Ok(data), - EncryptType::Xor(x) => Ok(data - .iter() - .enumerate() - .map(|(i, byte)| byte ^ x[i % x.len()]) - .collect()), - EncryptType::AesGcm(x) => { - let key = Key::::from_slice(x.key_holder()); - let aes = Aes256Gcm::new(key); - let nonce = Nonce::from_slice(x.nonce_holder()); - aes.encrypt(nonce, data.as_slice()).map_err(|e| anyhow!(e)) - } - } - } -} - -#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)] +#[derive(Debug, Default, Clone)] pub struct Bins { pub executable: Option>, pub dynamic_library: Option>, } +impl Bins { + pub fn is_platform_supported(&self) -> bool { + matches!((self.executable(), self.dynamic_library()), (None, None)).not() + } + + pub fn supported_binary_types(&self) -> Vec { + let mut bin_types = Vec::default(); + if self.executable().is_some() { + bin_types.push(BinaryType::Executable); + } + if self.dynamic_library().is_some() { + bin_types.push(BinaryType::DynamicLibrary); + } + + bin_types + } +} + impl Bins { pub fn executable(&self) -> Option<&Vec> { self.executable.as_ref() @@ -107,97 +105,424 @@ impl Bins { pub fn dynamic_library(&self) -> Option<&Vec> { self.dynamic_library.as_ref() } -} -#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)] -pub struct Platforms { - pub windows: Option, - pub linux: Option, - pub darwin: Option, -} - -impl Platforms { - pub fn windows(&self) -> Option<&Bins> { - self.windows.as_ref() + pub fn executable_mut(&mut self) -> &mut Option> { + &mut self.executable } - pub fn linux(&self) -> Option<&Bins> { - self.linux.as_ref() - } - - pub fn darwin(&self) -> Option<&Bins> { - self.darwin.as_ref() + pub fn dynamic_library_mut(&mut self) -> &mut Option> { + &mut self.dynamic_library } } -#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)] +#[derive(Debug, Default, Clone)] +pub struct PluginBins { + pub windows: Bins, + pub linux: Bins, + pub darwin: Bins, +} + +impl PluginBins { + pub fn supported_plaforms(&self) -> Vec { + let mut platforms = Vec::default(); + if self.windows().is_platform_supported() { + platforms.push(Platform::Windows); + } + if self.linux().is_platform_supported() { + platforms.push(Platform::Linux); + } + if self.darwin().is_platform_supported() { + platforms.push(Platform::Darwin); + } + + platforms + } + + pub fn get_that_binary(&self, platform: Platform, bin_type: BinaryType) -> Vec { + let platform = match platform { + Platform::Windows => self.windows(), + Platform::Linux => self.linux(), + Platform::Darwin => self.darwin(), + }; + + match bin_type { + BinaryType::Executable => platform.executable().unwrap().to_vec(), + BinaryType::DynamicLibrary => platform.dynamic_library().unwrap().to_vec(), + } + } +} + +impl PluginBins { + pub fn windows(&self) -> &Bins { + &self.windows + } + + pub fn linux(&self) -> &Bins { + &self.linux + } + + pub fn darwin(&self) -> &Bins { + &self.darwin + } +} + +#[derive(Debug, Default, Clone)] +pub struct PluginPlugins { + pub encrypt_shellcode: Option>, + pub format_encrypted_shellcode: Option>, + pub format_url_remote: Option>, + pub upload_final_shellcode_remote: Option>, +} + +impl PluginPlugins { + pub fn run_encrypt_shellcode(&self, path: &Path) -> anyhow::Result { + let shellcode = fs::read(path)?; + Ok(if let Some(wasm) = self.encrypt_shellcode() { + let input = EncryptShellcodeInput { shellcode }; + let res = run_plugin(wasm, "encrypt_shellcode", &input)?; + serde_json::from_slice(res.as_slice())? + } else { + EncryptShellcodeOutput { + encrypted: shellcode, + ..Default::default() + } + }) + } + + pub fn run_format_encrypted_shellcode( + &self, + shellcode: &[u8], + ) -> anyhow::Result { + let shellcode = shellcode.to_owned(); + Ok(if let Some(wasm) = self.format_encrypted_shellcode() { + let input = FormatEncryptedShellcodeInput { shellcode }; + let res = run_plugin(wasm, "format_encrypted_shellcode", &input)?; + serde_json::from_slice(res.as_slice())? + } else { + FormatEncryptedShellcodeOutput { + formated_shellcode: shellcode, + } + }) + } + + pub fn run_format_url_remote(&self, url: &str) -> anyhow::Result { + let url = url.to_owned(); + Ok(if let Some(wasm) = self.format_url_remote() { + let input = FormatUrlRemoteInput { url }; + let res = run_plugin(wasm, "format_url_remote", &input)?; + serde_json::from_slice(res.as_slice())? + } else { + FormatUrlRemoteOutput { formated_url: url } + }) + } + + pub fn run_upload_final_shellcode_remote( + &self, + final_shellcode: &[u8], + ) -> anyhow::Result { + let final_shellcode = final_shellcode.to_owned(); + Ok(if let Some(wasm) = self.upload_final_shellcode_remote() { + let input = UploadFinalShellcodeRemoteInput { final_shellcode }; + let res = run_plugin(wasm, "upload_final_shellcode_remote", &input)?; + serde_json::from_slice(res.as_slice())? + } else { + UploadFinalShellcodeRemoteOutput::default() + }) + } +} + +impl PluginPlugins { + pub fn encrypt_shellcode(&self) -> Option<&Vec> { + self.encrypt_shellcode.as_ref() + } + + pub fn format_encrypted_shellcode(&self) -> Option<&Vec> { + self.format_encrypted_shellcode.as_ref() + } + + pub fn format_url_remote(&self) -> Option<&Vec> { + self.format_url_remote.as_ref() + } + + pub fn upload_final_shellcode_remote(&self) -> Option<&Vec> { + self.upload_final_shellcode_remote.as_ref() + } + + pub fn encrypt_shellcode_mut(&mut self) -> &mut Option> { + &mut self.encrypt_shellcode + } + + pub fn format_encrypted_shellcode_mut(&mut self) -> &mut Option> { + &mut self.format_encrypted_shellcode + } + + pub fn format_url_remote_mut(&mut self) -> &mut Option> { + &mut self.format_url_remote + } + + pub fn upload_final_shellcode_remote_mut(&mut self) -> &mut Option> { + &mut self.upload_final_shellcode_remote + } +} + +#[derive(Debug, Default, Clone)] pub struct Plugin { - pub plugin_name: String, - pub author: Option, - pub version: Option, - pub desc: Option, - pub prefix: Vec, - pub size_holder: Option>, - pub max_len: usize, - pub encrypt_type: EncryptType, - pub platforms: Platforms, + pub version: String, + pub info: PluginInfo, + pub replace: PluginReplace, + pub bins: PluginBins, + pub plugins: PluginPlugins, } impl Plugin { - pub fn plugin_name(&self) -> &str { - &self.plugin_name + pub fn decode_from_slice(data: &[u8]) -> anyhow::Result { + let message = serialize_packed::read_message(data, ReaderOptions::new())?; + let plugin = message.get_root::()?; + + let info = plugin.get_info()?; + let replace = plugin.get_replace()?; + let bins = plugin.get_bins()?; + let plugins = plugin.get_plugins()?; + + let check_empty = |bin: &[u8]| { + if bin.is_empty() { + None + } else { + Some(bin.to_vec()) + } + }; + + Ok(Self { + version: plugin.get_version()?.to_string()?, + info: PluginInfo { + plugin_name: info.get_plugin_name()?.to_string()?, + author: info.get_author()?.to_string()?, + version: info.get_version()?.to_string()?, + desc: info.get_desc()?.to_string()?, + }, + replace: PluginReplace { + src_prefix: replace.get_src_prefix()?.to_vec(), + size_holder: check_empty(replace.get_size_holder()?), + max_len: replace.get_max_len(), + }, + bins: PluginBins { + windows: { + let platform_bins = bins.get_windows()?; + Bins { + executable: check_empty(platform_bins.get_executable()?), + dynamic_library: check_empty(platform_bins.get_dynamic_library()?), + } + }, + linux: { + let platform_bins = bins.get_linux()?; + Bins { + executable: check_empty(platform_bins.get_executable()?), + dynamic_library: check_empty(platform_bins.get_dynamic_library()?), + } + }, + darwin: { + let platform_bins = bins.get_darwin()?; + Bins { + executable: check_empty(platform_bins.get_executable()?), + dynamic_library: check_empty(platform_bins.get_dynamic_library()?), + } + }, + }, + plugins: PluginPlugins { + encrypt_shellcode: check_empty(plugins.get_encrypt_shellcode()?), + format_encrypted_shellcode: check_empty(plugins.get_format_encrypted_shellcode()?), + format_url_remote: check_empty(plugins.get_format_url_remote()?), + upload_final_shellcode_remote: check_empty( + plugins.get_upload_final_shellcode_remote()?, + ), + }, + }) } - pub fn author(&self) -> Option<&String> { - self.author.as_ref() + pub fn encode_to_vec(&self) -> anyhow::Result> { + let mut message = message::Builder::new_default(); + let mut plugin = message.init_root::(); + plugin.set_version(self.version()); + + let mut info = plugin.reborrow().init_info(); + let plugin_info = self.info(); + info.set_plugin_name(plugin_info.plugin_name()); + info.set_author(plugin_info.author()); + info.set_version(plugin_info.version()); + info.set_desc(plugin_info.desc()); + + let mut replace = plugin.reborrow().init_replace(); + let plugin_replace = self.replace(); + replace.set_src_prefix(plugin_replace.src_prefix()); + if let Some(size_holder) = plugin_replace.size_holder() { + replace.set_size_holder(size_holder); + } + replace.set_max_len(plugin_replace.max_len() as u64); + + let mut bins = plugin.reborrow().init_bins(); + if self.bins().windows().is_platform_supported() { + let mut builder = bins.reborrow().init_windows(); + let platform_bins = self.bins().windows(); + + if let Some(bin) = platform_bins.executable() { + builder.set_executable(bin); + } + if let Some(bin) = platform_bins.dynamic_library() { + builder.set_dynamic_library(bin); + } + } + if self.bins().linux().is_platform_supported() { + let mut builder = bins.reborrow().init_linux(); + let platform_bins = self.bins().linux(); + + if let Some(bin) = platform_bins.executable() { + builder.set_executable(bin); + } + if let Some(bin) = platform_bins.dynamic_library() { + builder.set_dynamic_library(bin); + } + } + if self.bins().darwin().is_platform_supported() { + let mut builder = bins.reborrow().init_darwin(); + let platform_bins = self.bins().darwin(); + + if let Some(bin) = platform_bins.executable() { + builder.set_executable(bin); + } + if let Some(bin) = platform_bins.dynamic_library() { + builder.set_dynamic_library(bin); + } + } + + let mut plugins = plugin.reborrow().init_plugins(); + let plugin_plugins = self.plugins(); + if let Some(plugin) = plugin_plugins.encrypt_shellcode() { + plugins.set_encrypt_shellcode(plugin); + } + if let Some(plugin) = plugin_plugins.format_encrypted_shellcode() { + plugins.set_format_encrypted_shellcode(plugin); + } + if let Some(plugin) = plugin_plugins.format_url_remote() { + plugins.set_format_url_remote(plugin); + } + if let Some(plugin) = plugin_plugins.upload_final_shellcode_remote() { + plugins.set_upload_final_shellcode_remote(plugin); + } + + let mut buf = Vec::new(); + serialize_packed::write_message(&mut buf, &message)?; + + anyhow::Ok(buf) } - pub fn version(&self) -> Option<&String> { - self.version.as_ref() - } + pub fn replace_binary( + &self, + bin: &mut [u8], + shellcode_src: String, + mut pass: Vec, + ) -> anyhow::Result<()> { + let save_type = if self.replace().size_holder().is_some() { + ShellcodeSaveType::Local + } else { + ShellcodeSaveType::Remote + }; - pub fn desc(&self) -> Option<&String> { - self.desc.as_ref() - } + // replace shellcode src + let shellcode_src = match save_type { + ShellcodeSaveType::Local => { + let path = Path::new(&shellcode_src); + let output = self.plugins().run_encrypt_shellcode(path)?; + pass = output.pass().to_vec(); - pub fn prefix(&self) -> &[u8] { - &self.prefix - } + let final_shellcode = self + .plugins() + .run_format_encrypted_shellcode(output.encrypted())?; - pub fn size_holder(&self) -> Option<&Vec> { - self.size_holder.as_ref() - } + final_shellcode.formated_shellcode().to_vec() + } + ShellcodeSaveType::Remote => { + let mut shellcode_src = self + .plugins() + .run_format_url_remote(&shellcode_src)? + .formated_url() + .as_bytes() + .to_vec(); + shellcode_src.push(b'\0'); - pub fn max_len(&self) -> usize { - self.max_len - } + shellcode_src + } + }; - pub fn encrypt_type(&self) -> &EncryptType { - &self.encrypt_type - } + if shellcode_src.len() > self.replace().max_len() { + bail!( + "{} too long.", + match save_type { + ShellcodeSaveType::Local => "Shellcode", + ShellcodeSaveType::Remote => "Shellcode Url", + } + ); + } - pub fn platforms(&self) -> &Platforms { - &self.platforms - } -} + utils::replace( + bin, + self.replace().src_prefix(), + shellcode_src.as_slice(), + self.replace().max_len(), + ); -impl Plugin { - pub fn reade_plugin(path: &Path) -> anyhow::Result { - let buf = fs::read(path)?; - let (plugin, _) = decode_from_slice(buf.as_slice(), BINCODE_PLUGIN_CONFIG)?; - Ok(plugin) - } + // replace pass + for pass in pass { + let holder = pass.holder(); + let replace_by = pass.replace_by(); - pub fn write_plugin(&self, path: &Path) -> anyhow::Result<()> { - let buf = encode_to_vec(self, BINCODE_PLUGIN_CONFIG)?; - fs::write(path, buf.as_slice())?; + utils::replace(bin, holder, replace_by, holder.len()); + } + + // replace size_holder + if save_type == ShellcodeSaveType::Local { + let size_holder = self.replace().size_holder().unwrap(); + let shellcode_len_bytes = shellcode_src.len().to_string().as_bytes().to_vec(); + + if shellcode_len_bytes.len() > size_holder.len() { + bail!("Shellcode size bytes too long."); + } + + let mut size_bytes: Vec = iter::repeat(b'0') + .take(size_holder.len() - shellcode_len_bytes.len()) + .collect(); + size_bytes.extend_from_slice(shellcode_len_bytes.as_slice()); + + utils::replace(bin, size_holder, size_bytes.as_slice(), size_holder.len()); + } Ok(()) } } +impl Plugin { + pub fn version(&self) -> &str { + &self.version + } + + pub fn info(&self) -> &PluginInfo { + &self.info + } + + pub fn replace(&self) -> &PluginReplace { + &self.replace + } + + pub fn bins(&self) -> &PluginBins { + &self.bins + } + + pub fn plugins(&self) -> &PluginPlugins { + &self.plugins + } +} + #[derive(Debug, Clone, Default, Encode, Decode, PartialEq, Eq)] -pub struct Plugins(pub HashMap); +pub struct Plugins(HashMap>); impl Plugins { pub fn reade_plugins() -> anyhow::Result { @@ -224,77 +549,31 @@ impl Plugins { Ok(()) } -} -#[cfg(test)] -mod test { - use std::io::Write; + pub fn get(&self, name: &str) -> anyhow::Result { + let buf = self + .0 + .get(name) + .ok_or(anyhow!("Get plugin by name failed."))?; - use tempfile::NamedTempFile; - - use super::*; - - #[test] - fn test_plugin() { - let plugin = Plugin { - plugin_name: "test_plugin".into(), - author: Some("b1n".into()), - version: Some("0.1.0".into()), - desc: Some("test desc".into()), - prefix: b"$$SHELLCODE$$".to_vec(), - size_holder: Some(b"$$99999$$".to_vec()), - max_len: 1024 * 1024, - encrypt_type: EncryptType::AesGcm(AesGcmPass { - key_holder: b"key".to_vec(), - nonce_holder: b"nonce".to_vec(), - }), - platforms: Platforms { - windows: None, - linux: None, - darwin: None, - }, - }; - - let plugin_file = NamedTempFile::new().unwrap(); - plugin.write_plugin(plugin_file.path()).unwrap(); - - let decode_plugin = Plugin::reade_plugin(plugin_file.path()).unwrap(); - - assert_eq!(decode_plugin, plugin); + Plugin::decode_from_slice(buf) } - #[test] - fn test_xor_encrypt() { - let mut plain_text = NamedTempFile::new().unwrap(); - plain_text.as_file_mut().write_all(b"test").unwrap(); - - let pass = b"pass"; - let xor = EncryptType::Xor(pass.to_vec()); - let encrypted = xor.encrypt(plain_text.path()).unwrap(); - let decrypted: Vec = encrypted - .iter() - .enumerate() - .map(|(i, byte)| byte ^ pass[i % pass.len()]) - .collect(); - assert_eq!(decrypted.as_slice(), b"test"); + pub fn get_sorted_names(&self) -> Vec { + let mut names: Vec = self.0.keys().map(|x| x.to_owned()).collect(); + names.sort(); + names } - #[test] - fn test_aes_gcm_encrypt() { - let mut plain_text = NamedTempFile::new().unwrap(); - plain_text.as_file_mut().write_all(b"test").unwrap(); + pub fn is_empty(&self) -> bool { + self.0.is_empty() + } - let pass = AesGcmPass { - key_holder: b"kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk".to_vec(), - nonce_holder: b"nnnnnnnnnnnn".to_vec(), - }; - let aes_gcm = EncryptType::AesGcm(pass.clone()); - let encrypted = aes_gcm.encrypt(plain_text.path()).unwrap(); + pub fn insert(&mut self, name: String, plugin: Vec) { + self.0.insert(name, plugin); + } - let aes = Aes256Gcm::new_from_slice(pass.key_holder()).unwrap(); - let nonce = Nonce::from_slice(pass.nonce_holder()); - let decrypted = aes.decrypt(nonce, encrypted.as_slice()).unwrap(); - - assert_eq!(decrypted.as_slice(), b"test"); + pub fn remove(&mut self, name: &str) { + self.0.remove(name); } } diff --git a/src/plugin_system.rs b/src/plugin_system.rs new file mode 100644 index 0000000..fc18e9f --- /dev/null +++ b/src/plugin_system.rs @@ -0,0 +1,99 @@ +use std::time::Duration; + +use extism::{Manifest, Wasm}; +use serde::{Deserialize, Serialize}; + +pub fn run_plugin(wasm: &[u8], func: &str, input: &T) -> anyhow::Result> { + let data = Wasm::data(wasm.to_vec()); + let manifest = Manifest::new([data]) + .with_timeout(Duration::from_secs(5)) + .with_allowed_host("*"); + let mut plugin = extism::Plugin::new(manifest, [], true)?; + + plugin.call::, Vec>(func, serde_json::to_vec(input)?) +} + +#[derive(Debug, Default, Clone, Serialize, Deserialize)] +pub struct EncryptShellcodeInput { + pub shellcode: Vec, +} + +#[derive(Debug, Default, Clone, Serialize, Deserialize)] +pub struct Pass { + pub holder: Vec, + pub replace_by: Vec, +} + +impl Pass { + pub fn holder(&self) -> &[u8] { + &self.holder + } + + pub fn replace_by(&self) -> &[u8] { + &self.replace_by + } +} + +#[derive(Debug, Default, Clone, Serialize, Deserialize)] +pub struct EncryptShellcodeOutput { + pub encrypted: Vec, + pub pass: Vec, +} + +impl EncryptShellcodeOutput { + pub fn encrypted(&self) -> &[u8] { + &self.encrypted + } + + pub fn pass(&self) -> &[Pass] { + &self.pass + } +} + +#[derive(Debug, Default, Clone, Serialize, Deserialize)] +pub struct FormatEncryptedShellcodeInput { + pub shellcode: Vec, +} + +#[derive(Debug, Default, Clone, Serialize, Deserialize)] +pub struct FormatEncryptedShellcodeOutput { + pub formated_shellcode: Vec, +} + +impl FormatEncryptedShellcodeOutput { + pub fn formated_shellcode(&self) -> &[u8] { + &self.formated_shellcode + } +} + +#[derive(Debug, Default, Clone, Serialize, Deserialize)] +pub struct FormatUrlRemoteInput { + pub url: String, +} + +#[derive(Debug, Default, Clone, Serialize, Deserialize)] +pub struct FormatUrlRemoteOutput { + pub formated_url: String, +} + +impl FormatUrlRemoteOutput { + pub fn formated_url(&self) -> &str { + &self.formated_url + } +} + +#[derive(Debug, Default, Clone, Serialize, Deserialize)] +pub struct UploadFinalShellcodeRemoteInput { + pub final_shellcode: Vec, +} + +#[derive(Debug, Default, Clone, Serialize, Deserialize)] +pub struct UploadFinalShellcodeRemoteOutput { + pub url: String, +} + +impl UploadFinalShellcodeRemoteOutput { + pub fn url(&self) -> &str { + &self.url + } +} diff --git a/src/button_style.rs b/src/style/button.rs similarity index 100% rename from src/button_style.rs rename to src/style/button.rs diff --git a/src/style/mod.rs b/src/style/mod.rs new file mode 100644 index 0000000..67f0e6e --- /dev/null +++ b/src/style/mod.rs @@ -0,0 +1,2 @@ +pub mod button; +pub mod svg; diff --git a/src/svg_style.rs b/src/style/svg.rs similarity index 100% rename from src/svg_style.rs rename to src/style/svg.rs diff --git a/src/utils.rs b/src/utils.rs new file mode 100644 index 0000000..4044329 --- /dev/null +++ b/src/utils.rs @@ -0,0 +1,78 @@ +use std::iter; + +use iced::{ + advanced::graphics::image::image_rs::ImageFormat, + window::{self, Level, Position}, + Font, Pixels, Settings, Size, Task, +}; +use memchr::memmem; +use rand::RngCore; +use rfd::{AsyncMessageDialog, MessageButtons, MessageDialog, MessageDialogResult, MessageLevel}; + +pub const JETBRAINS_MONO_FONT: Font = Font::with_name("JetBrainsMono NF"); + +pub fn error_dialog(error: anyhow::Error) { + MessageDialog::new() + .set_buttons(MessageButtons::Ok) + .set_description(error.to_string()) + .set_level(MessageLevel::Error) + .set_title("PumpBin") + .show(); +} + +pub fn message_dialog(message: String, level: MessageLevel) -> Task { + let dialog = AsyncMessageDialog::new() + .set_buttons(MessageButtons::Ok) + .set_description(message) + .set_level(level) + .set_title("PumpBin") + .show(); + Task::future(dialog) +} + +pub fn settings() -> Settings { + Settings { + fonts: vec![include_bytes!("../assets/JetBrainsMonoNerdFont-Regular.ttf").into()], + default_font: JETBRAINS_MONO_FONT, + default_text_size: Pixels(13.0), + antialiasing: true, + ..Default::default() + } +} + +pub fn window_settings() -> window::Settings { + let size = Size::new(1000.0, 600.0); + + window::Settings { + size, + position: Position::Centered, + min_size: Some(size), + visible: true, + resizable: true, + decorations: true, + transparent: false, + level: Level::Normal, + icon: window::icon::from_file_data( + include_bytes!("../logo/icon.png"), + Some(ImageFormat::Png), + ) + .ok(), + exit_on_close_request: true, + ..Default::default() + } +} + +pub fn replace(bin: &mut [u8], holder: &[u8], replace_by: &[u8], max_len: usize) { + let mut replace_by = replace_by.to_owned(); + + let find = memmem::find_iter(bin, holder).next(); + if let Some(position) = find { + let mut random: Vec = iter::repeat(b'0') + .take(max_len - replace_by.len()) + .collect(); + rand::thread_rng().fill_bytes(&mut random); + replace_by.extend_from_slice(random.as_slice()); + + bin[position..(position + max_len)].copy_from_slice(replace_by.as_slice()); + } +}