File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -106,13 +106,14 @@ impl Emu {
106106 log:: info!( "base: 0x{:x}" , base) ;
107107 }
108108
109+ let sec_allign = pe32. opt . section_alignment ;
109110 // 4. map pe and then sections
110111 let pemap = self
111112 . maps
112113 . create_map (
113114 & format ! ( "{}.pe" , filename2) ,
114115 base. into ( ) ,
115- pe32. opt . size_of_headers . into ( ) ,
116+ align_up ! ( pe32. opt. size_of_headers, sec_allign ) as u64 ,
116117 Permission :: READ_WRITE ,
117118 )
118119 . expect ( "cannot create pe map" ) ;
@@ -152,7 +153,7 @@ impl Emu {
152153 let map = match self . maps . create_map (
153154 & format ! ( "{}{}" , filename2, sect_name) ,
154155 base as u64 + sect. virtual_address as u64 ,
155- sz ,
156+ align_up ! ( sz , sec_allign as u64 ) ,
156157 permission,
157158 ) {
158159 Ok ( m) => m,
You can’t perform that action at this time.
0 commit comments