Leaderboard
Popular Content
Showing content with the highest reputation on 12/02/2013 in all areas
-
Need some major protection against decompilers
lordofthestrings and one other reacted to Melba23 for a topic
MariusN, So you want us to help you write malware? Anyway, there is NO WAY you can protect your scripts against determined hackers. If major games and OSes are hacked within hours, what chance to you have? And I see someone has left the door of the cage ajar, so before that bird gets out yet again......<click> M232 points -
@GeekIT - I have re-read the posts here from top to bottom. I have also researched this issue a bit. My quick thoughts: I believe that you have not found anything that can do this from memory because filepath is a required parameter to execute the batch instructions and that makes it different from the other programming languages you reference. I am fairly certain it is not possible but reserve that conclusion to the more talented members of the forum. If it were possible I doubt sryptkeeper would "hide" the batch files at run time to prevent alterations since they produce a commercial software focused on this issue. I did not read your earlier posts to conclude that this could be done in batch but rather that you wanted to emulate what was happening in javascript and vbscript ... but for batch files. I think part of the problem is that at one point you may have mistakenly quoted the functionality of the javascript and vb script functionality as evidence that it could be done for batch ... not evidence of what you were trying to do. My personal opinion is that while there is nothing inherently wrong with this question you need to appreciate not everyone will share your enthusiasm for exploring the issue in detail - especially if they see no inherent value in the solution. This is the case because even if the problem were capable of being solved (not so sure about that) you could do it all with native Au3. It's a bit like dressing up as a Jets' fan and going to a Patriots game (not wrong - but not popular). I am also off this thread since I doubt the feasibility but wish you the best in finding a solution.1 point
-
Sort Listview Name / Surname
Reinhardt1julian reacted to Melba23 for a topic
Reinhardt1julian, That was easy to fix: #include <ListViewConstants.au3> #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> $Form5 = GUICreate("Test", 674, 469, -1, -1) $List1 = GUICtrlCreateListView("Name|Surename|Info|Area Code|Telephone|Postal code|City", 8, 32, 353, 383, -1, BitOR($WS_EX_ACCEPTFILES, $LVS_EX_FULLROWSELECT)) $Button4 = GUICtrlCreateButton("Sort", 368, 232, 75, 25) GUISetState(@SW_SHOW) GUICtrlCreateListViewItem("Parker|Peter|This is info|3418|2154626|B2 4DB|Birmingham", $List1) GUICtrlCreateListViewItem("Louis|Louis|Is a person|4583|7952461|B2 4DB|Birmingham", $List1) GUICtrlCreateListViewItem("Grey|Christian|Is a random name|3419|794413154|B2 4DB|Birmingham", $List1) GUICtrlCreateListViewItem("Williams|John|Is a common name|8465|35415164|B2 4DB|Birmingham", $List1) GUICtrlCreateListViewItem("Parker|John|Is a common name|8465|35415164|B2 4DB|Birmingham", $List1) While 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $Button4 _Sort($List1) EndSwitch WEnd Func _Sort($listview) ; Read ListView content into an array Local $aArray = _ReadLVToArray($listview) ; Multisort the array - both columns "Ascending" Local $aSortData[2][2] = [[0, 0],[1, 0]] _ArrayMultiColSort($aArray, $aSortData) ; Now reload the array into the ListView _LoadArrayToLV($listview, $aArray) EndFunc ;==>_Sort Func _LoadArrayToLV($cLV, $aArray, $iStart = 0) ; Delete current items _GUICtrlListView_DeleteAllItems($cLV) ; Load from array For $i = 0 + $iStart To UBound($aArray) - 1 $sItem = "" For $j = 0 To UBound($aArray, 2) - 1 ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $sItem &= $aArray[$i][$j] & "|" Next $sItem = StringTrimRight($sItem, 1) GUICtrlCreateListViewItem($sItem, $cLV) Next EndFunc ;==>_LoadArrayToLV Func _ReadLVToArray($cLV, $iStart = 0) Local $aLVArray = "", $aRow ; Get ListView row count Local $iRows = _GUICtrlListView_GetItemCount($cLV) ; Check for empty ListView with no count If $iRows + $iStart <> 0 Then ; Get ListView column count Local $iCols = _GUICtrlListView_GetColumnCount($cLV) ; Create 2D array to hold ListView content and add count - count overwritten if not needed Local $aLVArray[$iRows + $iStart][$iCols] = [[$iRows]] ; Read ListView content into array For $i = 0 To $iRows - 1 ; Read the row content $aRow = _GUICtrlListView_GetItemTextArray($cLV, $i) For $j = 1 To $aRow[0] ; Add to the ListView content array $aLVArray[$i + $iStart][$j - 1] = $aRow[$j] Next Next EndIf ; Return array or empty string Return $aLVArray EndFunc ;==>_ReadLVToArray Func _ArrayMultiColSort(ByRef $aArray, $aSortData, $iStart = 0, $iEnd = 0) If UBound($aArray, 2) = 0 Then Return SetError(1, 1, "") EndIf ; 2D sort data If UBound($aSortData, 2) <> 2 Then Return SetError(1, 2, "") EndIf If UBound($aSortData) > UBound($aArray) Then Return SetError(1, 3) EndIf ; Start element If $iStart < 0 Then $iStart = 0 EndIf If $iStart >= UBound($aArray) - 1 Then Return SetError(1, 4, "") EndIf ; End element If $iEnd <= 0 Or $iEnd >= UBound($aArray) - 1 Then $iEnd = UBound($aArray) - 1 EndIf ; Sanity check If $iEnd <= $iStart Then Return SetError(1, 5, "") EndIf Local $iCurrCol, $iChunk_Start, $iMatchCol ; Sort first column __AMCS_SortChunk($aArray, $aSortData, 0, $aSortData[0][0], $iStart, $iEnd) If @error Then Return SetError(2, @extended, "") EndIf ; Now sort within other columns For $iSortData_Row = 1 To UBound($aSortData) - 1 ; Determine column to sort $iCurrCol = $aSortData[$iSortData_Row][0] ; Create arrays to hold data from previous columns Local $aBaseValue[$iSortData_Row] ; Set base values For $i = 0 To $iSortData_Row - 1 $aBaseValue[$i] = $aArray[$iStart][$aSortData[$i][0]] Next ; Set start of this chunk $iChunk_Start = $iStart ; Now work down through array For $iRow = $iStart + 1 To $iEnd ; Match each column For $k = 0 To $iSortData_Row - 1 $iMatchCol = $aSortData[$k][0] ; See if value in each has changed If $aArray[$iRow][$iMatchCol] <> $aBaseValue[$k] Then ; If so and row has advanced If $iChunk_Start < $iRow - 1 Then ; Sort this chunk __AMCS_SortChunk($aArray, $aSortData, $iSortData_Row, $iCurrCol, $iChunk_Start, $iRow - 1) If @error Then Return SetError(2, @extended, "") EndIf EndIf ; Set new base value $aBaseValue[$k] = $aArray[$iRow][$iMatchCol] ; Set new chunk start $iChunk_Start = $iRow EndIf Next Next ; Sort final section If $iChunk_Start < $iRow - 1 Then __AMCS_SortChunk($aArray, $aSortData, $iSortData_Row, $iCurrCol, $iChunk_Start, $iRow - 1) If @error Then Return SetError(2, @extended, "") EndIf EndIf Next EndFunc ;==>_ArrayMultiColSort Func __AMCS_SortChunk(ByRef $aArray, $aSortData, $iRow, $iColumn, $iChunkStart, $iChunkEnd) Local $aSortOrder ; Set default sort direction Local $iSortDirn = 1 ; Need to prefix elements? If IsString($aSortData[$iRow][1]) Then ; Split elements $aSortOrder = StringSplit($aSortData[$iRow][1], ",") If @error Then Return SetError(1, 1, "") EndIf ; Add prefix to each element For $i = $iChunkStart To $iChunkEnd For $j = 1 To $aSortOrder[0] If $aArray[$i][$iColumn] = $aSortOrder[$j] Then $aArray[$i][$iColumn] = StringFormat("%02i-", $j) & $aArray[$i][$iColumn] ExitLoop EndIf Next ; Deal with anything that does not match If $j > $aSortOrder[0] Then $aArray[$i][$iColumn] = StringFormat("%02i-", $j) & $aArray[$i][$iColumn] EndIf Next Else Switch $aSortData[$iRow][1] Case 0, 1 ; Set required sort direction if no list If $aSortData[$iRow][1] Then $iSortDirn = -1 Else $iSortDirn = 1 EndIf Case Else Return SetError(1, 2, "") EndSwitch EndIf ; Sort the chunk Local $iSubMax = UBound($aArray, 2) - 1 __ArrayQuickSort2D($aArray, $iSortDirn, $iChunkStart, $iChunkEnd, $iColumn, $iSubMax) ; Remove any prefixes If IsString($aSortData[$iRow][1]) Then For $i = $iChunkStart To $iChunkEnd $aArray[$i][$iColumn] = StringTrimLeft($aArray[$i][$iColumn], 3) Next EndIf EndFunc ;==>__AMCS_SortChunk I am just off to cook dinner now - any questions will have to wait until later this evening. M231 point -
Hi mlipok, I'll try to guide you rather than spoon you a canned answer; I'm sure you prefer things this way. Q1 is easy: apply the regexp to this slightly modified input and I'm sure the light will shed. Func _test1() Local $sTest1 = '' While 1 ;~ .... ;~ .... while 2 ;~ .... Local $sTest2 = '' ;~ .... ;~ .... WEnd ;~ .... WEnd EndFunc ;==>_test1 Func _test2() Local $sTest3 = '' While 3 ;~ .... ;~ .... while 4 ;~ .... Local $sTest4 = '' ;~ .... ;~ .... WEnd ;~ .... WEnd EndFunc ;==>_test2 Q2 part 1: explanation of why you get this result is simply because that's what you asked for. If you need more detail just ask. Q2 part 2: am I correct guessing that you will want the groups which are directly related (here I mean "while 4" and "Local $sTest4")?1 point
-
Are there any GPS api's for autoit ?
lordofthestrings reacted to tonycst for a topic
OK i tried Windows 8 and installed app called GPS Satellite. It showed me wrong location miles away from where i am at and where i have never been. I went outside hoping to pickup any sattalite signal but nothing changed. Perhaps i didnt go far enough from home. So i assume that my idea that my laptop had GPS is false, but then how did the GPS Satellite tracked my exact location when i went to the store ? EDIT: I drove around the block and no GPS data was recorded. I am clueless now. Went back to windows 7. Screw it. Too much effort for nothing.1 point -
Here is my best quess of what you want. Local $sStr = "Patrón: LLLAAMMDDXXX en donde, L=(A-Z) letra o caracteres & o Ñ, AA=año, MM=mes, DD=día, X=alfanumérico" & @CRLF & _ "AAAAMMDD; some blablablalba that i dont need" & @CRLF & _ ; "Patrón: XXAADD o Ñ, AA=año, MM=mes, DD=día, X=alfanumérico" & @CRLF & _ ; "XXAAMMDD more blablabla that i dont need" MsgBox(0, "Results", StringRegExpReplace($sStr, ".*?([ADLMX]{3,}).*\v*", '"\1" ')) #cs Returns:- "LLLAAMMDDXXX" "AAAAMMDD" "XXAADD" "XXAAMMDD" #ce1 point
-
Sh3llC043r, If you want a sound as the ExtMsgBox appears, just add this line into the UDF after the GUI is shown: ; Show GUI GUISetState(@SW_SHOW, $hMsgGUI) ; Play sound Soundplay(@WindowsDir & "\Media\Windows Exclamation.wav", 1)From what I can see from my system, the sound should normally only be heard for alert, rather than information or query, message boxes. If you want to match that then you need to use this line: If $iIcon_Style = -2 Or $iIcon_Style = -4 Then Soundplay(@WindowsDir & "\Media\Windows Exclamation.wav", 1)Happy listening! M231 point
-
Hello ! I just released another winpcap autoit3 demo script, to capture http files. It supports and recovers from missing TCP packets, crc errors, SACKs, packets in wrong order... (but not yet for ip fragmentation). It is available on its own webpage. As usual, comments or bug repports to opensource (arobase) grisambre (dot) net1 point