├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── build.rs └── src ├── .DS_Store ├── httpServer.rs ├── httpServer ├── .DS_Store ├── getMyInfo.rs ├── maimaiDX.rs └── sendMessage.rs ├── lib.rs ├── types.rs └── utils.rs /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | .history 3 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "adler" 7 | version = "1.0.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 10 | 11 | [[package]] 12 | name = "ahash" 13 | version = "0.8.3" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" 16 | dependencies = [ 17 | "cfg-if", 18 | "once_cell", 19 | "version_check", 20 | ] 21 | 22 | [[package]] 23 | name = "async-stream" 24 | version = "0.3.5" 25 | source = "registry+https://github.com/rust-lang/crates.io-index" 26 | checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" 27 | dependencies = [ 28 | "async-stream-impl", 29 | "futures-core", 30 | "pin-project-lite", 31 | ] 32 | 33 | [[package]] 34 | name = "async-stream-impl" 35 | version = "0.3.5" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" 38 | dependencies = [ 39 | "proc-macro2", 40 | "quote", 41 | "syn", 42 | ] 43 | 44 | [[package]] 45 | name = "async-trait" 46 | version = "0.1.68" 47 | source = "registry+https://github.com/rust-lang/crates.io-index" 48 | checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" 49 | dependencies = [ 50 | "proc-macro2", 51 | "quote", 52 | "syn", 53 | ] 54 | 55 | [[package]] 56 | name = "atomic" 57 | version = "0.5.1" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "b88d82667eca772c4aa12f0f1348b3ae643424c8876448f3f7bd5787032e234c" 60 | dependencies = [ 61 | "autocfg", 62 | ] 63 | 64 | [[package]] 65 | name = "autocfg" 66 | version = "1.1.0" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 69 | 70 | [[package]] 71 | name = "binascii" 72 | version = "0.1.4" 73 | source = "registry+https://github.com/rust-lang/crates.io-index" 74 | checksum = "383d29d513d8764dcdc42ea295d979eb99c3c9f00607b3692cf68a431f7dca72" 75 | 76 | [[package]] 77 | name = "bitflags" 78 | version = "1.3.2" 79 | source = "registry+https://github.com/rust-lang/crates.io-index" 80 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 81 | 82 | [[package]] 83 | name = "bitflags" 84 | version = "2.2.1" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "24a6904aef64d73cf10ab17ebace7befb918b82164785cb89907993be7f83813" 87 | 88 | [[package]] 89 | name = "bytes" 90 | version = "1.4.0" 91 | source = "registry+https://github.com/rust-lang/crates.io-index" 92 | checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" 93 | 94 | [[package]] 95 | name = "cc" 96 | version = "1.0.79" 97 | source = "registry+https://github.com/rust-lang/crates.io-index" 98 | checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" 99 | 100 | [[package]] 101 | name = "cfg-if" 102 | version = "1.0.0" 103 | source = "registry+https://github.com/rust-lang/crates.io-index" 104 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 105 | 106 | [[package]] 107 | name = "cookie" 108 | version = "0.17.0" 109 | source = "registry+https://github.com/rust-lang/crates.io-index" 110 | checksum = "7efb37c3e1ccb1ff97164ad95ac1606e8ccd35b3fa0a7d99a304c7f4a428cc24" 111 | dependencies = [ 112 | "percent-encoding", 113 | "time", 114 | "version_check", 115 | ] 116 | 117 | [[package]] 118 | name = "crc32fast" 119 | version = "1.3.2" 120 | source = "registry+https://github.com/rust-lang/crates.io-index" 121 | checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" 122 | dependencies = [ 123 | "cfg-if", 124 | ] 125 | 126 | [[package]] 127 | name = "devise" 128 | version = "0.4.1" 129 | source = "registry+https://github.com/rust-lang/crates.io-index" 130 | checksum = "d6eacefd3f541c66fc61433d65e54e0e46e0a029a819a7dbbc7a7b489e8a85f8" 131 | dependencies = [ 132 | "devise_codegen", 133 | "devise_core", 134 | ] 135 | 136 | [[package]] 137 | name = "devise_codegen" 138 | version = "0.4.1" 139 | source = "registry+https://github.com/rust-lang/crates.io-index" 140 | checksum = "9c8cf4b8dd484ede80fd5c547592c46c3745a617c8af278e2b72bea86b2dfed6" 141 | dependencies = [ 142 | "devise_core", 143 | "quote", 144 | ] 145 | 146 | [[package]] 147 | name = "devise_core" 148 | version = "0.4.1" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "35b50dba0afdca80b187392b24f2499a88c336d5a8493e4b4ccfb608708be56a" 151 | dependencies = [ 152 | "bitflags 2.2.1", 153 | "proc-macro2", 154 | "proc-macro2-diagnostics", 155 | "quote", 156 | "syn", 157 | ] 158 | 159 | [[package]] 160 | name = "either" 161 | version = "1.8.1" 162 | source = "registry+https://github.com/rust-lang/crates.io-index" 163 | checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" 164 | 165 | [[package]] 166 | name = "encoding_rs" 167 | version = "0.8.32" 168 | source = "registry+https://github.com/rust-lang/crates.io-index" 169 | checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" 170 | dependencies = [ 171 | "cfg-if", 172 | ] 173 | 174 | [[package]] 175 | name = "errno" 176 | version = "0.3.1" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" 179 | dependencies = [ 180 | "errno-dragonfly", 181 | "libc", 182 | "windows-sys 0.48.0", 183 | ] 184 | 185 | [[package]] 186 | name = "errno-dragonfly" 187 | version = "0.1.2" 188 | source = "registry+https://github.com/rust-lang/crates.io-index" 189 | checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" 190 | dependencies = [ 191 | "cc", 192 | "libc", 193 | ] 194 | 195 | [[package]] 196 | name = "fastrand" 197 | version = "1.9.0" 198 | source = "registry+https://github.com/rust-lang/crates.io-index" 199 | checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" 200 | dependencies = [ 201 | "instant", 202 | ] 203 | 204 | [[package]] 205 | name = "figment" 206 | version = "0.10.8" 207 | source = "registry+https://github.com/rust-lang/crates.io-index" 208 | checksum = "4e56602b469b2201400dec66a66aec5a9b8761ee97cd1b8c96ab2483fcc16cc9" 209 | dependencies = [ 210 | "atomic", 211 | "pear", 212 | "serde", 213 | "toml", 214 | "uncased", 215 | "version_check", 216 | ] 217 | 218 | [[package]] 219 | name = "flate2" 220 | version = "1.0.26" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" 223 | dependencies = [ 224 | "crc32fast", 225 | "miniz_oxide", 226 | ] 227 | 228 | [[package]] 229 | name = "fnv" 230 | version = "1.0.7" 231 | source = "registry+https://github.com/rust-lang/crates.io-index" 232 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 233 | 234 | [[package]] 235 | name = "forward-dll" 236 | version = "0.1.11" 237 | source = "registry+https://github.com/rust-lang/crates.io-index" 238 | checksum = "deff0d9994ce31a2de2849097343b2ea7e8f2193bbd52177187fd07a47a9cd64" 239 | dependencies = [ 240 | "forward-dll-derive", 241 | "implib", 242 | "object", 243 | "windows-sys 0.35.0", 244 | ] 245 | 246 | [[package]] 247 | name = "forward-dll-derive" 248 | version = "0.1.11" 249 | source = "registry+https://github.com/rust-lang/crates.io-index" 250 | checksum = "2f9782d1d81d9c2f39b986da38c3273ff656d7978599afd0b62eaf4e6d60db7a" 251 | dependencies = [ 252 | "object", 253 | "quote", 254 | "syn", 255 | ] 256 | 257 | [[package]] 258 | name = "futures" 259 | version = "0.3.28" 260 | source = "registry+https://github.com/rust-lang/crates.io-index" 261 | checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" 262 | dependencies = [ 263 | "futures-channel", 264 | "futures-core", 265 | "futures-executor", 266 | "futures-io", 267 | "futures-sink", 268 | "futures-task", 269 | "futures-util", 270 | ] 271 | 272 | [[package]] 273 | name = "futures-channel" 274 | version = "0.3.28" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" 277 | dependencies = [ 278 | "futures-core", 279 | "futures-sink", 280 | ] 281 | 282 | [[package]] 283 | name = "futures-core" 284 | version = "0.3.28" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" 287 | 288 | [[package]] 289 | name = "futures-executor" 290 | version = "0.3.28" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" 293 | dependencies = [ 294 | "futures-core", 295 | "futures-task", 296 | "futures-util", 297 | ] 298 | 299 | [[package]] 300 | name = "futures-io" 301 | version = "0.3.28" 302 | source = "registry+https://github.com/rust-lang/crates.io-index" 303 | checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" 304 | 305 | [[package]] 306 | name = "futures-macro" 307 | version = "0.3.28" 308 | source = "registry+https://github.com/rust-lang/crates.io-index" 309 | checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" 310 | dependencies = [ 311 | "proc-macro2", 312 | "quote", 313 | "syn", 314 | ] 315 | 316 | [[package]] 317 | name = "futures-sink" 318 | version = "0.3.28" 319 | source = "registry+https://github.com/rust-lang/crates.io-index" 320 | checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" 321 | 322 | [[package]] 323 | name = "futures-task" 324 | version = "0.3.28" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" 327 | 328 | [[package]] 329 | name = "futures-util" 330 | version = "0.3.28" 331 | source = "registry+https://github.com/rust-lang/crates.io-index" 332 | checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" 333 | dependencies = [ 334 | "futures-channel", 335 | "futures-core", 336 | "futures-io", 337 | "futures-macro", 338 | "futures-sink", 339 | "futures-task", 340 | "memchr", 341 | "pin-project-lite", 342 | "pin-utils", 343 | "slab", 344 | ] 345 | 346 | [[package]] 347 | name = "generator" 348 | version = "0.7.4" 349 | source = "registry+https://github.com/rust-lang/crates.io-index" 350 | checksum = "f3e123d9ae7c02966b4d892e550bdc32164f05853cd40ab570650ad600596a8a" 351 | dependencies = [ 352 | "cc", 353 | "libc", 354 | "log", 355 | "rustversion", 356 | "windows", 357 | ] 358 | 359 | [[package]] 360 | name = "getrandom" 361 | version = "0.2.9" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" 364 | dependencies = [ 365 | "cfg-if", 366 | "libc", 367 | "wasi", 368 | ] 369 | 370 | [[package]] 371 | name = "glob" 372 | version = "0.3.1" 373 | source = "registry+https://github.com/rust-lang/crates.io-index" 374 | checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" 375 | 376 | [[package]] 377 | name = "h2" 378 | version = "0.3.18" 379 | source = "registry+https://github.com/rust-lang/crates.io-index" 380 | checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" 381 | dependencies = [ 382 | "bytes", 383 | "fnv", 384 | "futures-core", 385 | "futures-sink", 386 | "futures-util", 387 | "http", 388 | "indexmap", 389 | "slab", 390 | "tokio", 391 | "tokio-util", 392 | "tracing", 393 | ] 394 | 395 | [[package]] 396 | name = "hashbrown" 397 | version = "0.12.3" 398 | source = "registry+https://github.com/rust-lang/crates.io-index" 399 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 400 | 401 | [[package]] 402 | name = "hashbrown" 403 | version = "0.13.2" 404 | source = "registry+https://github.com/rust-lang/crates.io-index" 405 | checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" 406 | dependencies = [ 407 | "ahash", 408 | ] 409 | 410 | [[package]] 411 | name = "hermit-abi" 412 | version = "0.2.6" 413 | source = "registry+https://github.com/rust-lang/crates.io-index" 414 | checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" 415 | dependencies = [ 416 | "libc", 417 | ] 418 | 419 | [[package]] 420 | name = "hermit-abi" 421 | version = "0.3.1" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" 424 | 425 | [[package]] 426 | name = "http" 427 | version = "0.2.9" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" 430 | dependencies = [ 431 | "bytes", 432 | "fnv", 433 | "itoa", 434 | ] 435 | 436 | [[package]] 437 | name = "http-body" 438 | version = "0.4.5" 439 | source = "registry+https://github.com/rust-lang/crates.io-index" 440 | checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" 441 | dependencies = [ 442 | "bytes", 443 | "http", 444 | "pin-project-lite", 445 | ] 446 | 447 | [[package]] 448 | name = "httparse" 449 | version = "1.8.0" 450 | source = "registry+https://github.com/rust-lang/crates.io-index" 451 | checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" 452 | 453 | [[package]] 454 | name = "httpdate" 455 | version = "1.0.2" 456 | source = "registry+https://github.com/rust-lang/crates.io-index" 457 | checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" 458 | 459 | [[package]] 460 | name = "hyper" 461 | version = "0.14.26" 462 | source = "registry+https://github.com/rust-lang/crates.io-index" 463 | checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" 464 | dependencies = [ 465 | "bytes", 466 | "futures-channel", 467 | "futures-core", 468 | "futures-util", 469 | "h2", 470 | "http", 471 | "http-body", 472 | "httparse", 473 | "httpdate", 474 | "itoa", 475 | "pin-project-lite", 476 | "socket2", 477 | "tokio", 478 | "tower-service", 479 | "tracing", 480 | "want", 481 | ] 482 | 483 | [[package]] 484 | name = "implib" 485 | version = "0.3.1" 486 | source = "registry+https://github.com/rust-lang/crates.io-index" 487 | checksum = "85f27436c808047cbf2202afcfd7ca5fd456bd5d1062d915fc9f3f5ea77550f9" 488 | dependencies = [ 489 | "memoffset", 490 | "object", 491 | ] 492 | 493 | [[package]] 494 | name = "indexmap" 495 | version = "1.9.3" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 498 | dependencies = [ 499 | "autocfg", 500 | "hashbrown 0.12.3", 501 | "serde", 502 | ] 503 | 504 | [[package]] 505 | name = "inlinable_string" 506 | version = "0.1.15" 507 | source = "registry+https://github.com/rust-lang/crates.io-index" 508 | checksum = "c8fae54786f62fb2918dcfae3d568594e50eb9b5c25bf04371af6fe7516452fb" 509 | 510 | [[package]] 511 | name = "instant" 512 | version = "0.1.12" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 515 | dependencies = [ 516 | "cfg-if", 517 | ] 518 | 519 | [[package]] 520 | name = "io-lifetimes" 521 | version = "1.0.10" 522 | source = "registry+https://github.com/rust-lang/crates.io-index" 523 | checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" 524 | dependencies = [ 525 | "hermit-abi 0.3.1", 526 | "libc", 527 | "windows-sys 0.48.0", 528 | ] 529 | 530 | [[package]] 531 | name = "is-terminal" 532 | version = "0.4.7" 533 | source = "registry+https://github.com/rust-lang/crates.io-index" 534 | checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" 535 | dependencies = [ 536 | "hermit-abi 0.3.1", 537 | "io-lifetimes", 538 | "rustix", 539 | "windows-sys 0.48.0", 540 | ] 541 | 542 | [[package]] 543 | name = "itoa" 544 | version = "1.0.6" 545 | source = "registry+https://github.com/rust-lang/crates.io-index" 546 | checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" 547 | 548 | [[package]] 549 | name = "lazy_static" 550 | version = "1.4.0" 551 | source = "registry+https://github.com/rust-lang/crates.io-index" 552 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 553 | 554 | [[package]] 555 | name = "libc" 556 | version = "0.2.143" 557 | source = "registry+https://github.com/rust-lang/crates.io-index" 558 | checksum = "edc207893e85c5d6be840e969b496b53d94cec8be2d501b214f50daa97fa8024" 559 | 560 | [[package]] 561 | name = "linux-raw-sys" 562 | version = "0.3.7" 563 | source = "registry+https://github.com/rust-lang/crates.io-index" 564 | checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" 565 | 566 | [[package]] 567 | name = "lock_api" 568 | version = "0.4.9" 569 | source = "registry+https://github.com/rust-lang/crates.io-index" 570 | checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" 571 | dependencies = [ 572 | "autocfg", 573 | "scopeguard", 574 | ] 575 | 576 | [[package]] 577 | name = "log" 578 | version = "0.4.17" 579 | source = "registry+https://github.com/rust-lang/crates.io-index" 580 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 581 | dependencies = [ 582 | "cfg-if", 583 | ] 584 | 585 | [[package]] 586 | name = "loom" 587 | version = "0.5.6" 588 | source = "registry+https://github.com/rust-lang/crates.io-index" 589 | checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" 590 | dependencies = [ 591 | "cfg-if", 592 | "generator", 593 | "scoped-tls", 594 | "serde", 595 | "serde_json", 596 | "tracing", 597 | "tracing-subscriber", 598 | ] 599 | 600 | [[package]] 601 | name = "matchers" 602 | version = "0.1.0" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" 605 | dependencies = [ 606 | "regex-automata", 607 | ] 608 | 609 | [[package]] 610 | name = "memchr" 611 | version = "2.5.0" 612 | source = "registry+https://github.com/rust-lang/crates.io-index" 613 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 614 | 615 | [[package]] 616 | name = "memoffset" 617 | version = "0.8.0" 618 | source = "registry+https://github.com/rust-lang/crates.io-index" 619 | checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1" 620 | dependencies = [ 621 | "autocfg", 622 | ] 623 | 624 | [[package]] 625 | name = "mime" 626 | version = "0.3.17" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" 629 | 630 | [[package]] 631 | name = "miniz_oxide" 632 | version = "0.7.1" 633 | source = "registry+https://github.com/rust-lang/crates.io-index" 634 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 635 | dependencies = [ 636 | "adler", 637 | ] 638 | 639 | [[package]] 640 | name = "mio" 641 | version = "0.8.6" 642 | source = "registry+https://github.com/rust-lang/crates.io-index" 643 | checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" 644 | dependencies = [ 645 | "libc", 646 | "log", 647 | "wasi", 648 | "windows-sys 0.45.0", 649 | ] 650 | 651 | [[package]] 652 | name = "multer" 653 | version = "2.1.0" 654 | source = "registry+https://github.com/rust-lang/crates.io-index" 655 | checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" 656 | dependencies = [ 657 | "bytes", 658 | "encoding_rs", 659 | "futures-util", 660 | "http", 661 | "httparse", 662 | "log", 663 | "memchr", 664 | "mime", 665 | "spin", 666 | "tokio", 667 | "tokio-util", 668 | "version_check", 669 | ] 670 | 671 | [[package]] 672 | name = "nu-ansi-term" 673 | version = "0.46.0" 674 | source = "registry+https://github.com/rust-lang/crates.io-index" 675 | checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" 676 | dependencies = [ 677 | "overload", 678 | "winapi", 679 | ] 680 | 681 | [[package]] 682 | name = "num_cpus" 683 | version = "1.15.0" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" 686 | dependencies = [ 687 | "hermit-abi 0.2.6", 688 | "libc", 689 | ] 690 | 691 | [[package]] 692 | name = "object" 693 | version = "0.30.3" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" 696 | dependencies = [ 697 | "crc32fast", 698 | "flate2", 699 | "hashbrown 0.13.2", 700 | "indexmap", 701 | "memchr", 702 | ] 703 | 704 | [[package]] 705 | name = "once_cell" 706 | version = "1.17.1" 707 | source = "registry+https://github.com/rust-lang/crates.io-index" 708 | checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" 709 | 710 | [[package]] 711 | name = "overload" 712 | version = "0.1.1" 713 | source = "registry+https://github.com/rust-lang/crates.io-index" 714 | checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" 715 | 716 | [[package]] 717 | name = "parking_lot" 718 | version = "0.12.1" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 721 | dependencies = [ 722 | "lock_api", 723 | "parking_lot_core", 724 | ] 725 | 726 | [[package]] 727 | name = "parking_lot_core" 728 | version = "0.9.7" 729 | source = "registry+https://github.com/rust-lang/crates.io-index" 730 | checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" 731 | dependencies = [ 732 | "cfg-if", 733 | "libc", 734 | "redox_syscall 0.2.16", 735 | "smallvec", 736 | "windows-sys 0.45.0", 737 | ] 738 | 739 | [[package]] 740 | name = "pear" 741 | version = "0.2.4" 742 | source = "registry+https://github.com/rust-lang/crates.io-index" 743 | checksum = "0ec95680a7087503575284e5063e14b694b7a9c0b065e5dceec661e0497127e8" 744 | dependencies = [ 745 | "inlinable_string", 746 | "pear_codegen", 747 | "yansi", 748 | ] 749 | 750 | [[package]] 751 | name = "pear_codegen" 752 | version = "0.2.4" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "9661a3a53f93f09f2ea882018e4d7c88f6ff2956d809a276060476fd8c879d3c" 755 | dependencies = [ 756 | "proc-macro2", 757 | "proc-macro2-diagnostics", 758 | "quote", 759 | "syn", 760 | ] 761 | 762 | [[package]] 763 | name = "percent-encoding" 764 | version = "2.2.0" 765 | source = "registry+https://github.com/rust-lang/crates.io-index" 766 | checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" 767 | 768 | [[package]] 769 | name = "pin-project-lite" 770 | version = "0.2.9" 771 | source = "registry+https://github.com/rust-lang/crates.io-index" 772 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 773 | 774 | [[package]] 775 | name = "pin-utils" 776 | version = "0.1.0" 777 | source = "registry+https://github.com/rust-lang/crates.io-index" 778 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 779 | 780 | [[package]] 781 | name = "ppv-lite86" 782 | version = "0.2.17" 783 | source = "registry+https://github.com/rust-lang/crates.io-index" 784 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 785 | 786 | [[package]] 787 | name = "proc-macro2" 788 | version = "1.0.56" 789 | source = "registry+https://github.com/rust-lang/crates.io-index" 790 | checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" 791 | dependencies = [ 792 | "unicode-ident", 793 | ] 794 | 795 | [[package]] 796 | name = "proc-macro2-diagnostics" 797 | version = "0.10.0" 798 | source = "registry+https://github.com/rust-lang/crates.io-index" 799 | checksum = "606c4ba35817e2922a308af55ad51bab3645b59eae5c570d4a6cf07e36bd493b" 800 | dependencies = [ 801 | "proc-macro2", 802 | "quote", 803 | "syn", 804 | "version_check", 805 | "yansi", 806 | ] 807 | 808 | [[package]] 809 | name = "quote" 810 | version = "1.0.26" 811 | source = "registry+https://github.com/rust-lang/crates.io-index" 812 | checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" 813 | dependencies = [ 814 | "proc-macro2", 815 | ] 816 | 817 | [[package]] 818 | name = "rand" 819 | version = "0.8.5" 820 | source = "registry+https://github.com/rust-lang/crates.io-index" 821 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 822 | dependencies = [ 823 | "libc", 824 | "rand_chacha", 825 | "rand_core", 826 | ] 827 | 828 | [[package]] 829 | name = "rand_chacha" 830 | version = "0.3.1" 831 | source = "registry+https://github.com/rust-lang/crates.io-index" 832 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 833 | dependencies = [ 834 | "ppv-lite86", 835 | "rand_core", 836 | ] 837 | 838 | [[package]] 839 | name = "rand_core" 840 | version = "0.6.4" 841 | source = "registry+https://github.com/rust-lang/crates.io-index" 842 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 843 | dependencies = [ 844 | "getrandom", 845 | ] 846 | 847 | [[package]] 848 | name = "redox_syscall" 849 | version = "0.2.16" 850 | source = "registry+https://github.com/rust-lang/crates.io-index" 851 | checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" 852 | dependencies = [ 853 | "bitflags 1.3.2", 854 | ] 855 | 856 | [[package]] 857 | name = "redox_syscall" 858 | version = "0.3.5" 859 | source = "registry+https://github.com/rust-lang/crates.io-index" 860 | checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" 861 | dependencies = [ 862 | "bitflags 1.3.2", 863 | ] 864 | 865 | [[package]] 866 | name = "ref-cast" 867 | version = "1.0.16" 868 | source = "registry+https://github.com/rust-lang/crates.io-index" 869 | checksum = "f43faa91b1c8b36841ee70e97188a869d37ae21759da6846d4be66de5bf7b12c" 870 | dependencies = [ 871 | "ref-cast-impl", 872 | ] 873 | 874 | [[package]] 875 | name = "ref-cast-impl" 876 | version = "1.0.16" 877 | source = "registry+https://github.com/rust-lang/crates.io-index" 878 | checksum = "8d2275aab483050ab2a7364c1a46604865ee7d6906684e08db0f090acf74f9e7" 879 | dependencies = [ 880 | "proc-macro2", 881 | "quote", 882 | "syn", 883 | ] 884 | 885 | [[package]] 886 | name = "regex" 887 | version = "1.8.1" 888 | source = "registry+https://github.com/rust-lang/crates.io-index" 889 | checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" 890 | dependencies = [ 891 | "regex-syntax 0.7.1", 892 | ] 893 | 894 | [[package]] 895 | name = "regex-automata" 896 | version = "0.1.10" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" 899 | dependencies = [ 900 | "regex-syntax 0.6.29", 901 | ] 902 | 903 | [[package]] 904 | name = "regex-syntax" 905 | version = "0.6.29" 906 | source = "registry+https://github.com/rust-lang/crates.io-index" 907 | checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" 908 | 909 | [[package]] 910 | name = "regex-syntax" 911 | version = "0.7.1" 912 | source = "registry+https://github.com/rust-lang/crates.io-index" 913 | checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" 914 | 915 | [[package]] 916 | name = "rocket" 917 | version = "0.5.0-rc.3" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "58734f7401ae5cfd129685b48f61182331745b357b96f2367f01aebaf1cc9cc9" 920 | dependencies = [ 921 | "async-stream", 922 | "async-trait", 923 | "atomic", 924 | "binascii", 925 | "bytes", 926 | "either", 927 | "figment", 928 | "futures", 929 | "indexmap", 930 | "is-terminal", 931 | "log", 932 | "memchr", 933 | "multer", 934 | "num_cpus", 935 | "parking_lot", 936 | "pin-project-lite", 937 | "rand", 938 | "ref-cast", 939 | "rocket_codegen", 940 | "rocket_http", 941 | "serde", 942 | "serde_json", 943 | "state", 944 | "tempfile", 945 | "time", 946 | "tokio", 947 | "tokio-stream", 948 | "tokio-util", 949 | "ubyte", 950 | "version_check", 951 | "yansi", 952 | ] 953 | 954 | [[package]] 955 | name = "rocket_codegen" 956 | version = "0.5.0-rc.3" 957 | source = "registry+https://github.com/rust-lang/crates.io-index" 958 | checksum = "7093353f14228c744982e409259fb54878ba9563d08214f2d880d59ff2fc508b" 959 | dependencies = [ 960 | "devise", 961 | "glob", 962 | "indexmap", 963 | "proc-macro2", 964 | "quote", 965 | "rocket_http", 966 | "syn", 967 | "unicode-xid", 968 | ] 969 | 970 | [[package]] 971 | name = "rocket_http" 972 | version = "0.5.0-rc.3" 973 | source = "registry+https://github.com/rust-lang/crates.io-index" 974 | checksum = "936012c99162a03a67f37f9836d5f938f662e26f2717809761a9ac46432090f4" 975 | dependencies = [ 976 | "cookie", 977 | "either", 978 | "futures", 979 | "http", 980 | "hyper", 981 | "indexmap", 982 | "log", 983 | "memchr", 984 | "pear", 985 | "percent-encoding", 986 | "pin-project-lite", 987 | "ref-cast", 988 | "serde", 989 | "smallvec", 990 | "stable-pattern", 991 | "state", 992 | "time", 993 | "tokio", 994 | "uncased", 995 | ] 996 | 997 | [[package]] 998 | name = "rustix" 999 | version = "0.37.19" 1000 | source = "registry+https://github.com/rust-lang/crates.io-index" 1001 | checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" 1002 | dependencies = [ 1003 | "bitflags 1.3.2", 1004 | "errno", 1005 | "io-lifetimes", 1006 | "libc", 1007 | "linux-raw-sys", 1008 | "windows-sys 0.48.0", 1009 | ] 1010 | 1011 | [[package]] 1012 | name = "rustversion" 1013 | version = "1.0.12" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" 1016 | 1017 | [[package]] 1018 | name = "ryu" 1019 | version = "1.0.13" 1020 | source = "registry+https://github.com/rust-lang/crates.io-index" 1021 | checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" 1022 | 1023 | [[package]] 1024 | name = "scoped-tls" 1025 | version = "1.0.1" 1026 | source = "registry+https://github.com/rust-lang/crates.io-index" 1027 | checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" 1028 | 1029 | [[package]] 1030 | name = "scopeguard" 1031 | version = "1.1.0" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1034 | 1035 | [[package]] 1036 | name = "serde" 1037 | version = "1.0.162" 1038 | source = "registry+https://github.com/rust-lang/crates.io-index" 1039 | checksum = "71b2f6e1ab5c2b98c05f0f35b236b22e8df7ead6ffbf51d7808da7f8817e7ab6" 1040 | dependencies = [ 1041 | "serde_derive", 1042 | ] 1043 | 1044 | [[package]] 1045 | name = "serde_derive" 1046 | version = "1.0.162" 1047 | source = "registry+https://github.com/rust-lang/crates.io-index" 1048 | checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6" 1049 | dependencies = [ 1050 | "proc-macro2", 1051 | "quote", 1052 | "syn", 1053 | ] 1054 | 1055 | [[package]] 1056 | name = "serde_json" 1057 | version = "1.0.96" 1058 | source = "registry+https://github.com/rust-lang/crates.io-index" 1059 | checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" 1060 | dependencies = [ 1061 | "itoa", 1062 | "ryu", 1063 | "serde", 1064 | ] 1065 | 1066 | [[package]] 1067 | name = "sharded-slab" 1068 | version = "0.1.4" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" 1071 | dependencies = [ 1072 | "lazy_static", 1073 | ] 1074 | 1075 | [[package]] 1076 | name = "signal-hook-registry" 1077 | version = "1.4.1" 1078 | source = "registry+https://github.com/rust-lang/crates.io-index" 1079 | checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" 1080 | dependencies = [ 1081 | "libc", 1082 | ] 1083 | 1084 | [[package]] 1085 | name = "slab" 1086 | version = "0.4.8" 1087 | source = "registry+https://github.com/rust-lang/crates.io-index" 1088 | checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" 1089 | dependencies = [ 1090 | "autocfg", 1091 | ] 1092 | 1093 | [[package]] 1094 | name = "smallvec" 1095 | version = "1.10.0" 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" 1097 | checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" 1098 | 1099 | [[package]] 1100 | name = "socket2" 1101 | version = "0.4.9" 1102 | source = "registry+https://github.com/rust-lang/crates.io-index" 1103 | checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" 1104 | dependencies = [ 1105 | "libc", 1106 | "winapi", 1107 | ] 1108 | 1109 | [[package]] 1110 | name = "spin" 1111 | version = "0.9.8" 1112 | source = "registry+https://github.com/rust-lang/crates.io-index" 1113 | checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" 1114 | 1115 | [[package]] 1116 | name = "stable-pattern" 1117 | version = "0.1.0" 1118 | source = "registry+https://github.com/rust-lang/crates.io-index" 1119 | checksum = "4564168c00635f88eaed410d5efa8131afa8d8699a612c80c455a0ba05c21045" 1120 | dependencies = [ 1121 | "memchr", 1122 | ] 1123 | 1124 | [[package]] 1125 | name = "state" 1126 | version = "0.5.3" 1127 | source = "registry+https://github.com/rust-lang/crates.io-index" 1128 | checksum = "dbe866e1e51e8260c9eed836a042a5e7f6726bb2b411dffeaa712e19c388f23b" 1129 | dependencies = [ 1130 | "loom", 1131 | ] 1132 | 1133 | [[package]] 1134 | name = "syn" 1135 | version = "2.0.15" 1136 | source = "registry+https://github.com/rust-lang/crates.io-index" 1137 | checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" 1138 | dependencies = [ 1139 | "proc-macro2", 1140 | "quote", 1141 | "unicode-ident", 1142 | ] 1143 | 1144 | [[package]] 1145 | name = "tempfile" 1146 | version = "3.5.0" 1147 | source = "registry+https://github.com/rust-lang/crates.io-index" 1148 | checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" 1149 | dependencies = [ 1150 | "cfg-if", 1151 | "fastrand", 1152 | "redox_syscall 0.3.5", 1153 | "rustix", 1154 | "windows-sys 0.45.0", 1155 | ] 1156 | 1157 | [[package]] 1158 | name = "thread_local" 1159 | version = "1.1.7" 1160 | source = "registry+https://github.com/rust-lang/crates.io-index" 1161 | checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" 1162 | dependencies = [ 1163 | "cfg-if", 1164 | "once_cell", 1165 | ] 1166 | 1167 | [[package]] 1168 | name = "time" 1169 | version = "0.3.21" 1170 | source = "registry+https://github.com/rust-lang/crates.io-index" 1171 | checksum = "8f3403384eaacbca9923fa06940178ac13e4edb725486d70e8e15881d0c836cc" 1172 | dependencies = [ 1173 | "itoa", 1174 | "serde", 1175 | "time-core", 1176 | "time-macros", 1177 | ] 1178 | 1179 | [[package]] 1180 | name = "time-core" 1181 | version = "0.1.1" 1182 | source = "registry+https://github.com/rust-lang/crates.io-index" 1183 | checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" 1184 | 1185 | [[package]] 1186 | name = "time-macros" 1187 | version = "0.2.9" 1188 | source = "registry+https://github.com/rust-lang/crates.io-index" 1189 | checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" 1190 | dependencies = [ 1191 | "time-core", 1192 | ] 1193 | 1194 | [[package]] 1195 | name = "tokio" 1196 | version = "1.28.0" 1197 | source = "registry+https://github.com/rust-lang/crates.io-index" 1198 | checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" 1199 | dependencies = [ 1200 | "autocfg", 1201 | "bytes", 1202 | "libc", 1203 | "mio", 1204 | "num_cpus", 1205 | "parking_lot", 1206 | "pin-project-lite", 1207 | "signal-hook-registry", 1208 | "socket2", 1209 | "tokio-macros", 1210 | "windows-sys 0.48.0", 1211 | ] 1212 | 1213 | [[package]] 1214 | name = "tokio-macros" 1215 | version = "2.1.0" 1216 | source = "registry+https://github.com/rust-lang/crates.io-index" 1217 | checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" 1218 | dependencies = [ 1219 | "proc-macro2", 1220 | "quote", 1221 | "syn", 1222 | ] 1223 | 1224 | [[package]] 1225 | name = "tokio-stream" 1226 | version = "0.1.14" 1227 | source = "registry+https://github.com/rust-lang/crates.io-index" 1228 | checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" 1229 | dependencies = [ 1230 | "futures-core", 1231 | "pin-project-lite", 1232 | "tokio", 1233 | ] 1234 | 1235 | [[package]] 1236 | name = "tokio-util" 1237 | version = "0.7.8" 1238 | source = "registry+https://github.com/rust-lang/crates.io-index" 1239 | checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" 1240 | dependencies = [ 1241 | "bytes", 1242 | "futures-core", 1243 | "futures-sink", 1244 | "pin-project-lite", 1245 | "tokio", 1246 | "tracing", 1247 | ] 1248 | 1249 | [[package]] 1250 | name = "toml" 1251 | version = "0.5.11" 1252 | source = "registry+https://github.com/rust-lang/crates.io-index" 1253 | checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" 1254 | dependencies = [ 1255 | "serde", 1256 | ] 1257 | 1258 | [[package]] 1259 | name = "tower-service" 1260 | version = "0.3.2" 1261 | source = "registry+https://github.com/rust-lang/crates.io-index" 1262 | checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" 1263 | 1264 | [[package]] 1265 | name = "tracing" 1266 | version = "0.1.37" 1267 | source = "registry+https://github.com/rust-lang/crates.io-index" 1268 | checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" 1269 | dependencies = [ 1270 | "cfg-if", 1271 | "pin-project-lite", 1272 | "tracing-attributes", 1273 | "tracing-core", 1274 | ] 1275 | 1276 | [[package]] 1277 | name = "tracing-attributes" 1278 | version = "0.1.24" 1279 | source = "registry+https://github.com/rust-lang/crates.io-index" 1280 | checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" 1281 | dependencies = [ 1282 | "proc-macro2", 1283 | "quote", 1284 | "syn", 1285 | ] 1286 | 1287 | [[package]] 1288 | name = "tracing-core" 1289 | version = "0.1.30" 1290 | source = "registry+https://github.com/rust-lang/crates.io-index" 1291 | checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" 1292 | dependencies = [ 1293 | "once_cell", 1294 | "valuable", 1295 | ] 1296 | 1297 | [[package]] 1298 | name = "tracing-log" 1299 | version = "0.1.3" 1300 | source = "registry+https://github.com/rust-lang/crates.io-index" 1301 | checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" 1302 | dependencies = [ 1303 | "lazy_static", 1304 | "log", 1305 | "tracing-core", 1306 | ] 1307 | 1308 | [[package]] 1309 | name = "tracing-subscriber" 1310 | version = "0.3.17" 1311 | source = "registry+https://github.com/rust-lang/crates.io-index" 1312 | checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" 1313 | dependencies = [ 1314 | "matchers", 1315 | "nu-ansi-term", 1316 | "once_cell", 1317 | "regex", 1318 | "sharded-slab", 1319 | "smallvec", 1320 | "thread_local", 1321 | "tracing", 1322 | "tracing-core", 1323 | "tracing-log", 1324 | ] 1325 | 1326 | [[package]] 1327 | name = "try-lock" 1328 | version = "0.2.4" 1329 | source = "registry+https://github.com/rust-lang/crates.io-index" 1330 | checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" 1331 | 1332 | [[package]] 1333 | name = "ubyte" 1334 | version = "0.10.3" 1335 | source = "registry+https://github.com/rust-lang/crates.io-index" 1336 | checksum = "c81f0dae7d286ad0d9366d7679a77934cfc3cf3a8d67e82669794412b2368fe6" 1337 | dependencies = [ 1338 | "serde", 1339 | ] 1340 | 1341 | [[package]] 1342 | name = "uncased" 1343 | version = "0.9.9" 1344 | source = "registry+https://github.com/rust-lang/crates.io-index" 1345 | checksum = "9b9bc53168a4be7402ab86c3aad243a84dd7381d09be0eddc81280c1da95ca68" 1346 | dependencies = [ 1347 | "serde", 1348 | "version_check", 1349 | ] 1350 | 1351 | [[package]] 1352 | name = "unicode-ident" 1353 | version = "1.0.8" 1354 | source = "registry+https://github.com/rust-lang/crates.io-index" 1355 | checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" 1356 | 1357 | [[package]] 1358 | name = "unicode-xid" 1359 | version = "0.2.4" 1360 | source = "registry+https://github.com/rust-lang/crates.io-index" 1361 | checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" 1362 | 1363 | [[package]] 1364 | name = "valuable" 1365 | version = "0.1.0" 1366 | source = "registry+https://github.com/rust-lang/crates.io-index" 1367 | checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" 1368 | 1369 | [[package]] 1370 | name = "version_check" 1371 | version = "0.9.4" 1372 | source = "registry+https://github.com/rust-lang/crates.io-index" 1373 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1374 | 1375 | [[package]] 1376 | name = "want" 1377 | version = "0.3.0" 1378 | source = "registry+https://github.com/rust-lang/crates.io-index" 1379 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 1380 | dependencies = [ 1381 | "log", 1382 | "try-lock", 1383 | ] 1384 | 1385 | [[package]] 1386 | name = "wasi" 1387 | version = "0.11.0+wasi-snapshot-preview1" 1388 | source = "registry+https://github.com/rust-lang/crates.io-index" 1389 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1390 | 1391 | [[package]] 1392 | name = "wechatHook" 1393 | version = "0.1.0" 1394 | dependencies = [ 1395 | "forward-dll", 1396 | "futures", 1397 | "libc", 1398 | "rocket", 1399 | "serde", 1400 | "serde_json", 1401 | "tokio", 1402 | "win32console", 1403 | "winapi", 1404 | "windows", 1405 | ] 1406 | 1407 | [[package]] 1408 | name = "win32console" 1409 | version = "0.1.5" 1410 | source = "registry+https://github.com/rust-lang/crates.io-index" 1411 | checksum = "9e69bbdf01990d3e8b9f5a7c4667feda30c63be20aa2f8e66b2f4efb6c06f673" 1412 | dependencies = [ 1413 | "winapi", 1414 | ] 1415 | 1416 | [[package]] 1417 | name = "winapi" 1418 | version = "0.3.9" 1419 | source = "registry+https://github.com/rust-lang/crates.io-index" 1420 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1421 | dependencies = [ 1422 | "winapi-i686-pc-windows-gnu", 1423 | "winapi-x86_64-pc-windows-gnu", 1424 | ] 1425 | 1426 | [[package]] 1427 | name = "winapi-i686-pc-windows-gnu" 1428 | version = "0.4.0" 1429 | source = "registry+https://github.com/rust-lang/crates.io-index" 1430 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1431 | 1432 | [[package]] 1433 | name = "winapi-x86_64-pc-windows-gnu" 1434 | version = "0.4.0" 1435 | source = "registry+https://github.com/rust-lang/crates.io-index" 1436 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1437 | 1438 | [[package]] 1439 | name = "windows" 1440 | version = "0.48.0" 1441 | source = "registry+https://github.com/rust-lang/crates.io-index" 1442 | checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" 1443 | dependencies = [ 1444 | "windows-targets 0.48.0", 1445 | ] 1446 | 1447 | [[package]] 1448 | name = "windows-sys" 1449 | version = "0.35.0" 1450 | source = "registry+https://github.com/rust-lang/crates.io-index" 1451 | checksum = "c700bb45cfcbdb738ce92c41fc13e512514d4eaf6a99e8c87e2260a227175c16" 1452 | dependencies = [ 1453 | "windows_aarch64_msvc 0.35.0", 1454 | "windows_i686_gnu 0.35.0", 1455 | "windows_i686_msvc 0.35.0", 1456 | "windows_x86_64_gnu 0.35.0", 1457 | "windows_x86_64_msvc 0.35.0", 1458 | ] 1459 | 1460 | [[package]] 1461 | name = "windows-sys" 1462 | version = "0.45.0" 1463 | source = "registry+https://github.com/rust-lang/crates.io-index" 1464 | checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" 1465 | dependencies = [ 1466 | "windows-targets 0.42.2", 1467 | ] 1468 | 1469 | [[package]] 1470 | name = "windows-sys" 1471 | version = "0.48.0" 1472 | source = "registry+https://github.com/rust-lang/crates.io-index" 1473 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1474 | dependencies = [ 1475 | "windows-targets 0.48.0", 1476 | ] 1477 | 1478 | [[package]] 1479 | name = "windows-targets" 1480 | version = "0.42.2" 1481 | source = "registry+https://github.com/rust-lang/crates.io-index" 1482 | checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" 1483 | dependencies = [ 1484 | "windows_aarch64_gnullvm 0.42.2", 1485 | "windows_aarch64_msvc 0.42.2", 1486 | "windows_i686_gnu 0.42.2", 1487 | "windows_i686_msvc 0.42.2", 1488 | "windows_x86_64_gnu 0.42.2", 1489 | "windows_x86_64_gnullvm 0.42.2", 1490 | "windows_x86_64_msvc 0.42.2", 1491 | ] 1492 | 1493 | [[package]] 1494 | name = "windows-targets" 1495 | version = "0.48.0" 1496 | source = "registry+https://github.com/rust-lang/crates.io-index" 1497 | checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" 1498 | dependencies = [ 1499 | "windows_aarch64_gnullvm 0.48.0", 1500 | "windows_aarch64_msvc 0.48.0", 1501 | "windows_i686_gnu 0.48.0", 1502 | "windows_i686_msvc 0.48.0", 1503 | "windows_x86_64_gnu 0.48.0", 1504 | "windows_x86_64_gnullvm 0.48.0", 1505 | "windows_x86_64_msvc 0.48.0", 1506 | ] 1507 | 1508 | [[package]] 1509 | name = "windows_aarch64_gnullvm" 1510 | version = "0.42.2" 1511 | source = "registry+https://github.com/rust-lang/crates.io-index" 1512 | checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" 1513 | 1514 | [[package]] 1515 | name = "windows_aarch64_gnullvm" 1516 | version = "0.48.0" 1517 | source = "registry+https://github.com/rust-lang/crates.io-index" 1518 | checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" 1519 | 1520 | [[package]] 1521 | name = "windows_aarch64_msvc" 1522 | version = "0.35.0" 1523 | source = "registry+https://github.com/rust-lang/crates.io-index" 1524 | checksum = "db3bc5134e8ce0da5d64dcec3529793f1d33aee5a51fc2b4662e0f881dd463e6" 1525 | 1526 | [[package]] 1527 | name = "windows_aarch64_msvc" 1528 | version = "0.42.2" 1529 | source = "registry+https://github.com/rust-lang/crates.io-index" 1530 | checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" 1531 | 1532 | [[package]] 1533 | name = "windows_aarch64_msvc" 1534 | version = "0.48.0" 1535 | source = "registry+https://github.com/rust-lang/crates.io-index" 1536 | checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" 1537 | 1538 | [[package]] 1539 | name = "windows_i686_gnu" 1540 | version = "0.35.0" 1541 | source = "registry+https://github.com/rust-lang/crates.io-index" 1542 | checksum = "0343a6f35bf43a07b009b8591b78b10ea03de86b06f48e28c96206cd0f453b50" 1543 | 1544 | [[package]] 1545 | name = "windows_i686_gnu" 1546 | version = "0.42.2" 1547 | source = "registry+https://github.com/rust-lang/crates.io-index" 1548 | checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" 1549 | 1550 | [[package]] 1551 | name = "windows_i686_gnu" 1552 | version = "0.48.0" 1553 | source = "registry+https://github.com/rust-lang/crates.io-index" 1554 | checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" 1555 | 1556 | [[package]] 1557 | name = "windows_i686_msvc" 1558 | version = "0.35.0" 1559 | source = "registry+https://github.com/rust-lang/crates.io-index" 1560 | checksum = "1acdcbf4ca63d8e7a501be86fee744347186275ec2754d129ddeab7a1e3a02e4" 1561 | 1562 | [[package]] 1563 | name = "windows_i686_msvc" 1564 | version = "0.42.2" 1565 | source = "registry+https://github.com/rust-lang/crates.io-index" 1566 | checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" 1567 | 1568 | [[package]] 1569 | name = "windows_i686_msvc" 1570 | version = "0.48.0" 1571 | source = "registry+https://github.com/rust-lang/crates.io-index" 1572 | checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" 1573 | 1574 | [[package]] 1575 | name = "windows_x86_64_gnu" 1576 | version = "0.35.0" 1577 | source = "registry+https://github.com/rust-lang/crates.io-index" 1578 | checksum = "893c0924c5a990ec73cd2264d1c0cba1773a929e1a3f5dbccffd769f8c4edebb" 1579 | 1580 | [[package]] 1581 | name = "windows_x86_64_gnu" 1582 | version = "0.42.2" 1583 | source = "registry+https://github.com/rust-lang/crates.io-index" 1584 | checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" 1585 | 1586 | [[package]] 1587 | name = "windows_x86_64_gnu" 1588 | version = "0.48.0" 1589 | source = "registry+https://github.com/rust-lang/crates.io-index" 1590 | checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" 1591 | 1592 | [[package]] 1593 | name = "windows_x86_64_gnullvm" 1594 | version = "0.42.2" 1595 | source = "registry+https://github.com/rust-lang/crates.io-index" 1596 | checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" 1597 | 1598 | [[package]] 1599 | name = "windows_x86_64_gnullvm" 1600 | version = "0.48.0" 1601 | source = "registry+https://github.com/rust-lang/crates.io-index" 1602 | checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" 1603 | 1604 | [[package]] 1605 | name = "windows_x86_64_msvc" 1606 | version = "0.35.0" 1607 | source = "registry+https://github.com/rust-lang/crates.io-index" 1608 | checksum = "a29bd61f32889c822c99a8fdf2e93378bd2fae4d7efd2693fab09fcaaf7eff4b" 1609 | 1610 | [[package]] 1611 | name = "windows_x86_64_msvc" 1612 | version = "0.42.2" 1613 | source = "registry+https://github.com/rust-lang/crates.io-index" 1614 | checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" 1615 | 1616 | [[package]] 1617 | name = "windows_x86_64_msvc" 1618 | version = "0.48.0" 1619 | source = "registry+https://github.com/rust-lang/crates.io-index" 1620 | checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" 1621 | 1622 | [[package]] 1623 | name = "yansi" 1624 | version = "0.5.1" 1625 | source = "registry+https://github.com/rust-lang/crates.io-index" 1626 | checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" 1627 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "wechatHook" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | futures = "0.3.28" 10 | libc = "0.2.143" 11 | rocket = { version="=0.5.0-rc.3", features = ["json"] } 12 | serde = { version = "1.0.162", features = ["derive"] } 13 | serde_json = "1.0.96" 14 | tokio = { version="1.28.0", features = ["full"] } 15 | win32console = "0.1.5" 16 | winapi = { version = "0.3.9", features = ["winuser"] } 17 | 18 | [lib] 19 | crate-type = ["cdylib"] 20 | 21 | [dependencies.windows] 22 | version = "0.*" 23 | features = [ 24 | "Win32_Foundation", 25 | "Win32_System_SystemServices", 26 | "Win32_UI_WindowsAndMessaging", 27 | "Win32_System_Threading" 28 | ] 29 | 30 | [build-dependencies] 31 | forward-dll = "0.1.11" 32 | -------------------------------------------------------------------------------- /build.rs: -------------------------------------------------------------------------------- 1 | use forward_dll::forward_dll; 2 | 3 | fn main() { 4 | forward_dll("C:\\Windows\\System32\\version.dll").unwrap(); 5 | } -------------------------------------------------------------------------------- /src/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clansty/WeChatHook/011986535a9ead919b953ef09855a0818b75a227/src/.DS_Store -------------------------------------------------------------------------------- /src/httpServer.rs: -------------------------------------------------------------------------------- 1 | mod getMyInfo; 2 | mod sendMessage; 3 | mod maimaiDX; 4 | 5 | use crate::types; 6 | 7 | use rocket::{self, get, post, routes}; 8 | use rocket::serde::{json::Json}; 9 | 10 | use std::thread; 11 | 12 | #[get("/")] 13 | fn index() -> &'static str { 14 | "Nya!" 15 | } 16 | 17 | #[get("/myInfo")] 18 | fn getMyInfoRoute() -> String { 19 | getMyInfo::get_my_info() 20 | } 21 | 22 | #[post("/sendMessage", format = "json", data = "")] 23 | fn sendMessageRoute(params: Json) -> &'static str { 24 | thread::spawn(move || { 25 | sendMessage::send_message(¶ms.target, ¶ms.content); 26 | }); 27 | "qwq" 28 | } 29 | 30 | // #[get("/maimaiDX")] 31 | // fn maimaiRoute() -> &'static str { 32 | // thread::spawn(move || { 33 | // maimaiDX::qrcode(); 34 | // }); 35 | // "qwq" 36 | // } 37 | 38 | #[rocket::main] 39 | pub async fn start_server() -> Result<(), rocket::Error> { 40 | rocket::build() 41 | .mount("/", routes![index, getMyInfoRoute, sendMessageRoute, maimaiRoute]) 42 | .launch() 43 | .await; 44 | 45 | Ok(()) 46 | } 47 | -------------------------------------------------------------------------------- /src/httpServer/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/clansty/WeChatHook/011986535a9ead919b953ef09855a0818b75a227/src/httpServer/.DS_Store -------------------------------------------------------------------------------- /src/httpServer/getMyInfo.rs: -------------------------------------------------------------------------------- 1 | use crate::utils; 2 | use winapi::um::libloaderapi::GetModuleHandleA; 3 | 4 | pub fn get_my_info() -> String { 5 | let handle = unsafe { GetModuleHandleA(b"WeChatWin.dll\0".as_ptr() as _) }; 6 | println!("WechatWin handle: {:p}", handle); 7 | 8 | let wxid = utils::get_pointed_string(unsafe { (handle as *const u8).add(0x2FFD484) }); 9 | let name = utils::get_addressed_string(unsafe { (handle as *const i8).add(0x2FFD590) }); 10 | let phone = utils::get_addressed_string(unsafe { (handle as *const i8).add(0x2FFD500) }); 11 | let avatar = utils::get_pointed_string(unsafe { (handle as *const u8).add(0x2FFD774) }); 12 | println!( 13 | "wxid: {}, name: {}, phone: {}, avatar: {}", 14 | wxid, name, phone, avatar 15 | ); 16 | 17 | let json = serde_json::json!({ 18 | "wxid": wxid, 19 | "name": name, 20 | "phone": phone, 21 | "avatar": avatar, 22 | }); 23 | return json.to_string(); 24 | } 25 | -------------------------------------------------------------------------------- /src/httpServer/maimaiDX.rs: -------------------------------------------------------------------------------- 1 | use std::ffi::OsStr; 2 | use std::os::windows::ffi::OsStrExt; 3 | use crate::types; 4 | use winapi::um::libloaderapi::GetModuleHandleA; 5 | 6 | use std::arch::asm; 7 | use std::thread; 8 | use std::time::Duration; 9 | 10 | // type GetArg1Function = extern "C" fn(i32) -> i32; 11 | 12 | pub fn qrcode() { 13 | let handle = unsafe { GetModuleHandleA(b"WeChatWin.dll\0".as_ptr() as _) }; 14 | println!("WechatWin handle: {:p}", handle); 15 | 16 | let callAddr = unsafe { (handle as *const u8).add(0xDA2450) }; 17 | 18 | let getArg1: *const u8 = unsafe { (handle as *const u8).add(0x240EAB0) }; 19 | 20 | let arg1: i32; 21 | 22 | unsafe { 23 | asm!( 24 | "push 576", 25 | "call {callAddr}", 26 | "mov {arg1}, eax", 27 | "add esp, 4", 28 | callAddr = in(reg) getArg1, 29 | arg1 = out(reg) arg1, 30 | ); 31 | } 32 | 33 | let arg3 = OsStr::new("#bizmenu#454854166rselfmenu_1end") 34 | .encode_wide() 35 | .chain(Some(0)) // add NULL termination 36 | .collect::>(); 37 | let arg8 = OsStr::new("gh_6cfb73ca89e6") 38 | .encode_wide() 39 | .chain(Some(0)) // add NULL termination 40 | .collect::>(); 41 | let esi = types::WxString { 42 | text: arg3.as_ptr(), 43 | size: 0x65, 44 | capacity: 0x65, 45 | fill: [0; 8], 46 | }; 47 | println!("CallAddr: {:p}, arg1: {:x}, arg3: {:p}, arg8: {:p}", callAddr, arg1, arg3.as_ptr(), arg8.as_ptr()); 48 | 49 | unsafe { 50 | asm!( 51 | "mov ecx,{arg1}", 52 | "push 0", 53 | "push 0", 54 | "push 0xf", 55 | "push 0xf", 56 | "push {arg8}", 57 | "push 0", 58 | "push 0", 59 | "push 0x65", 60 | "push 0x65", 61 | "push {arg3}", 62 | "push 1", 63 | "call {callAddr}", 64 | arg1 = in(reg) arg1, 65 | arg3 = in(reg) arg3.as_ptr(), 66 | arg8 = in(reg) arg8.as_ptr(), 67 | callAddr = in(reg) callAddr, 68 | ); 69 | } 70 | 71 | // thread::sleep(Duration::from_secs(30)); 72 | 73 | // let result = unsafe { (*function)(arg1.as_ptr() as u8, 1, arg3.as_ptr() as u8, 0x65, 0x65, 0, 0, arg8.as_ptr() as u8, 0xf, 0xf, 0, 0) }; 74 | // println!("result: {:p}", result); 75 | } 76 | -------------------------------------------------------------------------------- /src/httpServer/sendMessage.rs: -------------------------------------------------------------------------------- 1 | use crate::types; 2 | 3 | 4 | use std::ffi::OsStr; 5 | use std::os::windows::ffi::OsStrExt; 6 | 7 | use winapi::um::libloaderapi::GetModuleHandleA; 8 | 9 | use std::arch::asm; 10 | 11 | pub fn send_message(target: &str, message: &str) { 12 | let handle = unsafe { GetModuleHandleA(b"WeChatWin.dll\0".as_ptr() as _) }; 13 | println!("WechatWin handle: {:p}", handle); 14 | 15 | let callAddr = unsafe { (handle as *const u8).add(0xCE6C80) }; 16 | 17 | let uTarget = OsStr::new(target) 18 | .encode_wide() 19 | .chain(Some(0)) // add NULL termination 20 | .collect::>(); 21 | let wTarget = types::WxString { 22 | text: uTarget.as_ptr(), 23 | size: uTarget.len(), 24 | capacity: uTarget.len(), 25 | fill: [0; 8], 26 | }; 27 | 28 | let uMessage = OsStr::new(message) 29 | .encode_wide() 30 | .chain(Some(0)) // add NULL termination 31 | .collect::>(); 32 | let wMessage = types::WxString { 33 | text: uMessage.as_ptr(), 34 | size: uMessage.len(), 35 | capacity: uMessage.len(), 36 | fill: [0; 8], 37 | }; 38 | 39 | let buffer: [u8; 0x3B0] = [0; 0x3B0]; 40 | let at_addr = [buffer.as_ptr(); 3]; 41 | 42 | println!( 43 | "at_addr: {:p}, buffer: {:p}, wMessage: {:p}, wTarget: {:p}, callAddr: {:p}", 44 | &at_addr, &buffer, &wMessage, &wTarget, callAddr 45 | ); 46 | 47 | unsafe { 48 | asm!( 49 | "push {buffer}", 50 | "push 0", 51 | "push 1", 52 | "push {at_addr}", 53 | "push {wMessage}", 54 | "mov edx,{wTarget}", 55 | "mov ecx,{buffer}", 56 | "mov ebx,{callAddr}", 57 | "call ebx", 58 | at_addr = in(reg) at_addr.as_ptr(), 59 | buffer = in(reg) buffer.as_ptr(), 60 | wMessage = in(reg) &wMessage, 61 | wTarget = in(reg) &wTarget, 62 | callAddr = in(reg) callAddr, 63 | ); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | mod httpServer; 2 | mod utils; 3 | mod types; 4 | 5 | use std::thread; 6 | 7 | use win32console::console::WinConsole; 8 | use winapi::shared::minwindef::HINSTANCE; 9 | use windows::Win32::System::SystemServices::*; 10 | 11 | 12 | #[no_mangle] 13 | #[allow(non_snake_case, unused_variables)] 14 | extern "system" fn DllMain(dll_module: HINSTANCE, call_reason: u32, _: *mut ()) -> bool { 15 | match call_reason { 16 | DLL_PROCESS_ATTACH => attach(), 17 | DLL_PROCESS_DETACH => (), 18 | _ => (), 19 | } 20 | 21 | true 22 | } 23 | 24 | fn attach() { 25 | WinConsole::alloc_console(); 26 | WinConsole::set_title("Cat App!").unwrap(); 27 | println!("nya, hello injection from Rust!"); 28 | 29 | thread::spawn(move || { 30 | httpServer::start_server(); 31 | }); 32 | } 33 | -------------------------------------------------------------------------------- /src/types.rs: -------------------------------------------------------------------------------- 1 | use rocket::serde::{Deserialize}; 2 | use std::os::raw::c_char; 3 | 4 | #[repr(C)] 5 | pub struct WxString { 6 | pub text: *const u16, 7 | pub size: usize, 8 | pub capacity: usize, 9 | pub fill: [c_char; 8], 10 | } 11 | 12 | #[derive(Deserialize)] 13 | #[serde(crate = "rocket::serde")] 14 | pub struct SendMessageParams { 15 | pub target: String, 16 | pub content: String, 17 | } 18 | -------------------------------------------------------------------------------- /src/utils.rs: -------------------------------------------------------------------------------- 1 | 2 | use std::ffi::{CStr}; 3 | use std::os::raw::c_char; 4 | use libc::strlen; 5 | 6 | pub fn get_pointed_string(s_addr: *const u8) -> String { 7 | let str_ptr = unsafe { *(s_addr as *const *const c_char) }; 8 | let len = unsafe { strlen(str_ptr) }; 9 | let str_slice = unsafe { std::slice::from_raw_parts(str_ptr as *const u8, len as usize + 1) }; 10 | let cstr = unsafe { CStr::from_bytes_with_nul_unchecked(str_slice) }; 11 | return cstr.to_string_lossy().into_owned(); 12 | } 13 | 14 | pub fn get_addressed_string(str_ptr: *const i8) -> String { 15 | let len = unsafe { strlen(str_ptr) }; 16 | let str_slice = unsafe { std::slice::from_raw_parts(str_ptr as *const u8, len as usize + 1) }; 17 | let cstr = unsafe { CStr::from_bytes_with_nul_unchecked(str_slice) }; 18 | return cstr.to_string_lossy().into_owned(); 19 | } --------------------------------------------------------------------------------