Skip to content

Commit f335080

Browse files
committed
Add GitHub Actions to publish to PyPI
1 parent d627206 commit f335080

File tree

7 files changed

+82
-13
lines changed

7 files changed

+82
-13
lines changed

.github/workflows/build.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
# Skip building pull requests from the same repository
8+
if: ${{ github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
9+
runs-on: windows-2019
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
14+
- name: Python environment
15+
uses: actions/setup-python@v2
16+
with:
17+
python-version: '3.8'
18+
architecture: 'x64'
19+
20+
- name: Build
21+
run: |
22+
python setup.py develop
23+
24+
- name: StringEncryptionFun_x64
25+
run: |
26+
curl -sSOJL https://github.com/mrexodia/dumpulator/releases/download/v0.0.1/StringEncryptionFun_x64.dmp
27+
python tests/getting-started.py
28+
29+
- name: StringEncryptionFun_x86
30+
run: |
31+
curl -sSOJL https://github.com/mrexodia/dumpulator/releases/download/v0.0.1/StringEncryptionFun_x86.dmp
32+
python tests/getting-started32.py
33+
34+
publish:
35+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
36+
runs-on: ubuntu-20.04
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v2
40+
41+
- name: Python environment
42+
uses: actions/setup-python@v2
43+
with:
44+
python-version: '3.8'
45+
architecture: 'x64'
46+
47+
- name: Package
48+
run: |
49+
python setup.py sdist
50+
51+
- name: Publish to PyPI
52+
uses: pypa/gh-action-pypi-publish@master
53+
with:
54+
password: ${{ secrets.PYPI_API_TOKEN }}
55+
56+
- name: Release
57+
uses: softprops/action-gh-release@v1
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[metadata]
44
name = dumpulator
5-
version = 0.0.2
5+
version = v0.0.3
66
author = Duncan Ogilvie
77
author_email = [email protected]
88
description = An easy-to-use library for emulating code in minidump files.
@@ -22,8 +22,8 @@ package_dir =
2222
packages = find:
2323
python_requires = >=3.6
2424
install_requires =
25-
#minidump ==0.0.21 # this library has a bug, is vendored locally
26-
unicorn >=1.0.3
25+
#minidump ~=0.0.21 # this library has a bug, is vendored locally
26+
unicorn ~=1.0.3
2727
pefile >=2021.9.3
2828

2929
[options.packages.find]

setup.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
#!/usr/bin/env python
22

3-
# Source: https://stackoverflow.com/a/62983901/1806760
3+
# Based on: https://stackoverflow.com/a/62983901/1806760
44

55
import setuptools
6+
import os
67

78
if __name__ == "__main__":
9+
ref_name = os.getenv("GITHUB_REF_NAME")
10+
if ref_name:
11+
from pkg_resources import parse_version
12+
try:
13+
parse_version(ref_name)
14+
print(f"injecting version = {ref_name} into setup.cfg")
15+
with open("setup.cfg", "r") as f:
16+
lines = f.readlines()
17+
with open("setup.cfg", "w") as f:
18+
for line in lines:
19+
if line.startswith("version = "):
20+
line = f"version = {ref_name}\n"
21+
f.write(line)
22+
except:
23+
pass
24+
825
setuptools.setup()

src/dumpulator/dumpulator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ def __init__(self, uc: Uc, x64):
7575
"edx": UC_X86_REG_EDX,
7676
"eflags": UC_X86_REG_EFLAGS,
7777
"eip": UC_X86_REG_EIP,
78-
"eiz": UC_X86_REG_EIZ,
7978
"es": UC_X86_REG_ES,
8079
"esi": UC_X86_REG_ESI,
8180
"esp": UC_X86_REG_ESP,

tests/emulate-process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from dumpulator import Dumpulator
22

3-
dp = Dumpulator("test.dmp", trace=False)
3+
dp = Dumpulator("StringEncryptionFun_x64.dmp")
44
dp.start(dp.regs.rip)

tests/emulate-process32.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from dumpulator import Dumpulator
22

3-
dp = Dumpulator("stringenc32_entry.dmp", trace=True)
3+
dp = Dumpulator("StringEncryptionFun_x86.dmp")
44
dp.start(dp.regs.eip, count=0)

tests/getting-started32.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
from dumpulator import Dumpulator
22

33
dp = Dumpulator("StringEncryptionFun_x86.dmp")
4-
x = dp.regs.csp
5-
print(dp.regs.csp)
6-
x -= 4
7-
dp.regs.csp = x
8-
print(dp.regs.csp)
94
temp_addr = dp.allocate(256)
10-
print(f"temp_addr: {temp_addr:0x}")
115
dp.call(0x401000, [temp_addr, 0x413000])
126
decrypted = dp.read_str(temp_addr)
137
print(f"decrypted: '{decrypted}'")

0 commit comments

Comments
 (0)