fix PBX executable format identity
This commit is contained in:
@@ -2627,7 +2627,7 @@ mod tests {
|
||||
fn test_loader_hardening_unsupported_version() {
|
||||
let mut vm = VirtualMachine::default();
|
||||
let mut header = vec![0u8; 32];
|
||||
header[0..4].copy_from_slice(b"PBS\0");
|
||||
header[0..4].copy_from_slice(&prometeu_bytecode::PBX_MAGIC);
|
||||
header[4..6].copy_from_slice(&1u16.to_le_bytes()); // version 1 (unsupported)
|
||||
|
||||
let res = vm.initialize(header);
|
||||
@@ -2635,16 +2635,16 @@ mod tests {
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_loader_hardening_malformed_pbs_v0() {
|
||||
fn test_loader_hardening_malformed_pbx_v0() {
|
||||
let mut vm = VirtualMachine::default();
|
||||
let mut header = vec![0u8; 32];
|
||||
header[0..4].copy_from_slice(b"PBS\0");
|
||||
header[0..4].copy_from_slice(&prometeu_bytecode::PBX_MAGIC);
|
||||
header[8..12].copy_from_slice(&1u32.to_le_bytes()); // 1 section claimed but none provided
|
||||
|
||||
let res = vm.initialize(header);
|
||||
match res {
|
||||
Err(VmInitError::ImageLoadFailed(prometeu_bytecode::LoadError::UnexpectedEof)) => {}
|
||||
_ => panic!("Expected PbsV0LoadFailed(UnexpectedEof), got {:?}", res),
|
||||
_ => panic!("Expected PBX v0 load failure UnexpectedEof, got {:?}", res),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3084,7 +3084,7 @@ mod tests {
|
||||
fn test_loader_hardening_missing_sysc_section() {
|
||||
let mut vm = VirtualMachine::default();
|
||||
let mut header = vec![0u8; 32];
|
||||
header[0..4].copy_from_slice(b"PBS\0");
|
||||
header[0..4].copy_from_slice(&prometeu_bytecode::PBX_MAGIC);
|
||||
|
||||
let res = vm.initialize(header);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user