o
    àý°j)  ã                
   @   sL  d dl Z d dlZd dlZd dlZd dlZd dlmZmZ d dlm	Z	 d dl
mZmZ zeZW n	 ey7   Y nw edkr¤e jjdu rLe d¡e jƒe _eejƒ ejddd	Zejd
ddd ejdddd ejdddd ejdddd ejdddd ejdddd ejdddd ejdddd ee jƒdk r¨e ¡  e  d¡ e ¡ Ze	 ej ¡ ej!du rÇe "¡  #ej$¡ e !e %¡ ¡ ne "¡  #ej&¡ ej'du rãej(du rãe )d¡ e  d¡ ej'dur÷ej(dur÷e )d ¡ e  d¡ ej*du rej+du re )d!¡ e  d¡ ej*dur#ej+dur#e )d"¡ e  d¡ ej(r.e ,ej(¡Z(n	eej'ƒZ-e- .¡ Z(eej/e(d#ƒZ0ej+r^d$ej+vrQd%Z1e ,ej+¡Z2nd&d'„ ej+ 3d$¡D ƒ\Z1Z2ej*rjd%Z1e 4ej*¡Z2z
e0 5ej6e2e1¡ W n) e7y Z8 ze "¡ j9ej$krŽd dl:Z:e: ;¡  e <e8¡ W Y dZ8[8ndZ8[8ww e0 =¡  dS dS )(é    N)ÚversionÚntlm)Úlogger)ÚLocalOperationsÚ	SAMHashesÚ__main__Úutf8Tz9In-place edits a local user's password in a SAM hive file)Úadd_helpÚdescriptionÚuserÚstorez0Name of the user account to replace the password)ÚactionÚhelpÚsamzSAM hive file to editz	-passwordzNew password to be setz-hashesz0Replace NTLM hash directly (LM hash is optional)z-systemz?SYSTEM hive file containing the bootkey for password encryptionz-bootkeyz1Bootkey used to encrypt and decrypt SAM passwordsz-debugÚ
store_truezTurn DEBUG output ONz-tsz&Adds timestamp to every logging outputé   é   z@A SYSTEM hive or bootkey value is required for password changingz3Only a SYSTEM hive or bootkey value can be suppliedz'A password or hash argument is requiredz0Only a password or hash argument can be suppliedFú:ó    c                 C   s   g | ]}t  |¡‘qS © )ÚbinasciiÚ	unhexlify)Ú.0Úhashr   r   ú‡/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/../../../bin/samedit.pyÚ
<listcomp>k   s    r   )>ÚsysÚcodecsÚargparseÚloggingr   Úimpacketr   r   Úimpacket.examplesr   Úimpacket.examples.secretsdumpr   r   Ú	raw_inputÚinputÚ	NameErrorÚ__name__ÚstdoutÚencodingÚ	getWriterÚprintÚBANNERÚArgumentParserÚparserÚadd_argumentÚlenÚargvÚ
print_helpÚexitÚ
parse_argsÚoptionsÚinitÚtsÚdebugÚ	getLoggerÚsetLevelÚDEBUGÚgetInstallationPathÚINFOÚsystemÚbootkeyÚcriticalÚpasswordÚhashesr   ÚlocalOperationsÚ
getBootKeyr   ÚhiveÚLMHashÚNTHashÚsplitÚNTOWFv1Úeditr   Ú	ExceptionÚeÚlevelÚ	tracebackÚ	print_excÚerrorÚfinishr   r   r   r   Ú<module>   sŽ   ÿ












€ü²