mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:42:44 +00:00 
			
		
		
		
	 9d6372ff07
			
		
	
	
		9d6372ff07
		
	
	
	
	
		
			
			Previously, we started parsing the ELF file again in a completely different place, and without the partial mapping that we do while validating. Instead of doing manual parsing in two places, just capture the requested stack size right after we validated it.
		
			
				
	
	
		
			17 lines
		
	
	
	
		
			554 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
	
		
			554 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2020, Andrew Kaster <akaster@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/StringBuilder.h>
 | |
| #include <LibELF/ELFABI.h>
 | |
| 
 | |
| namespace ELF {
 | |
| 
 | |
| bool validate_elf_header(ElfW(Ehdr) const& elf_header, size_t file_size, bool verbose = true);
 | |
| ErrorOr<bool> validate_program_headers(ElfW(Ehdr) const& elf_header, size_t file_size, ReadonlyBytes buffer, StringBuilder* interpreter_path_builder = nullptr, Optional<size_t>* requested_stack_size = nullptr, bool verbose = true);
 | |
| 
 | |
| } // end namespace ELF
 |