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

write::pe::Writer: Add write_file_align function. #397

Merged
merged 1 commit into from
Nov 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/write/pe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,11 @@ impl<'a> Writer<'a> {
util::write_align(self.buffer, align_start as usize);
}

/// Write padding up to the next multiple of file alignment.
pub fn write_file_align(&mut self) {
self.write_align(self.file_alignment);
}

/// Reserve the file range up to the given file offset.
pub fn reserve_until(&mut self, offset: u32) {
debug_assert!(self.len <= offset);
Expand Down