Skip to content

Commit

Permalink
Changed integer constant range
Browse files Browse the repository at this point in the history
  • Loading branch information
Blank-c committed Nov 15, 2024
1 parent 2938b46 commit 9a7a89a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions BlankOBFv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,16 +202,16 @@ def visit_Constant(self, node: ast.Constant) -> ast.Constant:
if isinstance(node.value, int):
choice = random.randint(1, 2)
match choice:
case 1: # fn(x) = x*n - x*(n-1) ; Where n > 69^3
num = random.randint(69**3, sys.maxsize)
case 1: # fn(x) = x*n - x*(n-1) ; Where n > 2^16
num = random.randint(2 ** 16, sys.maxsize)
left = node.value * num
right = node.value * (num - 1)
node = ast.BinOp(left=ast.Constant(value=left),
op=ast.Sub(),
right=ast.Constant(value=right))

case 2: # fn(x) = ((n*2) + (x*2*m)) // 2 - n - x*(m-1) ; Where n > 69^3, m ∈ [50, 500]
num = random.randint(69**3, sys.maxsize)
case 2: # fn(x) = ((n*2) + (x*2*m)) // 2 - n - x*(m-1) ; Where n > 2^16, m ∈ [50, 500]
num = random.randint(2 ** 16, sys.maxsize)
times = random.randint(50, 500)
node = ast.BinOp(
left=ast.BinOp(
Expand Down

0 comments on commit 9a7a89a

Please sign in to comment.