chore: interact & quality

This commit is contained in:
2025-03-05 10:41:09 +08:00
parent c66529938f
commit 7d0e38e9cf
5 changed files with 17 additions and 9 deletions

View File

@@ -22,7 +22,10 @@ endif()
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_library(pycxx STATIC add_executable(pyarmor-1shot
pyarmor-1shot.cpp
ASTree.cpp
ASTNode.cpp
bytecode.cpp bytecode.cpp
data.cpp data.cpp
pyc_code.cpp pyc_code.cpp
@@ -61,8 +64,5 @@ add_library(pycxx STATIC
bytes/python_3_13.cpp bytes/python_3_13.cpp
) )
add_executable(pyarmor-1shot pyarmor-1shot.cpp ASTree.cpp ASTNode.cpp)
target_link_libraries(pyarmor-1shot pycxx)
install(TARGETS pyarmor-1shot install(TARGETS pyarmor-1shot
RUNTIME DESTINATION bin) RUNTIME DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/helpers)

View File

@@ -15,7 +15,7 @@ mkdir build
cd build cd build
cmake .. cmake ..
cmake --build . cmake --build .
mv pyarmor-1shot[.exe] ../helpers cmake --install .
``` ```
## Usage ## Usage

View File

@@ -44,7 +44,7 @@ class RuntimeInfo:
break break
return f'''\ return f'''\
======================== ========================
PyArmor Runtime ({'Trial' if trial else self.serial_number}) Information: Pyarmor Runtime ({'Trial' if trial else self.serial_number}) Information:
Product: {product} Product: {product}
AES key: {self.runtime_aes_key.hex()} AES key: {self.runtime_aes_key.hex()}
Mix string AES nonce: {self.mix_str_aes_nonce().hex()} Mix string AES nonce: {self.mix_str_aes_nonce().hex()}

View File

@@ -126,6 +126,9 @@ def main():
| | |__/ | | | | |__/ | |
|__|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|__| |__|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|__|
(____) (____) (____) (____)
For technology exchange only. Use at your own risk.
GitHub: https://github.com/Lil-House/Pyarmor-Static-Unpack-1shot
''') ''')
if args.runtime: if args.runtime:
@@ -200,7 +203,12 @@ def main():
# TODO: is Nuitka package? # TODO: is Nuitka package?
# TODO: is pyc or single marshalled binary? # TODO: is pyc or single marshalled binary?
# print(runtimes, [(i[0], i[1][:16]) for i in sequences], args.output_dir or args.directory) if not runtimes:
logger.error('No runtime found')
return
if not sequences:
logger.error('No armored data found')
return
decrypt_process(runtimes, sequences, args) decrypt_process(runtimes, sequences, args)

View File

@@ -178,7 +178,7 @@ void PycCode::pyarmorDecryptCoCode(unsigned long consts_index, PycModule *mod)
return; return;
} }
PyarmorCoDescriptor *desc = (PyarmorCoDescriptor *)(descriptor_str.data() + 8); const PyarmorCoDescriptor *desc = (const PyarmorCoDescriptor *)(descriptor_str.data() + 8);
bool copy_prologue = desc->flags & 0x8; bool copy_prologue = desc->flags & 0x8;
bool xor_aes_nonce = desc->flags & 0x4; bool xor_aes_nonce = desc->flags & 0x4;
bool short_code = desc->flags & 0x2; bool short_code = desc->flags & 0x2;