first commit

This commit is contained in:
endernon 2024-09-19 21:17:36 +01:00
commit 52b8c2bf51
5 changed files with 229 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/target

73
Cargo.lock generated Normal file
View file

@ -0,0 +1,73 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "idmangler-lib"
version = "0.3.0"
source = "git+https://github.com/Zatzou/idmangler-lib#9d1b88e2304927383c0efdad5b514a1a555d672b"
dependencies = [
"thiserror",
]
[[package]]
name = "proc-macro2"
version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
dependencies = [
"unicode-ident",
]
[[package]]
name = "quote"
version = "1.0.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af"
dependencies = [
"proc-macro2",
]
[[package]]
name = "syn"
version = "2.0.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed"
dependencies = [
"proc-macro2",
"quote",
"unicode-ident",
]
[[package]]
name = "thiserror"
version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
version = "1.0.63"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "unicode-ident"
version = "1.0.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe"
[[package]]
name = "wynntils-crafted-exploit"
version = "0.1.0"
dependencies = [
"idmangler-lib",
]

7
Cargo.toml Normal file
View file

@ -0,0 +1,7 @@
[package]
name = "wynntils-crafted-exploit"
version = "0.1.0"
edition = "2021"
[dependencies]
idmangler-lib = { git = "https://github.com/Zatzou/idmangler-lib", version = "0.3.0" }

0
README.md Normal file
View file

148
src/main.rs Normal file
View file

@ -0,0 +1,148 @@
use std::i32;
use idmangler_lib::{
decode,
encoding::{decode_string, encode_string},
types::{
ConsumableType, CustomStat, Effect, EffectType, GearType, ItemType, Powders, RollType,
SkillType, Stat, TransformVersion,
},
CustomConsumableTypeData, CustomGearTypeData, CustomIdentificationData, DataEncoder,
DurabilityData, EffectsData, EndData, IdentificationData, NameData, PowderData,
RequirementsData, RerollData, ShinyData, StartData, TypeData, UsesData,
};
fn main() {
let mut out = Vec::new();
let ver = TransformVersion::Version1;
StartData(ver).encode(ver, &mut out).unwrap();
TypeData(ItemType::CraftedConsu)
.encode(ver, &mut out)
.unwrap();
NameData(String::from("\n".repeat(220)))
.encode(ver, &mut out)
.unwrap();
let mut ids = Vec::new();
for i in 0..78 {
if i == 15 || i == 71 {
continue;
}
ids.push(Stat {
kind: i,
base: Some(63),
roll: RollType::Value(255),
})
}
// IdentificationData {
// identifications: vec![Stat {
// kind: 85,
// base: Some(100),
// roll: RollType::Value(100),
// }],
// extended_encoding: true,
// }
// .encode(ver, &mut out)
// .unwrap();
// let mut powdata = Vec::new();
// for _ in 0..51 {
// powdata.extend_from_slice(&[
// (Powders::AIR, 4),
// (Powders::EARTH, 4),
// (Powders::FIRE, 4),
// (Powders::THUNDER, 4),
// (Powders::WATER, 4),
// ]);
// }
// PowderData {
// powder_slots: 255,
// powders: powdata,
// }
// .encode(ver, &mut out)
// .unwrap();
// RerollData(255).encode(ver, &mut out).unwrap();
// ShinyData {
// id: 2,
// val: i64::MAX, //- 0b0100_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000_0000,
// }
// .encode(ver, &mut out)
// .unwrap();
CustomConsumableTypeData(ConsumableType::Potion)
.encode(ver, &mut out)
.unwrap();
UsesData {
current: 255,
max: 0,
}
.encode(ver, &mut out)
.unwrap();
// CustomGearTypeData(GearType::Boots)
// .encode(ver, &mut out)
// .unwrap();
// DurabilityData {
// effect_strenght: 255,
// current: 0,
// max: 0,
// }
// .encode(ver, &mut out)
// .unwrap();
RequirementsData {
level: 123,
class: None,
skills: Vec::new(), // vec![(SkillType::Strenght, 255)],
}
.encode(ver, &mut out)
.unwrap();
// EffectsData {
// effects: vec![Effect {
// kind: EffectType::Mana,
// value: i32::MIN,
// }],
// }
// .encode(ver, &mut out)
// .unwrap();
// CustomIdentificationData {
// idents: vec![CustomStat {
// kind: 81,
// max: i32::MAX,
// }],
// }
// .encode(ver, &mut out)
// .unwrap();
EndData.encode(ver, &mut out).unwrap();
println!("{}", encode_string(&out));
println!("lenght: {}", encode_string(&out).chars().count());
for b in out {
print!("{:02X}", b);
}
println!();
// decode test
// let input = "󰀀󰄀󰉁󶹴󶡲󶅣󶥴󶔠󴉡󶱬󶥳󷑡󰀃󰠁󰀞󾠇󵠑󳱩󳢠󱽴󴠧󷄡󱹵󳫠󰢂󱌨󵴅󲠞􏿮";
// let bytes = decode_string(input);
// let out = decode(&bytes).unwrap();
// println!("{:#?}", out);
// println!("{:#?}", out.get::<NameData>())
}