MCPcopy Create free account
hub / github.com/Kudaes/MFTool / parse_upcase

Function parse_upcase

parser/src/lib.rs:209–224  ·  view source on GitHub ↗

Parses the content of the $UpCase MFT entry and stores it in memory. # Parameters - `upcase_entry`: Raw content of the $UpCase MFT entry.

(upcase_entry: &Vec<u8>)

Source from the content-addressed store, hash-verified

207/// # Parameters
208/// - `upcase_entry`: Raw content of the $UpCase MFT entry.
209unsafe fn parse_upcase(upcase_entry: &Vec<u8>)
210{
211 let contents = get_file_content(upcase_entry);
212 if contents.is_none() {
213 panic!("{}", &lc!("[x] Critical error: $UpCase parsing failed.")); // There is no point in continuing the execution from here
214 }
215
216 let mut upcase_lock = UPCASE.write().unwrap();
217 let mut upcase_content = contents.unwrap();
218 let upcase_content_len = upcase_content.len() / 2; // utf16
219 let ptr = upcase_content.as_mut_ptr() as *mut u16;
220 for i in 0..upcase_content_len {
221 let item = *(ptr.add(i as usize));
222 upcase_lock.push(item);
223 }
224}
225
226/// Extracts the data run list of the non-resident unnamed $DATA attribute from an MFT entry.
227/// The returned list is **not** sorted by first VCN.

Callers 1

read_all_mft_entriesFunction · 0.85

Calls 1

get_file_contentFunction · 0.85

Tested by

no test coverage detected