File tree Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Expand file tree Collapse file tree 1 file changed +15
-13
lines changed Original file line number Diff line number Diff line change 3
3
4
4
// TODO: panics with unwrap on None for apisetschema.dll, fhuxgraphics.dll and some others
5
5
6
- use core:: cmp:: max;
7
-
8
6
use alloc:: borrow:: Cow ;
9
7
use alloc:: string:: String ;
10
8
use alloc:: vec:: Vec ;
9
+ use core:: cmp:: max;
10
+
11
+ use log:: debug;
11
12
use log:: warn;
13
+ use scroll:: { ctx, Pwrite } ;
14
+
15
+ use crate :: container;
16
+ use crate :: error;
17
+ use crate :: pe:: utils:: pad;
18
+ use crate :: strtab;
12
19
13
20
pub mod authenticode;
14
21
pub mod certificate_table;
@@ -29,15 +36,6 @@ pub mod symbol;
29
36
pub mod tls;
30
37
pub mod utils;
31
38
32
- use crate :: container;
33
- use crate :: error;
34
- use crate :: pe:: utils:: pad;
35
- use crate :: strtab;
36
-
37
- use scroll:: { ctx, Pwrite } ;
38
-
39
- use log:: debug;
40
-
41
39
#[ derive( Debug ) ]
42
40
/// An analyzed PE32/PE32+ binary
43
41
pub struct PE < ' a > {
@@ -142,7 +140,7 @@ impl<'a> PE<'a> {
142
140
return Err ( error:: Error :: Malformed ( format ! (
143
141
"Unsupported header magic ({:#x})" ,
144
142
magic
145
- ) ) )
143
+ ) ) ) ;
146
144
}
147
145
} ;
148
146
@@ -268,7 +266,11 @@ impl<'a> PE<'a> {
268
266
bytes,
269
267
certificate_table. virtual_address ,
270
268
certificate_table. size ,
271
- ) ?;
269
+ )
270
+ . unwrap_or_else ( |err| {
271
+ warn ! ( "Cannot parse CertificateTable: {:?}" , err) ;
272
+ Default :: default ( )
273
+ } ) ;
272
274
273
275
certificate_table. size as usize
274
276
} else {
You can’t perform that action at this time.
0 commit comments