
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
a2lfile
a2lfile
is a library that allows you to read, modify and write a2l files.
A2l files are commonly used during the development and testing of automotive ECUs. The consumer of the a2l file typically performs online calibration over a protocol such as XCP and/or offline tuning by generating flashable parameter sets.
If you have never seen an a2l file then you are unlikely to need this library.
The program a2ltool is based on this library.
A simple program based on the a2lfile
library might look like this:
use a2lfile::*;
fn main() {
let input_filename = &std::ffi::OsString::from("example.a2l");
let mut logmsgs = Vec::<A2LError>::new();
let mut a2l_file = a2lfile::load(
input_filename,
None,
&mut logmsgs,
false
).expect("could not load the file");
for log_msg in logmsgs {
println!("warning while loading the file: {}", log_msg);
}
// perform a consistency check
let mut logmsgs = Vec::<String>::new();
a2l_file.check(&mut logmsgs);
for log_msg in logmsgs {
println!("warning during consistency check: {}", log_msg);
}
for measurement in &a2l_file.project.module[0].measurement {
// do something with the MEASUREMENT objects in the file
println!("MEASUREMENT: {:#?}", measurement);
}
// create a new CHARACTERISTIC object
let new_characteristic = Characteristic::new(
"my_name".to_string(),
"my extended description".to_string(),
CharacteristicType::Value,
0x12345678,
"something.RECORD_LAYOUT".to_string(),
0.0,
"NO_COMPU_METHOD".to_string(),
0.0,
100.0
);
a2l_file.project.module[0].characteristic.push(new_characteristic);
// update the sorting to find a suitable insertion point for the new characteristic - by default it will be placed at the end
a2l_file.sort_new_items();
// write the modified file
a2l_file.write(
&std::ffi::OsString::from("example_output.txt"),
Some("modified by the demo program")
).expect("failed to write output");
}
All features are active by default. If "default-features = false" is set in Cargo.toml, then the following features can be enabled separately:
check
: perform a consistency check on the datacleanup
: remove unused GROUP
s, RECORD_LAYOUT
s, COMPU_METHOD
s, COMPU_(V)TAB
s and UNIT
sifdata_cleanup
: remove any IF_DATA
blocks that could not be parsed using either the specification provided during load or the specification in the A2ML block in the filemerge
: merge two a2l files on the MODULE
levelsort
: sort the data in the a2l fileLicensed under either of
LICENSE-APACHE
or http://www.apache.org/licenses/LICENSE-2.0)LICENSE-MIT
or http://opensource.org/licenses/MIT)FAQs
Unknown package
We found that a2lfile demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.