Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/18/2014 in all areas

  1. 3 points
  2. trancexx

    WinHTTP functions

    The other day mikeytown2 posted one post in HTTP UDF's thread that got me thinking if there is better (different) method to send requests through the HTTP protocol to HTTP servers. There is Winhttp.dll that ships with windows and that is its main purpose. I couldn't find any examples of using this dll in AutoIt, so I came up with this. Microsoft about Windows HTTP Services: Microsoft Windows HTTP Services (WinHTTP) provides developers with an HTTP client application programming interface (API) to send requests through the HTTP protocol to other HTTP servers... .. blah, blah, and so on... This is an example of getting page header: #include "WinHttp.au3" Opt("MustDeclareVars", 1) ; Open needed handles Local $hOpen = _WinHttpOpen() Local $hConnect = _WinHttpConnect($hOpen, "msdn.microsoft.com") ; Specify the reguest: Local $hRequest = _WinHttpOpenRequest($hConnect, Default, "en-us/library/aa384101(VS.85).aspx") ; Send request _WinHttpSendRequest($hRequest) ; Wait for the response _WinHttpReceiveResponse($hRequest) Local $sHeader = _WinHttpQueryHeaders($hRequest) ; ...get full header ; Clean _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) ; Display retrieved header MsgBox(0, "Header", $sHeader)Everything you need to be able to use this UDF can be found at WinHttp site. Remember, basic understanding of the HTTP protocol is important to use this interface. ProgAndy, trancexx WinHttp.au3 is completely free and no one has right to charge you for it. That's very important. If you feel WinHttp.au3 was helpful to you and you wish to support my further work you can donate to my personal account via PayPal address: trancexx at yahoo dot com I will appreciate that very much. Thank you in advance! :kiss:
    1 point
  3. trancexx

    GIF Animation

    No it doesn't speak, I lied. That is impossible. It's about setting animated GIF (and every other type of images) to a GUI control. How is this done for animated GIF? Few simple steps: - created ImageList of GIF Bitmaps retrieved from gif file/resource - created Pic control - every now and then another image is displayed. This is determined by frame delay time - see gif specification somewhere. That's it. All that takes time and could potentially block our gui/script. That's why flying assembly is used. Animation is done in another thread different from one AutoIt's code is executed in. Nothing stops animation but you. Animation works both for x64 and x86. Also it works for all kind of images not only GIFs. That means you can use it to display PNGs, BMPs, JPGs, etc... All of them from resources too. Example: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "GIFAnimation.au3" Opt("MustDeclareVars", 1) ; Start by choosing GIF to display Global $sFile = FileOpenDialog("Choose Image", "", "(*.gif;*.png;*.jpg;*.tiff;*.bmp;*.jpeg)", -1, "") If @error Then Exit ; Make GUI Global $hGui = GUICreate("GIF Animation", 500, 500, -1, -1, $WS_OVERLAPPEDWINDOW) ; Add some buttons Global $hButton = GUICtrlCreateButton("&Pause animation", 50, 450, 100, 25) Global $hButton1 = GUICtrlCreateButton("&Delete Control", 200, 450, 100, 25) Global $hButton2 = GUICtrlCreateButton("&Open Image", 350, 450, 100, 25) ; Make GIF Control Global $hGIF = _GUICtrlCreateGIF($sFile, "", 10, 10) If @extended Then GUICtrlSetState($hButton, $GUI_DISABLE) GUICtrlSetTip($hGIF, "Image") ; Additional processing of some windows messages (for example) GUIRegisterMsg(133, "_Refresh") ; WM_NCPAINT GUIRegisterMsg(15, "_ValidateGIFs") ; WM_PAINT Global $iPlay = 1 ; Show it GUISetState() ; Loop till end While 1 Switch GUIGetMsg() Case -3 Exit Case $hButton If $iPlay Then If _GIF_PauseAnimation($hGIF) Then $iPlay = 0 GUICtrlSetData($hButton, "Resume animation") EndIf Else If _GIF_ResumeAnimation($hGIF) Then $iPlay = 1 GUICtrlSetData($hButton, "Pause animation") EndIf EndIf Case $hButton1 _GIF_DeleteGIF($hGIF) Case $hButton2 $sFile = FileOpenDialog("Choose gif", "", "(*.gif;*.png;*.jpg;*.tiff;*.bmp;*.jpeg)", -1, "", $hGui) If Not @error Then _GIF_DeleteGIF($hGIF); delete previous $hGIF = _GUICtrlCreateGIF($sFile, "", 10, 10) If @extended Then GUICtrlSetState($hButton, $GUI_DISABLE) Else GUICtrlSetState($hButton, $GUI_ENABLE) EndIf GUICtrlSetTip($hGIF, "Image") $iPlay = 1 GUICtrlSetData($hButton, "Pause animation") EndIf EndSwitch WEnd Func _Refresh($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam _GIF_RefreshGIF($hGIF) EndFunc ;==>_Refresh Func _ValidateGIFs($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam _GIF_ValidateGIF($hGIF) EndFunc ;==>_ValidateGIFs It should be 0% cpu. Download from here if you want to impress chicks: http://code.google.com/p/gif-animation/downloads/list There are 8 examples in there. GIF files are downloaded automatically if some example script needs it. Mostly from photobucket.com. Some examples work without classic download. Required data is get with InetRead(). That's mighty cool. So, download, open ZIP, grab folder inside and place it where you want. Run examples and that's it. Word or two about main function, _GUICtrlCreateGIF(). It can handle all sorts of input. Will display Images that are passed as binary, resource identifiers, strings, file names, ... everything. If it's valid image all works. For example, all this is valid: ; Pass GIF File path/name _GUICtrlCreateGIF("Some.gif", "", 10, 10) ; Binary data _GUICtrlCreateGIF($bGIF, "", 10, 10,) ; PE Resource (file GIF.dll, Type: GIF, Name: 4) _GUICtrlCreateGIF("GIF.dll", "GIF;4", 10, 10, 100, 120) ; PE Resource (file @AutoItExe, Type: RES, Name: BLAH, Language: 1033) _GUICtrlCreateGIF(@AutoItExe, "RES;BLAH;1033", 10, 10) ; PE Resource (file "explorer.exe", Type: 2, Name: 6801) _GUICtrlCreateGIF("explorer.exe", "2;6801", 10, 10) ;<- BITMAP ; PE Resource (file @AutoItExe, Type: RC_DATA, Name: PNG) _GUICtrlCreateGIF(@AutoItExe, "10;PNG", 10, 10) ; GIF string _GUICtrlCreateGIF(FileRead("Some.gif"), "", 10, 10) ____________________________________________
    1 point
  4. mesale0077 asked me whether I could code some CSS loading animations from different web sites. These are the results using GDI+ (AutoIt v3.3.12.0+ required!): _GDIPlus_MonochromaticBlinker.au3 / _GDIPlus_RotatingBokeh.au3 _GDIPlus_SpinningCandy.au3 / _GDIPlus_SteamPunkLoading.au3 _GDIPlus_IncreasingBalls.au3 / _GDIPlus_PacmanProgressbar.au3 _GDIPlus_StripProgressbar.au3 / _GDIPlus_RingProgressbar.au3 _GDIPlus_LineProgressbar.au3 / _GDIPlus_SimpleLoadingAnim.au3 _GDIPlus_TextFillingWithWater.au3 / _GDIPlus_MultiColorLoader.au3 _GDIPlus_LoadingSpinner.au3 / _GDIPlus_SpinningAndPulsing.au3 _GDIPlus_TogglingSphere.au3 / _GDIPlus_CloudySpiral.au3 _GDIPlus_GlowingText.au3 (thanks to Eukalyptus) / _GDIPlus_HypnoticLoader.au3 _GDIPlus_RotatingRectangles.au3 / _GDIPlus_TRONSpinner.au3 _GDIPlus_RotatingBars.au3 / _GDIPlus_AnotherText.au3 (thanks to Eukalyptus) _GDIPlus_CogWheels.au3 (thanks to Eukalyptus) / _GDIPlus_DrawingText.au3 (thanks to Eukalyptus) _GDIPlus_GearsAnim.au3 / _GDIPlus_LEDAnim.au3 _GDIPlus_LoadingTextAnim.au3 / _GDIPlus_MovingRectangles.au3 _GDIPlus_SpinningAndGlowing.au3 (thanks to Eukalyptus) / _GDIPlus_YetAnotherLoadingAnim.au3 _GDIPlus_AnimatedTypeLoader.au3 / _GDIPlus_Carousel.au3 Each animation function has a built-in example how it can be used. AiO download: GDI+ Animated Wait Loading Screens.7z (previous downloads: 1757) Big thanks to Eukalyptus for providing several examples. Maybe useful for some of you Br, UEZ PS: I don't understand CSS - everything is made out of my mind, so it might be different from original CSS examples
    1 point
  5. Melba23

    Remove Duplicates

    Althalus, 3.3.7 is the SciTE editor version. You find the AutoIt version by running this: ConsoleWrite(@AutoItVersion & @CRLF) M23
    1 point
  6. BrewManNH

    Remove Duplicates

    Upgrade your AutoIt version to the latest release (3.3.10.x) and you will find that the function runs a lot faster.
    1 point
  7. I'm very interested in this "useless" part of programming. Everything I learnt regarding GDI+ is from this forum! Prerequisite are a basic mathematical understanding how graphical stuff seems to work and the will to learn it. Br, UEZ
    1 point
  8. Servant, As I have nothing better to do for the moment, try this: #include <MsgBoxConstants.au3> #include <StringConstants.au3> $sParam = "{This|This particular|This kind of|This specific|That} {is one of the|is among the|is probably the|is just about the|is amongst the} {sentences|phrases|content|essay sentences|paragraphs} {in the|within the|inside the|inside|from the} {article|post|write-up|content|document} {with|along with|together with|using|having} {spin|rewrite|spin and rewrite|whirl|rotate} {syntax|format}." While 1 If MsgBox($MB_YESNO + $MB_SYSTEMMODAL, "Result", _SpinSyntax($sParam) & @CRLF & @CRLF & "Continue?") = 7 Then ExitLoop WEnd $sParam = "Note {this is the|this is actually the|here is the|this can be a|this can be the} other {value|worth|benefit|price|importance} of parameter." While 1 If MsgBox($MB_YESNO + $MB_SYSTEMMODAL, "Result", _SpinSyntax($sParam) & @CRLF & @CRLF & "Continue?") = 7 Then ExitLoop WEnd Func _SpinSyntax($sParam) Local $aSplit = StringSplit($sParam, "{}") Local $sResult = "" For $i = 1 To $aSplit[0] $aOption = StringSplit(StringStripWS($aSplit[$i], $STR_STRIPLEADING + $STR_STRIPTRAILING), "|") If @error Then $sResult &= $aOption[1] & " " Else $sResult &= $aOption[Random(1, $aOption[0], 1)] & " " EndIf Next Return $sResult EndFunc Works for me. M23
    1 point
  9. Something like this. Modify it to suite your needs: $param = "{This|This particular|This kind of|This specific|That} {is one of the|is among the|is probably the|is just about the|is amongst the} {sentences|phrases|content|essay sentences|paragraphs} {in the|within the|inside the|inside|from the} {article|post|write-up|content|document} {with|along with|together with|using|having} {spin|rewrite|spin and rewrite|whirl|rotate} {syntax|format}." $a = StringRegExp($param,"\{([^|]+)\|([^|]+)\|?([^|]+)?\|?([^|]+)?\|?([^|]+)?\}",4) For $i = 0 to UBound($a)-1 $aTemp = $a[$i] ConsoleWrite($aTemp[Random(1,UBound($aTemp)-1,1)] & @CRLF) Next
    1 point
  10. You can get all this data from the registry using AutoIt too. Then write it out to a SQL database. That way an external text file wouldn't be a controlled variable you have to worry about.
    1 point
  11. Fixed the two of the bugs (courtesy - Lupo73 and theTony). Check the first post for more information. I was delaying for the reason of finding out a way to make asynchronous finding of the text in the list, so as to populate words efficiently when the size is more than 1000(as posted by ValeryVal). I could find out an appropriate way, but now I'm running out of time to implement it in the UDF. For the time being, I had fixed up the bugs. Regards Phoenix XL
    1 point
  12. ok now try this: Local $oMaps= _IETagNameGetCollection($oIE, "map") For $oMap In $oMaps if StringInStr($oMap.outerhtml,'MapdbbTopGraphic:_ct10:ccTopGraphic') <> 0 Then _IEAction ($oMap, "click") ExitLoop EndIf EndIf
    1 point
  13. BuckMaster

    Form Builder beta

    Update v1.0.7 - Help File Look-up hotkey changed to Ctrl+B - Replace hotkey changed to Ctrl+H - Changes to $SCN_MODIFIED so only text events are notified - Bookmarks added, Ctrl+M to add or delete a Bookmark from the current line - Edit -> Bookmarks -> Set Bookmark changes the currently selected Bookmark - Edit -> Clear Current Bookmarks deletes only the currently selected Bookmark - Allows you to change foreground and background colors of Bookmarks - Added F2 hotkey for Next Bookmark - Added Shift+F2 hotkey for Previous Bookmark - Fixed a bug that made it so script annotation did not show up for some people - Script errors and warnings now add a Bookmark on each line - Ctrl+E hotkey added to clear all Bookmarks and Annotations - Minor GUI tweaks - Fixed a bug with the GUI Style undo action - Undo and Redo actions for GUI windows will now update the window properties if the GUI is selected - F4 Hotkey no longer switches modes, switching modes is now F10 - F4 is to toggle next error or warning message, works like it does in SciTe, bookmarks the line and highlights the error in the console - Shift+F4 Hotkey added to toggle previous error or warning message - Shift+F5 Hotkey added to clear script output - Ctrl+F5 Hotkey added as SyntaxCheck Prod - Form Builder now performs a SyntaxCheck before entering GUI Mode and prompts on Error or Warning - Language Select Menu Added Settings -> Lanugage - Icons added to main menu - Languages added to all new menu items and msgbox's - Language Files updated for new data - Language Support added for Arabic, Chinese, Dutch, French, German, Hebrew, Japanese, Swedish, Thai, and Vietnamese [ Google Translate ] - Fixed bug with updating a language that made it look like ANSI and UTF-8 were both selected - Added redo button next to undo button - Font attribute buttons Bold, Italic, Underline and Strike-Out changed to labels Source has all resource files and non-standard includes now
    1 point
  14. UEZ

    GUIConstants dont show

    I assume he means that the controls are overwritten by the animation. When using GDI+ you can exclude areas used by the controls, I don't know how to exclude areas using OpenGL but you can add a transparent child GUI where you can see the animated background. @mesale0077 try this: #include <Date.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Memory.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> ;Opt("MouseCoordMode",0) opt("TrayIconDebug", 1) Opt("TrayOnEventMode", 1) Opt("TrayMenuMode", 3) ;#include "OpenGLconstants.au3" ; constants are extracred for this examle ;Opt("GUIOnEventMode", 1) _Fofff() Func _Fofff() Global $Input2, $Input1, $exititem_2, $exititem_1, $exititem Global $speed = 0.5 ; speed of projectile, 0.28 defult Global $relitave = 0 If $relitave = 1 Then Global $tail = $speed * 3.2145 Else Global $tail = 14.0 EndIf ; Used constants from OpenGLconstants.au3 Global Const $GL_VERSION_1_1 = 1 Global Const $GL_DEPTH_BUFFER_BIT = 0x00000100 Global Const $GL_COLOR_BUFFER_BIT = 0x00004000 Global Const $GL_SRC_COLOR = 0x0300 Global Const $GL_DST_COLOR = 0x0306 Global Const $GL_FOG = 0x0B60 Global Const $GL_FOG_DENSITY = 0x0B62 Global Const $GL_FOG_START = 0x0B63 Global Const $GL_FOG_END = 0x0B64 Global Const $GL_FOG_MODE = 0x0B65 Global Const $GL_FOG_COLOR = 0x0B66 Global Const $GL_BLEND = 0x0BE2 Global Const $GL_FOG_HINT = 0x0C54 Global Const $GL_DONT_CARE = 0x1100 Global Const $GL_MODELVIEW = 0x1700 Global Const $GL_PROJECTION = 0x1701 Global Const $GL_LINEAR = 0x2601 ; Some other constants Global Const $PFD_TYPE_RGBA = 0 Global Const $PFD_MAIN_PLANE = 0 Global Const $PFD_DOUBLEBUFFER = 1 Global Const $PFD_DRAW_TO_WINDOW = 4 Global Const $PFD_SUPPORT_OPENGL = 32 ; Number of stars Global $iNumStars = 9999 ; for example ; Make a GUI Global $iWidthGUI = 334 Global $iHeightGUI = 118 Global $Form1 = GUICreate("[#]Zaman baþlatma by @mesale0077[#]", $iWidthGUI, $iHeightGUI, -1, -1, $WS_OVERLAPPEDWINDOW) Global $hGUI_Child = GUICreate("", $iWidthGUI, $iHeightGUI, 0, 0, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $Form1) GUISetBkColor(0xABCDEF, $hGUI_Child) GUISwitch($hGUI_Child) _WinAPI_SetLayeredWindowAttributes($hGUI_Child, 0xABCDEF) $Label1 = GUICtrlCreateLabel("BEKLETME DK CÝNSÝ :", 8, 16, 112, 17) GUICtrlSetColor(-1, 0xFFFFFF) $Label2 = GUICtrlCreateLabel("SINAV SÜRE DK CÝNSÝ :", 8, 60, 120, 17) GUICtrlSetColor(-1, 0xFFFFFF) GUICtrlSetLimit(-1, 2) $Input2 = GUICtrlCreateInput("3", 192, 56, 57, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER)) GUICtrlSetLimit(-1, 2) $Input1 = GUICtrlCreateInput("1", 192, 16, 57, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_NUMBER)) $Button1 = GUICtrlCreateButton("BAÞLA", 256, 24, 57, 41, $WS_GROUP) GUICtrlSetCursor(-1, 0) $Label3 = GUICtrlCreateLabel("Hazýrlayan: @mesale0077", 176, 88, 144, 17) GUICtrlSetColor(-1, 0xFFFFFF) $exititem_1 = TrayCreateItem("SIFIRLA") TrayItemSetOnEvent(-1, "Close") $exititem = TrayCreateItem("ÇIKIÞ") TrayItemSetOnEvent(-1, "Close") $exititem_2 = TrayCreateItem("HAKKINDA") TrayItemSetOnEvent(-1, "Close") TraySetState() GUISetState(@SW_SHOW, $Form1) GUISetState(@SW_SHOW, $hGUI_Child) ; Black? Yes black. ;~ GUISetBkColor(0) ; Device context and rendering context Global $hDC, $hRC ; this two goes in _EnableOpenGL() ByRef ; Enabling OpenGL If Not _EnableOpenGL($Form1, $hDC, $hRC) Then MsgBox(48, "Error", "Error initializing usage of OpenGL functions" & @CRLF & "Error code: " & @error) ; this is bad Exit EndIf ; Initially cleaning buffers - this is almost redundant. wglMakeCurrent is to associate rendering context with the current thread DllCall("opengl32.dll", "int", "wglMakeCurrent", "hwnd", $hDC, "hwnd", $hRC) _glClear(BitOR($GL_COLOR_BUFFER_BIT, $GL_DEPTH_BUFFER_BIT)) ; initially cleaning buffers in case something is left there Global $tRandom = DllStructCreate("dword") ; this will hold generated random walues by RtlRandomEx function Global $pRandom = DllStructGetPtr($tRandom) Global $tFogColor = DllStructCreate("float[4]") ; fog color structure. Needed for _glFogfv function DllStructSetData($tFogColor, 1, 1, 4) ; other two values are 0 Global $pFogColor = DllStructGetPtr($tFogColor) Global $tStars = DllStructCreate("float[" & 3 * $iNumStars & "]") ; this structure holds coordinates for every star Global $pStars = DllStructGetPtr($tStars) Global $tInt = DllStructCreate("dword") ; this will dynamically hold the address of $tStars DllStructSetData($tInt, 1, $pStars) Global $pInt = DllStructGetPtr($tInt) Global $tInt1 = DllStructCreate("int") ; this is placeholder for the integer used in assembly code in different places Global $pInt1 = DllStructGetPtr($tInt1) Global $tInt2 = DllStructCreate("int") ; this is placeholder for the float value of the same value. It's the main 'frequency' DllStructSetData($tInt2, 1, 150) Global $pInt2 = DllStructGetPtr($tInt2) Global $tEndColor = DllStructCreate("float[3]") ; this structure holds ending color of each star (same value for all of them) DllStructSetData($tEndColor, 1, 0.2, 3) ; other two values are 0 Global $pEndColor = DllStructGetPtr($tEndColor) Global $tStartColor = DllStructCreate("float[3]") ; this structure holds start color for each star DllStructSetData($tStartColor, 1, 0.5, 1) ; color crap============================================================= DllStructSetData($tStartColor, 1, 0.9, 2) ; color crap============================================================= DllStructSetData($tStartColor, 1, 0.9, 3) ; color crap============================================================= Global $pStartColor = DllStructGetPtr($tStartColor) Global $tZoffset = DllStructCreate("float") ; this is determining the tail of passing stars DllStructSetData($tZoffset, 1, $tail) ; length of tail============================================================= Global $pZoffset = DllStructGetPtr($tZoffset) Global $tZincrement = DllStructCreate("float") ; I call this 'repetitive density value' ...or spead if you like DllStructSetData($tZincrement, 1, $speed) ; 0.28 Global $pZincrement = DllStructGetPtr($tZincrement) Global $tThreshold = DllStructCreate("float") ; this structure will hold a threshold value DllStructSetData($tThreshold, 1, 5) ; value is 5 (star will be out of scope when 5 is reached) Global $pThreshold = DllStructGetPtr($tThreshold) ; SwapBuffers to fully use double-buffering Global $aSwapBuffers = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("gdi32.dll"), "str", "SwapBuffers") Global $pSwapBuffers = $aSwapBuffers[0] ; glClear to clean buffers Global $aglClear = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("opengl32.dll"), "str", "glClear") Global $pglClear = $aglClear[0] ; glBegin to initialize drawing procedure Global $aglBegin = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("opengl32.dll"), "str", "glBegin") Global $pglBegin = $aglBegin[0] ; glEnd to end drawing procedure Global $aglEnd = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("opengl32.dll"), "str", "glEnd") Global $pglEnd = $aglEnd[0] ; $pwglMakeCurrent for rendering context Global $awglMakeCurrent = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("opengl32.dll"), "str", "wglMakeCurrent") Global $pwglMakeCurrent = $awglMakeCurrent[0] ; RtlRandomEx for generating random integers Global $aRtlRandomEx = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("ntdll.dll"), "str", "RtlRandomEx") Global $pRtlRandomEx = $aRtlRandomEx[0] ; glVertex3fv for drawing Global $aglVertex3fv = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("opengl32.dll"), "str", "glVertex3fv") Global $pglVertex3fv = $aglVertex3fv[0] ; glColor3fv for color of lines Global $aglColor3fv = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("opengl32.dll"), "str", "glColor3fv") Global $pglColor3fv = $aglColor3fv[0] ; Allocating enough memory (512 bytes) with $PAGE_EXECUTE_READWRITE Global $pRemoteCode = _MemVirtualAlloc(0, 512, $MEM_COMMIT, $PAGE_EXECUTE_READWRITE) ; Standard allocation in reserved address (512 bytes again) Global $tCodeBuffer = DllStructCreate("byte[512]", $pRemoteCode) ; Writing to it (this is setting initial values - coordinates for aech and every star) DllStructSetData($tCodeBuffer, 1, _ "0x" & _ "8B1D" & SwapEndian($pInt) & _ ; mov ebx, $pInt "" & _ "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx "FFD0" & _ ; call eax "99" & _ ; cdq "B9" & SwapEndian(42949673) & _ ; mov ecx, 42949673d "F7F1" & _ ; div ecx "83E8" & Hex(25, 2) & _ ; sub eax, 25d "A3" & SwapEndian($pInt1) & _ ; mov $pInt1, eax "DB05" & SwapEndian($pInt1) & _ ; fild $pInt1 "D95B" & Hex(0, 2) & _ ; fstp 32real[ebx+0d] "" & _ "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx "FFD0" & _ ; call eax "99" & _ ; cdq "B9" & SwapEndian(42949673) & _ ; mov ecx, 42949673d "F7F1" & _ ; div ecx "83E8" & Hex(25, 2) & _ ; sub eax, 25d "A3" & SwapEndian($pInt1) & _ ; mov $pInt1, eax "DB05" & SwapEndian($pInt1) & _ ; fild $pInt1 "D95B" & Hex(4, 2) & _ ; fstp 32real[ebx+4d] "" & _ "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx "FFD0" & _ ; call eax "99" & _ ; cdq "B9" & SwapEndian(14316558) & _ ; mov ecx, 14316558d "F7F1" & _ ; div ecx "A3" & SwapEndian($pInt1) & _ ; mov $pInt1, eax "DB05" & SwapEndian($pInt1) & _ ; fild $pInt1 "D9E0" & _ ; fchs ;<- change sign of st(0) "D95B" & Hex(8, 2) & _ ; fstp 32real[ebx+8d] "" & _ "81C3" & SwapEndian(12) & _ ; add ebx, 12 "81FB" & SwapEndian($pStars + $iNumStars * 12) & _ ; cmp ebx, $pStars+$iNumStars*12 ; <- compare ebx with $pStars+$iNumStars*size of float[3] "75" & Hex(-124, 2) & _ ; jne -124 bytes ;<- go back 124 bytes if not equal "C3" _ ; ret ) ; Executing code DllCall("user32.dll", "int", "CallWindowProcW", _ "ptr", $pRemoteCode, _ "int", 0, _ "int", 0, _ "int", 0, _ "int", 0) ; Writing new code (will use the same buffer since the code from it is already executed) DllStructSetData($tCodeBuffer, 1, _ "0x" & _ "" & _ ; >>>>>>>>>>>>>>>>>>>> GENERAL JOB <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 10. $hRC TO THIS THREAD (17 bytes code): "68" & SwapEndian($hRC) & _ ; push $hRC "68" & SwapEndian($hDC) & _ ; push $hDC "B8" & SwapEndian($pwglMakeCurrent) & _ ; mov eax, wglMakeCurrent "FFD0" & _ ; call eax ;<- calling function "" & _ ; 20. CLEAR BUFFERS (12 bytes code): "68" & SwapEndian(16640) & _ ; push $GL_COLOR_BUFFER_BIT|$GL_DEPTH_BUFFER_BIT "B8" & SwapEndian($pglClear) & _ ; mov eax, glClear "FFD0" & _ ; call eax ;<- calling function "" & _ ; 30. WILL DRAW LINES - INITIALIZE LINES (12 bytes code): "68" & SwapEndian(1) & _ ; push $GL_LINES "B8" & SwapEndian($pglBegin) & _ ; mov eax, glBegin "FFD0" & _ ; call eax ;<- calling function "" & _ ; >>>>>>>>>>>>>>>>>>>> FIRST LOOP <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 40. INITIALIZE LOOP BY ASSIGNING INITIAL VALUE TO ebx (6 bytes code): "8B1D" & SwapEndian($pInt) & _ ; mov ebx, [$pInt] ;<- assigning ebx to address of $pStars (stored in $tInt) "" & _ ; 50. DETERMINING INITIAL COLOR (12 bytes code): "68" & SwapEndian($pStartColor) & _ ; push $pStartColor ;<- this is float[3] with start color (r, g, b) "B8" & SwapEndian($pglColor3fv) & _ ; mov eax, $pglColor3fv ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling glColor3fv function "" & _ ; 60. DETERMINING INITIAL POINT (8 bytes code): "53" & _ ; push ebx ;<- this is float[3] with start coordinates (x, y, z) "B8" & SwapEndian($pglVertex3fv) & _ ; mov eax, $pglVertex3fv ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling glVertex3fv function "" & _ ; 70. DETERMINING END COLOR (12 bytes code): "68" & SwapEndian($pEndColor) & _ ; push $pEndColor ;<- this is float[3] with ending color (r, g, b) "B8" & SwapEndian($pglColor3fv) & _ ; mov eax, $pglColor3fv "FFD0" & _ ; call eax ;<- calling glColor3fv function "" & _ ; 80. DETERMINING END POINT (dislocate z coordinate by value of $tZoffset) (20 bytes code): "D943" & Hex(8, 2) & _ ; fld 32real[ebx+8d] ;<- load float (z coordinate) "D825" & SwapEndian($pZoffset) & _ ; fsub [$pZoffset] ; <- substract value stored in $tZoffset "D95B" & Hex(8, 2) & _ ; fstp 32real[ebx+8d] ;<- save changes and pop "53" & _ ; push ebx ;<- this is float[3] with ending coordinates (x, y, z) "B8" & SwapEndian($pglVertex3fv) & _ ; mov eax, $pglVertex3fv ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling glVertex3fv function "" & _ ; 90. RESTORE z COORDINATE (12 bytes code): "D943" & Hex(8, 2) & _ ; fld 32real[ebx+8d] ;<- load float (z coordinate) "D805" & SwapEndian($pZoffset) & _ ; fadd [$pZoffset] ;<- add value of $tZoffset "D95B" & Hex(8, 2) & _ ; fstp 32real[ebx+8d] ;<- save changes and pop "" & _ ; 100. ADD SIZE OF float[3] TO ebx (3 bytes code): "83C3" & Hex(12, 2) & _ ; add ebx, 12 ;<- add 12 to ebx. That is the size of float[3] "" & _ ; 110. COMPARE IT (6 bytes code): "81FB" & SwapEndian($pStars + $iNumStars * 12) & _ ; cmp ebx, $pStars+$iNumStars*12 ; <- compare ebx with $pStars+$iNumStars*size of float[3] "" & _ ; 120. MAKE A CONDITION (2 bytes code): "73" & Hex(2, 2) & _ ; jnb 2d ;<- jump forward 2 bytes on not below; to <135> "" & _ ; 130. GO BACK (2 bytes code): "EB" & Hex(-77, 2) & _ ; jump -77d ;<- jump 77 bytes back otherwise; to <50> "" & _ ; >>>>>>>>>>>>>>>>>>>> GENERAL JOB <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 135. CALL glEnd FUNCTION (7 bytes code): "B8" & SwapEndian($pglEnd) & _ ; mov eax, glEnd "FFD0" & _ ; call eax ;<- calling glEnd "" & _ ; >>>>>>>>>>>>>>>>>>>> SECOND LOOP <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 140. INITIALIZING NEW LOOP (6 bytes code): "8B1D" & SwapEndian($pInt) & _ ; mov ebx, [$pInt] ;<- assigning ebx to address of $pStars (stored in $tInt) "" & _ ; 150. CHECK THRESHOLD (12 bytes code): "D943" & Hex(8, 2) & _ ; fld 32real[ebx+8d] ;<- load float (z coordinate) "D81D" & SwapEndian($pThreshold) & _ ; fcomp [$pThreshold] ;<- compare st(0) to float at $tThreshold and pop "DFE0" & _ ; fnstsw ax ; update ax register (this is essential for conditional jumps with floats) "9E" & _ ; sahf ; copy ah register (same remark as above) "" & _ ; 160. MAKE A CONDITION (2 bytes code): "73" & Hex(25, 2) & _ ; jnb 25d ;<- jump 25 bytes forward on not below; to <220> "" & _ ; 170. 'MOVE' IT (12 bytes code): "D943" & Hex(8, 2) & _ ; fld 32real[ebx+8d] ;<- load float (z coordinate) "D805" & SwapEndian($pZincrement) & _ ; fadd [$pZincrement] ;<- add (increment by) value of $tZincrement "D95B" & Hex(8, 2) & _ ; fstp 32real[ebx+8d] ;<- save changes "" & _ ; 180. ADD SIZE OF float[3] TO ebx (3 bytes code): "83C3" & Hex(12, 2) & _ ; add ebx, 12 ;<- add 12 to ebx. That is the size of float[3] "" & _ ; 190. COMPARE IT (6 bytes code): "81FB" & SwapEndian($pStars + $iNumStars * 12) & _ ; cmp ebx, $pStars+$iNumStars*12 ; <- compare ebx with $pStars+$iNumStars*size of float[3] "" & _ ; 200. MAKE A CONDITION (2 bytes code): "73" & Hex(103, 2) & _ ; jnb 103d ;<- jump forward 103 bytes on not below; to <290> "" & _ ; 210. GO BACK (2 bytes code): "EB" & Hex(-39, 2) & _ ; jump -39d ;<- jump 39 bytes back otherwise; to <150> "" & _ ; 220. GENERATE RANDOM INTEGER IN RANGE OF -25, 25 AND SAVE IT TO x COORDINATE FLOAT (37 bytes code): "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling RtlRandomEx function "99" & _ ; cdq "B9" & SwapEndian(42949673) & _ ; mov ecx, 42949673d "F7F1" & _ ; div ecx "83E8" & Hex(25, 2) & _ ; sub eax, 25d "A3" & SwapEndian($pInt1) & _ ; mov $pInt1, eax "DB05" & SwapEndian($pInt1) & _ ; fild $pInt1 "D95B" & Hex(0, 2) & _ ; fstp 32real[ebx+0d] "" & _ ; 230. GENERATE RANDOM INTEGER IN RANGE OF -25, 25 AND SAVE IT TO y COORDINATE FLOAT (37 bytes code): "68" & SwapEndian($pRandom) & _ ; push $pRandom ;<- "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling RtlRandomEx "99" & _ ; cdq "B9" & SwapEndian(42949673) & _ ; mov ecx, 4294967d "F7F1" & _ ; div ecx "83E8" & Hex(25, 2) & _ ; sub eax, 250d "A3" & SwapEndian($pInt1) & _ ; mov $pInt1, eax "DB05" & SwapEndian($pInt1) & _ ; fild $pInt1 "D95B" & Hex(4, 2) & _ ; fstp 32real[ebx+4d] "" & _ ; 240. SET z COORDINATE to -150 FLOAT VALUE (11 bytes code): "DB05" & SwapEndian($pInt2) & _ ; fild $pInt2 "D9E0" & _ ; fchs ;<- change sign of st(0) "D95B" & Hex(8, 2) & _ ; fstp 32real[ebx+8d] ;<- save it to proper location "" & _ ; 250. ADD SIZE OF float[3] TO ebx (3 bytes code): "83C3" & Hex(12, 2) & _ ; add ebx, 12 ;<- add 12 to ebx. That is the size of float[3] "" & _ ; 260. COMPARE IT (6 bytes code): "81FB" & SwapEndian($pStars + $iNumStars * 12) & _ ; cmp ebx, $pStars+$iNumStars*12 ; <- compare ebx with $pStars+$iNumStars*size of float[3] "" & _ ; 270. MAKE A CONDITION (2 bytes code): "73" & Hex(5, 2) & _ ; jnb 5d ;<- jump forward 5 bytes on not below; to <290> "" & _ ; 280. GO BACK (5 bytes code): "E9" & SwapEndian(-140) & _ ; jump -140d ;<- jump 140 bytes back otherwise; to <150> "" & _ ; 290. CALL SwapBuffers function (12 bytes code): "68" & SwapEndian($hDC) & _ ; push $hDC "B8" & SwapEndian($pSwapBuffers) & _ ; mov eax, SwapBuffers "FFD0" & _ ; call eax ;<- calling SwapBuffers "" & _ ; 300. RETURN (1 byte code): "C3" _ ; ret ) ; associate contexts with the current thread DllCall("opengl32.dll", "int", "wglMakeCurrent", "hwnd", $hDC, "hwnd", $hRC) ;Initializing gl environment _glClearColor(0, 0, 0, 1) ; we said black _glFogi($GL_FOG_MODE, $GL_LINEAR) _glFogfv($GL_FOG_COLOR, $pFogColor) _glFogf($GL_FOG_DENSITY, 0.1) _glHint($GL_FOG_HINT, $GL_DONT_CARE) _glFogf($GL_FOG_START, 70) _glFogf($GL_FOG_END, 150) _glEnable($GL_FOG) _glBlendFunc($GL_SRC_COLOR, $GL_DST_COLOR) _glEnable($GL_BLEND) ; Initially put things in place (literally) _glLoadIdentity() _glViewport(0, 0, $iWidthGUI, $iHeightGUI) _glMatrixMode($GL_PROJECTION) _glLoadIdentity() Global $nRatio = $iWidthGUI / $iHeightGUI _glFrustum(-$nRatio * 0.75, $nRatio * 0.75, -0.75, 0.75, 6, 150) _glMatrixMode($GL_MODELVIEW) ; Installing function to do the refreshment GUIRegisterMsg(133, "_Preserve") ; WM_NCPAINT ; Installing function to do handle resizing GUIRegisterMsg(5, "_ResizeGL") ; WM_SIZE ; Handling things on Exit ;GUISetOnEvent(-3, "_Quit") ; $GUI_EVENT_CLOSE ; Loop till the end While 1 _GLDraw() Sleep(20) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ;_BlockInputEx(0) ;~ TrayBoxCreate("", "HAZIRLAYAN:" & @CRLF & "@mesale0077" & @CRLF & "Bilgi:" & @CRLF & "Ýlginiz için teþekkürler") Exit Case $Button1 GUISetState(@SW_HIDE, $Form1) r1() EndSwitch WEnd EndFunc ;==>_Fofff Func Close_skin() ToolTip("") ; Make a GUI ; Make a GUI Global $iWidthGUI = @DesktopWidth Global $iHeightGUI = @DesktopHeight Global $hGUI = GUICreate("OpenGL Space", $iWidthGUI, $iHeightGUI, 0, 0, $WS_POPUP, $WS_EX_TOPMOST) $Label1121 = GUICtrlCreateLabel("SÜRE BÝTTÝ !", (@DesktopWidth / 2) - 100, (@DesktopHeight / 2) - 100, 207, 41, $SS_CENTER) GUICtrlSetFont(-1, 24, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFFFF) Sleep(500) $Button2123 = GUICtrlCreateLabel("ÇIKIÞ", (@DesktopWidth / 2) - 50, (@DesktopHeight / 2) - 30, 92, 25, BitOR($SS_CENTER, $WS_BORDER), $WS_EX_CLIENTEDGE) GUICtrlSetCursor(-1, 0) GUICtrlSetBkColor(-1, 0x000000) GUICtrlSetColor(-1, 0xFFFFFF) $Label3 = GUICtrlCreateLabel("Hazýrlayan: @mesale0077", (@DesktopWidth / 2) - 75, (@DesktopHeight / 2), 144, 17, $SS_CENTER) GUICtrlSetColor(-1, 0xFFFFFF) ; Black? Yes black. GUISetBkColor(0) ; Device context and rendering context Global $hDC, $hRC ; this two goes in _EnableOpenGL() ByRef ; Enabling OpenGL If Not _EnableOpenGL($hGUI, $hDC, $hRC) Then MsgBox(48, "Error", "Error initializing usage of OpenGL functions" & @CRLF & "Error code: " & @error) ; this is bad Exit EndIf ; Initially cleaning buffers - this is almost redundant. wglMakeCurrent is to associate rendering context with the current thread DllCall("opengl32.dll", "int", "wglMakeCurrent", "hwnd", $hDC, "hwnd", $hRC) _glClear(BitOR($GL_COLOR_BUFFER_BIT, $GL_DEPTH_BUFFER_BIT)) ; initially cleaning buffers in case something is left there Global $tRandom = DllStructCreate("dword") ; this will hold generated random walues by RtlRandomEx function Global $pRandom = DllStructGetPtr($tRandom) Global $tFogColor = DllStructCreate("float[4]") ; fog color structure. Needed for _glFogfv function DllStructSetData($tFogColor, 1, 1, 4) ; other two values are 0 Global $pFogColor = DllStructGetPtr($tFogColor) Global $tStars = DllStructCreate("float[" & 3 * $iNumStars & "]") ; this structure holds coordinates for every star Global $pStars = DllStructGetPtr($tStars) Global $tInt = DllStructCreate("dword") ; this will dynamically hold the address of $tStars DllStructSetData($tInt, 1, $pStars) Global $pInt = DllStructGetPtr($tInt) Global $tInt1 = DllStructCreate("int") ; this is placeholder for the integer used in assembly code in different places Global $pInt1 = DllStructGetPtr($tInt1) Global $tInt2 = DllStructCreate("int") ; this is placeholder for the float value of the same value. It's the main 'frequency' DllStructSetData($tInt2, 1, 150) Global $pInt2 = DllStructGetPtr($tInt2) Global $tEndColor = DllStructCreate("float[3]") ; this structure holds ending color of each star (same value for all of them) DllStructSetData($tEndColor, 1, 0.2, 3) ; other two values are 0 Global $pEndColor = DllStructGetPtr($tEndColor) Global $tStartColor = DllStructCreate("float[3]") ; this structure holds start color for each star DllStructSetData($tStartColor, 1, 0.5, 1) ; color crap============================================================= DllStructSetData($tStartColor, 1, 0.9, 2) ; color crap============================================================= DllStructSetData($tStartColor, 1, 0.9, 3) ; color crap============================================================= Global $pStartColor = DllStructGetPtr($tStartColor) Global $tZoffset = DllStructCreate("float") ; this is determining the tail of passing stars DllStructSetData($tZoffset, 1, $tail) ; length of tail============================================================= Global $pZoffset = DllStructGetPtr($tZoffset) Global $tZincrement = DllStructCreate("float") ; I call this 'repetitive density value' ...or spead if you like DllStructSetData($tZincrement, 1, $speed) ; 0.28 Global $pZincrement = DllStructGetPtr($tZincrement) Global $tThreshold = DllStructCreate("float") ; this structure will hold a threshold value DllStructSetData($tThreshold, 1, 5) ; value is 5 (star will be out of scope when 5 is reached) Global $pThreshold = DllStructGetPtr($tThreshold) ; SwapBuffers to fully use double-buffering Global $aSwapBuffers = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("gdi32.dll"), "str", "SwapBuffers") Global $pSwapBuffers = $aSwapBuffers[0] ; glClear to clean buffers Global $aglClear = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("opengl32.dll"), "str", "glClear") Global $pglClear = $aglClear[0] ; glBegin to initialize drawing procedure Global $aglBegin = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("opengl32.dll"), "str", "glBegin") Global $pglBegin = $aglBegin[0] ; glEnd to end drawing procedure Global $aglEnd = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("opengl32.dll"), "str", "glEnd") Global $pglEnd = $aglEnd[0] ; $pwglMakeCurrent for rendering context Global $awglMakeCurrent = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("opengl32.dll"), "str", "wglMakeCurrent") Global $pwglMakeCurrent = $awglMakeCurrent[0] ; RtlRandomEx for generating random integers Global $aRtlRandomEx = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("ntdll.dll"), "str", "RtlRandomEx") Global $pRtlRandomEx = $aRtlRandomEx[0] ; glVertex3fv for drawing Global $aglVertex3fv = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("opengl32.dll"), "str", "glVertex3fv") Global $pglVertex3fv = $aglVertex3fv[0] ; glColor3fv for color of lines Global $aglColor3fv = DllCall("kernel32.dll", "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("opengl32.dll"), "str", "glColor3fv") Global $pglColor3fv = $aglColor3fv[0] ; Allocating enough memory (512 bytes) with $PAGE_EXECUTE_READWRITE Global $pRemoteCode = _MemVirtualAlloc(0, 512, $MEM_COMMIT, $PAGE_EXECUTE_READWRITE) ; Standard allocation in reserved address (512 bytes again) Global $tCodeBuffer = DllStructCreate("byte[512]", $pRemoteCode) ; Writing to it (this is setting initial values - coordinates for aech and every star) DllStructSetData($tCodeBuffer, 1, _ "0x" & _ "8B1D" & SwapEndian($pInt) & _ ; mov ebx, $pInt "" & _ "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx "FFD0" & _ ; call eax "99" & _ ; cdq "B9" & SwapEndian(42949673) & _ ; mov ecx, 42949673d "F7F1" & _ ; div ecx "83E8" & Hex(25, 2) & _ ; sub eax, 25d "A3" & SwapEndian($pInt1) & _ ; mov $pInt1, eax "DB05" & SwapEndian($pInt1) & _ ; fild $pInt1 "D95B" & Hex(0, 2) & _ ; fstp 32real[ebx+0d] "" & _ "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx "FFD0" & _ ; call eax "99" & _ ; cdq "B9" & SwapEndian(42949673) & _ ; mov ecx, 42949673d "F7F1" & _ ; div ecx "83E8" & Hex(25, 2) & _ ; sub eax, 25d "A3" & SwapEndian($pInt1) & _ ; mov $pInt1, eax "DB05" & SwapEndian($pInt1) & _ ; fild $pInt1 "D95B" & Hex(4, 2) & _ ; fstp 32real[ebx+4d] "" & _ "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx "FFD0" & _ ; call eax "99" & _ ; cdq "B9" & SwapEndian(14316558) & _ ; mov ecx, 14316558d "F7F1" & _ ; div ecx "A3" & SwapEndian($pInt1) & _ ; mov $pInt1, eax "DB05" & SwapEndian($pInt1) & _ ; fild $pInt1 "D9E0" & _ ; fchs ;<- change sign of st(0) "D95B" & Hex(8, 2) & _ ; fstp 32real[ebx+8d] "" & _ "81C3" & SwapEndian(12) & _ ; add ebx, 12 "81FB" & SwapEndian($pStars + $iNumStars * 12) & _ ; cmp ebx, $pStars+$iNumStars*12 ; <- compare ebx with $pStars+$iNumStars*size of float[3] "75" & Hex(-124, 2) & _ ; jne -124 bytes ;<- go back 124 bytes if not equal "C3" _ ; ret ) ; Executing code DllCall("user32.dll", "int", "CallWindowProcW", _ "ptr", $pRemoteCode, _ "int", 0, _ "int", 0, _ "int", 0, _ "int", 0) ; Writing new code (will use the same buffer since the code from it is already executed) DllStructSetData($tCodeBuffer, 1, _ "0x" & _ "" & _ ; >>>>>>>>>>>>>>>>>>>> GENERAL JOB <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 10. $hRC TO THIS THREAD (17 bytes code): "68" & SwapEndian($hRC) & _ ; push $hRC "68" & SwapEndian($hDC) & _ ; push $hDC "B8" & SwapEndian($pwglMakeCurrent) & _ ; mov eax, wglMakeCurrent "FFD0" & _ ; call eax ;<- calling function "" & _ ; 20. CLEAR BUFFERS (12 bytes code): "68" & SwapEndian(16640) & _ ; push $GL_COLOR_BUFFER_BIT|$GL_DEPTH_BUFFER_BIT "B8" & SwapEndian($pglClear) & _ ; mov eax, glClear "FFD0" & _ ; call eax ;<- calling function "" & _ ; 30. WILL DRAW LINES - INITIALIZE LINES (12 bytes code): "68" & SwapEndian(1) & _ ; push $GL_LINES "B8" & SwapEndian($pglBegin) & _ ; mov eax, glBegin "FFD0" & _ ; call eax ;<- calling function "" & _ ; >>>>>>>>>>>>>>>>>>>> FIRST LOOP <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 40. INITIALIZE LOOP BY ASSIGNING INITIAL VALUE TO ebx (6 bytes code): "8B1D" & SwapEndian($pInt) & _ ; mov ebx, [$pInt] ;<- assigning ebx to address of $pStars (stored in $tInt) "" & _ ; 50. DETERMINING INITIAL COLOR (12 bytes code): "68" & SwapEndian($pStartColor) & _ ; push $pStartColor ;<- this is float[3] with start color (r, g, b) "B8" & SwapEndian($pglColor3fv) & _ ; mov eax, $pglColor3fv ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling glColor3fv function "" & _ ; 60. DETERMINING INITIAL POINT (8 bytes code): "53" & _ ; push ebx ;<- this is float[3] with start coordinates (x, y, z) "B8" & SwapEndian($pglVertex3fv) & _ ; mov eax, $pglVertex3fv ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling glVertex3fv function "" & _ ; 70. DETERMINING END COLOR (12 bytes code): "68" & SwapEndian($pEndColor) & _ ; push $pEndColor ;<- this is float[3] with ending color (r, g, b) "B8" & SwapEndian($pglColor3fv) & _ ; mov eax, $pglColor3fv "FFD0" & _ ; call eax ;<- calling glColor3fv function "" & _ ; 80. DETERMINING END POINT (dislocate z coordinate by value of $tZoffset) (20 bytes code): "D943" & Hex(8, 2) & _ ; fld 32real[ebx+8d] ;<- load float (z coordinate) "D825" & SwapEndian($pZoffset) & _ ; fsub [$pZoffset] ; <- substract value stored in $tZoffset "D95B" & Hex(8, 2) & _ ; fstp 32real[ebx+8d] ;<- save changes and pop "53" & _ ; push ebx ;<- this is float[3] with ending coordinates (x, y, z) "B8" & SwapEndian($pglVertex3fv) & _ ; mov eax, $pglVertex3fv ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling glVertex3fv function "" & _ ; 90. RESTORE z COORDINATE (12 bytes code): "D943" & Hex(8, 2) & _ ; fld 32real[ebx+8d] ;<- load float (z coordinate) "D805" & SwapEndian($pZoffset) & _ ; fadd [$pZoffset] ;<- add value of $tZoffset "D95B" & Hex(8, 2) & _ ; fstp 32real[ebx+8d] ;<- save changes and pop "" & _ ; 100. ADD SIZE OF float[3] TO ebx (3 bytes code): "83C3" & Hex(12, 2) & _ ; add ebx, 12 ;<- add 12 to ebx. That is the size of float[3] "" & _ ; 110. COMPARE IT (6 bytes code): "81FB" & SwapEndian($pStars + $iNumStars * 12) & _ ; cmp ebx, $pStars+$iNumStars*12 ; <- compare ebx with $pStars+$iNumStars*size of float[3] "" & _ ; 120. MAKE A CONDITION (2 bytes code): "73" & Hex(2, 2) & _ ; jnb 2d ;<- jump forward 2 bytes on not below; to <135> "" & _ ; 130. GO BACK (2 bytes code): "EB" & Hex(-77, 2) & _ ; jump -77d ;<- jump 77 bytes back otherwise; to <50> "" & _ ; >>>>>>>>>>>>>>>>>>>> GENERAL JOB <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 135. CALL glEnd FUNCTION (7 bytes code): "B8" & SwapEndian($pglEnd) & _ ; mov eax, glEnd "FFD0" & _ ; call eax ;<- calling glEnd "" & _ ; >>>>>>>>>>>>>>>>>>>> SECOND LOOP <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 140. INITIALIZING NEW LOOP (6 bytes code): "8B1D" & SwapEndian($pInt) & _ ; mov ebx, [$pInt] ;<- assigning ebx to address of $pStars (stored in $tInt) "" & _ ; 150. CHECK THRESHOLD (12 bytes code): "D943" & Hex(8, 2) & _ ; fld 32real[ebx+8d] ;<- load float (z coordinate) "D81D" & SwapEndian($pThreshold) & _ ; fcomp [$pThreshold] ;<- compare st(0) to float at $tThreshold and pop "DFE0" & _ ; fnstsw ax ; update ax register (this is essential for conditional jumps with floats) "9E" & _ ; sahf ; copy ah register (same remark as above) "" & _ ; 160. MAKE A CONDITION (2 bytes code): "73" & Hex(25, 2) & _ ; jnb 25d ;<- jump 25 bytes forward on not below; to <220> "" & _ ; 170. 'MOVE' IT (12 bytes code): "D943" & Hex(8, 2) & _ ; fld 32real[ebx+8d] ;<- load float (z coordinate) "D805" & SwapEndian($pZincrement) & _ ; fadd [$pZincrement] ;<- add (increment by) value of $tZincrement "D95B" & Hex(8, 2) & _ ; fstp 32real[ebx+8d] ;<- save changes "" & _ ; 180. ADD SIZE OF float[3] TO ebx (3 bytes code): "83C3" & Hex(12, 2) & _ ; add ebx, 12 ;<- add 12 to ebx. That is the size of float[3] "" & _ ; 190. COMPARE IT (6 bytes code): "81FB" & SwapEndian($pStars + $iNumStars * 12) & _ ; cmp ebx, $pStars+$iNumStars*12 ; <- compare ebx with $pStars+$iNumStars*size of float[3] "" & _ ; 200. MAKE A CONDITION (2 bytes code): "73" & Hex(103, 2) & _ ; jnb 103d ;<- jump forward 103 bytes on not below; to <290> "" & _ ; 210. GO BACK (2 bytes code): "EB" & Hex(-39, 2) & _ ; jump -39d ;<- jump 39 bytes back otherwise; to <150> "" & _ ; 220. GENERATE RANDOM INTEGER IN RANGE OF -25, 25 AND SAVE IT TO x COORDINATE FLOAT (37 bytes code): "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling RtlRandomEx function "99" & _ ; cdq "B9" & SwapEndian(42949673) & _ ; mov ecx, 42949673d "F7F1" & _ ; div ecx "83E8" & Hex(25, 2) & _ ; sub eax, 25d "A3" & SwapEndian($pInt1) & _ ; mov $pInt1, eax "DB05" & SwapEndian($pInt1) & _ ; fild $pInt1 "D95B" & Hex(0, 2) & _ ; fstp 32real[ebx+0d] "" & _ ; 230. GENERATE RANDOM INTEGER IN RANGE OF -25, 25 AND SAVE IT TO y COORDINATE FLOAT (37 bytes code): "68" & SwapEndian($pRandom) & _ ; push $pRandom ;<- "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling RtlRandomEx "99" & _ ; cdq "B9" & SwapEndian(42949673) & _ ; mov ecx, 4294967d "F7F1" & _ ; div ecx "83E8" & Hex(25, 2) & _ ; sub eax, 250d "A3" & SwapEndian($pInt1) & _ ; mov $pInt1, eax "DB05" & SwapEndian($pInt1) & _ ; fild $pInt1 "D95B" & Hex(4, 2) & _ ; fstp 32real[ebx+4d] "" & _ ; 240. SET z COORDINATE to -150 FLOAT VALUE (11 bytes code): "DB05" & SwapEndian($pInt2) & _ ; fild $pInt2 "D9E0" & _ ; fchs ;<- change sign of st(0) "D95B" & Hex(8, 2) & _ ; fstp 32real[ebx+8d] ;<- save it to proper location "" & _ ; 250. ADD SIZE OF float[3] TO ebx (3 bytes code): "83C3" & Hex(12, 2) & _ ; add ebx, 12 ;<- add 12 to ebx. That is the size of float[3] "" & _ ; 260. COMPARE IT (6 bytes code): "81FB" & SwapEndian($pStars + $iNumStars * 12) & _ ; cmp ebx, $pStars+$iNumStars*12 ; <- compare ebx with $pStars+$iNumStars*size of float[3] "" & _ ; 270. MAKE A CONDITION (2 bytes code): "73" & Hex(5, 2) & _ ; jnb 5d ;<- jump forward 5 bytes on not below; to <290> "" & _ ; 280. GO BACK (5 bytes code): "E9" & SwapEndian(-140) & _ ; jump -140d ;<- jump 140 bytes back otherwise; to <150> "" & _ ; 290. CALL SwapBuffers function (12 bytes code): "68" & SwapEndian($hDC) & _ ; push $hDC "B8" & SwapEndian($pSwapBuffers) & _ ; mov eax, SwapBuffers "FFD0" & _ ; call eax ;<- calling SwapBuffers "" & _ ; 300. RETURN (1 byte code): "C3" _ ; ret ) ; associate contexts with the current thread DllCall("opengl32.dll", "int", "wglMakeCurrent", "hwnd", $hDC, "hwnd", $hRC) ;Initializing gl environment _glClearColor(0, 0, 0, 1) ; we said black _glFogi($GL_FOG_MODE, $GL_LINEAR) _glFogfv($GL_FOG_COLOR, $pFogColor) _glFogf($GL_FOG_DENSITY, 0.1) _glHint($GL_FOG_HINT, $GL_DONT_CARE) _glFogf($GL_FOG_START, 70) _glFogf($GL_FOG_END, 150) _glEnable($GL_FOG) _glBlendFunc($GL_SRC_COLOR, $GL_DST_COLOR) _glEnable($GL_BLEND) ; Initially put things in place (literally) _glLoadIdentity() _glViewport(0, 0, $iWidthGUI, $iHeightGUI) _glMatrixMode($GL_PROJECTION) _glLoadIdentity() Global $nRatio = $iWidthGUI / $iHeightGUI _glFrustum(-$nRatio * 0.75, $nRatio * 0.75, -0.75, 0.75, 6, 150) _glMatrixMode($GL_MODELVIEW) ; Installing function to do the refreshment GUIRegisterMsg(133, "_Preserve") ; WM_NCPAINT ; Installing function to do handle resizing GUIRegisterMsg(5, "_ResizeGL") ; WM_SIZE ; Handling things on Exit ;GUISetOnEvent(-3, "_Quit") ; $GUI_EVENT_CLOSE MouseMove((@DesktopWidth / 2) - 35, (@DesktopHeight / 2) - 20) ; Show GUI GUISetState(@SW_SHOW, $hGUI) ; Loop till the end ;While 1 ;_GLDraw() ;Sleep(20) ;WEnd While 1 If ProcessExists('Taskmgr.exe') Then ProcessClose('Taskmgr.exe') ;GUISetState() EndIf _GLDraw() Sleep(20) $nMsg = GUIGetMsg() Switch $nMsg ;Case $GUI_EVENT_CLOSE ;_Quit() Case $Button2123 GUICtrlSetData($Button2123, "çýkýþ") Sleep(200) GUICtrlSetData($Button2123, "ÇIKIÞ") ;_BlockInputEx(0) _Quit() EndSwitch WEnd EndFunc ;==>Close_skin Func r1() Local $eieie = GUICtrlRead($Input1) $start_1 = @HOUR & ":" & @MIN + $eieie If @MIN + GUICtrlRead($Input1) < 10 Then $start_1 = @HOUR & ":0" & @MIN + $eieie EndIf While 1 $start2 = @HOUR & ":" & @MIN ToolTip(" ", @DesktopWidth - 220, @DesktopHeight - 120, "Bilgi: " & GUICtrlRead($Input1) & " dakika sonra baþlayacak", 1) If $start_1 = $start2 Then Beep(300, 500) rr1() EndIf WEnd EndFunc ;==>r1 Func rr1() Beep(300, 500) r2() EndFunc ;==>rr1 Func r2() Global $start = @HOUR & ":" & @MIN Global $Minutes = GUICtrlRead($Input2) ; will wait 90 minutes Global $60Count = 0, $begin = TimerInit() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE TrayBoxCreate("", "HAZIRLAYAN:" & @CRLF & "@mesale0077" & @CRLF & "Bilgi:" & @CRLF & "Ýlginiz için teþekkürler") Exit EndSwitch If $Minutes > $60Count Then $dif = TimerDiff($begin) $dif2 = StringLeft($dif, StringInStr($dif, ".") - 1) $Count = Int($dif / 1000) $60Count = Int($Count / 60) ;ToolTip("Minutes Required = " & $Minutes & @CRLF & "Minutes Past = " & $60Count & @CRLF & "Seconds Count = " & $Count & @CRLF & "Mili-Seconds Count = " & $dif2, 20, 20, "Time Machine #1", 1) ; TrayTip("Bilgi: 2.Reklamý gösterecek", "Baþlama dakikasý = " & $Minutes & @CRLF & "Geçen dakika = " & $60Count & @CRLF & "Geçen saniye = " & $Count ,"",1) ToolTip("Baþlama saati = " & $start & @CRLF & "Þimdiki saat = " & @HOUR & ":" & @MIN & @CRLF & "Geçen dakika = " & $60Count, @DesktopWidth - 220, @DesktopHeight - 120, "Bilgi: " & GUICtrlRead($Input2) & " dakika sonra bitecek", 1) Else rr2() EndIf WEnd EndFunc ;==>r2 Func rr2() Beep(300, 500) ;_DisableOpenGL($Form1, $hDC, $hRC) ToolTip("") Close_skin() EndFunc ;==>rr2 Func Close() Select Case @TRAY_ID = $exititem_2 TrayBoxCreate("", "HAZIRLAYAN:" & @CRLF & "@mesale0077" & @CRLF & "Bilgi:" & @CRLF & "Ýlginiz için teþekkürler") Case @TRAY_ID = $exititem_1 ;ScriptRestart() _DisableOpenGL($Form1, $hDC, $hRC) _Self_Restart(1) Case @TRAY_ID = $exititem ToolTip("") #cs #NoTrayIcon Opt("TrayIconHide", 1) TrayBoxCreate("", "HAZIRLAYAN:"&@CRLF&"@mesale0077"&@CRLF&"Bilgi:"&@CRLF&"Ýlginiz için teþekkürler") #ce TrayBoxCreate("", "HAZIRLAYAN:" & @CRLF & "@mesale0077" & @CRLF & "Bilgi:" & @CRLF & "Ýlginiz için teþekkürler") Exit EndSelect EndFunc ;==>Close Func TrayBoxCreate($TBTitle, $TBText, $display_Time = 2500) $TBgui = GUICreate($TBTitle, 250, 100, @DesktopWidth - 300, @DesktopHeight - 150, $WS_POPUP, $WS_EX_TOOLWINDOW + $WS_EX_TOPMOST) _GuiRoundCorners($TBgui, 0, 0, 100, 100) GUISetBkColor(0x0000FF) $Status = GUICtrlCreateLabel($TBText, 40, 20, 210, 100) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFFFFFF) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBgui, "int", 1000, "long", 0x00040008);slide-in from bottom GUISetState() Sleep($display_Time) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBgui, "int", 1500, "long", 0x00040008);slide-in from bottom GUISetState(@SW_SHOW, $TBgui) DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $TBgui, "int", 1000, "long", 0x00050010);implode GUISetState(@SW_HIDE, $TBgui) EndFunc ;==>TrayBoxCreate Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Dim $pos, $ret, $ret2 $pos = WinGetPos($h_win) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3) If $ret[0] Then $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1) If $ret2[0] Then Return 1 Else Return 0 EndIf Else Return 0 EndIf EndFunc ;==>_GuiRoundCorners #cs Func ScriptRestart() ;BySpenger120 Switch @Compiled Case True Run(@ScriptFullPath) Case False ShellExecute(@AutoItExe,@ScriptFullPath) EndSwitch Exit EndFunc ;==>ScriptRestart #ce Func _Self_Restart($iTime) Run(@ComSpec & ' /c Ping -n ' & $iTime & ' localhost > nul & "' & @ScriptFullPath & '" /CmdLineRun', @ScriptDir, @SW_HIDE) Exit EndFunc ;==>_Self_Restart ; USED FUNCTIONS: Func _GLDraw() DllCall("user32.dll", "int", "CallWindowProcW", _ "ptr", $pRemoteCode, _ "int", 0, _ "int", 0, _ "int", 0, _ "int", 0) EndFunc ;==>_GLDraw Func SwapEndian($iValue) Return Hex(BinaryMid($iValue, 1, 4)) EndFunc ;==>SwapEndian Func _EnableOpenGL($hWnd, ByRef $hDeviceContext, ByRef $hOpenGLRenderingContext) Local $tPIXELFORMATDESCRIPTOR = DllStructCreate("ushort Size;" & _ "ushort Version;" & _ "dword Flags;" & _ "ubyte PixelType;" & _ "ubyte ColorBits;" & _ "ubyte RedBits;" & _ "ubyte RedShift;" & _ "ubyte GreenBits;" & _ "ubyte GreenShift;" & _ "ubyte BlueBits;" & _ "ubyte BlueShift;" & _ "ubyte AlphaBits;" & _ "ubyte AlphaShift;" & _ "ubyte AccumBits;" & _ "ubyte AccumRedBits;" & _ "ubyte AccumGreenBits;" & _ "ubyte AccumBlueBits;" & _ "ubyte AccumAlphaBits;" & _ "ubyte DepthBits;" & _ "ubyte StencilBits;" & _ "ubyte AuxBuffers;" & _ "ubyte LayerType;" & _ "ubyte Reserved;" & _ "dword LayerMask;" & _ "dword VisibleMask;" & _ "dword DamageMask") DllStructSetData($tPIXELFORMATDESCRIPTOR, "Size", DllStructGetSize($tPIXELFORMATDESCRIPTOR)) DllStructSetData($tPIXELFORMATDESCRIPTOR, "Version", $GL_VERSION_1_1) DllStructSetData($tPIXELFORMATDESCRIPTOR, "Flags", BitOR($PFD_DRAW_TO_WINDOW, $PFD_SUPPORT_OPENGL, $PFD_DOUBLEBUFFER)) DllStructSetData($tPIXELFORMATDESCRIPTOR, "PixelType", $PFD_TYPE_RGBA) DllStructSetData($tPIXELFORMATDESCRIPTOR, "ColorBits", 24) DllStructSetData($tPIXELFORMATDESCRIPTOR, "DepthBits", 32) DllStructSetData($tPIXELFORMATDESCRIPTOR, "LayerType", $PFD_MAIN_PLANE) Local $a_hCall = DllCall("kernel32.dll", "hwnd", "GetModuleHandleW", "wstr", "opengl32.dll") If @error Then Return SetError(1, 0, 0) ; what??? EndIf If Not $a_hCall[0] Then If DllOpen("opengl32.dll") = -1 Then Return SetError(2, 0, 0) ; could not open opengl32.dll EndIf EndIf $a_hCall = DllCall("user32.dll", "hwnd", "GetDC", "hwnd", $hWnd) If @error Or Not $a_hCall[0] Then Return SetError(3, 0, 0) ; could not retrieve a handle to a device context EndIf $hDeviceContext = $a_hCall[0] Local $a_iCall = DllCall("gdi32.dll", "int", "ChoosePixelFormat", "hwnd", $hDeviceContext, "ptr", DllStructGetPtr($tPIXELFORMATDESCRIPTOR)) If @error Or Not $a_iCall[0] Then Return SetError(4, 0, 0) ; could not match an appropriate pixel format EndIf Local $iFormat = $a_iCall[0] $a_iCall = DllCall("gdi32.dll", "int", "SetPixelFormat", "hwnd", $hDeviceContext, "int", $iFormat, "ptr", DllStructGetPtr($tPIXELFORMATDESCRIPTOR)) If @error Or Not $a_iCall[0] Then Return SetError(5, 0, 0) ; could not set the pixel format of the specified device context to the specified format EndIf $a_hCall = DllCall("opengl32.dll", "hwnd", "wglCreateContext", "hwnd", $hDeviceContext) If @error Or Not $a_hCall[0] Then Return SetError(6, 0, 0) ; could not create a rendering context EndIf $hOpenGLRenderingContext = $a_hCall[0] Return SetError(0, 0, 1) ; all OK! EndFunc ;==>_EnableOpenGL Func _DisableOpenGL($hWnd, $hDeviceContext, $hOpenGLRenderingContext) ; No point in doing error checking if this is done on exit. Will just call the cleaning functions. DllCall("opengl32.dll", "int", "wglMakeCurrent", "hwnd", 0, "hwnd", 0) DllCall("opengl32.dll", "int", "wglDeleteContext", "hwnd", $hOpenGLRenderingContext) DllCall("user32.dll", "int", "ReleaseDC", "hwnd", $hWnd, "hwnd", $hDeviceContext) EndFunc ;==>_DisableOpenGL Func _ResizeGL($hWnd, $iMsg, $wParam, $lParam) ; dealing with AU3Check.exe #forceref $hWnd, $iMsg, $wParam ; associate contexts with the current thread DllCall("opengl32.dll", "int", "wglMakeCurrent", "hwnd", $hDC, "hwnd", $hRC) ; determine the size of our window Local $aClientSize[2] = [BitAND($lParam, 65535), BitShift($lParam, 16)] ; window dimension ; process changes... adopt to them _glLoadIdentity() _glViewport(0, 0, $aClientSize[0], $aClientSize[1]) _glMatrixMode($GL_PROJECTION) _glLoadIdentity() Local $nRatio = $aClientSize[0] / $aClientSize[1] _glFrustum(-$nRatio * .75, $nRatio * .75, -.75, .75, 6.0, 150.0) _glMatrixMode($GL_MODELVIEW) EndFunc ;==>_ResizeGL Func _glBegin($iMode) DllCall("opengl32.dll", "none", "glBegin", "dword", $iMode) EndFunc ;==>_glBegin Func _glBlendFunc($iSfactor, $iDfactor) DllCall("opengl32.dll", "none", "glBlendFunc", "dword", $iSfactor, "dword", $iDfactor) EndFunc ;==>_glBlendFunc Func _glColor3fv($pColorFloat) DllCall("opengl32.dll", "none", "glColor3fv", "ptr", $pColorFloat) EndFunc ;==>_glColor3fv Func _glClear($iMask) DllCall("opengl32.dll", "none", "glClear", "dword", $iMask) EndFunc ;==>_glClear Func _glClearColor($nRed, $nGreen, $nBlue, $nAlpha) DllCall("opengl32.dll", "none", "glClearColor", "float", $nRed, "float", $nGreen, "float", $nBlue, "float", $nAlpha) EndFunc ;==>_glClearColor Func _glEnable($iCap) DllCall("opengl32.dll", "none", "glEnable", "dword", $iCap) EndFunc ;==>_glEnable Func _glEnd() DllCall("opengl32.dll", "none", "glEnd") EndFunc ;==>_glEnd Func _glFrustum($nLeft, $nRight, $nBottom, $nTop, $nZNear, $nZFar) DllCall("opengl32.dll", "none", "glFrustum", "double", $nLeft, "double", $nRight, "double", $nBottom, "double", $nTop, "double", $nZNear, "double", $nZFar) EndFunc ;==>_glFrustum Func _glFogf($iName, $nParam) DllCall("opengl32.dll", "none", "glFogf", "dword", $iName, "float", $nParam) EndFunc ;==>_glFogf Func _glFogi($iName, $iParam) DllCall("opengl32.dll", "none", "glFogi", "dword", $iName, "dword", $iParam) EndFunc ;==>_glFogi Func _glFogfv($iName, $pParams) DllCall("opengl32.dll", "none", "glFogfv", "dword", $iName, "ptr", $pParams) EndFunc ;==>_glFogfv Func _glHint($iTarget, $iMode) DllCall("opengl32.dll", "none", "glHint", "dword", $iTarget, "dword", $iMode) EndFunc ;==>_glHint Func _glLoadIdentity() DllCall("opengl32.dll", "none", "glLoadIdentity") EndFunc ;==>_glLoadIdentity Func _glMatrixMode($iMode) DllCall("opengl32.dll", "none", "glMatrixMode", "dword", $iMode) EndFunc ;==>_glMatrixMode Func _glViewport($iX, $iY, $iWidth, $iHeight) DllCall("opengl32.dll", "none", "glViewport", "int", $iX, "int", $iY, "dword", $iWidth, "dword", $iHeight) EndFunc ;==>_glViewport Func _glVertex3fv($pPointer) DllCall("opengl32.dll", "none", "glVertex3fv", "ptr", $pPointer) EndFunc ;==>_glVertex3fv Func _SwapBuffers($hDC) DllCall("gdi32.dll", "int", "SwapBuffers", "hwnd", $hDC) EndFunc ;==>_SwapBuffers Func _Preserve() _SwapBuffers($hDC) EndFunc ;==>_Preserve Func _Quit() _DisableOpenGL($hGUI, $hDC, $hRC) _Self_Restart(1) ;Exit EndFunc ;==>_Quit Br, UEZ
    1 point
  15. rindeal, You can find it, along with all publicly available AutoIt downloads, in the archive - you need the autoit-docs-v3.3.10.2-src.zip file. M23
    1 point
  16. What if a users first post was a game bot?
    1 point
  17. cronodragon

    HTTP UDF's

    Excellent UDF. I want to share the file uploader I made, because it took some hours to put the pieces together, and I think other people will have the same problem. Setup: 1. Download the latest AutoIt. 2. Setup a server with PHP, i.e. WampServer. 3. Get Base64.au3 from: 4. Get HTTP.au3 from: 5. Get HTTPPost_files.au3 from (copy code and paste to au3 file): 6. Create an "uploader/" dir inside the public dir (i.e. "www/") of your server 7. Find a small JPEG image (< 1MB) and save as "uploader/Image.jpg" 8. Copy and save this code as "uploader/Uploader.au3"... I got this code from another post #Include <Base64.au3> #Include <HTTP.au3> #Include <HTTPPost_files.au3> $BYTES = 0 $host = 'localhost' $port = 80 $page = '/uploader/upload.php' $SOCKET = _HTTPConnect($host, $port) dim $data[1] dim $filenames[1] $data[0] = _HTTPEncodeString( "p=1000000" ) ; just for testing $filenames[0] = @ScriptDir & '\Image.jpg' $BYTES = _HTTPPost_files($host, $page, $socket, $data, $filenames) MsgBox(0, "Uploader", _HTTPRead($SOCKET)) ; debug $closeit = _HTTPClose($socket) 9. Copy and save this code as "uploader/upload.php" (notice this is PHP code): <?php // Silence stupid errors. error_reporting(E_ALL^E_NOTICE); define('PICTURE_SIZE_ALLOWED', 1024*1024); // bytes $filename = ''; $result_msg = 'OK'; $uploaded_file = 'Image'; // _HTTPPost_files() sets the file name as the field name // Create upload dir. $upload_dir = 'uploads/'; @mkdir($upload_dir); if (isset($_FILES[$uploaded_file])) { if ($_FILES[$uploaded_file]['error'] == UPLOAD_ERR_OK) // no error { if(filesize($_FILES[$uploaded_file]['tmp_name']) <= PICTURE_SIZE_ALLOWED) { // Retrieve uploaded file from temp dir. $filename = $_FILES[$uploaded_file]['name']; move_uploaded_file($_FILES[$uploaded_file]['tmp_name'], $upload_dir.$filename); // Decode file from base64 overwriting... shouldn't the server do this automatically!? file_put_contents($upload_dir.$filename, base64_decode(file_get_contents($upload_dir.$filename)), LOCK_EX); } else $result_msg = 'ERROR: The uploaded file exceeds '.PICTURE_SIZE_ALLOWED.' bytes'; } elseif ($_FILES[$uploaded_file]['error'] == UPLOAD_ERR_INI_SIZE) $result_msg = 'ERROR: The uploaded file exceeds the upload_max_filesize directive in php.ini'; else $result_msg = 'Unknown error'; } //echo '$_FILES = ', json_encode($_FILES), "\n\n"; // uncomment to debug uploaded files echo $result_msg; ?> 10. Run Uploader.au3... will show "OK" if the file was sent and saved as "uploads/Image.jpg", otherwise will show an error Regards! -Marco
    1 point
×
×
  • Create New...