Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/10/2024 in all areas

  1. TL;DR: Create_Process calls cmd.exe if passed a .bat or .cmd file, however the non-standard character escaping of cmd.exe allows arbitrary code execution. NVD - CVE-2024-24576 (nist.gov) https://flatt.tech/research/posts/batbadbut-you-cant-securely-execute-commands-on-windows
    1 point
  2. SmOke_N

    Problem with SELECT

    That makes me giggle... Whatever the case, I know other mods are already fed up with his ignorantly posturized requests. No matter what people suggest, if they don't write the code for them specifically, this OP is never satisfied to do the work or research. I know others are (including mods) are already at their limit. To the OP, start posting really worked on problems, start researching the suggestions given to you with examples on how those suggestions are not working for you, starting reading some manuals, manuals not only on coding, but maybe how to request help. I'm locking this topic, I know his last topic was locked as well. Hopefully the OP gets the hint.
    1 point
  3. Musashi

    Problem with SELECT

    A simple question : do you really want to learn, or is your avatar just a abbreviation for "other people have to solve my poorly defined questions" ?
    1 point
  4. MattyD

    SNMP UDF rewrite

    I've recently been looking at the old SNMP UDP, and although it has served well over a long period of time it did look in need of a freshen up. So from the ground up, reintroducing SNMPv2. The UDF is still only community string stuff, so just SNMPv1 and SNMPv2c for now. V3 support is probably a ways off I'm affraid - the projects only about a week old, and theres a ton of work to be done before attacking that. The basic workflow is: Call the startup func Register a function to recieve incoming messages. (basically to recieve decoded OID/Value pairs.) or if you cant be bothered, an internal one will just write to the console! Open a device start querying devices and stuff The zip file attached has a bunch of demos scripts etc. to get you going. But here's an example script for post #1 anyhow. #include "SNMPv2.au3" ;-------------------------------------------------- Local $sIPAddress = "10.0.0.5" ;Device $__g_bRetTicksAsStr = True ;Return TimeTicks as human readable string (instead of int) ;There are few global params for now that you can set. - Check the demo scripts for details. ;-------------------------------------------------- Global Const $sOID_sysDescr = "1.3.6.1.2.1.1.1.0" Global Const $sOID_sysName = "1.3.6.1.2.1.1.5.0" Global Const $sOID_sysLocation = "1.3.6.1.2.1.1.6.0" Global Const $sOID_sysUpTime = "1.3.6.1.2.1.1.3.0" Global $mOIDLabMap[] $mOIDLabMap[$sOID_sysDescr] = "sysDescr" $mOIDLabMap[$sOID_sysName] = "sysName" $mOIDLabMap[$sOID_sysLocation] = "sysLocation" $mOIDLabMap[$sOID_sysUpTime] = "sysUpTime" ; Startup and register a handler for incoming messages. ; The function must accept 4 parameters - more on this futher down _SNMP_Startup("_CustomMsgHandler") ;Open device Local $iDevice = _SNMP_OpenDevice($sIPAddress) ;Get one specfic property. ;The community param is optional. (defaults to "public") _SNMP_GetRequest($iDevice, $sOID_sysDescr, "public") ;Or get multiple properties in one request. Local $aOids[3] $aOids[0] = $sOID_sysName $aOids[1] = $sOID_sysLocation $aOids[2] = $sOID_sysUpTime _SNMP_GetRequest($iDevice, $aOids) ;Temporarily keep the script alive! Sleep(500) ;Cleanup _SNMP_CloseDevice($iDevice) _SNMP_Shutdown() ; Handler Params: ; $iDevice - device that responded ; $dPacket - rawData ; $avHeader - metadata pulled from the response. Format: $array[6][2] (field, data) ; $avVarBinds - list of OID's and their associated data. Format: $array[n][6] (OID, Type, Value, RawType, RawValue) ; header feilds - "SNMP Version", "Community", "Request Index", "Error Message", "Error Code", "Error Index" Func _CustomMsgHandler($iDevice, $dRawPacket, $avHeaders, $avVarBinds) Local $sFeild, $vData For $i = 0 To UBound($avVarBinds) - 1 ; $avVarBinds[index][OID, Type, Value, RawType, RawValue] $sFeild = $mOIDLabMap[$avVarBinds[$i][0]] $vData = $avVarBinds[$i][2] ConsoleWrite(StringFormat("%15s: %s\r\n", $sFeild, $vData)) Next EndFunc SNMPv2c_1.0.zip
    1 point
  5. Not trying to re-invent the wheel here, but I found some examples that did A-L-O-T that I didn't think was necessary (like forcing owner-drawn), the sparse number of the web examples were failing miserably too. It looked like @argumentum was taking the path I was on, his is much more feature rich ( 😅 ) ... Anyway, I was going to add a font option using this subclass method (Thanks to @LarsJ for his subclass method, saved me some time) but I am out of time and if I don't post this now, I will probably forget to post it later (Yep, age is getting there). @LarsJ - GUIRegisterMsg20 - @argumentum ComboBox Set DROPDOWNLIST Colors/size UDF (Lots-O-Stuff) Here's my short and sweet (I don't think I ever code anything short.. or sweet) Edit 2024-04-10: Added the font change functions, pay attention to the fact that there are 3 different hwnds, the control hwnd, the edit hwnd as well as the listbox hwnd for the combo box. There are 4 functions, one changes all 3, the others change each of the other hwnds. Edit-2 2024-04-10: So I was going to use the forum members meticulous eyes to find issues, but I seemed to find a few that I didn't notice before myself. - Wrong array bounds in font au3 was fixed - Multi color (LB and Edit different colors) fixed (mistakenly used 1 brush ... oops) for color au3 - Missing edit color logic fixed for color au3 GUIComboBox.2024.04.10-002.zip
    1 point
  6. Yeah, I was closing it out of SciTe when I noticed I had the wrong number of default elements in the return array... oops. You must have went to download it when I was uploading the fix... sorry
    1 point
  7. Jump2afilenameinsidealitteralstring() still needs to be developed and is on my roadmap of 2040. But seriously, build your own lua function to jump to a selected string is always possible.
    1 point
  8. Guess we can shake hands on that one. 😉
    1 point
×
×
  • Create New...