
    	h                     ^    S SK r S SKrS SKrS SKrS SKrSS jrS rS r\S:X  a  \" 5         gg)    Nc                    [         R                  " X5      n[         R                  " U5      nSn [         R                  " U[         R                  [         R
                  -  S5      nU(       d  OU H  n[        R                  " Xq5      nUR                  b1   [        R                  " XR                  5      u  pnU	 SU
 3nSU 3nOS nU(       d  Mb  [        SR                  UR                  UR                   R#                  5       5      5        U(       a  [        U5         [        U5        M     U[)        U5      -  nGM  XE:X  a  [        SUS5        O[        SXE4-  5        [        S	5        [         R*                  " U5        g ! [        R                   a    [        UR                  5      n Nf = f! [$         a$    [        S5        [        ['        U5      5         GMr  f = f)
Nr   /zEvent associated with user z&Event record from {!r} generated at {}z3(unicode error printing message: repr() follows...)zSuccessfully read allrecordsz4Couldn't get all records - reported %d, but found %dzJ(Note that some other app may have written records while we were running!))win32evtlogOpenEventLogGetNumberOfEventLogRecordsReadEventLogEVENTLOG_BACKWARDS_READEVENTLOG_SEQUENTIAL_READwin32evtlogutilSafeFormatMessageSidwin32securityLookupAccountSiderrorstrprintformat
SourceNameTimeGeneratedFormatUnicodeErrorreprlenCloseEventLog)computerlogTypedumpEachRecordh
numRecordsnumobjectsobjectmsgdomainusertypsidDesc	user_descs                 kC:\Users\julio\OneDrive\Documentos\Trabajo\Ideas Frescas\venv\Lib\site-packages\win32/Demos/eventLogDemo.pyReadLogr+      s     3A77:J C
**//+2V2VV

 F!33FDCzz%.(5(F(F **)%F# "($0G :'C	 	~<CC))6+?+?+F+F+H
 )$%#J/ 8 	s7|I L %z9=BjEVV	
 	X	
 a = %** .!&**oG. $ %OP$s)$$%s$   *F#F6)F32F36)G$#G$c                      [        S5        [        S5        [        S5        [        S5        [        S5        [        S5        g )Nz!Writes an event to the event log.z"-w : Don't write any test records.z-r : Don't read the event logz=-c : computerName : Process the log on the specified computerz-v : Verbosez>-t : LogType - Use the specified log - default = 'Application')r        r*   usager/   A   s7    	
-.	
./	
)*	
IJ	.	
JKr.   c            	      4   SS K n SS KnU R                  UR                  SS  S5      u  p#S nS=pVSnSn[        U5      S:  a  [	        S5        [        5         gU HD  u  pU	S:X  a  U
nU	S:X  a  U
nU	S;   a  [        5           g U	S	:X  a  SnU	S
:X  a  SnU	S:X  d  M?  US-  nMF     U(       a  [        R                  " 5       n[        R                  " U[        R                  5      n[        R                  " U[        R                  5      S   n[        R                  " USSS/SUS9  [        R                  " US[         R"                  SS/SUS9  [        R                  " US[         R$                  SS/SUS9  [	        S5        U(       a  ['        XGUS:  5        g g )Nr      z	rwh?c:t:vApplicationzInvalid argsz-tz-c)z-hz-?z-rz-wz-v   zThe message text for event 2zAnother inserts   Raw Data)stringsdatasidz	A warningzAn even more dire warning)	eventTyper4   r5   r6   zAn infozToo much infoz'Successfully wrote 3 records to the log)getoptsysargvr   r   r/   win32apiGetCurrentProcessr   OpenProcessTokenwin32con
TOKEN_READGetTokenInformation	TokenUserr   ReportEventr   EVENTLOG_WARNING_TYPEEVENTLOG_INFORMATION_TYPEr+   )r8   r9   optsargsr   do_readdo_writer   verboseoptvalphthmy_sids                 r*   testrO   J   s   sxx|[9JDHGGG
4y1}n$;G$;H,G$;G$;H$;qLG  '')++B0C0CD222}7N7NOPQR##35EF	
 	##!77 "=>	
 	##!;;0	
 	787Q;/ r.   __main__)r2   r   )	r;   r>   r   r   r   r+   r/   rO   __name__r-   r.   r*   <module>rR      s:        6!rL<0~ zF r.   