Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More mod info from DLL files for mods outside of the manifest #138

Open
ljoonal opened this issue Jan 15, 2024 · 0 comments
Open

More mod info from DLL files for mods outside of the manifest #138

ljoonal opened this issue Jan 15, 2024 · 0 comments
Labels
enhancement Improvements/tweaks to existing features

Comments

@ljoonal
Copy link

ljoonal commented Jan 15, 2024

I'd love to see the DLL version info be tried to be parsed and be shown similarly as mods from the manifest. Though I'd except the unknown mods to keep the blue question mark to indicate that they aren't actually from the manifest, and the details are just provided by the file metadata :P

I do realize this is most likely a low priority feature request, so I did play around with the idea of making a PR but for now I ran out of time 😅

fn get_assembly_version<P: AsRef<Path>>(path: &P) -> Option<semver::Version> {
	use pelite::FileMap;
	use pelite::pe32::{Pe, PeFile};

    let Some(file_map) = FileMap::open(path).ok() else { return None;};
    let Some(file) = PeFile::from_bytes(file_map.as_ref()).ok() else { return None;};
		let Some(resources) = file.resources().ok() else { return None;};
		let Some(version_info) = resources.version_info().ok() else { return None;};
		let Some(fixed_info) = version_info.fixed() else { return None;};
    Some(semver::Version {
			major: fixed_info.dwFileVersion.Major as u64,
			minor: fixed_info.dwFileVersion.Minor as u64,
			patch: fixed_info.dwFileVersion.Patch as u64,
			pre: Default::default(),
			build: semver::BuildMetadata::new(&fixed_info.dwFileVersion.Build.to_string()).unwrap_or_default(),
		})
}

The ProductName could be gotten in a similar way for the hypothetically correct GUIDs to show.

@Gawdl3y Gawdl3y added the enhancement Improvements/tweaks to existing features label Jan 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improvements/tweaks to existing features
Projects
None yet
Development

No branches or pull requests

2 participants