| OLD | NEW |
| 1 // Copyright 2015 Google Inc. All Rights Reserved. | 1 // Copyright 2015 Google Inc. All Rights Reserved. |
| 2 // | 2 // |
| 3 // Licensed under the Apache License, Version 2.0 (the "License"); | 3 // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 // you may not use this file except in compliance with the License. | 4 // you may not use this file except in compliance with the License. |
| 5 // You may obtain a copy of the License at | 5 // You may obtain a copy of the License at |
| 6 // | 6 // |
| 7 // http://www.apache.org/licenses/LICENSE-2.0 | 7 // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 // | 8 // |
| 9 // Unless required by applicable law or agreed to in writing, software | 9 // Unless required by applicable law or agreed to in writing, software |
| 10 // distributed under the License is distributed on an "AS IS" BASIS, | 10 // distributed under the License is distributed on an "AS IS" BASIS, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // @returns the corresponding module id, or kNoModuleId if the signature is | 50 // @returns the corresponding module id, or kNoModuleId if the signature is |
| 51 // unknown. | 51 // unknown. |
| 52 ModuleId Find(const pe::PEFile::Signature& signature) const; | 52 ModuleId Find(const pe::PEFile::Signature& signature) const; |
| 53 | 53 |
| 54 // Find the module id corresponding to a signature if it exists, otherwise | 54 // Find the module id corresponding to a signature if it exists, otherwise |
| 55 // index the signature and return the newly assigned module id. | 55 // index the signature and return the newly assigned module id. |
| 56 // @param signature the module's signature. | 56 // @param signature the module's signature. |
| 57 // @returns the corresponding module id. | 57 // @returns the corresponding module id. |
| 58 ModuleId FindOrIndex(const pe::PEFile::Signature& signature); | 58 ModuleId FindOrIndex(const pe::PEFile::Signature& signature); |
| 59 | 59 |
| 60 // Find and return the signature corresponding to a module @p id. |
| 61 // @param id the module identifier. |
| 62 // @param signature on success, contains the signature corresponding to module |
| 63 // @p id. |
| 64 // @returns true on success, false otherwise. |
| 60 bool Find(ModuleId id, pe::PEFile::Signature* signature) const; | 65 bool Find(ModuleId id, pe::PEFile::Signature* signature) const; |
| 61 | 66 |
| 62 private: | 67 private: |
| 63 base::hash_map<pe::PEFile::Signature, ModuleId, PESignatureHasher> | 68 base::hash_map<pe::PEFile::Signature, ModuleId, PESignatureHasher> |
| 64 signature_to_id_; | 69 signature_to_id_; |
| 65 std::vector<pe::PEFile::Signature> id_to_signature_; | 70 std::vector<pe::PEFile::Signature> id_to_signature_; |
| 66 }; | 71 }; |
| 67 | 72 |
| 68 } // namespace refinery | 73 } // namespace refinery |
| 69 | 74 |
| 70 #endif // SYZYGY_REFINERY_PROCESS_STATE_LAYER_DATA_H_ | 75 #endif // SYZYGY_REFINERY_PROCESS_STATE_LAYER_DATA_H_ |
| OLD | NEW |