ByteBomber 2.2.1__py3-none-any.whl → 2.3.0__py3-none-any.whl

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.
bytebomber/__main__.py CHANGED
@@ -1,17 +1,12 @@
1
1
  import zipfile
2
2
  import os
3
3
  import sys
4
+ import argparse
4
5
 
5
6
  UNITS = {
6
- "B": 1,
7
- "KB": 1 << 10,
8
- "MB": 1 << 20,
9
- "GB": 1 << 30,
10
- "TB": 1 << 40,
11
- "PB": 1 << 50,
12
- "EB": 1 << 60,
13
- "ZB": 1 << 70,
14
- "YB": 1 << 80,
7
+ "B": 1, "KB": 1 << 10, "MB": 1 << 20, "GB": 1 << 30,
8
+ "TB": 1 << 40, "PB": 1 << 50, "EB": 1 << 60,
9
+ "ZB": 1 << 70, "YB": 1 << 80,
15
10
  }
16
11
 
17
12
  def progress_bar(iteration, total, bar_length=50):
@@ -30,18 +25,13 @@ def get_bytes(amount_str):
30
25
  raise ValueError("Format: <number> <unit>, e.g., 1 PB or 500 GB")
31
26
 
32
27
  def build_zip_bomb(
33
- target_input=None,
34
- payload_input=None,
35
- zip_name=None,
36
- folder_name=None,
28
+ target_input="500 GB",
29
+ payload_input="1 MB",
30
+ zip_name="bomb.zip",
31
+ folder_name="bomb-dir",
37
32
  verbose=True,
38
33
  show_progress=True
39
34
  ):
40
- target_input = target_input or input("Bomb decompressed size: ") or "500 GB"
41
- payload_input = payload_input or input("Payload file size: ") or "1 MB"
42
- zip_name = zip_name or input("Output zip name: ") or "bomb.zip"
43
- folder_name = folder_name or input("Bomb directory name: ") or "bomb-dir"
44
-
45
35
  PAYLOAD_NAME = "payload.txt"
46
36
  DECOMPRESSED_TOTAL = get_bytes(target_input)
47
37
  PAYLOAD_SIZE = get_bytes(payload_input)
@@ -69,5 +59,25 @@ def build_zip_bomb(
69
59
  if verbose:
70
60
  print(f"\n\nCreated zip bomb: {zip_name}")
71
61
 
62
+ def main():
63
+ parser = argparse.ArgumentParser(description="Create a ZIP bomb.")
64
+ parser.add_argument("-t", "--target-size", default="500 GB", help="Decompressed size (e.g., '500 GB')")
65
+ parser.add_argument("-p", "--payload-size", default="1 MB", help="Payload file size (e.g., '1 MB')")
66
+ parser.add_argument("-o", "--output", default="bomb.zip", help="Output zip filename")
67
+ parser.add_argument("-f", "--folder", default="bomb-dir", help="Folder name inside zip")
68
+ parser.add_argument("-n","--no-progress", dest="progress", action="store_false", help="Disable progress bar")
69
+ parser.add_argument("-q", "--quiet", dest="verbose", action="store_false", help="Silence output")
70
+ parser.set_defaults(progress=True, verbose=True)
71
+ args = parser.parse_args()
72
+
73
+ build_zip_bomb(
74
+ target_input=args.target_size,
75
+ payload_input=args.payload_size,
76
+ zip_name=args.output,
77
+ folder_name=args.folder,
78
+ verbose=args.verbose,
79
+ show_progress=args.progress
80
+ )
81
+
72
82
  if __name__ == "__main__":
73
83
  main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ByteBomber
3
- Version: 2.2.1
3
+ Version: 2.3.0
4
4
  Summary: ZIP bomb generator (for educational purposes only)
5
5
  License: MIT
6
6
  Project-URL: Source, https://github.com/luckalgorithm/ByteBomber
@@ -50,7 +50,7 @@ build_zip_bomb(
50
50
  | `verbose` | If `True`, shows config + summary output. Default: `True`. |
51
51
  | `show_progress` | If `True`, shows a live progress bar. Default: `True`. |
52
52
 
53
- Use the format `<number> <unit>` when entering values (e.g., `500 GB`, `1 TB`). ByteBomber supports B, KB, MB, GB, TB, PB, EB, ZB, and YB. Valuse in the GB-TB range are usaully more than enough to stress a system. Values above TB are astronomical data zizes far more than most systems can handle.
53
+ Use the format `<number> <unit>` when entering values (e.g., `500 GB`, `1 TB`). ByteBomber supports B, KB, MB, GB, TB, PB, EB, ZB, and YB. Valuse in the GB-TB range are usually more than enough to stress a system. Values above TB are astronomical data zizes far more than most systems can handle.
54
54
 
55
55
  > [!NOTE]
56
56
  > The program accepts values using standard units (e.g., MB, GB), but internally it treats them as binary units (e.g., MiB, GiB).
@@ -0,0 +1,8 @@
1
+ bytebomber/__init__.py,sha256=ry7B_o4gtFbUp_z8D3UsaoB0yO26eiUN9YDfk67ui2E,36
2
+ bytebomber/__main__.py,sha256=qep0feiQNhtgkoJQVrSnK3hWeurLHQWxgf6q4Wf_c4E,2983
3
+ bytebomber-2.3.0.dist-info/licenses/LICENSE,sha256=ZOBy1MmbOFhWGjGe0xv_g9T7SCiiq5JafpBBBp280ss,1496
4
+ bytebomber-2.3.0.dist-info/METADATA,sha256=MOPFSN-zPqtlyxf075c-dFzj1L44KTedxgQ4qPeEmCg,2803
5
+ bytebomber-2.3.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ bytebomber-2.3.0.dist-info/entry_points.txt,sha256=v7HnIUxttlBwYp_xC0K0YpXrEzIbEybt6tmbPjj8pKg,66
7
+ bytebomber-2.3.0.dist-info/top_level.txt,sha256=bDtIXh70vdwT8VslZsHHLGkV7VBuZXxk0fzN0lWv4Y4,11
8
+ bytebomber-2.3.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (79.0.0)
2
+ Generator: setuptools (80.9.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, redkitlab
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -1,8 +0,0 @@
1
- bytebomber/__init__.py,sha256=ry7B_o4gtFbUp_z8D3UsaoB0yO26eiUN9YDfk67ui2E,36
2
- bytebomber/__main__.py,sha256=EDnfKoVTJSKkFD_4bCn_4rVk3AG2WGYFtTBaU4RS8b8,2251
3
- bytebomber-2.2.1.dist-info/licenses/LICENSE,sha256=D19NENd0v-XNzdKjvdphMBIdnY-aUcaok4q32x2G-jY,1070
4
- bytebomber-2.2.1.dist-info/METADATA,sha256=uvy6TCOlTT05EaJ9QG7ESkdiMtpobFu0HDv7HrRSv3s,2803
5
- bytebomber-2.2.1.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
6
- bytebomber-2.2.1.dist-info/entry_points.txt,sha256=v7HnIUxttlBwYp_xC0K0YpXrEzIbEybt6tmbPjj8pKg,66
7
- bytebomber-2.2.1.dist-info/top_level.txt,sha256=bDtIXh70vdwT8VslZsHHLGkV7VBuZXxk0fzN0lWv4Y4,11
8
- bytebomber-2.2.1.dist-info/RECORD,,
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 luckalgorithm
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.