Skip to content

Commit f5062f7

Browse files
authored
Merge pull request Gallopsled#1274 from Gallopsled/stable
Merge travis-ci related changes on stable into dev
2 parents 5fa4fcd + 547905f commit f5062f7

File tree

7 files changed

+34
-18
lines changed

7 files changed

+34
-18
lines changed

.travis.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dist: trusty
1+
dist: xenial
22
language: python
33
addons:
44
apt:
@@ -13,15 +13,22 @@ addons:
1313
- zsh
1414
- pandoc
1515
- gdb
16+
- binutils
17+
- qemu-user-static
18+
- binutils-multiarch
19+
- binutils-aarch64-linux-gnu
20+
- binutils-arm-linux-gnueabihf
21+
- binutils-mips-linux-gnu
22+
- binutils-powerpc-linux-gnu
1623
cache:
1724
- pip
1825
- directories:
1926
- usr
20-
- /home/travis/virtualenv/python2.7.13/lib/python2.7/site-packages/
21-
- /home/travis/virtualenv/python2.7.13/bin/
27+
- /home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/
28+
- /home/travis/virtualenv/python2.7.15/bin/
2229
sudo: required
2330
python:
24-
- "2.7"
31+
- "2.7.15"
2532
before_install:
2633
- echo $-
2734
- source travis/install.sh

docs/source/util/proc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.. testsetup:: *
22

33
from pwnlib.util.proc import *
4+
from pwnlib.tubes.process import process
45
import os, sys
56

67

pwnlib/asm.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
To disassemble code, simply invoke :func:`disasm` on the bytes to disassemble.
3737
3838
>>> disasm('\xb8\x0b\x00\x00\x00')
39-
' 0: b8 0b 00 00 00 mov eax,0xb'
39+
' 0: b8 0b 00 00 00 mov eax, 0xb'
4040
4141
"""
4242
from __future__ import absolute_import
@@ -735,15 +735,15 @@ def disasm(data, vma = 0, byte = True, offset = True, instructions = True):
735735
Examples:
736736
737737
>>> print disasm('b85d000000'.decode('hex'), arch = 'i386')
738-
0: b8 5d 00 00 00 mov eax,0x5d
738+
0: b8 5d 00 00 00 mov eax, 0x5d
739739
>>> print disasm('b85d000000'.decode('hex'), arch = 'i386', byte = 0)
740-
0: mov eax,0x5d
740+
0: mov eax, 0x5d
741741
>>> print disasm('b85d000000'.decode('hex'), arch = 'i386', byte = 0, offset = 0)
742-
mov eax,0x5d
742+
mov eax, 0x5d
743743
>>> print disasm('b817000000'.decode('hex'), arch = 'amd64')
744-
0: b8 17 00 00 00 mov eax,0x17
744+
0: b8 17 00 00 00 mov eax, 0x17
745745
>>> print disasm('48c7c017000000'.decode('hex'), arch = 'amd64')
746-
0: 48 c7 c0 17 00 00 00 mov rax,0x17
746+
0: 48 c7 c0 17 00 00 00 mov rax, 0x17
747747
>>> print disasm('04001fe552009000'.decode('hex'), arch = 'arm')
748748
0: e51f0004 ldr r0, [pc, #-4] ; 0x4
749749
4: 00900052 addseq r0, r0, r2, asr r0
@@ -814,4 +814,4 @@ def disasm(data, vma = 0, byte = True, offset = True, instructions = True):
814814
line += i
815815
lines.append(line)
816816

817-
return '\n'.join(lines)
817+
return re.sub(',([^ ])', r', \1', '\n'.join(lines))

pwnlib/shellcraft/templates/thumb/linux/findpeer.asm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
<% from pwnlib.shellcraft.thumb.linux import mov %>
1+
<% from pwnlib.shellcraft.thumb import mov %>
22
<% from socket import htons %>
33
<%page args="port = None"/>
44
<%docstring>
55
findpeer(port)
66

77
Finds a connected socket. If port is specified it is checked
88
against the peer port. Resulting socket is left in r6.
9+
10+
Example:
11+
>>> enhex(asm(shellcraft.findpeer(1337)))
12+
'6ff00006ee4606f101064ff001074fea072707f11f07f54630461fb401a96a4601df0130efdd01994fea11414ff039024fea022202f105029142e4d1'
913
</%docstring>
1014
findpeer:
1115
/* File descriptor in r6 */
@@ -52,7 +56,7 @@ compare_port:
5256
ldr r1, [sp, #4]
5357
lsr r1, #16
5458

55-
/* Put the port (${port}) to search for into r1 */
59+
/* Put the port (${port}) to search for into r2 */
5660
${mov('r2', htons(int(port)))}
5761

5862
/* Is it the one we have been searching for? */

pwnlib/shellcraft/templates/thumb/linux/listen.asm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
<% from pwnlib.shellcraft.thumb.linux import mov %>
1+
<% from pwnlib.shellcraft.thumb import mov %>
22
<% from socket import htons %>
33
<%page args="port, network='ipv4'"/>
44
<%docstring>
55
listen(port,network)
66

77
Listens on a TCP port, accept a client and leave his socket in r6.
88
Port is the TCP port to listen on, network is either 'ipv4' or 'ipv6'.
9+
10+
Example:
11+
>>> enhex(asm(shellcraft.listen(1337, 'ipv4')))
12+
'4ff001074fea072707f119074ff002004ff0010182ea020201df0646004901e00200053906b469464ff0100207f1010701df30464ff0010107f1020701df304681ea010182ea020207f1010701df0646'
913
</%docstring>
1014
/* First create listening socket */
1115
${mov('r7', 'SYS_socket')}

pwnlib/util/proc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ def name(pid):
100100
Name of process as listed in ``/proc/<pid>/status``.
101101
102102
Example:
103-
>>> pid = pidof('init')[0]
104-
>>> name(pid) == 'init'
105-
True
103+
>>> p = process('cat')
104+
>>> name(p.pid)
105+
'cat'
106106
"""
107107
return psutil.Process(pid).name()
108108

travis/install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ setup_osx()
184184
}
185185

186186
if [[ "$USER" == "travis" ]]; then
187-
setup_travis
187+
# setup_travis
188188
setup_android_emulator
189189
elif [[ "$USER" == "shippable" ]]; then
190190
sudo apt-get update

0 commit comments

Comments
 (0)