Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.DS_Store
__pycache__/
6 changes: 5 additions & 1 deletion esp32_image_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@
import os, argparse
from makeelf.elf import *
from esptool import *
from esptool.bin_image import *
from esp32_firmware_reader import *
from read_nvs import *

symbols_dump = os.path.dirname(os.path.realpath(__file__)) + "/symbols_dump.txt"

def image_base_name(path):
filename_w_ext = os.path.basename(path)
filename, ext = os.path.splitext(filename_w_ext)
Expand Down Expand Up @@ -52,6 +55,7 @@ def image2elf(filename, output_file, verbose=False):
# maps segment names to ELF sections
section_map = {
'DROM' : '.flash.rodata',
'BYTE_ACCESSIBLE, DRAM' : '.dram0.data',
'BYTE_ACCESSIBLE, DRAM, DMA': '.dram0.data',
'IROM' : '.flash.text',
#'RTC_IRAM' : '.rtc.text' TODO
Expand Down Expand Up @@ -186,7 +190,7 @@ def image2elf(filename, output_file, verbose=False):

def add_elf_symbols(elf):

fh = open("symbols_dump.txt", "r")
fh = open(symbols_dump, "r")
lines = fh.readlines()

bind_map = {"LOCAL" : STB.STB_LOCAL, "GLOBAL" : STB.STB_GLOBAL}
Expand Down