-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Heap analysis #1785
Draft
zer1t0
wants to merge
181
commits into
Gallopsled:dev
Choose a base branch
from
zer1t0:heap_analysis
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Heap analysis #1785
Changes from 1 commit
Commits
Show all changes
181 commits
Select commit
Hold shift + click to select a range
1c83fbb
added MemoryMap classes to util.proc
zer1t0 3beff0d
added maps method to process
zer1t0 5c434d0
changed path access from process to MemoryAccess through proc module
zer1t0 88fbc55
fixed test in process.maps with uncommon binary path
zer1t0 18a689c
added MemoryMaps instead of list of MemoryMap
zer1t0 e1d7340
added heap module
f558916
added method to process to return the heap explorer
56dc290
added construct dependency
66775af
resolved heap import problems
3546228
added __str__ methods to heap items
1e89373
added __str__ methods to heap items
912a5ae
updated MemoryMaps
fb89d38
added rst file for heap module
028fd38
added heap_explorer to heap.rst
af2dda7
removed arguments from HeapExplorer in heap.rst
3f63324
added malloc_chunk to heap documentation
9d75ac5
added heap class to heap documentation
7cb4eed
added malloc state to the documentation
9b8eab1
added property attributes to malloc_stat Bins docstring
50b7d91
added bins classes to documentation
9e68270
added override of bins type in bins documentation
da01633
added explanation for non used types in bins entries
804febc
added the type of each bin entry for each bin type
0077874
added headers to separate each bin type
4dab1b3
added documentation for the arena to the rst files
91741c5
added heap module use examples
8111e59
remove TODO comments
20c4215
Merge branch 'dev' into process_maps
zer1t0 9c88b7f
fix test invalid syntax in proc.MemoryMap.is_in_range
3676de5
Merge branch 'process_maps' of https://github.com/Zer1t0/pwntools int…
62cf594
imported process into heap tests
2bbbbb1
added skip doctest in heap_explorer.tcaches()>>> try:
37e728a
added try context to test in heap_explorer.tcaches()
7b494b4
fix typo in proc.MemoryMap.is_in_range
83290a1
added public method describe to ELF to print security checks and fixe…
9b08ecd
added check in case libc is not found, as statically linked files
a7298a8
added example to arenas_count
ccce1e2
added example to HeapExplorer.malloc_state
a3a2b08
added example to HeapExplorer.heap
bced600
added example to HeapExplorer.unsorted_bin
7e57d96
added example to HeapExplorer.small_bins
c3b82b9
added example to HeapExplorer.large_bins
81f3270
added example to HeapExplorer.fast_bins
65184f8
added example to process.heap_explorer
23fdec8
added examples to MemoryMap.address and MemoryMap.size
864bbdd
added example to MemoryMap.readable
4a616a6
added example to MemoryMap.writable
c6fa558
added example to MemoryMap.executable
0f4da5f
added example to MemoryMap.shared
a156466
added example to MemoryMap.private
7fde593
added example to MemoryMapFlags.shared
c24be31
added example to MemoryMaps.heap
d3d3d17
added example to MemoryMaps.stack
a4cfff2
refactorized MemoryMaps, added function _look_map
c60338d
added example to MemoryMaps.map_with_address
3aa3b36
added example to MemoryMaps.from_str
ab0aab0
added example to MemoryMaps.from_process
c823b4b
added example to MemoryMap.from_str
8735f2f
fixed indentation in HeapExplorer.malloc_state example
5a20b8e
fixed string format error in MemoryMaps.from_str example
8ff1c0e
added exception process._libc (and therefore process.libc) in case of…
a052c0e
added process detail to the libc exception
99e3a60
added addresss details to the MemoryMaps.map_with_address exception
b590b44
modify example of MemoryMaps.map_with_address
1f5cd36
changed heap examples process to sh
5b6cf77
removed __repr__ from SmallBins
1a3aec8
removed __repr__ from UnsortedBin
a6011df
increased scope of HeapExplorer.heap example
9af661b
removed __repr__ from LargeBin
e07e420
added explicit imports to heap.malloc_state.malloc_state.parser
be6eec2
added explicit imports to heap.malloc_state.malloc_state.__init__
5be297c
added explicit imports to heap.malloc_state.fastbinsy
0333430
added explicit imports to heap.malloc_state.bins.parser
8067c92
added explicit imports to heap.malloc_state.bins.bins and set descrip…
648ea2d
added explicit imports to heap.malloc_state.bins.__init__
6274f80
added explicit imports to heap.malloc_state.__init__
ffe1a76
added explicit imports to heap.heap.heap_info.py
f558e7b
added explicit imports to heap.heap.heap_parser
02c3b96
added explicit imports to heap.heap.__init__
5b6210b
added explicit imports to heap.process_informer
a1e8d59
added explicit imports to heap.malloc_chunk
6d5c86d
added explicit imports to heap.arena.arena
a60b5a5
added explicit imports to heap.arena.parser
c8eb681
added explicit imports to heap.arena.__init__
da3e48e
added explicit imports to heap.bins.bin_parser
646950e
added explicit imports to heap.bins.fast_bin
e1c1bfa
added explicit imports to heap.bins.larg_bin
09caa63
added explicit imports to heap.bins.small_bin
1e3b1ee
added explicit imports to heap.bins.unsorted_bin
0f7dc29
added explicit imports to heap.bins.tcache.tcache_per_thread_struct
345f22f
added explicit imports to heap.bins.tcache.tcache and moved TcacheEnt…
d742609
fixed imports to heap.bins.tcache.tcache_per_thread_struct
c83128f
added explicit imports to heap.bins.tcache.parser
af0b035
added explicit imports to heap.bins.tcache.__init__
87093e7
added explicit imports to heap.bins.__init__
be04ecc
fixed imports in heap.bins.__init__ and heap.bins.tcache.__init__
0c2c5ac
added explicit imports to heap.bins.heap_explorer
6c97800
added imports to heap.__init__
9696b86
expanded heap_explorer.arena example scope
7c9258e
fixed import in heap.heap_explorer
dac4486
removed unused functions from heap.utils
badf8d1
removed unused method __repr__ of MallocState and __str__ of malloc_s…
19b1fe7
added examples to all public methods of HeapExplorer
3c2a72f
included NoTcacheError in heap.__init__
1edb105
added initialization to cat in process examples
30e85e4
removed Fastbin.__repr__
a882946
removed TcachePerthreadStruct.__repr__
0e4ca38
added code to examples to make sh use the heap and the bins
58d48e6
added coverage for bin arrays
b059668
expanded scope of MemoryMaps example
9c71609
changed process.libc example to python
43a1e2f
fix raise NotImplementedError in TcacheParser
96f3b0e
fix format in heap.arena.arena and heap.heap.heap_parser
9e6f363
added __all__ to heap.__init__
52475db
added __all__ to heap __init__ files
fad98c0
added IOError exception handler in bins parser (bin, fast and tcache)…
zer1t0 bf30ad4
use #: to document Arena attributes
zer1t0 8a6f2a3
use #: to document Bin attributes
zer1t0 8d2b625
use #: to document fast bin attributes
zer1t0 4e5b059
fix error in FastBinEntry
zer1t0 2cdf58d
use #: to document large bin attributes
zer1t0 b3eec70
use #: to document small bin attributes
zer1t0 42df6d3
use #: to document unsorted bin attributes
zer1t0 20f7087
use #: to document tcache attributes
zer1t0 a271f45
use #: to document tcache per thread struct attributes
zer1t0 85aa480
use #: to document heap attributes
zer1t0 3d1540d
use #: to document HeapInfo attributes
zer1t0 10c3624
use #: to document malloc state bins attributes
zer1t0 d02de96
use #: to document malloc state fastbinsy attributes
zer1t0 d74886b
use #: to document malloc chunk attributes
zer1t0 f846e68
use #: to document malloc state attributes
zer1t0 239e7f0
use #: to document heap explorer attributes
zer1t0 21b6782
create glmalloc module
zer1t0 3cdf2e0
fix imports in glmalloc files
zer1t0 57b9d69
add glmalloc to docs
zer1t0 e718743
reorganize heap documentation
zer1t0 4a5a821
add timeout to process heap_explorer
zer1t0 3313ac2
create _waitfor_libc method in process
zer1t0 d8f5f64
change heap_explorer to a method in examples
zer1t0 88fe03d
establish minimum width in heap messages
zer1t0 f594775
use ellipsis in heap_explorer examples
zer1t0 2941124
set glmalloc examples as code-blocks
zer1t0 782b4dd
remove SKIP from glmalloc examples
zer1t0 d8b65e8
set heap_explorer parsers as properties
zer1t0 8ee042e
create HeapError
zer1t0 cb05671
fix error loading heap_explorer without [heap] map
zer1t0 81fcb68
add HeapError to documentation
zer1t0 c76ba7e
add tcache parameter to process.heap_explorer
zer1t0 2d73b93
add safe-link demangling in tcaches
zer1t0 5fa91d1
add demangle and tcaches parameters to process
zer1t0 47e2358
add safe-link demangle to fast bins
zer1t0 52ee590
use fd_demangled in tcache parser
zer1t0 a289588
simplify tcaches check in heap explorer
zer1t0 efc2dc6
print correctly bins with safe-link
zer1t0 2905261
change demangle term by safe-link
zer1t0 689f56e
use packing in malloc chunk
zer1t0 edeca4f
use Timeout in _waitfor_libc
zer1t0 36b90b6
format import in arena.py
zer1t0 f965dc6
remove packing functions from glmalloc/utils
zer1t0 b3b5a48
pass ProcessInformer as argument to HeapExplorer
zer1t0 a33e276
remove pid from MallocChunk
zer1t0 9b9ce85
Created CoreFileInformer
zer1t0 aec1d10
get correct main heap from corefile in heap parser
zer1t0 d41ff5b
use corefile instead of process to read heap
zer1t0 79d94df
move heap_explorer to Corefile
zer1t0 1b20381
add corefile samples for heap explorer testing
zer1t0 94a8e29
add libc-2.32.so to samples
zer1t0 7f3a2cb
add custom libc_path option to heap_explorer
zer1t0 84d9ec0
add corefile as import for tests
zer1t0 ac28007
add fast bins corefile
zer1t0 307a479
put tests in methods
zer1t0 1e52515
remove maps from CoreFileInformer
zer1t0 ea696ca
move test samples to pwnlib.data.heap
zer1t0 c3d246a
change process mappings for corefile mappings
zer1t0 0ca2072
remove MemoryMaps
zer1t0 7817933
use ProcessInformer to parse process memory
zer1t0 aedf3b8
change 126 number for constant
zer1t0 32e0e1f
handle gracefully get_libc_version_from_name
zer1t0 3ec9aff
add libc_version parameter to manually indicate the libc version
zer1t0 13d3555
put elf.describe as an exclusive example
zer1t0 72d99e4
add corefile tests for all HeapExplorer public methods
zer1t0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
added maps method to process
- Loading branch information
commit 3beff0dca0671cca78ad325aab5db8db35502a4d
There are no files selected for viewing
This file contains 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use
self.corefile.mappings
orself.corefile.maps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have parsed the maps and transform them in corefile.Mappings in c3d246a, since by creating a corefile some information is lost, like the name of the heap map. Moreover, creating a corefile to inspect the maps is annoying, since it creates a core file in the directory (and many if this is invoked many times).