Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/30/2023 in all areas

  1. __ExampleA() Func __ExampleA() Local $BinaryString = StringToBinary("Hello @World") Local $Bin_Len = BinaryLen($BinaryString) ConsoleWrite('BinaryLen: ' & $Bin_Len & @TAB & 'BinaryString: ' & $BinaryString & @CRLF) Local $tSTRUCT1 = DllStructCreate('uint; Byte[' & $Bin_Len & ']') DllStructSetData($tSTRUCT1, 1, $Bin_Len, 1) For $i = 1 To $Bin_Len ;you have to write bytes...because it is not a string! or you can make a memcpy DllStructSetData($tSTRUCT1, 2, Dec(StringMid($BinaryString, $i * 2 + 1, 2)), $i) ;~ ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : stringmid($BinaryString,$i*2+1,2) = ' & StringMid($BinaryString, $i * 2 + 1, 2) & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console Next ConsoleWrite('[Data uint ]: ' & DllStructGetData($tSTRUCT1, 1) & @CRLF) ConsoleWrite('[Data String ]: ' & DllStructGetData($tSTRUCT1, 2) & @CRLF) Local $pVariant = DllStructGetPtr($tSTRUCT1) ConsoleWrite('[$pVariant ]: ' & $pVariant & @CRLF & @CRLF & @CRLF) ;end of writing data into memory ;start reading data from memory with known pointer $struct_stringlen = DllStructCreate("uint", $pVariant) ;get first 4 bytes = uint =stringlen $stringlen = DllStructGetData($struct_stringlen, 1) ;lets get the binarystring $struct_binarystring = DllStructCreate("byte[" & $stringlen & "]", $pVariant + 4) ;place the struct at the pointer +4 because uint is 4 bytes $binary = DllStructGetData($struct_binarystring, 1) $string = BinaryToString($binary) ConsoleWrite(" Stringlen = " & $stringlen & @CRLF & " Binary = " & $binary & @CRLF & " String = " & $string & @crlf & @crlf) EndFunc ;==>__ExampleA If you have an ANSI/ASCII String, it is much easier because the transformation to binary data is omitted. You can write the (ANSI/ASCII) string directly into the memory. This works with char and wchar (16 bit unicode). __ExampleB() Func __ExampleB() Local $String = "Hello @World" Local $Len = StringLen($String) ConsoleWrite('StringLen: ' & $Len & @TAB & 'String: ' & $String & @CRLF) Local $tSTRUCT1 = DllStructCreate('uint; char[' & $Len & ']') ;or wchar if unicode!!! DllStructSetData($tSTRUCT1, 1, $Len) DllStructSetData($tSTRUCT1, 2, $String) ConsoleWrite('[Data uint ]: ' & DllStructGetData($tSTRUCT1, 1) & @CRLF) ConsoleWrite('[Data String ]: ' & DllStructGetData($tSTRUCT1, 2) & @CRLF) Local $pVariant = DllStructGetPtr($tSTRUCT1) ConsoleWrite('[$pVariant ]: ' & $pVariant & @CRLF & @CRLF & @CRLF) ;end of writing data into memory ;start reading data from memory with known pointer $struct_stringlen = DllStructCreate("uint", $pVariant) ;get first 4 bytes = uint =stringlen $stringlen = DllStructGetData($struct_stringlen, 1) ;lets get the string char or wchar if unicode $struct_string = DllStructCreate("char[" & $stringlen & "]", $pVariant + 4) ;place the struct at the pointer +4 because uint is 4 bytes $String = DllStructGetData($struct_string, 1) ConsoleWrite(" Stringlen = " & $stringlen & @CRLF & " String = " & $String & @CRLF & @CRLF) EndFunc ;==>__ExampleB
    2 points
  2. Autologon takes command line arguments so using it might be simpler than you think. autologon.exe <username> <domain> <password> If the PC in question isn't joined to a Windows Domain, you would use the name of the PC. Example from the command line: autologon.exe noellarkin %COMPUTERNAME% MyC0mplexP@ssword Right before you trigger your logoff use autologon to set whoever you want to log in next. Example in AutoIt: $iPID = Run ( @ComSpec & " /c c:\path\to\autologon.exe noellarkin " & @computername & " MyC0mplexP@ssword" , "" , @SW_HIDE ) ProcessWaitClose($iPID) Shutdown (0)
    2 points
  3. When ever you hover your mouse over a native function, user defined function, or an AutoItObject method then you will see the calltip for that function. Click "Like This" if you found this useful! To use this just place the following lua file in the "...AutoIt3\SciTE\lua" directory. MouseHoverCallTips.zip downloads:741 After you have done that then open SciTE and click 'Options' --> 'Open Lua Startup Script' and paste this line after the other lines (may require administrative rights): LoadLuaFile("MouseHoverCallTips.lua") Updates and changes:
    1 point
  4. Here is a link to an older post regarding AutoIt and Python encryption. However, I would like to explicitly point out that this method is in the meantime no longer considered to be absolutely secure. https://stackoverflow.com/questions/20510975/autoit-to-python-encrypt-decrypt
    1 point
  5. To follow up with another possible issue I noticed tha triggers false positive is how arrays are formed. This will trigger false positives, Local $arrName = ['3G1', '3G2', '3G3', '3G4', '3G5', '3G6', '3G7', '3G8', '3G9'] This does not trigger false positives, Local $arrName[9] = ['3G1', '3G2', '3G3', '3G4', '3G5', '3G6', '3G7', '3G8', '3G9']
    1 point
  6. Yes, in a very specific case where the binary has been created the way you need it to access it. But of course this won't work in the general case.
    1 point
×
×
  • Create New...