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

nom::be_u32 is used instead of the nom::le_u32 #4

Open
Mingun opened this issue Apr 25, 2021 · 1 comment
Open

nom::be_u32 is used instead of the nom::le_u32 #4

Mingun opened this issue Apr 25, 2021 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@Mingun
Copy link

Mingun commented Apr 25, 2021

According to the original unrar sources Little-endian should be used there:

RAR/src/head_block.rs

Lines 152 to 161 in b84da66

/// get a base header
named!(base_header(&[u8]) -> (HeadBlock),
do_parse!(
crc: be_u32 >>
size: vint >>
typ: vint >>
flags: vint >>
(HeadBlock::new(crc, size, typ.into(), flags.into()))
)
);

RAR/src/file_block.rs

Lines 68 to 79 in b84da66

if file.flags.time {
let (i, mtime) = be_u32(input)?;
input = i;
file.mtime = mtime;
}
// check for file crc data
if file.flags.crc {
let (i, crc) = be_u32(input)?;
input = i;
file.data_crc = crc;
}

@Roba1993
Copy link
Owner

@Mingun Thank you for the input. Yes you are right! This should be changed.

@Roba1993 Roba1993 added bug Something isn't working good first issue Good for newcomers labels Apr 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants