gef-file-to-map 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- gef_file_to_map-0.1.0/.github/workflows/release_pypi.yaml +74 -0
- gef_file_to_map-0.1.0/.gitignore +17 -0
- gef_file_to_map-0.1.0/Cargo.lock +349 -0
- gef_file_to_map-0.1.0/Cargo.toml +29 -0
- gef_file_to_map-0.1.0/LICENSE +21 -0
- gef_file_to_map-0.1.0/PKG-INFO +36 -0
- gef_file_to_map-0.1.0/README.md +21 -0
- gef_file_to_map-0.1.0/dist/gef_file_to_map-0.1.0.tar.gz +0 -0
- gef_file_to_map-0.1.0/pyproject.toml +21 -0
- gef_file_to_map-0.1.0/run-maturin-action.sh +15 -0
- gef_file_to_map-0.1.0/src/error.rs +22 -0
- gef_file_to_map-0.1.0/src/header.rs +369 -0
- gef_file_to_map-0.1.0/src/lib.rs +77 -0
- gef_file_to_map-0.1.0/src/nom.rs +7 -0
- gef_file_to_map-0.1.0/tests/test.gef +1534 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
name: Test & Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
tags:
|
|
8
|
+
- "v*"
|
|
9
|
+
pull_request:
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
linux:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v3
|
|
16
|
+
- uses: PyO3/maturin-action@v1
|
|
17
|
+
with:
|
|
18
|
+
manylinux: auto
|
|
19
|
+
command: build
|
|
20
|
+
args: --release --sdist -o dist --find-interpreter
|
|
21
|
+
- name: Upload wheels
|
|
22
|
+
uses: actions/upload-artifact@v3
|
|
23
|
+
with:
|
|
24
|
+
name: wheels
|
|
25
|
+
path: dist
|
|
26
|
+
|
|
27
|
+
windows:
|
|
28
|
+
runs-on: windows-latest
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v3
|
|
31
|
+
- uses: PyO3/maturin-action@v1
|
|
32
|
+
with:
|
|
33
|
+
command: build
|
|
34
|
+
args: --release -o dist --find-interpreter
|
|
35
|
+
- name: Upload wheels
|
|
36
|
+
uses: actions/upload-artifact@v3
|
|
37
|
+
with:
|
|
38
|
+
name: wheels
|
|
39
|
+
path: dist
|
|
40
|
+
|
|
41
|
+
macos:
|
|
42
|
+
runs-on: macos-latest
|
|
43
|
+
steps:
|
|
44
|
+
- uses: actions/checkout@v3
|
|
45
|
+
- uses: PyO3/maturin-action@v1
|
|
46
|
+
with:
|
|
47
|
+
command: build
|
|
48
|
+
args: --release -o dist --universal2 --find-interpreter
|
|
49
|
+
- name: Upload wheels
|
|
50
|
+
uses: actions/upload-artifact@v3
|
|
51
|
+
with:
|
|
52
|
+
name: wheels
|
|
53
|
+
path: dist
|
|
54
|
+
|
|
55
|
+
release:
|
|
56
|
+
name: Release
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
needs:
|
|
59
|
+
- macos
|
|
60
|
+
- windows
|
|
61
|
+
- linux
|
|
62
|
+
if: "startsWith(github.ref, 'refs/tags/')"
|
|
63
|
+
steps:
|
|
64
|
+
- uses: actions/download-artifact@v2
|
|
65
|
+
with:
|
|
66
|
+
name: wheels
|
|
67
|
+
- uses: actions/setup-python@v2
|
|
68
|
+
- name: Publish to PyPi
|
|
69
|
+
env:
|
|
70
|
+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
|
71
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
72
|
+
run: |
|
|
73
|
+
pip install --upgrade twine
|
|
74
|
+
twine upload --skip-existing *
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Generated by Cargo
|
|
2
|
+
# will have compiled files and executables
|
|
3
|
+
/target/
|
|
4
|
+
|
|
5
|
+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
|
6
|
+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
|
7
|
+
Cargo.lock
|
|
8
|
+
|
|
9
|
+
# These are backup files generated by rustfmt
|
|
10
|
+
**/*.rs.bk
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# Added by cargo
|
|
14
|
+
|
|
15
|
+
/target
|
|
16
|
+
|
|
17
|
+
.env
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
# This file is automatically @generated by Cargo.
|
|
2
|
+
# It is not intended for manual editing.
|
|
3
|
+
version = 3
|
|
4
|
+
|
|
5
|
+
[[package]]
|
|
6
|
+
name = "autocfg"
|
|
7
|
+
version = "1.1.0"
|
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
+
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
|
10
|
+
|
|
11
|
+
[[package]]
|
|
12
|
+
name = "bitflags"
|
|
13
|
+
version = "1.3.2"
|
|
14
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
15
|
+
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
|
|
16
|
+
|
|
17
|
+
[[package]]
|
|
18
|
+
name = "cargo-husky"
|
|
19
|
+
version = "1.5.0"
|
|
20
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
21
|
+
checksum = "7b02b629252fe8ef6460461409564e2c21d0c8e77e0944f3d189ff06c4e932ad"
|
|
22
|
+
|
|
23
|
+
[[package]]
|
|
24
|
+
name = "cfg-if"
|
|
25
|
+
version = "1.0.0"
|
|
26
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
27
|
+
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
|
28
|
+
|
|
29
|
+
[[package]]
|
|
30
|
+
name = "either"
|
|
31
|
+
version = "1.8.1"
|
|
32
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
33
|
+
checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91"
|
|
34
|
+
|
|
35
|
+
[[package]]
|
|
36
|
+
name = "gef-file-to-map"
|
|
37
|
+
version = "0.1.0"
|
|
38
|
+
dependencies = [
|
|
39
|
+
"cargo-husky",
|
|
40
|
+
"itertools",
|
|
41
|
+
"nom",
|
|
42
|
+
"pyo3",
|
|
43
|
+
"thiserror",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[[package]]
|
|
47
|
+
name = "indoc"
|
|
48
|
+
version = "1.0.9"
|
|
49
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
50
|
+
checksum = "bfa799dd5ed20a7e349f3b4639aa80d74549c81716d9ec4f994c9b5815598306"
|
|
51
|
+
|
|
52
|
+
[[package]]
|
|
53
|
+
name = "itertools"
|
|
54
|
+
version = "0.10.5"
|
|
55
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
56
|
+
checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
|
|
57
|
+
dependencies = [
|
|
58
|
+
"either",
|
|
59
|
+
]
|
|
60
|
+
|
|
61
|
+
[[package]]
|
|
62
|
+
name = "libc"
|
|
63
|
+
version = "0.2.139"
|
|
64
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
65
|
+
checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79"
|
|
66
|
+
|
|
67
|
+
[[package]]
|
|
68
|
+
name = "lock_api"
|
|
69
|
+
version = "0.4.9"
|
|
70
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
71
|
+
checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
|
|
72
|
+
dependencies = [
|
|
73
|
+
"autocfg",
|
|
74
|
+
"scopeguard",
|
|
75
|
+
]
|
|
76
|
+
|
|
77
|
+
[[package]]
|
|
78
|
+
name = "memchr"
|
|
79
|
+
version = "2.5.0"
|
|
80
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
81
|
+
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
|
|
82
|
+
|
|
83
|
+
[[package]]
|
|
84
|
+
name = "memoffset"
|
|
85
|
+
version = "0.8.0"
|
|
86
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
87
|
+
checksum = "d61c719bcfbcf5d62b3a09efa6088de8c54bc0bfcd3ea7ae39fcc186108b8de1"
|
|
88
|
+
dependencies = [
|
|
89
|
+
"autocfg",
|
|
90
|
+
]
|
|
91
|
+
|
|
92
|
+
[[package]]
|
|
93
|
+
name = "minimal-lexical"
|
|
94
|
+
version = "0.2.1"
|
|
95
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
96
|
+
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
|
97
|
+
|
|
98
|
+
[[package]]
|
|
99
|
+
name = "nom"
|
|
100
|
+
version = "7.1.3"
|
|
101
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
102
|
+
checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a"
|
|
103
|
+
dependencies = [
|
|
104
|
+
"memchr",
|
|
105
|
+
"minimal-lexical",
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
[[package]]
|
|
109
|
+
name = "once_cell"
|
|
110
|
+
version = "1.17.1"
|
|
111
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
112
|
+
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
|
|
113
|
+
|
|
114
|
+
[[package]]
|
|
115
|
+
name = "parking_lot"
|
|
116
|
+
version = "0.12.1"
|
|
117
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
118
|
+
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
|
|
119
|
+
dependencies = [
|
|
120
|
+
"lock_api",
|
|
121
|
+
"parking_lot_core",
|
|
122
|
+
]
|
|
123
|
+
|
|
124
|
+
[[package]]
|
|
125
|
+
name = "parking_lot_core"
|
|
126
|
+
version = "0.9.7"
|
|
127
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
128
|
+
checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521"
|
|
129
|
+
dependencies = [
|
|
130
|
+
"cfg-if",
|
|
131
|
+
"libc",
|
|
132
|
+
"redox_syscall",
|
|
133
|
+
"smallvec",
|
|
134
|
+
"windows-sys",
|
|
135
|
+
]
|
|
136
|
+
|
|
137
|
+
[[package]]
|
|
138
|
+
name = "proc-macro2"
|
|
139
|
+
version = "1.0.51"
|
|
140
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
141
|
+
checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6"
|
|
142
|
+
dependencies = [
|
|
143
|
+
"unicode-ident",
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
[[package]]
|
|
147
|
+
name = "pyo3"
|
|
148
|
+
version = "0.18.1"
|
|
149
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
150
|
+
checksum = "06a3d8e8a46ab2738109347433cb7b96dffda2e4a218b03ef27090238886b147"
|
|
151
|
+
dependencies = [
|
|
152
|
+
"cfg-if",
|
|
153
|
+
"indoc",
|
|
154
|
+
"libc",
|
|
155
|
+
"memoffset",
|
|
156
|
+
"parking_lot",
|
|
157
|
+
"pyo3-build-config",
|
|
158
|
+
"pyo3-ffi",
|
|
159
|
+
"pyo3-macros",
|
|
160
|
+
"unindent",
|
|
161
|
+
]
|
|
162
|
+
|
|
163
|
+
[[package]]
|
|
164
|
+
name = "pyo3-build-config"
|
|
165
|
+
version = "0.18.1"
|
|
166
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
167
|
+
checksum = "75439f995d07ddfad42b192dfcf3bc66a7ecfd8b4a1f5f6f046aa5c2c5d7677d"
|
|
168
|
+
dependencies = [
|
|
169
|
+
"once_cell",
|
|
170
|
+
"target-lexicon",
|
|
171
|
+
]
|
|
172
|
+
|
|
173
|
+
[[package]]
|
|
174
|
+
name = "pyo3-ffi"
|
|
175
|
+
version = "0.18.1"
|
|
176
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
177
|
+
checksum = "839526a5c07a17ff44823679b68add4a58004de00512a95b6c1c98a6dcac0ee5"
|
|
178
|
+
dependencies = [
|
|
179
|
+
"libc",
|
|
180
|
+
"pyo3-build-config",
|
|
181
|
+
]
|
|
182
|
+
|
|
183
|
+
[[package]]
|
|
184
|
+
name = "pyo3-macros"
|
|
185
|
+
version = "0.18.1"
|
|
186
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
187
|
+
checksum = "bd44cf207476c6a9760c4653559be4f206efafb924d3e4cbf2721475fc0d6cc5"
|
|
188
|
+
dependencies = [
|
|
189
|
+
"proc-macro2",
|
|
190
|
+
"pyo3-macros-backend",
|
|
191
|
+
"quote",
|
|
192
|
+
"syn",
|
|
193
|
+
]
|
|
194
|
+
|
|
195
|
+
[[package]]
|
|
196
|
+
name = "pyo3-macros-backend"
|
|
197
|
+
version = "0.18.1"
|
|
198
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
199
|
+
checksum = "dc1f43d8e30460f36350d18631ccf85ded64c059829208fe680904c65bcd0a4c"
|
|
200
|
+
dependencies = [
|
|
201
|
+
"proc-macro2",
|
|
202
|
+
"quote",
|
|
203
|
+
"syn",
|
|
204
|
+
]
|
|
205
|
+
|
|
206
|
+
[[package]]
|
|
207
|
+
name = "quote"
|
|
208
|
+
version = "1.0.23"
|
|
209
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
210
|
+
checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b"
|
|
211
|
+
dependencies = [
|
|
212
|
+
"proc-macro2",
|
|
213
|
+
]
|
|
214
|
+
|
|
215
|
+
[[package]]
|
|
216
|
+
name = "redox_syscall"
|
|
217
|
+
version = "0.2.16"
|
|
218
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
219
|
+
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
|
|
220
|
+
dependencies = [
|
|
221
|
+
"bitflags",
|
|
222
|
+
]
|
|
223
|
+
|
|
224
|
+
[[package]]
|
|
225
|
+
name = "scopeguard"
|
|
226
|
+
version = "1.1.0"
|
|
227
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
228
|
+
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
|
229
|
+
|
|
230
|
+
[[package]]
|
|
231
|
+
name = "smallvec"
|
|
232
|
+
version = "1.10.0"
|
|
233
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
234
|
+
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"
|
|
235
|
+
|
|
236
|
+
[[package]]
|
|
237
|
+
name = "syn"
|
|
238
|
+
version = "1.0.107"
|
|
239
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
240
|
+
checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5"
|
|
241
|
+
dependencies = [
|
|
242
|
+
"proc-macro2",
|
|
243
|
+
"quote",
|
|
244
|
+
"unicode-ident",
|
|
245
|
+
]
|
|
246
|
+
|
|
247
|
+
[[package]]
|
|
248
|
+
name = "target-lexicon"
|
|
249
|
+
version = "0.12.6"
|
|
250
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
251
|
+
checksum = "8ae9980cab1db3fceee2f6c6f643d5d8de2997c58ee8d25fb0cc8a9e9e7348e5"
|
|
252
|
+
|
|
253
|
+
[[package]]
|
|
254
|
+
name = "thiserror"
|
|
255
|
+
version = "1.0.38"
|
|
256
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
257
|
+
checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0"
|
|
258
|
+
dependencies = [
|
|
259
|
+
"thiserror-impl",
|
|
260
|
+
]
|
|
261
|
+
|
|
262
|
+
[[package]]
|
|
263
|
+
name = "thiserror-impl"
|
|
264
|
+
version = "1.0.38"
|
|
265
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
266
|
+
checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f"
|
|
267
|
+
dependencies = [
|
|
268
|
+
"proc-macro2",
|
|
269
|
+
"quote",
|
|
270
|
+
"syn",
|
|
271
|
+
]
|
|
272
|
+
|
|
273
|
+
[[package]]
|
|
274
|
+
name = "unicode-ident"
|
|
275
|
+
version = "1.0.6"
|
|
276
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
277
|
+
checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc"
|
|
278
|
+
|
|
279
|
+
[[package]]
|
|
280
|
+
name = "unindent"
|
|
281
|
+
version = "0.1.11"
|
|
282
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
283
|
+
checksum = "e1766d682d402817b5ac4490b3c3002d91dfa0d22812f341609f97b08757359c"
|
|
284
|
+
|
|
285
|
+
[[package]]
|
|
286
|
+
name = "windows-sys"
|
|
287
|
+
version = "0.45.0"
|
|
288
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
289
|
+
checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0"
|
|
290
|
+
dependencies = [
|
|
291
|
+
"windows-targets",
|
|
292
|
+
]
|
|
293
|
+
|
|
294
|
+
[[package]]
|
|
295
|
+
name = "windows-targets"
|
|
296
|
+
version = "0.42.1"
|
|
297
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
298
|
+
checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7"
|
|
299
|
+
dependencies = [
|
|
300
|
+
"windows_aarch64_gnullvm",
|
|
301
|
+
"windows_aarch64_msvc",
|
|
302
|
+
"windows_i686_gnu",
|
|
303
|
+
"windows_i686_msvc",
|
|
304
|
+
"windows_x86_64_gnu",
|
|
305
|
+
"windows_x86_64_gnullvm",
|
|
306
|
+
"windows_x86_64_msvc",
|
|
307
|
+
]
|
|
308
|
+
|
|
309
|
+
[[package]]
|
|
310
|
+
name = "windows_aarch64_gnullvm"
|
|
311
|
+
version = "0.42.1"
|
|
312
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
313
|
+
checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608"
|
|
314
|
+
|
|
315
|
+
[[package]]
|
|
316
|
+
name = "windows_aarch64_msvc"
|
|
317
|
+
version = "0.42.1"
|
|
318
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
319
|
+
checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7"
|
|
320
|
+
|
|
321
|
+
[[package]]
|
|
322
|
+
name = "windows_i686_gnu"
|
|
323
|
+
version = "0.42.1"
|
|
324
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
325
|
+
checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640"
|
|
326
|
+
|
|
327
|
+
[[package]]
|
|
328
|
+
name = "windows_i686_msvc"
|
|
329
|
+
version = "0.42.1"
|
|
330
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
331
|
+
checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605"
|
|
332
|
+
|
|
333
|
+
[[package]]
|
|
334
|
+
name = "windows_x86_64_gnu"
|
|
335
|
+
version = "0.42.1"
|
|
336
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
337
|
+
checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45"
|
|
338
|
+
|
|
339
|
+
[[package]]
|
|
340
|
+
name = "windows_x86_64_gnullvm"
|
|
341
|
+
version = "0.42.1"
|
|
342
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
343
|
+
checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463"
|
|
344
|
+
|
|
345
|
+
[[package]]
|
|
346
|
+
name = "windows_x86_64_msvc"
|
|
347
|
+
version = "0.42.1"
|
|
348
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
349
|
+
checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd"
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "gef-file-to-map"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
|
|
6
|
+
[lib]
|
|
7
|
+
# Name of the python module
|
|
8
|
+
name = "gef_file_to_map"
|
|
9
|
+
crate-type = ["cdylib"]
|
|
10
|
+
|
|
11
|
+
[dependencies]
|
|
12
|
+
itertools = "0.10.5"
|
|
13
|
+
nom = "7.1.3"
|
|
14
|
+
pyo3 = { version = "0.18.1", features = ["extension-module", "abi3-py37"] }
|
|
15
|
+
thiserror = "1.0.38"
|
|
16
|
+
|
|
17
|
+
# Automatically add git hooks for code conventions & tests
|
|
18
|
+
[dev-dependencies.cargo-husky]
|
|
19
|
+
version = "1.5.0"
|
|
20
|
+
features = [
|
|
21
|
+
"precommit-hook",
|
|
22
|
+
"postmerge-hook",
|
|
23
|
+
"run-cargo-check",
|
|
24
|
+
"run-cargo-clippy",
|
|
25
|
+
"run-cargo-fmt",
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[package.metadata.maturin]
|
|
29
|
+
python-source = "python"
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 CEMS
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: gef-file-to-map
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Summary: Utility library for parsing .gef files
|
|
9
|
+
Keywords: gef,pygef
|
|
10
|
+
Author-email: Thomas Versteeg <t.versteeg@cemsbv.io>
|
|
11
|
+
Requires-Python: >=3.7
|
|
12
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
13
|
+
Project-URL: repository, https://github.com/cemsbv/gef-file-to-map
|
|
14
|
+
|
|
15
|
+
# gef-file-to-map
|
|
16
|
+
|
|
17
|
+
Utility library for parsing of .gef files, written for [pygef](https://github.com/cemsbv/pygef).
|
|
18
|
+
|
|
19
|
+
### Run locally
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
# Install maturin inside a Python environment
|
|
23
|
+
python3 -m venv .env
|
|
24
|
+
source .env/bin/activate
|
|
25
|
+
pip install maturin
|
|
26
|
+
|
|
27
|
+
# Create a Python package from the Rust code
|
|
28
|
+
maturin develop
|
|
29
|
+
|
|
30
|
+
# Open a GEF file locally
|
|
31
|
+
python
|
|
32
|
+
|
|
33
|
+
>>> from gef_file_to_map import parse
|
|
34
|
+
>>> gef_to_map(open('./tests/test.gef').read())
|
|
35
|
+
```
|
|
36
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# gef-file-to-map
|
|
2
|
+
|
|
3
|
+
Utility library for parsing of .gef files, written for [pygef](https://github.com/cemsbv/pygef).
|
|
4
|
+
|
|
5
|
+
### Run locally
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
# Install maturin inside a Python environment
|
|
9
|
+
python3 -m venv .env
|
|
10
|
+
source .env/bin/activate
|
|
11
|
+
pip install maturin
|
|
12
|
+
|
|
13
|
+
# Create a Python package from the Rust code
|
|
14
|
+
maturin develop
|
|
15
|
+
|
|
16
|
+
# Open a GEF file locally
|
|
17
|
+
python
|
|
18
|
+
|
|
19
|
+
>>> from gef_file_to_map import parse
|
|
20
|
+
>>> gef_to_map(open('./tests/test.gef').read())
|
|
21
|
+
```
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "gef-file-to-map"
|
|
3
|
+
version = "0.1.0"
|
|
4
|
+
description = "Utility library for parsing .gef files"
|
|
5
|
+
requires-python = ">=3.7"
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
license = { file = "LICENSE" }
|
|
8
|
+
keywords = ["gef", "pygef"]
|
|
9
|
+
authors = [{ name = "Thomas Versteeg", email = "t.versteeg@cemsbv.io" }]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Programming Language :: Rust",
|
|
12
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
13
|
+
"Programming Language :: Python :: Implementation :: PyPy",
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[project.urls]
|
|
17
|
+
repository = "https://github.com/cemsbv/gef-file-to-map"
|
|
18
|
+
|
|
19
|
+
[build-system]
|
|
20
|
+
requires = ["maturin>=0.14,<0.15"]
|
|
21
|
+
build-backend = "maturin"
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
set -e
|
|
3
|
+
echo "::group::Install Rust"
|
|
4
|
+
which rustup > /dev/null || curl --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --default-toolchain stable
|
|
5
|
+
export PATH="$HOME/.cargo/bin:$PATH"
|
|
6
|
+
rustup override set stable
|
|
7
|
+
rustup component add llvm-tools-preview || true
|
|
8
|
+
echo "::endgroup::"
|
|
9
|
+
export PATH="$PATH:/opt/python/cp36-cp36m/bin:/opt/python/cp37-cp37m/bin:/opt/python/cp38-cp38/bin:/opt/python/cp39-cp39/bin"
|
|
10
|
+
echo "::group::Install maturin"
|
|
11
|
+
curl -L https://github.com/PyO3/maturin/releases/download/v0.14.13/maturin-x86_64-unknown-linux-musl.tar.gz | tar -xz -C /usr/local/bin
|
|
12
|
+
maturin --version || true
|
|
13
|
+
which patchelf > /dev/null || python3 -m pip install patchelf
|
|
14
|
+
echo "::endgroup::"
|
|
15
|
+
maturin build --release --sdist -o dist --find-interpreter
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//! Error primitives.
|
|
2
|
+
|
|
3
|
+
use pyo3::{exceptions::PyException, PyErr};
|
|
4
|
+
use std::convert::From;
|
|
5
|
+
|
|
6
|
+
/// Alias result to always return our own error type.
|
|
7
|
+
pub(crate) type Result<T> = std::result::Result<T, Error>;
|
|
8
|
+
|
|
9
|
+
/// Error variants this library might throw.
|
|
10
|
+
#[derive(Debug, thiserror::Error)]
|
|
11
|
+
pub enum Error {
|
|
12
|
+
#[error("expected header \"{0}\" is missing")]
|
|
13
|
+
MissingHeader(String),
|
|
14
|
+
#[error("error while parsing \"{0}\"")]
|
|
15
|
+
Parsing(String),
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
impl From<Error> for PyErr {
|
|
19
|
+
fn from(err: Error) -> PyErr {
|
|
20
|
+
PyException::new_err(err.to_string())
|
|
21
|
+
}
|
|
22
|
+
}
|