Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/16/2015 in all areas

  1. When i get back ima attempt to rebuild this to NTOpenDirectoryObject... Func _NTAPI_ZwQueryObject(Const ByRef $hObject, $iObjectInformationClass = 0) Static $tagPUBLIC_OBJECT_BASIC_INFORMATION = "ULONG Attributes;ULONG GrantedAccess;ULONG HandleCount;ULONG PointerCount;ULONG Reserved[10]" Static $tagPUBLIC_OBJECT_TYPE_INFORMATION = "STRUCT;USHORT Length;USHORT MaximumLength;PTR Buffer;ENDSTRUCT;ULONG Reserved[22]" If Not $hObject Or ($iObjectInformationClass <> 0 And $iObjectInformationClass <> 2) Then Return SetError(87, 87, 0) Local $tObjectInformation = $iObjectInformationClass ? DllStructCreate($tagPUBLIC_OBJECT_TYPE_INFORMATION) : DllStructCreate($tagPUBLIC_OBJECT_BASIC_INFORMATION) $arDllCall = DllCall("Ntdll.dll", "LONG", "ZwQueryObject", "HANDLE", $hObject, "INT", $iObjectInformationClass, "STRUCT*", $tObjectInformation, "ULONG", DllStructGetSize($tObjectInformation), "ULONG*", 0) If @Error Then Return SetError(1, -@Error, 0) If $arDllCall[0] = 0xC0000004 Then $arDllCall = DllCall("Ntdll.dll", "LONG", "ZwQueryObject", "HANDLE", $hObject, "INT", $iObjectInformationClass, "STRUCT*", $tObjectInformation, "ULONG", $arDllCall[5], "ULONG*", 0) Return SetError($arDllCall[0], 0, $tObjectInformation) EndFunc
    1 point
  2. PRNG Here's a small PRNG called fliptag. It uses mostly linear math and its state can be completely kept within only 6 "registers" and the implementation is only 27 lines of code long. Verification I ran ent, DIEHARD and the NIST.GOV test suite against it (though I only did all the tests for one fixed seed). I re-ran ent with this, because this implementation has a system-time dependent seed. fliptag has 4 seed parameters, of which 3 are optional. The first one is the genesis seed and determines the starting state. Because this seed is very sensitive to small decimal changes, the current system tickcount (modified) is used in addition to the current system time. (AutoIts MT uses time(NULL)) Here are some sample ent results from the AutoIt test suite, which generates a 1,5 MB file from random bytes: Conclusion 1. Entropy A truly random sequence has an entropy value of 8.0. This is however not achievable by any software PRNG. Both PRNG are on par and have a very respectable entropy value. 2. Compression A dense file (with high entropy) cannot be compressed. Both PRNG achieve perfect scores. 3. Chi² The chi-square test is the most commonly used test for the randomness of data, and is extremely sensitive to errors in pseudorandom sequence generators. The chi-square distribution is calculated for the stream of bytes in the file and expressed as an absolute number and a percentage which indicates how frequently a truly random sequence would exceed the value calculated. We interpret the percentage as the degree to which the sequence tested is suspected of being non-random. If the percentage is greater than 99% or less than 1%, the sequence is almost certainly not random. If the percentage is between 99% and 95% or between 1% and 5%, the sequence is suspect. Percentages between 90% and 95% and 5% and 10% indicate the sequence is “almost suspect”. Both PRNGs achieve very good results. For comparison, Unix' rand() achieves a catastrophic 0.01, a Park & Miller PRNG will achieve roughly 97.5, while a truly - physical - random sequence will result in a Chi² score of about 40.9. 4. Arithmetic mean value Truly random sequences have an arithmetic mean value of exactly 127.5 (0xFF * 0.5). Both PRNG achieve near-perfect scores. 5. Monte Carlo Pi Each successive sequence of six bytes is used as 24 bit X and Y co-ordinates within a square. If the distance of the randomly-generated point is less than the radius of a circle inscribed within the square, the six-byte sequence is considered a “hit”. The percentage of hits can be used to calculate the value of Pi. For very large streams (this approximation converges very slowly), the value will approach the correct value of Pi if the sequence is close to random. Considering that even radioactive decay (true physical randomness) will not achieve better results than both PRNGs. So the scores are almost perfect. 6. Serial Correlation This quantity measures the extent to which each byte in the file depends upon the previous byte. For random sequences, this value (which can be positive or negative) will, of course, be close to zero. A non-random byte stream such as a C program will yield a serial correlation coefficient on the order of 0.5. Wildly predictable data such as uncompressed bitmaps will exhibit serial correlation coefficients approaching 1. Both PRNGs achieve very good results. Download fliptag-3.1.zip
    1 point
  3. lol, just found this link after all that... https://randomsourcecode.wordpress.com/2015/03/14/enumerating-deviceobjects-from-user-mode/ ​will check into it more later though...bed Zzzz
    1 point
  4. Look, I'm torn between two thoughts here. Free information sharing is cool and all, which is why I like these fora and I appreciate initiatives such as the one you undertook. But this course was obviously intended to be sold for actual money, and that opens you up for some more serious scrutiny. But it is free now, so I feel kind of bad for having such a strong opinion about it. Anyway, since you seem to want to go into it, I think you just adequately proved my point about the client being a bad choice. My bigger point is that there is no reason to use a third-party tool (in this case meaning not embedded in Windows by default) in the first place. Let me answer that not "ready for prime time" (yes, I know you asked JLogan3o13): in my opinion the course looks like you just videoed some random brainstorm sessions about what you would like to teach, but then decided to kind of leave it at that and stamp "course" on it. I'm not saying it's bad stuff in principle (I'm not going into what I would code differently), just that it's just not well-constructed teaching material (yet). It can probably be turned into teaching material, but in all honesty, I would suggest starting by redesigning the whole thing and preparing the lessons in advance, as opposed to just kind of making it up as you go along.
    1 point
  5. Having worked on a number SEPA-related projects myself, I'm sure you know PCI compliancy. Why then do you use what seem to be real-life contacts in your video, thereby compromising their privacy? If that isn't an obvious nono for someone as educated, experienced and driven as yourself, I don't know what is. Also you require your students to install some obscure third party application for no reason whatsoever. There are dozens of readily available applications in every student's Windows installation.
    1 point
  6. Someone told me I should post this in the examples section. I wrote this to make it easy for me to call a Windows console application and get its output using a single line of AutoIt code. I hope it's helpful to someone else. #include <Constants.au3> ; Examples: MsgBox(0,"Windows Version",_RunWaitGet(@ComSpec & " /c ver",1,"",@SW_HIDE)) MsgBox(0,"System Info",_RunWaitGet(@SystemDir & "\systeminfo.exe",1)) ; #FUNCTION# ==================================================================================================================== ; Name ..........: _RunWaitGet ; Description ...: Runs the specified process, waits for it to exit, then returns the contents of its StdOut and/or StdErr streams. ; Handy for running command-line tools and getting their output. ; Syntax ........: _RunWaitGet($sProgram, $nOptions, $sWorkingDir, $nShowFlag) ; Parameters ....: $sProgram - The full path of the program (EXE, BAT, COM, or PIF) to run ; $nOptions - Add options together: ; 1 = Capture the StdOut stream. ; 2 = Capture the StdErr stream. ; 4 = Return when the stream(s) close(s), not when the process ends. ; $sWorkingDir - The working directory. Blank ("") uses the current working directory. ; This is not the path to the program. ; $nShowFlag - The "show" flag of the executed program: ; @SW_SHOW = Show window (default) ; @SW_HIDE = Hidden window (or Default keyword) ; @SW_MINIMIZE = Minimized window ; @SW_MAXIMIZE = Maximized window ; Return values .: String value containing the captured contents. ; If there was a problem running the process, @error is set to the @error value returned by Run(). ; Otherwise, @error is 0. ; Author ........: ToasterKing ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: MsgBox(0,"System Info",_RunWaitGet(@SystemDir & "\systeminfo.exe",1)) ; MsgBox(0,"Windows Version",_RunWaitGet(@ComSpec & " /c ver",1,"",@SW_HIDE)) ; =============================================================================================================================== Func _RunWaitGet($sProgram,$nOptions = 0,$sWorkingDir = @SystemDir,$nShowFlag = @SW_SHOW) Local $nRunOptFlags = 0,$sStreamOut = "" ; Initialize variables ; Determine flags for parent/child interaction If BitAND($nOptions,1) Then $nRunOptFlags += $STDOUT_CHILD If BitAND($nOptions,2) Then $nRunOptFlags += $STDERR_CHILD Local $hRunStream = Run($sProgram,$sWorkingDir,$nShowFlag,$nRunOptFlags) ; Run the process If @error Then Return SetError(@error,@extended,0) ; If there was an error code, return it. Otherwise... While 1 ; Loop until the end of the stream, which indicates that the process has closed it (which usually means the process ended) If BitAND($nOptions,1) Then ; If user specified to capture STDOUT stream... $sStreamOut &= StdoutRead($hRunStream) ; Append new stream contents to existing variable while removing those contents from the stream. If @error = 2 And BitAND($nOptions,4) Then ExitLoop ; If stream ended and user specified to return when the stream closes, stop looping. EndIf If BitAND($nOptions,2) Then ; If user specified to capture STDERR stream... $sStreamOut &= StderrRead($hRunStream) ; Append new stream contents to existing variable while removing those contents from the stream. If @error = 2 And BitAND($nOptions,4) Then ExitLoop ; If stream ended and user specified to return when the stream closes, stop looping. EndIf If Not BitAND($nOptions,4) And Not ProcessExists($hRunStream) Then ExitLoop ; If using the default setting and the process ended, stop looping. Sleep(100) ; To avoid overloading the CPU WEnd Return SetError(0,0,$sStreamOut) ; Return the captured contents and @error = 0 EndFunc
    1 point
  7. That's not the sort of use I intended when I wrote the function, but this is AutoIt. Of course there is a way.™ Try my scribblings below. If you want something wrapped up in a nice, tidy function, that's an exercise for the reader. #include <Constants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiEdit.au3> $FormMain = GUICreate("Crappy Demo", 602, 297) $EditStdOut = GUICtrlCreateEdit("", 16, 16, 569, 225, BitOR($ES_AUTOVSCROLL,$ES_WANTRETURN,$WS_VSCROLL)) $ButtonTraceRoute = GUICtrlCreateButton("Trace Route!", 240, 256, 115, 25) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $ButtonTraceRoute _TraceRoute() EndSwitch WEnd Func _TraceRoute() GUICtrlSetState($ButtonTraceRoute,$GUI_DISABLE) $hRunStream = Run(@SystemDir & "\tracert.exe www.autoitscript.com",@SystemDir,@SW_HIDE,$STDOUT_CHILD) While 1 $sStreamOut = StdoutRead($hRunStream) If @error Then ExitLoop Else _GUICtrlEdit_AppendText($EditStdOut,$sStreamOut) EndIf Sleep(100) WEnd GUICtrlSetState($ButtonTraceRoute,$GUI_ENABLE) EndFunc
    1 point
  8. Hey! Im just going to say that im new to autoit and this is my first successful script ! anyway i have a little problem that does not make sense at all to me.... Maybe you can help me out? Anyone please?? What i have the SCRIPT do is this : The script finds a text box (on the screen) then it clicks the text box, then it sends "guess what...." but after it has sent "guess what...." FOR SOME REASON IT SCROLLS DOWN THEN ENDS THE SCRIPT WITH AN ERROR.... (see below for error...) "C:\Users\yolo\Desktop\bot\best.au3" (47) : ==> Illegal text at the end of statement (one statement per line).: mousewheel("down"), 3) mousewheel("down")^ ERRORHERE IS MY SCRIPT BELOW... That im having problems with. func ns3() $pixel = PixelSearch(416, 295, 882, 315, 0x707070) if IsArray($pixel) = true then MouseClick("left", $pixel[0], $pixel[1]) tn() EndIf EndFunc func tn() send ("guess{SPACE}what.....") sleep ($interval) sleep ($interval) findcombox() EndFuncSo what happens is it searches for the text box, then if it's true then mouse click then Func tn() runs Then func tn sends "guess what...." then sleeps THEN IS SCROLLS DOWN AND AN ERROR COMES UP?!!?!?!? what the heck ?! oh BTW i have a few "Scroll func's" (See Below) Func scroll() mousewheel("down", 2) EndFunc func scroll3t() mousewheel("down"), 3) EndFunc func scrollup() mousewheel("up"), 20) EndFunc scroll () - scrolls twice down scroll3t() - scrolls 3 times scrollup() - YOU GUESSED IT! scrolls up SO?! What the heck is happening?! im so confused why it's scrolling down twice for no reason.... it's not like i have the scroll() in the tn() ??
    1 point
  9. I think the video is somewhat incorrect (mis-leading?)... IMHO though Except the video, Its pure gold, TD
    1 point
  10. Quiz 2 question 5 has 3 multiple choice answers, of which two were exactly the same. Course designers should really walk through their own courses at least once (and preferably sober) before charging $179 for them. Luckily OP is an experienced IT manager, who succeeded in a record time to evolve in the stategic field of SEPA buzzword-or-another. Just imagine what this course would have been like without his excellent comunication skills and his total understanding of customers' requirements!
    1 point
  11. The language is AutoIt NOT AutoIT.
    1 point
  12. Wow... I never heard about that one. My fingers are itching to buy the Kindle version, just out of morbid curiosity. Like taking that big bucket of popcorn, rum and cola to watch The Room Luckily I am blissfully lacking a Kindle... I browsed to a few more lessons and lesson 11 is just the proverbial big bucket of nope. We are taught how to automate a "fat client", which is apparently a piece of nondescript software that we have to install, on the instructor's computer magically filled with a large number of seemingly real-life contact names, shown in a public video. Really?! Furthermore, we are taught how to hardcode coordinates and unwieldy keystroke combinations into our script to automate this very very specific piece of software that we will never use. And it goes on for 16 minutes. It's a good thing that lesson isn't the first one I landed on
    1 point
  13. That is pretty much the reaction I had to this user's several posts in the AutoIt LinkedIn group. As I stated there, I am all for people sharing their stuff and teaching others, but in this case I don't think the course is "ready for prime time". It reminds me of this debacle. http://www.amazon.com/Instant-AutoIt-Scripting-Emilio-Aristides/dp/1782165789/ref=sr_1_2?s=books&ie=UTF8&qid=1400637993&sr=1-2&keywords=autoit
    1 point
  14. I am in doubt about how to react. What exactly is your intention with this post? Are you looking for feedback? And can you indicate who your target audience actually is, so that it can be regarded from that perspective? I am sincerely interested in your research of the actual demand for such a course. Especially if you are planning on charging money for it. I did sit through a number of lessons and all in all, it looks (to me!) very much like an early draft version, with lots of botched sentences, unfinished examples and kind of disjointed "islands of tips&tricks", I would say. (Come on, who really needs a lesson about some very specific webcam automation UDF in a beginner AutoIt course?) You should also definitely collaborate with a sample member of your target audience. Preferably a native or at least a very good English speaker too, because heavily accented, mumbly English (also in your writing) and mediocre sound quality are very distracting. Maybe even more so to fellow non-native speakers. Also, the way you talk through your examples shows too little preparation. Mind you, that's all in my honest opinion of course, and I am definitely not the actual target audience Don't get me wrong, there's nothing wrong with the idea. And for free, as it is now, all it costs is some of your time and some viewers could maybe get some ideas from it that they wouldn't have gotten otherwise without extensive searching. But if you ever want to sell this, it needs a lot of work. This is an alpha version.
    1 point
  15. As I mentioned on the LinkedIn page, I think the price is just right You should also ask a Mod to move this to the appropriate forum, as there isn't really a question attached to it.
    1 point
×
×
  • Create New...