ergrelet / unlicense

Dynamic unpacker and import fixer for Themida/WinLicense 2.x and 3.x.
GNU General Public License v3.0
945 stars 181 forks source link

running unlicense has no output and effect #64

Closed danyhm closed 11 months ago

danyhm commented 1 year ago

Hello,

since some previous commits , running and installing unlicense with pip as described in the readme has no effect and no output on the console. it installs fine but when running the tool it generates no output.

pip install git+https://github.com/ergrelet/unlicense.git

succesfull install and then

C:\path>unlicense target.dll --verbose

C:\path>
danyhm commented 1 year ago

it seems this is an issue since commit b373d5628f807013c629a1e6b6154956a3dd77ee

danyhm commented 1 year ago

https://github.com/ergrelet/unlicense/blob/217d0d66c57b5deae45f8abd05c851a0bb3b0e6e/unlicense/version_detection.py#L13

restoring this line seems to fix the problem, however I have to manually give the target version

# Version 3.x
    try:
    # Note: The '.boot' section might not always be present, so we do not check
        _themida_section = binary.get_section(".themida")       
        return 3

    except lief.not_found:
        # Not Themida 3.x 
        pass

    try:
        # Note: The '.boot' section might not always be present         
        _winlice_section = binary.get_section(".winlice")       
        return 3

    except lief.not_found:      
        # Not Winlicense 3.x
        pass
ergrelet commented 11 months ago

Hi! This is now fixed I think.