Further Small Fixes

- Some improvements which is same as what has been made in the former commit has made
This commit is contained in:
*Nix Fanboy
2024-10-25 15:32:11 +03:00
parent 822856747a
commit 96beb607c9
3 changed files with 6 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
use std::ffi::c_char;
use std::ptr::null_mut; use std::ptr::null_mut;
use crate::{ use crate::{
@@ -20,7 +21,7 @@ fn find_os_from_strtab_elf(elf: &Elf<'_>, pat: &[&str]) -> bool {
.any(|s| pat.iter().any(|i| s.to_lowercase().contains(i))) .any(|s| pat.iter().any(|i| s.to_lowercase().contains(i)))
} }
fn find_os_elf(elf: &Elf<'_>, os_abi: u8) -> (ElfOS, *mut i8) { fn find_os_elf(elf: &Elf<'_>, os_abi: u8) -> (ElfOS, *mut c_char) {
let os = { let os = {
match os_abi { match os_abi {
0x00 => match true { 0x00 => match true {

View File

@@ -1,3 +1,4 @@
use std::ffi::c_char;
use crate::{ use crate::{
debug::{debug_objects, merge_members}, debug::{debug_objects, merge_members},
structs::{CharVec, Debugging, ParsingError, ULDDObj, ULDDObjResult}, structs::{CharVec, Debugging, ParsingError, ULDDObj, ULDDObjResult},
@@ -11,7 +12,7 @@ use std::ptr::null_mut;
use crate::debug::option_to_c_string; use crate::debug::option_to_c_string;
use crate::impls::{ErrorToInt, StringToCString}; use crate::impls::{ErrorToInt, StringToCString};
fn find_os_mach(mach: &MachO<'_>) -> *mut i8 { fn find_os_mach(mach: &MachO<'_>) -> *mut c_char {
for lc in &mach.load_commands { for lc in &mach.load_commands {
if let BuildVersion(build_version) = lc.command { if let BuildVersion(build_version) = lc.command {
let os = match build_version.platform { let os = match build_version.platform {

View File

@@ -1,3 +1,4 @@
use std::ffi::c_char;
use crate::{ use crate::{
debug::debug_objects, debug::debug_objects,
structs::{CharVec, ParsingError, ULDDObj, ULDDObjResult}, structs::{CharVec, ParsingError, ULDDObj, ULDDObjResult},
@@ -8,7 +9,7 @@ use std::ptr::null_mut;
use crate::debug::option_to_c_string; use crate::debug::option_to_c_string;
use crate::impls::StringToCString; use crate::impls::StringToCString;
fn find_os_pe(pe: &PE<'_>) -> *mut i8 { fn find_os_pe(pe: &PE<'_>) -> *mut c_char {
let Some(optional_header) = pe let Some(optional_header) = pe
.header .header
.optional_header .optional_header