command1 = f'objdump -M intel -d Binary{stage}'.split(' ')
command2 = 'grep -A30 <main>'.split(' ')

main_parse = subprocess.Popen(command1,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
obj_parse = subprocess.Popen(command2, stdin=main_parse.stdout, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
main_parse.stdout.close()

output = obj_parse.communicate()[0].decode().split('\n')[4]
buf_size = int(output.split(',')[1].strip(),16)

main_parse.kill()
obj_parse.kill()

'나 보려고 만든거' 카테고리의 다른 글

서브 도메인 설정(Apache2)  (0) 2021.07.21
Docker libc 가져오는법 정리  (0) 2021.07.19
방학동안 해야할거  (4) 2021.06.20
녹스, VMware, WSL2 hyper-v 끄고 키기  (0) 2021.05.20
Linux Named PIPE (FIFO)  (0) 2021.03.25

+ Recent posts