;.......script written by trancexx (trancexx at yahoo dot com). And yes, it's a paypal account also if you think I'm worth anything :) #NoTrayIcon #include #include Opt("GUIOnEventMode", 1) ; Used Dlls Global Const $hKERNEL32 = DllOpen("kernel32.dll") Global Const $hUSER32 = DllOpen("user32.dll") Global Const $hGDI32 = DllOpen("gdi32.dll") Global Const $hOPENGL32 = DllOpen("opengl32.dll") ; 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 = 7777 ; for example ; Make a GUI Global $iWidthGUI = 900 Global $iHeightGUI = 500 Global $hGUI = GUICreate("OpenGL Space", $iWidthGUI, $iHeightGUI, -1, -1, 0x00CF0000) ; WS_OVERLAPPEDWINDOW ; 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($hOPENGL32, "int", "wglMakeCurrent", "ptr", $hDC, "ptr", $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 & "]; float[" & 3 * $iNumStars & "]") ; first element of this structure holds coordinates for every star. Second one is color. Global $pStars = DllStructGetPtr($tStars) 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 $tZoffset = DllStructCreate("float") ; this is determining the tail of passing stars DllStructSetData($tZoffset, 1, 1.9) Global $pZoffset = DllStructGetPtr($tZoffset) Global $tZincrement = DllStructCreate("float") ; I call this 'repetitive density value' ...or spead if you like DllStructSetData($tZincrement, 1, 0.57) Global $pZincrement = DllStructGetPtr($tZincrement) Global $tThreshold = DllStructCreate("float") ; this structure will hold a threshold value DllStructSetData($tThreshold, 1, 6) ; value is 6 (star will be out of scope when 6 is reached) Global $pThreshold = DllStructGetPtr($tThreshold) Global $tDiv = DllStructCreate("float") ; this is additional divisor for generated random floats. To make them 'more' random DllStructSetData($tDiv, 1, 100.23) Global $pDiv = DllStructGetPtr($tDiv) ; RtlRandomEx for generating random integers Global $aRtlRandomEx = DllCall($hKERNEL32, "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("ntdll.dll"), "str", "RtlRandomEx") Global $pRtlRandomEx = $aRtlRandomEx[0] ; See that it works for Windows 2000 If Not $pRtlRandomEx Then $aRtlRandomEx = DllCall($hKERNEL32, "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("ntdll.dll"), "str", "RtlRandom") $pRtlRandomEx = $aRtlRandomEx[0] EndIf ; SwapBuffers to fully use double-buffering Global $aSwapBuffers = DllCall($hKERNEL32, "ptr", "GetProcAddress", "ptr", _WinAPI_GetModuleHandle("gdi32.dll"), "str", "SwapBuffers") Global $pSwapBuffers = $aSwapBuffers[0] ; Get handle of $hOPENGL32 for 'economy' reasons Global $hOpenGL = _WinAPI_GetModuleHandle("opengl32.dll") ; opengl32.dll handle (not to have to call it more than once) ; glClear to clean buffers Global $aglClear = DllCall($hKERNEL32, "ptr", "GetProcAddress", "ptr", $hOpenGL, "str", "glClear") Global $pglClear = $aglClear[0] ; glBegin to initialize drawing procedure Global $aglBegin = DllCall($hKERNEL32, "ptr", "GetProcAddress", "ptr", $hOpenGL, "str", "glBegin") Global $pglBegin = $aglBegin[0] ; glEnd to end drawing procedure Global $aglEnd = DllCall($hKERNEL32, "ptr", "GetProcAddress", "ptr", $hOpenGL, "str", "glEnd") Global $pglEnd = $aglEnd[0] ; $pwglMakeCurrent for rendering context Global $awglMakeCurrent = DllCall($hKERNEL32, "ptr", "GetProcAddress", "ptr", $hOpenGL, "str", "wglMakeCurrent") Global $pwglMakeCurrent = $awglMakeCurrent[0] ; glVertex3fv for drawing Global $aglVertex3fv = DllCall($hKERNEL32, "ptr", "GetProcAddress", "ptr", $hOpenGL, "str", "glVertex3fv") Global $pglVertex3fv = $aglVertex3fv[0] ; glColor3fv for color of lines Global $aglColor3fv = DllCall($hKERNEL32, "ptr", "GetProcAddress", "ptr", $hOpenGL, "str", "glColor3fv") Global $pglColor3fv = $aglColor3fv[0] ; Allocating enough memory with $PAGE_EXECUTE_READWRITE Global $iCodeSize = 2048 Global $pRemoteCode = _MemVirtualAlloc(0, $iCodeSize, $MEM_COMMIT, $PAGE_EXECUTE_READWRITE) ; Standard allocation in reserved address Global $tCodeBuffer = DllStructCreate("byte[" & $iCodeSize & "]", $pRemoteCode) ; Writing to it (this is setting initial values - coordinates for aech and every star plus green and blue color factors) If @AutoItX64 Then DllStructSetData($tCodeBuffer, 1, _ "0x" & _ "4883EC" & SwapEndian(88, 1) & _ ; sub rsp, 88d ;<- expand the stack "49BB" & SwapEndian($pStars) & _ ; mov r11, $pStars "" & _ ; x COORDINATE "48B9" & SwapEndian($pRandom) & _ ; mov rcx, $pRandom "48B8" & SwapEndian($pRtlRandomEx) & _ ; mov rax, RtlRandomEx "FFD0" & _ ; call rax "31D2" & _ ; xor edx, edx "41BA" & SwapEndian(429497, 4) & _ ; mov r10d, 429497d "41F7F2" & _ ; div eax, r10d "482D" & SwapEndian(2500, 4) & _ ; sub eax, 2500d "" & _ "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "48B8" & SwapEndian($pDiv) & _ ; mov rax, $pDiv "F30F1008" & _ ; movss xmm1, [rax] "F30F5EC1" & _ ; divss xmm0, xmm1 "F3410F1103" & _ ; movss [r11], xmm0 "" & _ ; y COORDINATE "48B9" & SwapEndian($pRandom) & _ ; mov rcx, $pRandom "48B8" & SwapEndian($pRtlRandomEx) & _ ; mov rax, RtlRandomEx "FFD0" & _ ; call rax "31D2" & _ ; xor edx, edx "41BA" & SwapEndian(429497, 4) & _ ; mov r10, 429497d "41F7F2" & _ ; div eax, r10d "2D" & SwapEndian(2500, 4) & _ ; sub eax, 2500d "" & _ "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "48B8" & SwapEndian($pDiv) & _ ; mov rax, $pDiv "F30F1008" & _ ; movss xmm1, [eax] "F30F5EC1" & _ ; divss xmm0, xmm1 "F3410F1143" & SwapEndian(4, 1) & _ ; movss [r11+4d], xmm0 "" & _ "" & _ ; z COORDINATE "48B9" & SwapEndian($pRandom) & _ ; mov rcx, $pRandom "48B8" & SwapEndian($pRtlRandomEx) & _ ; mov rax, RtlRandomEx "FFD0" & _ ; call rax "31D2" & _ ; xor edx, edx "41BA" & SwapEndian(14316558, 4) & _ ; mov r10d, 14316558d "41F7F2" & _ ; div eax, r10d "" & _ "6BC0" & SwapEndian(-1, 1) & _ ; imul eax, -1 "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "F3410F1143" & SwapEndian(8, 1) & _ ; movss [r11+8d], xmm0 "" & _ "" & _ ; g COLOR "48B9" & SwapEndian($pRandom) & _ ; mov rcx, $pRandom "48B8" & SwapEndian($pRtlRandomEx) & _ ; mov rax, RtlRandomEx "FFD0" & _ ; call rax "31D2" & _ ; xor edx, edx "41BA" & SwapEndian(107374182, 4) & _ ; mov r10d, 429497d "41F7F2" & _ ; div eax, r10d "" & _ "83C0" & SwapEndian(80, 1) & _ ; add eax, 80d "" & _ "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "48B8" & SwapEndian($pDiv) & _ ; mov eax, $pDiv "F30F1008" & _ ; movss xmm1, [eax] "F30F5EC1" & _ ; divss xmm0, xmm1 "F3410F1183" & SwapEndian(4 + 3 * $iNumStars * 4, 4) & _ ; movss [r11+4+3*$iNumStars*4], xmm0 "" & _ ; b COLOR "48B9" & SwapEndian($pRandom) & _ ; mov rcx, $pRandom "48B8" & SwapEndian($pRtlRandomEx) & _ ; mov rax, RtlRandomEx "FFD0" & _ ; call rax "31D2" & _ ; xor edx, edx "41BA" & SwapEndian(107374182, 4) & _ ; mov r10d, 429497d "41F7F2" & _ ; div eax, r10d "" & _ "83C0" & SwapEndian(80, 1) & _ ; add eax, 80d "" & _ "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "48B8" & SwapEndian($pDiv) & _ ; mov eax, $pDiv "F30F1008" & _ ; movss xmm1, [eax] "F30F5EC1" & _ ; divss xmm0, xmm1 "F3410F1183" & SwapEndian(8 + 3 * $iNumStars * 4, 4) & _ ; movss [r11+8+3*$iNumStars*8], xmm0 "" & _ ; SEE IF IT'S ALL "4983C3" & SwapEndian(12, 1) & _ ; add r11, 12 "48B8" & SwapEndian($pStars + $iNumStars * 12) & _ ; mov rax, $pStars+$iNumStars*12 "4939C3" & _ ; cmp r11, rax; <- compare r11 with $pStars+$iNumStars*size of float[3] "75" & SwapEndian(5, 1) & _ ; jne 5 byte ;<- go forward 5 bytes if not equal "4883C4" & SwapEndian(88, 1) & _ ; add rsp, 88d ;<- shrink stack (88 bytes) "C3" & _ ; ret "E9" & SwapEndian(-341, 4) _ ; jump -341d ;<- jump 341 bytes back ) Else DllStructSetData($tCodeBuffer, 1, _ "0x" & _ "BB" & SwapEndian($pStars) & _ ; mov ebx, $pStars "" & _ ; x COORDINATE "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx "FFD0" & _ ; call eax "31D2" & _ ; xor edx, edx "B9" & SwapEndian(429497) & _ ; mov ecx, 429497d "F7F1" & _ ; div ecx "2D" & SwapEndian(2500) & _ ; sub eax, 2500d "" & _ "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "48B8" & SwapEndian($pDiv) & _ ; mov eax, $pDiv "F30F1008" & _ ; movss xmm1, [rax] "F30F5EC1" & _ ; divss xmm0, xmm1 "F30F1103" & _ ; movss [ebx+0d], xmm0 "" & _ "" & _ ; y COORDINATE "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx "FFD0" & _ ; call eax "31D2" & _ ; xor edx, edx "B9" & SwapEndian(429497) & _ ; mov ecx, 429497d "F7F1" & _ ; div ecx "81E8" & SwapEndian(2500) & _ ; sub eax, 2500d "" & _ "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "48B8" & SwapEndian($pDiv) & _ ; mov eax, $pDiv "F30F1008" & _ ; movss xmm1, [eax] "F30F5EC1" & _ ; divss xmm0, xmm1 "F30F1143" & SwapEndian(4, 1) & _ ; movss [ebx+4d], xmm0 "" & _ "" & _ ; z COORDINATE "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx "FFD0" & _ ; call eax "31D2" & _ ; xor edx, edx "B9" & SwapEndian(14316558) & _ ; mov ecx, 14316558d "F7F1" & _ ; div ecx "" & _ "6BC0" & SwapEndian(-1, 1) & _ ; imul eax, -1 "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "F30F1143" & SwapEndian(8, 1) & _ ; movss [ebx+8d], xmm0 "" & _ "" & _ ; g COLOR "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx "FFD0" & _ ; call eax "31D2" & _ ; xor edx, edx "B9" & SwapEndian(107374182) & _ ; mov ecx, 107374182d "F7F1" & _ ; div ecx "05" & SwapEndian(80) & _ ; add eax, 80d "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "48B8" & SwapEndian($pDiv) & _ ; mov eax, $pDiv "F30F1008" & _ ; movss xmm1, [eax] "F30F5EC1" & _ ; divss xmm0, xmm1 "F30F1183" & SwapEndian(4 + 3 * $iNumStars * 4) & _ ; movss [ebx+4+3*$iNumStars*4], xmm0 "" & _ ; b COLOR "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx "FFD0" & _ ; call eax "31D2" & _ ; xor edx, edx "B9" & SwapEndian(107374182) & _ ; mov ecx, 107374182d "F7F1" & _ ; div ecx "05" & SwapEndian(80) & _ ; add eax, 80d "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "48B8" & SwapEndian($pDiv) & _ ; mov eax, $pDiv "F30F1008" & _ ; movss xmm1, [eax] "F30F5EC1" & _ ; divss xmm0, xmm1 "F30F1183" & SwapEndian(8 + 3 * $iNumStars * 4) & _ ; movss [ebx+4+3*$iNumStars*4], xmm0 "" & _ ; SEE IF IT'S ALL "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" & SwapEndian(1, 1) & _ ; jne 1 byte ;<- go forward 1 byte if not equal "89D8" & _ ; mov eax, ebx "C3" & _ ; ret "E9" & SwapEndian(-257) _ ; jump -257d ;<- jump 257 bytes back ) EndIf ; Executing code DllCallAddress("ulong_ptr", $pRemoteCode) ; Writing new code (will use the same buffer since the code from it is already executed) If @AutoItX64 Then DllStructSetData($tCodeBuffer, 1, _ "0x" & _ "4883EC" & SwapEndian(88, 1) & _ ; sub rsp, 88d ;<- expand the stack "" & _ ; 20. CLEAR BUFFERS: "B9" & SwapEndian(16640, 4) & _ ; mov ecx, $GL_COLOR_BUFFER_BIT|$GL_DEPTH_BUFFER_BIT "48B8" & SwapEndian($pglClear) & _ ; mov rax, $pglClear "FFD0" & _ ; call rax ;<- calling function "" & _ ; 30. WILL DRAW LINES - INITIALIZE LINES: "B9" & SwapEndian(1, 4) & _ ; mov ecx, $GL_LINES "48B8" & SwapEndian($pglBegin) & _ ; mov rax, $pglBegin "FFD0" & _ ; call rax ;<- calling function "" & _ ; >>>>>>>>>>>>>>>>>>>> FIRST LOOP <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 40. INITIALIZE LOOP BY ASSIGNING INITIAL VALUE TO rsi: "48BE" & SwapEndian($pStars) & _ ; mov rsi, $pStars "" & _ ; 50. DEFINING INITIAL COLOR: "4889F0" & _ ; mov rax, rsi "4805" & SwapEndian(3 * $iNumStars * 4) & _ ; add rax, 3*$iNumStars*4 "4889C1" & _ ; mov rcx, rax "48B8" & SwapEndian($pglColor3fv) & _ ; mov rax, $pglColor3fv "FFD0" & _ ; call rax ;<- calling function "" & _ ; 60. DEFINING INITIAL POINT: "4889F1" & _ ; mov rcx, rsi "48B8" & SwapEndian($pglVertex3fv) & _ ; mov rax, $pglVertex3fv "FFD0" & _ ; call rax ;<- calling function "" & _ ; 70. DEFINING END COLOR: "48B9" & SwapEndian($pEndColor) & _ ; mov rcx, $pEndColor "48B8" & SwapEndian($pglColor3fv) & _ ; mov rax, $pglColor3fv "FFD0" & _ ; call rax ;<- calling glColor3fv function "" & _ ; 80. DEFINING END POINT (dislocate z coordinate by value of $tZoffset): "F30F1046" & SwapEndian(8, 1) & _ ; movss xmm0, [rsi + 8d] "48B8" & SwapEndian($pZoffset) & _ ; mov rax, $pZoffset "F30F1008" & _ ; movss xmm1, [rax] "F30F5CC1" & _ ; subss xmm0, xmm1 "F30F1146" & SwapEndian(8, 1) & _ ; movss [rsi + 8d], xmm0 "" & _ ; 85. "4889F1" & _ ; mov rcx, rsi ;<- this is float[3] with ending coordinates (x, y, z) "48B8" & SwapEndian($pglVertex3fv) & _ ; mov rax, $pglVertex3fv ;<- 'preparing' to call "FFD0" & _ ; call rax ;<- calling glVertex3fv function "" & _ ; 90. RESTORE z COORDINATE: "F30F1046" & SwapEndian(8, 1) & _ ; movss xmm0, [rsi + 8d] "48B8" & SwapEndian($pZoffset) & _ ; mov rax, $pZoffset "F30F1008" & _ ; movss xmm1, [rax] "F30F58C1" & _ ; addss xmm0, xmm1 "F30F1146" & SwapEndian(8, 1) & _ ; movss [rsi + 8d], xmm0 "" & _ ; 100. ADD SIZE OF float[3] TO ebx: "4883C6" & SwapEndian(12, 1) & _ ; add rsi, 12d ;<- add 12 to r11. That is the size of float[3] "" & _ ; 110. COMPARE IT: "48B8" & SwapEndian($pStars + $iNumStars * 12) & _ ; mov rax, $pStars+$iNumStars*12 "4839C6" & _ ; cmp rsi, rax; <- compare rbx with $pStars+$iNumStars*size of float[3] "" & _ ; 120. MAKE A CONDITION: "73" & SwapEndian(5, 1) & _ ; jnb 5d ;<- jump forward 5 bytes on not below; to <135> "" & _ ; 130. GO BACK: "E9" & SwapEndian(-156, 4) & _ ; jmp -156d ;<- jump 156 bytes back otherwise; to <50> "" & _ ; >>>>>>>>>>>>>>>>>>>> GENERAL JOB <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 135. CALL glEnd FUNCTION "48B8" & SwapEndian($pglEnd) & _ ; mov eax, $pglEnd "FFD0" & _ ; call rax ;<- calling glEnd "" & _ ; >>>>>>>>>>>>>>>>>>>> SECOND LOOP <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 140. INITIALIZING NEW LOOP: "48BE" & SwapEndian($pStars) & _ ; mov rsi, $pStars "" & _ ; 150. CHECK THRESHOLD: "F30F1046" & SwapEndian(8, 1) & _ ; movss xmm0, [rsi + 8d] "48B8" & SwapEndian($pThreshold) & _ ; mov rax, $pThreshold "F30F1008" & _ ; movss xmm1, [rax] "660F2FC8" & _ ; comisd xmm1, xmm0 "73" & SwapEndian(51, 1) & _ ; jnb 51d ;<- jump 51 bytes forward on not below; to <220> "48B8" & SwapEndian($pZincrement) & _ ; mov rax, $pZincrement "F30F1008" & _ ; movss xmm1, [rax] "F30F58C1" & _ ; addss xmm0, xmm1 "F30F1146" & SwapEndian(8, 1) & _ ; movss [rsi + 8d], xmm0 "" & _ ; 180. ADD SIZE OF float[3] TO rsi: "4883C6" & SwapEndian(12, 1) & _ ; add rsi, 12d ;<- add 12 to rsi. That is the size of float[3] "" & _ ; 190. COMPARE IT: "48B8" & SwapEndian($pStars + $iNumStars * 12) & _ ; mov rax, $pStars+$iNumStars*12 "4839C6" & _ ; cmp rsi, rax; <- compare rsi with $pStars+$iNumStars*size of float[3] "" & _ ; 200. MAKE A CONDITION: "0F83" & SwapEndian(177, 4) & _ ; jnb 177d ;<- jump forward 177 bytes on not below; to <290> "" & _ ; 210. GO BACK: "E9" & SwapEndian(-76, 4) & _ ; jump -76d ;<- jump 76 bytes back otherwise; to <150> "" & _ ; 220. GENERATE RANDOM INTEGER IN RANGE OF -25, 25 AND SAVE IT TO x COORDINATE FLOAT: "48B9" & SwapEndian($pRandom) & _ ; mov rcx, $pRandom "48B8" & SwapEndian($pRtlRandomEx) & _ ; mov rax, RtlRandomEx "FFD0" & _ ; call rax "31D2" & _ ; xor edx, edx "41BA" & SwapEndian(429497, 4) & _ ; mov r10d, 429497d "41F7F2" & _ ; div eax, r10d "2D" & SwapEndian(2500, 4) & _ ; sub eax, 2500d "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "48B8" & SwapEndian($pDiv) & _ ; mov rax, $pDiv "F30F1008" & _ ; movss xmm1, [eax] "F30F5EC1" & _ ; divss xmm0, xmm1 "F30F1106" & _ ; movss [rsi+0d], xmm0 "" & _ ; 230. GENERATE RANDOM INTEGER IN RANGE OF -25, 25 AND SAVE IT TO y COORDINATE FLOAT: "48B9" & SwapEndian($pRandom) & _ ; mov rcx, $pRandom "48B8" & SwapEndian($pRtlRandomEx) & _ ; mov rax, RtlRandomEx "FFD0" & _ ; call rax "31D2" & _ ; xor edx, edx "41BA" & SwapEndian(429497, 4) & _ ; mov r10d, 429497d "41F7F2" & _ ; div eax, r10d "2D" & SwapEndian(2500, 4) & _ ; sub eax, 2500d "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "48B8" & SwapEndian($pDiv) & _ ; mov rax, $pDiv "F30F1008" & _ ; movss xmm1, [rax] "F30F5EC1" & _ ; divss xmm0, xmm1 "F30F1146" & SwapEndian(4, 1) & _ ; movss [rsi+4d], xmm0 "" & _ ; 240. SET z COORDINATE to -150 FLOAT VALUE: "48B8" & SwapEndian($pInt2) & _ ; mov rax, $pInt2 "F30F2A00" & _ ; cvtsi2ss xmm0, [rax] "F30F1146" & SwapEndian(8, 1) & _ ; movss [rsi+8d], xmm0 "" & _ ; 250. ADD SIZE OF float[3] TO rsi: "4883C6" & SwapEndian(12, 1) & _ ; add rsi, 12d ;<- add 12 to rsi. That is the size of float[3] "" & _ ; 260. COMPARE IT: "48B8" & SwapEndian($pStars + $iNumStars * 12) & _ ; mov rax, $pStars+$iNumStars*12 "4839C6" & _ ; cmp rsi, rax; <- compare rsi with $pStars+$iNumStars*size of float[3] "" & _ ; 270. MAKE A CONDITION: "73" & SwapEndian(5, 1) & _ ; jnb 5d ;<- jump forward 5 bytes on not below; to <290> "" & _ ; 280. GO BACK: "E9" & SwapEndian(-250, 4) & _ ; jump -250d ;<- jump 250 bytes back otherwise; to <150> "" & _ ; 290. CALL SwapBuffers function: "48B9" & SwapEndian($hDC) & _ ; mov rcx, $hDC "48B8" & SwapEndian($pSwapBuffers) & _ ; mov rax, $pSwapBuffers "FFD0" & _ ; call eax ;<- calling SwapBuffers "4883C4" & SwapEndian(88, 1) & _ ; add rsp, 88d ;<- shrink stack (88 bytes) "C3" _ ; ; ret ) Else DllStructSetData($tCodeBuffer, 1, _ "0x" & _ "" & _ ; >>>>>>>>>>>>>>>>>>>> GENERAL JOB <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 20. CLEAR BUFFERS: "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: "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: "BB" & SwapEndian($pStars) & _ ; mov ebx, $pStars ;<- assigning ebx "" & _ ; 50. DEFINING INITIAL COLOR: "8BC3" & _ ; mov eax, ebx "05" & SwapEndian(3 * $iNumStars * 4) & _ ; add eax, 3*$iNumStars*4 "50" & _ ; push eax "B8" & SwapEndian($pglColor3fv) & _ ; mov eax, $pglColor3fv ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling glColor3fv function "" & _ ; 60. DEFINING INITIAL POINT : "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. DEFINING END COLOR: "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. DEFINING END POINT (dislocate z coordinate by value of $tZoffset): "F30F1043" & SwapEndian(8, 1) & _ ; movss xmm0, [ebx + 8d] "48B8" & SwapEndian($pZoffset) & _ ; mov eax, $pZoffset "F30F1008" & _ ; movss xmm1, [eax] "F30F5CC1" & _ ; subss xmm0, xmm1 "F30F1143" & SwapEndian(8, 1) & _ ; movss [ebx + 8d], xmm0 "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: "F30F1043" & SwapEndian(8, 1) & _ ; movss xmm0, [ebx + 8d] "48B8" & SwapEndian($pZoffset) & _ ; mov eax, $pZoffset "F30F1008" & _ ; movss xmm1, [eax] "F30F58C1" & _ ; addss xmm0, xmm1 "F30F1143" & SwapEndian(8, 1) & _ ; movss [ebx + 8d], xmm0 "" & _ ; 100. ADD SIZE OF float[3] TO ebx: "83C3" & SwapEndian(12, 1) & _ ; add ebx, 12 ;<- add 12 to ebx. That is the size of float[3] "" & _ ; 110. COMPARE IT: "81FB" & SwapEndian($pStars + $iNumStars * 12) & _ ; cmp ebx, $pStars+$iNumStars*12 ; <- compare ebx with $pStars+$iNumStars*size of float[3] "" & _ ; 120. MAKE A CONDITION: "73" & SwapEndian(2, 1) & _ ; jnb 2d ;<- jump forward 2 bytes on not below; to <135> "" & _ ; 130. GO BACK: "EB" & SwapEndian(-104, 1) & _ ; jump -104d ;<- jump 104 bytes back otherwise; to <50> "" & _ ; >>>>>>>>>>>>>>>>>>>> GENERAL JOB <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 135. CALL glEnd FUNCTION: "B8" & SwapEndian($pglEnd) & _ ; mov eax, glEnd "FFD0" & _ ; call eax ;<- calling glEnd "" & _ ; >>>>>>>>>>>>>>>>>>>> SECOND LOOP <<<<<<<<<<<<<<<<<<<<<<< "" & _ ; 140. INITIALIZING NEW LOOP: "BB" & SwapEndian($pStars) & _ ; mov ebx, $pStars ;<- assigning ebx "" & _ ; 150. CHECK THRESHOLD: "F30F1043" & SwapEndian(8, 1) & _ ; movss xmm0, [ebx + 8d] "48B8" & SwapEndian($pThreshold) & _ ; mov eax, $pThreshold "F30F1008" & _ ; movss xmm1, [eax] "660F2FC8" & _ ; comisd xmm1, xmm0 "73" & SwapEndian(36, 1) & _ ; jnb 36d ;<- jump 36 bytes forward on not below; to <220> "48B8" & SwapEndian($pZincrement) & _ ; mov eax, $pZincrement "F30F1008" & _ ; movss xmm1, [eax] "F30F58C1" & _ ; addss xmm0, xmm1 "F30F1143" & SwapEndian(8, 1) & _ ; movss [ebx + 8], xmm0 "" & _ ; 180. ADD SIZE OF float[3] TO ebx: "83C3" & SwapEndian(12, 1) & _ ; add ebx, 12 ;<- add 12 to ebx. That is the size of float[3] "" & _ ; 190. COMPARE IT: "81FB" & SwapEndian($pStars + $iNumStars * 12) & _ ; cmp ebx, $pStars+$iNumStars*12 ; <- compare ebx with $pStars+$iNumStars*size of float[3] "" & _ ; 200. MAKE A CONDITION : "0F83" & SwapEndian(132) & _ ; jnb 132d ;<- jump forward 132 bytes on not below; to <290> "" & _ ; 210. GO BACK: "EB" & SwapEndian(-57, 1) & _ ; jump -57d ;<- jump 57 bytes back otherwise; to <150> "" & _ ; 220. GENERATE RANDOM INTEGER IN RANGE OF -25, 25 AND SAVE IT TO x COORDINATE FLOAT: "68" & SwapEndian($pRandom) & _ ; push $pRandom "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling RtlRandomEx function "31D2" & _ ; xor edx, edx ;<- this is needed o avoid illegalness (dividing below) "B9" & SwapEndian(429497) & _ ; mov ecx, 429497d ;<- ecx = 429497 "F7F1" & _ ; div ecx ;<- divide eax by ecx "81E8" & SwapEndian(2500) & _ ; sub eax, 2500d ;<- substract 2500 "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "48B8" & SwapEndian($pDiv) & _ ; mov eax, $pDiv "F30F1008" & _ ; movss xmm1, [eax] "F30F5EC1" & _ ; divss xmm0, xmm1 "F30F1103" & _ ; movss [ebx+0d], xmm0 "" & _ ; 230. GENERATE RANDOM INTEGER IN RANGE OF -25, 25 AND SAVE IT TO y COORDINATE FLOAT: "68" & SwapEndian($pRandom) & _ ; push $pRandom ;<- "B8" & SwapEndian($pRtlRandomEx) & _ ; mov eax, RtlRandomEx ;<- 'preparing' to call "FFD0" & _ ; call eax ;<- calling RtlRandomEx "31D2" & _ ; xor edx, edx ;<- dividing below "B9" & SwapEndian(429497) & _ ; mov ecx, 429497d ;<- ecx = 429497 "F7F1" & _ ; div ecx ;<- divide eax by ecx "81E8" & SwapEndian(2500) & _ ; sub eax, 2500d ;<- substract 2500 "F30F2AC0" & _ ; cvtsi2ss xmm0, eax "48B8" & SwapEndian($pDiv) & _ ; mov eax, $pDiv "F30F1008" & _ ; movss xmm1, [eax] "F30F5EC1" & _ ; divss xmm0, xmm1 "F30F1143" & SwapEndian(4, 1) & _ ; movss [ebx+4d], xmm0 "" & _ ; 240. SET z COORDINATE to -150 FLOAT VALUE: "48B8" & SwapEndian($pInt2) & _ ; mov eax, $pInt2 "F30F2A00" & _ ; cvtsi2ss xmm0, [eax] "F30F1143" & SwapEndian(8, 1) & _ ; movss [ebx+8d], xmm0 "" & _ ; 250. ADD SIZE OF float[3] TO ebx: "83C3" & SwapEndian(12, 1) & _ ; add ebx, 12 ;<- add 12 to ebx. That is the size of float[3] "" & _ ; 260. COMPARE IT: "81FB" & SwapEndian($pStars + $iNumStars * 12) & _ ; cmp ebx, $pStars+$iNumStars*12 ; <- compare ebx with $pStars+$iNumStars*size of float[3] "" & _ ; 270. MAKE A CONDITION: "73" & SwapEndian(5, 1) & _ ; jnb 5d ;<- jump forward 5 bytes on not below; to <290> "" & _ ; 280. GO BACK: "E9" & SwapEndian(-187) & _ ; jump -187d ;<- jump 187 bytes back otherwise; to <150> "" & _ ; 290. CALL SwapBuffers function: "68" & SwapEndian($hDC) & _ ; push $hDC "B8" & SwapEndian($pSwapBuffers) & _ ; mov eax, SwapBuffers "FFD0" & _ ; call eax ;<- calling SwapBuffers "" & _ ; 300. RETURN: "C3" _ ; ret ) EndIf ; Associate contexts with the current thread DllCall($hOPENGL32, "int", "wglMakeCurrent", "ptr", $hDC, "ptr", $hRC) ; Initializing GL environment _glClearColor(0, 0, 0, 1) ; black _glFogi($GL_FOG_MODE, $GL_LINEAR) ; use linear equation to compute the fog blend factor _glFogfv($GL_FOG_COLOR, $pFogColor) ; set fog color _glFogf($GL_FOG_DENSITY, 0.1) ; fog density _glHint($GL_FOG_HINT, $GL_DONT_CARE) ; no preference _glFogf($GL_FOG_START, 70) ; set the near distance for linear fog equation _glFogf($GL_FOG_END, 150) ; set the far distance for linear fog equation _glEnable($GL_FOG) ; enable fog _glBlendFunc($GL_SRC_COLOR, $GL_DST_COLOR) _glEnable($GL_BLEND) ; enable blending ; Initially put things in place (literally) _glLoadIdentity() _glViewport(0, 0, $iWidthGUI, $iHeightGUI) ; default position _glMatrixMode($GL_PROJECTION) ; current matrix _glLoadIdentity() Global $nRatio = $iWidthGUI / $iHeightGUI _glFrustum(-$nRatio * 0.75, $nRatio * 0.75, -0.75, 0.75, 6, 150) ; multiplying the current matrix by a perspective matrix _glMatrixMode($GL_MODELVIEW) ; current matrix ; Installing function to do the refreshment GUIRegisterMsg(133, "_Preserve") ; WM_NCPAINT ; Installing function to handle resizing GUIRegisterMsg(5, "_ResizeGL") ; WM_SIZE ; Installing function to change speed with mouse wheel GUIRegisterMsg(522, "_SpeedMouse") ; WM_MOUSEWHEEL ; Add some keyboard support. UP and DOWN arrows to change speed Global $aAccelKeys[2][2] = [["{UP}", GUICtrlCreateDummy()], ["{DOWN}", GUICtrlCreateDummy()]] GUISetAccelerators($aAccelKeys) GUICtrlSetOnEvent($aAccelKeys[0][1], "_UpSpeedHK") ; UP arrow GUICtrlSetOnEvent($aAccelKeys[1][1], "_DnSpeedHK") ; DOWN arrow ; Handling things on Exit GUISetOnEvent(-3, "_Quit") ; $GUI_EVENT_CLOSE ; Show GUI GUISetState(@SW_SHOW, $hGUI) ; Loop till the end While 1 _GLDraw() Sleep(10) WEnd ; THE END ; USED FUNCTIONS: Func _GLDraw() DllCallAddress("ulong", $pRemoteCode) EndFunc Func SwapEndian($iValue, $iSize = @AutoItX64 ? 8 : 4) Return Hex(BinaryMid($iValue, 1, $iSize)) EndFunc Func _EnableOpenGL($hWnd, ByRef $hDeviceContext, ByRef $hOPENGL32RenderingContext) 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($hUSER32, "ptr", "GetDC", "hwnd", $hWnd) If @error Or Not $a_hCall[0] Then Return SetError(1, 0, 0) ; could not retrieve a handle to a device context EndIf $hDeviceContext = $a_hCall[0] Local $a_iCall = DllCall($hGDI32, "int", "ChoosePixelFormat", "ptr", $hDeviceContext, "ptr", DllStructGetPtr($tPIXELFORMATDESCRIPTOR)) If @error Or Not $a_iCall[0] Then Return SetError(2, 0, 0) ; could not match an appropriate pixel format EndIf Local $iFormat = $a_iCall[0] $a_iCall = DllCall($hGDI32, "int", "SetPixelFormat", "ptr", $hDeviceContext, "int", $iFormat, "ptr", DllStructGetPtr($tPIXELFORMATDESCRIPTOR)) If @error Or Not $a_iCall[0] Then Return SetError(3, 0, 0) ; could not set the pixel format of the specified device context to the specified format EndIf $a_hCall = DllCall($hOPENGL32, "ptr", "wglCreateContext", "ptr", $hDeviceContext) If @error Or Not $a_hCall[0] Then Return SetError(4, 0, 0) ; could not create a rendering context EndIf $hOPENGL32RenderingContext = $a_hCall[0] Return SetError(0, 0, 1) ; all OK! EndFunc Func _DisableOpenGL($hWnd, $hDeviceContext, $hOpenGLRenderingContext) ; No point in doing error checking if this is done on exit. Will just call the cleaning functions. DllCall($hOPENGL32, "int", "wglMakeCurrent", "ptr", 0, "ptr", 0) DllCall($hOPENGL32, "int", "wglDeleteContext", "ptr", $hOpenGLRenderingContext) DllCall($hUSER32, "int", "ReleaseDC", "hwnd", $hWnd, "ptr", $hDeviceContext) EndFunc Func _ResizeGL($hWnd, $iMsg, $wParam, $lParam) ; dealing with AU3Check.exe #forceref $hWnd, $iMsg, $wParam ; associate contexts with the current thread DllCall($hOPENGL32, "int", "wglMakeCurrent", "ptr", $hDC, "ptr", $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 Func _SpeedMouse($hWnd, $iMsg, $wParam, $lParam) ; dealing with AU3Check.exe #forceref $hWnd, $iMsg, $lParam Local $nSpeedFactor = DllStructGetData($tZincrement, 1) ; this is where speed information is kept If BitShift($wParam, 16) > 0 Then ; determine in what way the wheel is turning $nSpeedFactor *= 1.1 ; speed it up by 10% (not linear on purpose) Else $nSpeedFactor /= 1.1 ; slow it down by 10% EndIf _ChangeSpeed($nSpeedFactor) EndFunc Func _UpSpeedHK() Local $nSpeedFactor = DllStructGetData($tZincrement, 1) ; this is where speed information is kept _ChangeSpeed($nSpeedFactor * 1.1) ; speed it up by 10% (not linear on purpose) EndFunc Func _DnSpeedHK() Local $nSpeedFactor = DllStructGetData($tZincrement, 1) ; this is where speed information is kept _ChangeSpeed($nSpeedFactor / 1.1) ; speed it up by 10% (not linear on purpose) EndFunc Func _ChangeSpeed($nSpeedFactor) If $nSpeedFactor > 3 Then $nSpeedFactor = 3 If $nSpeedFactor < 0.26 Then $nSpeedFactor = 0.26 ; save the changes DllStructSetData($tZincrement, 1, $nSpeedFactor) Local $nTail = $nSpeedFactor * 3 If $nTail < 0.5 Then $nTail = 0.5 DllStructSetData($tZoffset, 1, $nTail) ; update window title WinSetTitle($hGUI, 0, "OpenGL Space, Warp " & 1 + Round($nSpeedFactor, 2)) EndFunc ; Used OpenGL function plus some unused Func _glBegin($iMode) DllCall($hOPENGL32, "none", "glBegin", "dword", $iMode) EndFunc Func _glBlendFunc($iSfactor, $iDfactor) DllCall($hOPENGL32, "none", "glBlendFunc", "dword", $iSfactor, "dword", $iDfactor) EndFunc Func _glColor3fv($pColorFloat) DllCall($hOPENGL32, "none", "glColor3fv", "ptr", $pColorFloat) EndFunc Func _glClear($iMask) DllCall($hOPENGL32, "none", "glClear", "dword", $iMask) EndFunc Func _glClearColor($nRed, $nGreen, $nBlue, $nAlpha) DllCall($hOPENGL32, "none", "glClearColor", "float", $nRed, "float", $nGreen, "float", $nBlue, "float", $nAlpha) EndFunc Func _glEnable($iCap) DllCall($hOPENGL32, "none", "glEnable", "dword", $iCap) EndFunc Func _glEnd() DllCall($hOPENGL32, "none", "glEnd") EndFunc Func _glFrustum($nLeft, $nRight, $nBottom, $nTop, $nZNear, $nZFar) DllCall($hOPENGL32, "none", "glFrustum", "double", $nLeft, "double", $nRight, "double", $nBottom, "double", $nTop, "double", $nZNear, "double", $nZFar) EndFunc Func _glFogf($iName, $nParam) DllCall($hOPENGL32, "none", "glFogf", "dword", $iName, "float", $nParam) EndFunc Func _glFogi($iName, $iParam) DllCall($hOPENGL32, "none", "glFogi", "dword", $iName, "dword", $iParam) EndFunc Func _glFogfv($iName, $pParams) DllCall($hOPENGL32, "none", "glFogfv", "dword", $iName, "ptr", $pParams) EndFunc Func _glHint($iTarget, $iMode) DllCall($hOPENGL32, "none", "glHint", "dword", $iTarget, "dword", $iMode) EndFunc Func _glLoadIdentity() DllCall($hOPENGL32, "none", "glLoadIdentity") EndFunc Func _glMatrixMode($iMode) DllCall($hOPENGL32, "none", "glMatrixMode", "dword", $iMode) EndFunc Func _glViewport($iX, $iY, $iWidth, $iHeight) DllCall($hOPENGL32, "none", "glViewport", "int", $iX, "int", $iY, "dword", $iWidth, "dword", $iHeight) EndFunc Func _glVertex3fv($pPointer) DllCall($hOPENGL32, "none", "glVertex3fv", "ptr", $pPointer) EndFunc Func _SwapBuffers($hDC) DllCall($hGDI32, "int", "SwapBuffers", "ptr", $hDC) EndFunc Func _Preserve() _SwapBuffers($hDC) EndFunc Func _Quit() _DisableOpenGL($hGUI, $hDC, $hRC) Exit EndFunc