Skip to content

Commit

Permalink
Prepare project for public release
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2b3bfa0 committed Mar 21, 2023
1 parent 2f5b93b commit b97e849
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,14 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/github-script@v4
with:
script: core.setOutput('version', context.ref.replace(/refs\/tags\/v?/, ''))
id: version
- uses: docker/login-action@v1
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v4
with:
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ steps.version.outputs.version }}
ghcr.io/${{ github.repository }}:${{ github.ref_name }}
ghcr.io/${{ github.repository }}:latest
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/build-push-action@v2
- uses: docker/build-push-action@v4
id: image
- run: >-
docker run ${{ steps.image.outputs.digest }}
Expand All @@ -14,13 +13,13 @@ jobs:
--date=1970-12-31T23:59:59
--reference=255
--status=INBOUND_NOT_READ |
diff - <(printf "$RESULT")
diff - <(printenv RESULT)
env:
MESSAGE: |
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat.
RESULT: |
RESULT: |-
0307910121436587F9400B919178563412F0000007211332959500A0050003FF0201986F79B90D4AC3E7F53688FC66BFE5A0799A0E0AB7CB741668FC76CFCB637A995E9783C2E4343C3D1FA7DD6750999DA6B314F33219447E83CAE9FABCFD2683E8E536FC2D07A5DDE334394DAEBBE9A03A1DC40E8BDFF232A84C0791DFECB7BC0C6A87CFEE3028CC4EC7EB6197A24A0795DDE936284C06B5D3EE741B642FBBD3E1360B14AFA7E7
0307910121436587F9400B919178563412F000000721133295950056050003FF020240EEF79C2EAF9341657C593E4ED3C3F4F4DB0DAAB3D9E1F6F8AD6087C56F797A0E72A7E769509D0E0AB3D3F17A1A0E2AE341E53068FC6EB7DFE43768FC76CFCBF17A98EE5200
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
FROM python:2.7-alpine
WORKDIR /opt/montlhery
COPY requirements.txt .
COPY montlhery.py montlhery
WORKDIR /opt/villefort
COPY requirements.txt villefort.py .
RUN pip install --requirement requirements.txt
ENTRYPOINT ["python", "montlhery"]
ENTRYPOINT ["python", "villefort.py"]
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Montlhéry
# Villefort

Tool to generate concatenated SIM card SMS records in the EF<sub>SMS</sub> format. Named after the telegraph of Montlhéry from [Le Comte de Monte-Cristo](https://fr.wikisource.org/wiki/Le_Comte_de_Monte-Cristo/Chapitre_61).
Generate concatenated SIM card SMS records in the EF<sub>SMS</sub> format.

## Example
## Generate

Message `HELLO` with `INBOUND_NOT_READ` status, sent from `+1 987 654 3210` to `+1 012 345 6789` with reference `255` and date/time 1970-12-31 23:59:59.
_Message `HELLO` with `INBOUND_NOT_READ` status, sent from `+1 987 654 3210` to `+1 012 345 6789` with reference `255` and date/time 1970-12-31 23:59:59._

```console
$ montlhery \
$ docker run --rm ghcr.io/montlhery/villefort \
> --message=HELLO \
> --recipient=10123456789 \
> --sender=19876543210 \
Expand All @@ -17,12 +17,22 @@ $ montlhery \
0307910121436587F9400B919178563412F00000072113329595000C050003FF0101904526F309
```

## Installation
## Write

This project only supports Python 2 [(obsolete)](https://www.python.org/doc/sunset-python-2) because of the [`smspdu`](https://pypi.org/project/smspdu) package. Use the provided container images to avoid [XKCD 1987](https://xkcd.com/1987).
Use [osmocom/pysim](https://github.com/osmocom/pysim) to write SMS records to a physical SIM card.

```console
$ docker run --rm ghcr.io/0x2b3bfa0/montlhery --help
$ pySim-shell.py --pcsc-device=0
Using PC/SC reader interface
...
Welcome to pySim-shell!
% pySIM-shell (MF)> verify_chv 1234 # SIM primary PIN
CHV verification successful
% pySIM-shell (MF)> select DF.TELECOM
...
% pySIM-shell (MF/DF.TELECOM)> select EF.SMS
...
% pySIM-shell (MF/DF.TELECOM/EF.SMS)> update_record 001 0307910121436587F9400B919178563412F00000072113329595000C050003FF0101904526F309
```

## References
Expand All @@ -31,4 +41,4 @@ $ docker run --rm ghcr.io/0x2b3bfa0/montlhery --help
* [3GPP TS 24.011 V17.0.0 (2020-12) 8.2.5.2](https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1017)
* [3GPP TS 23.040 V17.1.0 (2021-06) 9.2.2.1](https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=747)
* [3GPP TS 23.040 V17.1.0 (2021-06) 9.2.3.24.1](https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=747)
* [UNDERSTANDING SMS: Practitioner's Basics](https://mobileforensics.files.wordpress.com/2007/06/understanding_sms.pdf)
* [UNDERSTANDING SMS: Practitioner's Basics](https://web.archive.org/web/20130717141618/https://mobileforensics.files.wordpress.com/2007/06/understanding_sms.pdf)
4 changes: 2 additions & 2 deletions montlhery.py → villefort.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@click.option('--reference', type=int, default=0)
@click.option('--limit', type=int, default=153)
@click.option('--status', type=click.Choice(STATUSES.keys()))
def montlhery(sender, recipient, message, date, reference, limit, status):
def main(sender, recipient, message, date, reference, limit, status):
"""
Create SMS records in the EF.SMS SIM card format.
"""
Expand All @@ -43,5 +43,5 @@ def montlhery(sender, recipient, message, date, reference, limit, status):


if __name__ == '__main__':
montlhery()
main()

0 comments on commit b97e849

Please sign in to comment.