This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def import_memory_map_from_other_program( program2_name ): | |
program2_file = state.getProject().getProjectData().getRootFolder().getFile(program2_name) | |
program2 = program2_file.getImmutableDomainObject(currentProgram,ghidra.framework.model.DomainFile.DEFAULT_VERSION,monitor) | |
try: | |
# process each memory block from program2 | |
for memblock in program2.getMemory().getBlocks(): | |
#memblock = program2.getMemory().getBlocks()[0] | |
if memblock.isOverlay() or not memblock.isInitialized(): | |
print('Memblock "{}" of "{}" is overlay or not initialized. Skipping.'.format(memblock.getName(),program2_name)) | |
continue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
i=32; sudo dd if=/dev/sdb1 of=/dev/stdout bs=1 skip=$(expr 65536 + $i ) count=$(expr 4096 - $i)|python -c "import crcmod; import sys; import struct; crc32c = crcmod.predefined.Crc('crc-32c'); crc32c.update(sys.stdin.buffer.read()); final_value=struct.unpack('<I', struct.pack('>I', crc32c.crcValue))[0]; print('0x{:08x}'.format(final_value));" |