@@ -40,13 +40,13 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen,
4040 } while (0)
4141
4242 chkaddr (0 , 0 , sizeof (* mz ));
43- if (mz -> magic != MZ_MAGIC )
43+ if (mz -> magic != IMAGE_DOS_SIGNATURE )
4444 return - ELIBBAD ;
4545 cursor = sizeof (* mz );
4646
4747 chkaddr (cursor , mz -> peaddr , sizeof (* pe ));
4848 pe = pebuf + mz -> peaddr ;
49- if (pe -> magic != PE_MAGIC )
49+ if (pe -> magic != IMAGE_NT_SIGNATURE )
5050 return - ELIBBAD ;
5151 cursor = mz -> peaddr + sizeof (* pe );
5252
@@ -55,7 +55,7 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen,
5555 pe64 = pebuf + cursor ;
5656
5757 switch (pe32 -> magic ) {
58- case PE_OPT_MAGIC_PE32 :
58+ case IMAGE_NT_OPTIONAL_HDR32_MAGIC :
5959 chkaddr (0 , cursor , sizeof (* pe32 ));
6060 ctx -> image_checksum_offset =
6161 (unsigned long )& pe32 -> csum - (unsigned long )pebuf ;
@@ -64,7 +64,7 @@ static int pefile_parse_binary(const void *pebuf, unsigned int pelen,
6464 ctx -> n_data_dirents = pe32 -> data_dirs ;
6565 break ;
6666
67- case PE_OPT_MAGIC_PE32PLUS :
67+ case IMAGE_NT_OPTIONAL_HDR64_MAGIC :
6868 chkaddr (0 , cursor , sizeof (* pe64 ));
6969 ctx -> image_checksum_offset =
7070 (unsigned long )& pe64 -> csum - (unsigned long )pebuf ;
0 commit comments