MCPcopy
hub / github.com/Gallopsled/pwntools / _arch_header

Function _arch_header

pwnlib/asm.py:342–366  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

340
341
342def _arch_header():
343 prefix = ['.section .shellcode,"awx"',
344 '.global _start',
345 '.global __start',
346 '_start:',
347 '__start:']
348 headers = {
349 'i386' : ['.intel_syntax noprefix', '.p2align 0'],
350 'amd64' : ['.intel_syntax noprefix', '.p2align 0'],
351 'arm' : ['.syntax unified',
352 '.arch armv7-a',
353 '.arm',
354 '.p2align 2'],
355 'thumb' : ['.syntax unified',
356 '.arch armv7-a',
357 '.thumb',
358 '.p2align 2'
359 ],
360 'mips' : ['.set mips2',
361 '.set noreorder',
362 '.p2align 2'
363 ],
364 }
365
366 return '\n'.join(prefix + headers.get(context.arch, [])) + '\n'
367
368def _bfdname():
369 arch = context.arch

Callers 2

make_elfFunction · 0.85
asmFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected