summaryrefslogtreecommitdiffstats
path: root/md/writeup/elf_text_section.md
blob: a35c423208ab90376333c5a93da4378e0fa944be (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
title:ELF text section
keywords:elf,linux

# ELF text section
This code based on .text writable

Find out .text section and make it writable.
segmentcheck.h contains two functions

```c
int sec_text_check( FILE* );
```

check if given file have .text writable section or not. return 0 if 
fasle, 1 if true and -1 if there was some kind error.

```c
int sec_text_set( FILE* , int );
```
set section segment to writable/unwritable depends on second value
that canbe 0 or 1.
Code:
Source includes two tests for both functions.I have not tested both
functions very whell. That whay there can be some error.I have used
used that for proving concept. And have checked result with
```sh
test1
```
and
```sh
readelf -l simple
```



## Links
http://toku.es/2010/06/text-writable/

## Downloads
elf_segment.tar.gz - 
26KiB - http://archive.main.lv/files/writeup/elf_text_section/elf_segment.tar.gz