Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/24/2022 in Posts

  1. Hi mucitbey The following script seems to do it : #include <Array.au3> #include <File.au3> #include <GUIConstantsEx.au3> Global $aInFile _FileReadToArray("Data.txt", $aInFile, $FRTA_NOCOUNT) Global $iLines = UBound($aInFile) Global $bFile _FileReadToArray("Users.txt", $bFile, $FRTA_NOCOUNT, "=") GUICreate("_mucitbey_", 430, 500, -1, -1) $lv = GUICtrlCreateListView("#|Card ID|[]|Date|Clock|User", 10, 10, 410, 480) For $i = 0 To $iLines - 1 $aTemp = StringSplit($aInFile[$i], ", ", $STR_NOCOUNT) $user = GetUser($aTemp[1]) $sLine = $aTemp[0] &"|"& $aTemp[1] &"|"& $aTemp[2] &"|"& $aTemp[3] &"|"& $aTemp[4] &"|"& $user GUICtrlCreateListViewItem($sLine, $lv) If $aTemp[4] > "08:10:00" And $aTemp[4] < "16:50:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF) If $i = 0 Then ; only once (1st line => 1st date => open 1st date txt file) Local $sDate = $aTemp[3], $sFilePath = @ScriptDir & '\' & $sDate & '.txt' Local $hFileOpen = FileOpen($sFilePath, $FO_OVERWRITE) If $hFileOpen = -1 Then Exit MsgBox(0, "FileOpen error", "Date = " & $sDate) EndIf If $sDate <> $aTemp[3] Then ; If date changed => close old date txt file, then open new date txt file FileClose($hFileOpen) $sDate = $aTemp[3] $sFilePath = @ScriptDir & '\' & $sDate & '.txt' $hFileOpen = FileOpen($sFilePath, $FO_OVERWRITE) If $hFileOpen = -1 Then Exit MsgBox(0, "FileOpen error", "Date = " & $sDate) EndIf FileWriteLine($hFileOpen, $sLine) Next If IsDeclared("hFileOpen") Then FileClose($hFileOpen) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete() Exit EndSwitch WEnd Func GetUser($ID) Local $iIndex = _ArraySearch($bFile, $ID) If $iIndex <> -1 Then Return $bFile[$iIndex][1] Else Return "Undefined ID" EndIf EndFunc It generated 75 text files on my computer (named "30.05.2022.txt" to "12.08.2022.txt") each file containing the corresponding records of the day. Edit: a possible Users.txt (partial) : 00000069=User 69 00000021=Name of user 21 00000062=I am user 62 00000065=Here is 65 Partial listview : 15th July 2022 in "Data.txt" (4 lines) 001,00000034,00,15.07.2022 08:04:20 001,00000054,00,15.07.2022 08:57:42 001,00000055,00,15.07.2022 19:56:59 001,00000034,00,15.07.2022 19:57:01 File : "15.07.2022.txt" (4 lines) 001|00000034|00|15.07.2022|08:04:20|Undefined ID 001|00000054|00|15.07.2022|08:57:42|Undefined ID 001|00000055|00|15.07.2022|19:56:59|Undefined ID 001|00000034|00|15.07.2022|19:57:01|Undefined ID
    4 points
  2. I fully agree with @argumentum ! @bartmon2005 : Your ass is safe, but your index finger was not capable to click the Thanks button - that's pathetic ! @Exit is a well-known member of this forum. The thread is 8 pages long and his solution has already helped a lot of people. Asking about the security of a solution may be legitimate (but what is secure these days?). Asking about backdoors insinuates that the author has dishonest intentions, and that is insulting.
    3 points
  3. @pixelsearch nice, here is your script little optimized, not needed "If $i = 0 Then ..." #include <Array.au3> #include <File.au3> #include <GUIConstantsEx.au3> Global $aInFile _FileReadToArray("Data.txt", $aInFile, $FRTA_NOCOUNT) Global $iLines = UBound($aInFile) Global $bFile _FileReadToArray("Users.txt", $bFile, $FRTA_NOCOUNT, "=") GUICreate("_mucitbey_", 430, 500, -1, -1) $lv = GUICtrlCreateListView("#|Card ID|[]|Date|Clock|User", 10, 10, 410, 480) $sDate = '' $hFileOpen = 0 For $i = 0 To $iLines - 1 $aTemp = StringSplit($aInFile[$i], ", ", $STR_NOCOUNT) $user = GetUser($aTemp[1]) $sLine = $aTemp[0] &"|"& $aTemp[1] &"|"& $aTemp[2] &"|"& $aTemp[3] &"|"& $aTemp[4] &"|"& $user GUICtrlCreateListViewItem($sLine, $lv) If $aTemp[4] > "08:10:00" And $aTemp[4] < "16:50:00" Then GUICtrlSetBkColor(-1, 0xC0FFFF) If $sDate <> $aTemp[3] Then ; If date changed => close old date txt file, then open new date txt file If $hFileOpen <> 0 Then FileClose($hFileOpen) $sDate = $aTemp[3] $sFilePath = @ScriptDir & '\' & $sDate & '.txt' $hFileOpen = FileOpen($sFilePath, $FO_OVERWRITE) If $hFileOpen = -1 Then Exit MsgBox(0, "FileOpen error", "Date = " & $sDate) EndIf FileWriteLine($hFileOpen, $sLine) Next If $hFileOpen <> 0 Then FileClose($hFileOpen) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUIDelete() Exit EndSwitch WEnd Func GetUser($ID) Local $iIndex = _ArraySearch($bFile, $ID) If $iIndex <> -1 Then Return $bFile[$iIndex][1] Else Return "Undefined ID" EndIf EndFunc
    2 points
  4. My test script was very similar to yours. 🙂 As you can see below, the key & IV can be any data type as long as it has the correct length and value. That is why the variables, in the UDF definition, are prefixed with "$v", meaning variable. Function definition: ; Name ..........: _CryptoNG_AES_CBC_DecryptData ; Description ...: Decrypt data using AES with CBC block chaining. ; Syntax ........: _CryptoNG_DecryptData($xData, $vEncryptionKey, $vIV = Default, $sProvider = Default) ; Parameters ....: $xData Binary data to be decrypted. ; $vEncryptionKey Secret/Password used to encrypt text. Must be correct size for encryption algorithm. ; $vIV [optional] A 128 bit (16 byte) initialization vector. Default is 0x000102030405060708090A0B0C0D0E0F ; $sProvider [optional] A string specifying the desired algorithm provider. Default is Microsoft Primitive Provider. Test script: #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 -w 6 -d #include <Constants.au3> #include <CryptoNG.au3> aes_cbc_decrypt_with_iv_example() Func aes_cbc_decrypt_with_iv_example() Const $ALG_ID = "AES CBC" Const $BASE64_MSG = "eiUj3S9BgJDcRylhHExLMRRjmsxXj1nwB1HzaN8fp9nrduDyGriduqbjh452imKr" Const $KEY = "93wj660t8fok9jws" Const $IV = "r0yy7e67p49ee4d7" Local $xEncryptedMessage = Binary("") Local $sDecryptedMessage = "" ;Convert Base64 string to binary $xEncryptedMessage = _CryptoNG_CryptStringToBinary($BASE64_MSG, $CNG_CRYPT_STRING_BASE64) If @error Then Exit ConsoleWrite("StringToBinary Error: " & _CryptoNG_LastErrorMessage() & @CRLF) ;Decrypt encrypted message $sDecryptedMessage = _CryptoNG_AES_CBC_DecryptData($xEncryptedMessage, $KEY, $IV) If @error Then Exit ConsoleWrite("DecryptData Error: " & _CryptoNG_LastErrorMessage() & @CRLF) ;Display results ConsoleWrite(StringFormat("%s Encrypted Message (Base64) = %s", $ALG_ID, $BASE64_MSG) & @CRLF) ConsoleWrite(StringFormat("%s Encrypted Message (Binary) = %s", $ALG_ID, $xEncryptedMessage) & @CRLF) ConsoleWrite(StringFormat("%s Encryption Key = %s", $ALG_ID, $KEY) & @CRLF) ConsoleWrite(StringFormat("%s Initialization Vector = %s", $ALG_ID, $IV) & @CRLF) ConsoleWrite(StringFormat("%s Decrypted Message = %s", $ALG_ID, $sDecryptedMessage) & @CRLF) EndFunc Output AES CBC Encrypted Message (Base64) = eiUj3S9BgJDcRylhHExLMRRjmsxXj1nwB1HzaN8fp9nrduDyGriduqbjh452imKr AES CBC Encrypted Message (Binary) = 0x7A2523DD2F418090DC4729611C4C4B3114639ACC578F59F00751F368DF1FA7D9EB76E0F21AB89DBAA6E3878E768A62AB AES CBC Encryption Key = 93wj660t8fok9jws AES CBC Initialization Vector = r0yy7e67p49ee4d7 AES CBC Decrypted Message = {"Color": "Blue", "Type": "Deep Blue"}
    1 point
  5. #AutoIt3Wrapper_AU3Check_Parameters=-w 3 -w 4 -w 5 -w 6 -d #include <Constants.au3> #include <CryptoNG.au3> __ExampleA() Func __ExampleA() Local $xEncryptedMessage = 'eiUj3S9BgJDcRylhHExLMRRjmsxXj1nwB1HzaN8fp9nrduDyGriduqbjh452imKr' Local $Key = '93wj660t8fok9jws' Local $IV = 'r0yy7e67p49ee4d7' $xEncryptedMessage = _CryptoNG_CryptStringToBinary($xEncryptedMessage, $CNG_CRYPT_STRING_BASE64) ConsoleWrite("$xEncryptedMessage: "& @tab & $xEncryptedMessage & @CRLF) $Key = StringToBinary($Key) ConsoleWrite("$Key: " & @tab & @tab & @tab & $Key & @CRLF) $IV = StringToBinary($IV) ConsoleWrite("$IV: " & @tab & @tab & @tab & $IV & @CRLF) Local $sDecryptedMessage = _CryptoNG_AES_CBC_DecryptData($xEncryptedMessage, $Key, $IV) If @error Then Exit ConsoleWrite("DECRYPT ERROR: " & _CryptoNG_LastErrorMessage()) ConsoleWrite("$sDecryptedMessage: " & @tab & $sDecryptedMessage & @CRLF) EndFunc @TheXman thanks
    1 point
  6. Sometimes our minds can't come up with ideas. Right here, broad-minded and intelligent friends like you come to your aid. Thanks once again #pixelsearch
    1 point
  7. As it says in the CryptoNG Help File, the encrypted message input to _CryptoNG_AES_CBC_DecryptData() should be binary data. You can convert Base64 strings to binary using _CryptoNG_CryptStringToBinary(). So convert your base64 string to binary and then use that binary string with the supplied key & iv to get your decrypted text. If your decryption parameters are correct, then your result should match the information in the example that you provided.
    1 point
  8. It's quite simple. You are thanking for the solution but superstitious of a backdoor ?!!!. All the code is there. Is worthless to have reasons in a chat with you because you don't even know CMD ? so, yes. It'd be a waste of time. Like I'm doing right now. Hereon after you're in my ignore list of, now 2 users.
    1 point
  9. Hi. As you write, that you have a mixture of stand alone PCs and Domain PCs I'd like to mention, that there is another registry value that can be a bad constraint: Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa] "lmcompatibilitylevel"=dword:00000005 If the destination computer providing the share has this value set to 5, and a computer from a different domain or a stand alone PC is set to 0, 1 or 2 trying to use this share, then this will only work, if specifying a AD-user account with access rights from the domain, the sharing computer is a member of. Using a local user account of the PC/Win-Server presenting the share will not work. The error message will give you an "invalid username or password" error. Any AD account will work smoothly (but that was not possible for my scenario) https://docs.microsoft.com/en-us/windows/security/threat-protection/security-policy-settings/network-security-lan-manager-authentication-level Seting both sides to "2" solves this issue immediately, a reboot is not required. If this should switch back to 5 check for the GPO pushing the value and exclude the sharing server from receiving that particular GPO. Regards, Rudi.
    1 point
  10. Andreik

    Forum for MS SQL Server

    Beyond the simple procedure of backup there are many settings in SQL Server regarding backup . A decent amount of DBAs use Ola Hallengren scripts for database backups and indexes maintenance because these scripts are handy but it's fairly simple to set the appropriate parameters for specific backup scenarios. From my experience, if there are not disk related issues or any kind of weird bottlenecks, even with default SQL Server configuration you can obtain great backup optimizations just by tweaking BUFFERCOUNT and MAXTRANSFERSIZE. In the company I used to work the backup process for some large database usually took about 2-3 hours but with small tweaks in these parameters I managed to improve the backup process to 20 minutes. Anyway, if your scenario is more complex and you use compression then you can test your backup performance with trace flag 3042 (preferably not on production server) to see if there is any improvement,
    1 point
  11. mLipok

    Forum for MS SQL Server

    Finally I ask here: https://stackoverflow.com/questions/50882824/sql-server-why-is-the-backup-speed-so-slow And found answer by my self (together with my co worker @dPilar).
    1 point
  12. StringIsDigit, StringIsFloat, StringIsXDigit (link) the behavior of the StringIsFloat function is slightly different EnableExplicit Procedure StringIsDigit(*text) Protected flag = #True, *c.Character = *text If *c = 0 Or *c\c = 0 ProcedureReturn 0 EndIf Repeat If *c\c < '0' Or *c\c > '9' flag = #False Break EndIf *c + SizeOf(Character) Until Not *c\c ProcedureReturn flag EndProcedure Debug StringIsDigit(@"123") Debug StringIsDigit(@"12 3") Debug StringIsDigit(@"") Debug "===" Procedure StringIsFloat(*text) Protected flag = #True, *c.Character = *text, sep = 0, increment = 1 If *c = 0 Or *c\c = 0 ProcedureReturn 0 EndIf Repeat If *c\c >= '0' And *c\c <= '9' ; Debug "-> 0-9" sep = increment ElseIf sep And *c\c = '.' ; Debug "-> ." If sep <= 0 ; Debug "-> Out2" flag = #False Break EndIf sep = 0 increment = -1 Else ; Debug "-> Out" flag = #False Break EndIf *c + SizeOf(Character) Until Not *c\c If sep <> -1 ; Debug "-> Out3" flag = #False EndIf ProcedureReturn flag EndProcedure Debug StringIsFloat(@"1.2") Debug StringIsFloat(@"1..2") Debug StringIsFloat(@"1.2.3") Debug StringIsFloat(@"1") Debug StringIsFloat(@"1.") Debug StringIsFloat(@".1") Debug StringIsFloat(@"qwerty") Debug StringIsFloat(@".") Debug StringIsFloat(@"") Debug "===" Procedure StringIsXDigit(*text) Protected flag = #True, *c.Character = *text If *c = 0 Or *c\c = 0 ProcedureReturn 0 EndIf Repeat If Not ((*c\c >= '0' And *c\c <= '9') Or (*c\c >= 'a' And *c\c <= 'f') Or (*c\c >= 'A' And *c\c <= 'F')) flag = #False Break EndIf *c + SizeOf(Character) Until Not *c\c ProcedureReturn flag EndProcedure Debug StringIsXDigit(@"123") Debug StringIsXDigit(@"FF34FF") Debug StringIsXDigit(@"") Debug StringIsXDigit(@" ")
    1 point
  13. My idea of a source being "secure" isn't just plain asm compiled. I fail to comprehend both the security merits, and the purpose of this. If your autoit code is going to be converted to another language, wouldn't it be easier to learn that language instead? Then you can VMP easily, end of story. Unless your only intent is to prevent kids who only know how to drag drop to get your 1337 source, this will not provide you the slightest help.
    0 points
×
×
  • Create New...