mirror of
https://github.com/lifegpc/msg-tool.git
synced 2026-06-07 13:28:47 +08:00
Fix BGI Bp parse bug
This commit is contained in:
@@ -73,10 +73,14 @@ impl BGIBpScript {
|
||||
}
|
||||
let mut last_instr_pos = 0;
|
||||
reader.seek(SeekFrom::Start(header_size as u64))?;
|
||||
for _ in 0..instr_size / 4 {
|
||||
let instr = reader.read_u32()?;
|
||||
let max_instr_len = reader.data.len() - 4;
|
||||
while reader.pos < max_instr_len {
|
||||
let instr = reader.cpeek_u32()?;
|
||||
if instr == 0x17 {
|
||||
last_instr_pos = reader.pos;
|
||||
reader.pos += 4;
|
||||
} else {
|
||||
reader.pos += 1;
|
||||
}
|
||||
}
|
||||
if last_instr_pos == 0 {
|
||||
|
||||
@@ -56,7 +56,7 @@ pub struct SrcXmlScript {
|
||||
|
||||
impl SrcXmlScript {
|
||||
/// Creates a new `SrcXmlScript` from the provided buffer and encoding.
|
||||
///
|
||||
///
|
||||
/// * `buf` - The buffer containing the XML data.
|
||||
/// * `encoding` - The encoding of the XML data.
|
||||
/// * `config` - Additional configuration options.
|
||||
|
||||
Reference in New Issue
Block a user