Спойлер: Public_CFRF.pb Код: IncludeFile "include.pbi" DataSection Reserved: Data.b $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 Data.b $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 Data.b $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 Data.b $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 Data.b $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 Data.b $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 bad_mem: Data.b $E9, $01, $00, $00, $00, $00 EndDataSection Procedure Init() Global DIP_addr Global Present9_addr Global m_font.ID3DXFont Global CurrItem Global crosshair=1, WallHack, NoRecoil, NoSpread, Autoshot, Fullbright, WalkThroughWalls Global count Global FPS Global fontname.s="Consolas" Global cshell_addr=0 Global maxx, maxy Global counter = 3 Structure Menu Alpha.l x.l y.l Width.l Height.l ItemHeight.l ItemWidth.l HeaderStrings.l HeaderHeight.l HeaderSplitterHeight.l BackColor.l TextColor.l BorderWidth.l BorderHeight.l BorderColor.l ItemSelectColor.l nbItems.l EndStructure Global menu = 1 ;Home Global MenuInfo.Menu EndProcedure Procedure NoSpread(state) Protected addr1=cshell_addr+$6CD1E8, addr2=cshell_addr+$6CD2F8, addr3=cshell_addr+$6CD287, addr4=cshell_addr+$6CD221, addr5=cshell_addr+$404DD1, addr6 = cshell_addr + $404D32, addr7 = cshell_addr + $404E42, addr8 = cshell_addr + $404D6B If state=1 CopyMemory(addr1, ?Reserved, 6) CopyMemory(addr2, ?Reserved+6, 6) CopyMemory(addr3, ?Reserved+12, 6) CopyMemory(addr4, ?Reserved+18, 6) CopyMemory(addr5, ?Reserved+24, 6) CopyMemory(addr6, ?Reserved+30, 6) CopyMemory(addr7, ?Reserved+36, 6) CopyMemory(addr8, ?Reserved+42, 6) CopyMemory(?bad_mem, addr1, 6) CopyMemory(?bad_mem, addr2, 6) CopyMemory(?bad_mem, addr3, 6) CopyMemory(?bad_mem, addr4, 6) CopyMemory(?bad_mem, addr5, 6) CopyMemory(?bad_mem, addr6, 6) CopyMemory(?bad_mem, addr7, 6) CopyMemory(?bad_mem, addr8, 6) ElseIf state=0 CopyMemory(?Reserved, addr1, 6) CopyMemory(?Reserved+6, addr2, 6) CopyMemory(?Reserved+12, addr3, 6) CopyMemory(?Reserved+18, addr4, 6) CopyMemory(?Reserved+24, addr5, 6) CopyMemory(?Reserved+30, addr6, 6) CopyMemory(?Reserved+36, addr7, 6) CopyMemory(?Reserved+42, addr8, 6) EndIf EndProcedure Procedure NoRecoil(state) Protected addr1 = cshell_addr + $3FBEAF, addr2 = cshell_addr + $6C2C44 If state=1 CopyMemory(addr1, ?Reserved+48, 6) CopyMemory(addr2, ?Reserved+54, 6) CopyMemory(?bad_mem, addr1, 6) CopyMemory(?bad_mem, addr2, 6) ElseIf state=0 CopyMemory(?Reserved+48, addr1, 6) CopyMemory(?Reserved+54, addr2, 6) EndIf EndProcedure Procedure ChangeCurrItemState(CurrItem, CurrItemState) If CurrItem=0 crosshair+CurrItemState If crosshair<0 crosshair=4 ElseIf crosshair>4 crosshair=0 EndIf ElseIf CurrItem=1 WallHack=Bool(Not WallHack) ElseIf CurrItem=2 Fullbright=Bool(Not Fullbright) ElseIf CurrItem=3 NoRecoil=Bool(Not NoRecoil) NoRecoil(NoRecoil) ElseIf CurrItem=4 NoSpread=Bool(Not NoSpread) NoSpread(NoSpread) ElseIf CurrItem=5 Autoshot=Bool(Not Autoshot) ElseIf CurrItem=6 WalkThroughWalls=Bool(Not WalkThroughWalls) ElseIf CurrItem=7 If GetAsyncKeyState_(#VK_MENU) CurrItemState*10 EndIf With MenuInfo \Alpha+CurrItemState If \Alpha<=0 \Alpha=255 ElseIf \Alpha>=256 \Alpha=1 EndIf \BackColor=D3DCOLOR_ARGB(0, 0, 0, \Alpha) \TextColor=D3DCOLOR_ARGB(255, 255, 255, \Alpha) \BorderColor=D3DCOLOR_ARGB(0, 255, 0, \Alpha) \ItemSelectColor=D3DCOLOR_ARGB(255, 0, 0, \Alpha) EndWith EndIf EndProcedure Procedure ChangeCurrItem(action) MaxItem=MenuInfo\nbItems-MenuInfo\HeaderStrings-1 CurrItem+action If CurrItem>MaxItem CurrItem=0 ElseIf CurrItem<0 CurrItem=MaxItem EndIf EndProcedure Procedure LoadMenuSettings() With MenuInfo \Alpha=$FF \nbItems=10 \BorderWidth=1 \BorderHeight=1 \HeaderStrings=2 \x=0 \y=0 \ItemHeight=20 \HeaderSplitterHeight=1 \ItemWidth=\Width-\BorderWidth \HeaderHeight=\HeaderStrings*\ItemHeight \BackColor=D3DCOLOR_ARGB(0, 0, 0, \Alpha) \TextColor=D3DCOLOR_ARGB(255, 255, 255, \Alpha) \BorderColor=D3DCOLOR_ARGB(0, 255, 0, \Alpha) \ItemSelectColor=D3DCOLOR_ARGB(255, 0, 0, \Alpha) \Width=\BorderWidth*2+240 \Height=\ItemHeight*\nbItems+\BorderHeight*2 EndWith EndProcedure Procedure DrawMenuText(TextLeft.s, TextRight.s) Protected y y=MenuInfo\y+count*MenuInfo\ItemHeight DrawMenuTextA(m_font, TextLeft, TextRight, MenuInfo\TextColor, MenuInfo\x, y, MenuInfo\Width, MenuInfo\ItemHeight) count+1 EndProcedure Procedure DrawMenuItems() count=0 ;header DrawMenuText("CFRF", "#DT_CENTER") DrawMenuText("FPS", Str(FPS)) ;functions DrawMenuText("Crosshair", GetCrosshairColorText(crosshair)) DrawMenuText("Wallhack", GetState(WallHack)) DrawMenuText("See Ghosts", GetState(Fullbright)) DrawMenuText("No Recoil", GetState(NoRecoil)) DrawMenuText("No Spread", GetState(NoSpread)) DrawMenuText("Autoshot", GetState(Autoshot)) DrawMenuText("Walk Through Walls (SHIFT)", GetState(WalkThroughWalls)) DrawMenuText("Transparency", Str(MenuInfo\Alpha)) EndProcedure Procedure DrawMenu(pDev.IDirect3DDevice9) With MenuInfo ;menu border DrawBox(pDev,\x, \y, \Width, \BorderHeight, \BorderColor) DrawBox(pDev,\x+\Width-1, \y, \BorderWidth, \Height, \BorderColor) DrawBox(pDev,\x, \y+\Height-1, \Width, \BorderHeight, \BorderColor) DrawBox(pDev,\x, \y, \BorderWidth, \Height, \BorderColor) ;menu background DrawBox(pDev,\x+\BorderWidth, \y+\BorderHeight, \Width-\BorderWidth*2, \Height-\BorderHeight*2, \BackColor) ;header splitter DrawBox(pDev,\x, \y+\HeaderHeight, \Width, \HeaderSplitterHeight, \BorderColor) ;current item DrawBox(pDev,\x+\BorderWidth, \y+\HeaderHeight+CurrItem*\ItemHeight+\HeaderSplitterHeight, \Width-\BorderWidth*2, \ItemHeight, \ItemSelectColor) DrawMenuItems() EndWith EndProcedure Procedure GetDevice9Methods() Protected d3dDevice.IDirect3DDevice9 Protected d3ddm.D3DDISPLAYMODE Protected D3D.IDirect3D9 Protected d3dpp.D3DPRESENT_PARAMETERS For a=0 To 5000 Next For a=0 To 1 Step 0 hD3D9=GetModuleHandle_("d3d9.dll") If hD3D9 Break EndIf Next d3d=CallFunctionFast(GetProcAddress_(hD3D9,"Direct3DCreate9"),#D3D_SDK_VERSION+1) hWnd = CreateWindowEx_(0, "STATIC", "", 0, 0, 0, 0, 0, 0, 0, 0, 0) d3d\GetAdapterDisplayMode(0, @d3ddm) ZeroMemory_(@d3dpp, SizeOf(D3DPRESENT_PARAMETERS)) d3dpp\Windowed = 1 d3dpp\SwapEffect = #D3DSWAPEFFECT_DISCARD d3dpp\BackBufferFormat = d3ddm\Format d3d\CreateDevice(0, #D3DDEVTYPE_HAL, hWnd, #D3DCREATE_SOFTWARE_VERTEXPROCESSING, @d3dpp, @d3dDevice) DIP_addr = @d3dDevice\DrawIndexedPrimitive() Present9_addr = @d3dDevice\Present() d3d\Release() d3d=0 d3dDevice\Release() d3dDevice=0 DestroyWindow_(hWnd) EndProcedure Procedure TrampolineDIP(pDev.IDirect3DDevice9, PrimType, BaseVertexIndex.i, MinVertexIndex.i, NumVertices.i, startIndex.i, primCount.i) !push ebp !mov ebp,esp !mov eax, [v_DIP_addr] !add eax, 5 !jmp eax EndProcedure Procedure HookedDIP(pDev.IDirect3DDevice9, PrimType, BaseVertexIndex.i, MinVertexIndex.i, NumVertices.i, startIndex.i, primCount.i) If WallHack Protected Stream_Data.IDIRECT3DVERTEXBUFFER9 Protected offset=0 Protected stride=0 If pDev\GetStreamSource(0, @Stream_Data, @offset, @stride) = #S_OK Stream_Data\Release() Stream_Data=0 If stride=44 Or stride=40 pDev\GetRenderState(#D3DRS_ZENABLE, @lOld) pDev\SetRenderState(#D3DRS_ZENABLE, #False) If Fullbright pDev\SetRenderState(#D3DRS_LIGHTING, #False) EndIf TrampolineDIP(pDev.IDirect3DDevice9, PrimType, BaseVertexIndex.i, MinVertexIndex.i, NumVertices.i, startIndex.i, primCount.i) pDev\SetRenderState(#D3DRS_ZENABLE, lOld) Else TrampolineDIP(pDev.IDirect3DDevice9, PrimType, BaseVertexIndex.i, MinVertexIndex.i, NumVertices.i, startIndex.i, primCount.i) EndIf Else TrampolineDIP(pDev.IDirect3DDevice9, PrimType, BaseVertexIndex.i, MinVertexIndex.i, NumVertices.i, startIndex.i, primCount.i) EndIf Else TrampolineDIP(pDev.IDirect3DDevice9, PrimType, BaseVertexIndex.i, MinVertexIndex.i, NumVertices.i, startIndex.i, primCount.i) EndIf EndProcedure Procedure TrampolinePresent9(pDev.IDirect3DDevice9, a, b, c, d) !push ebp !mov ebp,esp !mov eax, [v_Present9_addr] !add eax, 5 !jmp eax EndProcedure Procedure HookedPresent9(pDev.IDirect3DDevice9, a, b, c, d) Protected vp.D3DVIEWPORT9 Protected crhr.D3DRECT Protected pos.POINT Protected time_cur=ElapsedMilliseconds() Static time_old,count pDev\BeginScene() If Not m_font D3DXCreateFont=GetProcAddress_(GetModuleHandle_("d3dx9_29.dll"), "D3DXCreateFontA") If D3DXCreateFont CallFunctionFast(D3DXCreateFont, pDev, 18, 0, #FW_BOLD, 0, 0, 1, 0, 0, 0 | #FF_DONTCARE, @fontname, @m_font) EndIf EndIf DeviceSettings(pDev, 0) pDev\GetViewport(@vp) maxy = vp\Height maxx = vp\Width If GetAsyncKeyState_(#VK_HOME)&1 menu=Bool(Not menu) EndIf If menu DrawMenu(pDev) If m_font m_font\OnLostDevice() m_font\OnResetDevice() EndIf If GetAsyncKeyState_(#VK_LEFT)&1 ChangeCurrItemState(CurrItem, -1) ElseIf GetAsyncKeyState_(#VK_RIGHT)&1 ChangeCurrItemState(CurrItem, 1) EndIf If GetAsyncKeyState_(#VK_UP)&1 ChangeCurrItem(-1) ElseIf GetAsyncKeyState_(#VK_DOWN)&1 ChangeCurrItem(1) EndIf EndIf If crosshair DrawBox(pDev, maxx/2-5, maxy/2, 11, 1, GetCrosshairColor(crosshair)) DrawBox(pDev, maxx/2, maxy/2 - 5, 1, 11, GetCrosshairColor(crosshair)) EndIf If time_old=0 time_old=time_cur ElseIf time_cur-time_old<1000 count+1 ElseIf time_cur-time_old>=1000 FPS=count time_old=time_cur count=0 EndIf If cshell_addr=0 cshell_addr=GetModuleHandle_("cshell.dll") Else ClientShell = PeekL(cshell_addr + $CA219C) pCLTPlayerClient = PeekL(ClientShell + $70) EndIf If Autoshot And GetAsyncKeyState_(#VK_LBUTTON)=0 If PeekA(cshell_addr+$B840E1)=1 mouse_event_(#MOUSEEVENTF_ABSOLUTE|#MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0) mouse_event_(#MOUSEEVENTF_ABSOLUTE|#MOUSEEVENTF_LEFTUP, 0, 0, 0, 0) EndIf EndIf If (WalkThroughWalls) If (pCLTPlayerClient <> 0) For i = 0 To $1FF If PeekF(pCLTPlayerClient + 4 * i) = 56 If (GetAsyncKeyState_(#VK_SHIFT)) PokeF(pCLTPlayerClient + 4 * i, -56) EndIf EndIf Next EndIf EndIf DeviceSettings(pDev, 1) If m_font And GetAsyncKeyState_(#VK_F2)&1 m_font\Release() m_font=0 EndIf pDev\EndScene() TrampolinePresent9(pDev.IDirect3DDevice9, a, b, c, d) EndProcedure Procedure ErrorHandler() ErrorMessage$ = "A program error was detected:" + Chr(13) ErrorMessage$ + Chr(13) ErrorMessage$ + "Error Message: " + ErrorMessage() + Chr(13) ErrorMessage$ + "Error Code: " + Str(ErrorCode()) + Chr(13) ErrorMessage$ + "Code Address: " + Str(ErrorAddress()) + Chr(13) If ErrorCode() = #PB_OnError_InvalidMemory ErrorMessage$ + "Target Address: " + Str(ErrorTargetAddress()) + Chr(13) EndIf If ErrorLine() = -1 ErrorMessage$ + "Sourcecode line: Enable OnError lines support to get code line information." + Chr(13) Else ErrorMessage$ + "Sourcecode line: " + Str(ErrorLine()) + Chr(13) ErrorMessage$ + "Sourcecode file: " + GetFilePart(ErrorFile()) + Chr(13) EndIf ErrorMessage$ + Chr(13) ErrorMessage$ + "Register content:" + Chr(13) CompilerSelect #PB_Compiler_Processor CompilerCase #PB_Processor_x86 ErrorMessage$ + "EAX = " + Str(ErrorRegister(#PB_OnError_EAX)) + Chr(13) ErrorMessage$ + "EBX = " + Str(ErrorRegister(#PB_OnError_EBX)) + Chr(13) ErrorMessage$ + "ECX = " + Str(ErrorRegister(#PB_OnError_ECX)) + Chr(13) ErrorMessage$ + "EDX = " + Str(ErrorRegister(#PB_OnError_EDX)) + Chr(13) ErrorMessage$ + "EBP = " + Str(ErrorRegister(#PB_OnError_EBP)) + Chr(13) ErrorMessage$ + "ESI = " + Str(ErrorRegister(#PB_OnError_ESI)) + Chr(13) ErrorMessage$ + "EDI = " + Str(ErrorRegister(#PB_OnError_EDI)) + Chr(13) ErrorMessage$ + "ESP = " + Str(ErrorRegister(#PB_OnError_ESP)) + Chr(13) CompilerCase #PB_Processor_x64 ErrorMessage$ + "RAX = " + Str(ErrorRegister(#PB_OnError_RAX)) + Chr(13) ErrorMessage$ + "RBX = " + Str(ErrorRegister(#PB_OnError_RBX)) + Chr(13) ErrorMessage$ + "RCX = " + Str(ErrorRegister(#PB_OnError_RCX)) + Chr(13) ErrorMessage$ + "RDX = " + Str(ErrorRegister(#PB_OnError_RDX)) + Chr(13) ErrorMessage$ + "RBP = " + Str(ErrorRegister(#PB_OnError_RBP)) + Chr(13) ErrorMessage$ + "RSI = " + Str(ErrorRegister(#PB_OnError_RSI)) + Chr(13) ErrorMessage$ + "RDI = " + Str(ErrorRegister(#PB_OnError_RDI)) + Chr(13) ErrorMessage$ + "RSP = " + Str(ErrorRegister(#PB_OnError_RSP)) + Chr(13) ErrorMessage$ + "Display of registers R8-R15 skipped." + Chr(13) CompilerCase #PB_Processor_PowerPC ErrorMessage$ + "r0 = " + Str(ErrorRegister(#PB_OnError_r0)) + Chr(13) ErrorMessage$ + "r1 = " + Str(ErrorRegister(#PB_OnError_r1)) + Chr(13) ErrorMessage$ + "r2 = " + Str(ErrorRegister(#PB_OnError_r2)) + Chr(13) ErrorMessage$ + "r3 = " + Str(ErrorRegister(#PB_OnError_r3)) + Chr(13) ErrorMessage$ + "r4 = " + Str(ErrorRegister(#PB_OnError_r4)) + Chr(13) ErrorMessage$ + "r5 = " + Str(ErrorRegister(#PB_OnError_r5)) + Chr(13) ErrorMessage$ + "r6 = " + Str(ErrorRegister(#PB_OnError_r6)) + Chr(13) ErrorMessage$ + "r7 = " + Str(ErrorRegister(#PB_OnError_r7)) + Chr(13) ErrorMessage$ + "Display of registers r8-R31 skipped." + Chr(13) CompilerEndSelect MessageRequester("OnError", ErrorMessage$) EndProcedure Procedure SetHook(OriginalFunction, HookedFunction) Protected addr, oldProtect addr = HookedFunction - OriginalFunction - 5 VirtualProtect_(OriginalFunction, 5, #PAGE_EXECUTE_READWRITE, @oldProtect) PokeB(OriginalFunction, $E9) PokeL(OriginalFunction+1, addr) VirtualProtect_(OriginalFunction, 5, oldProtect, @oldProtect) EndProcedure Procedure TF(lpParam) Init() LoadMenuSettings() GetDevice9Methods() SetHook(DIP_addr, @HookedDIP()) SetHook(Present9_addr, @HookedPresent9()) EndProcedure ProcedureDLL AttachProcess(Instance) OnErrorCall(@ErrorHandler()) CreateThread(@TF(), 0) EndProcedure Спойлер: include.pbi Код: ; DataSection ; bPink: ; Data.b $42, $4D, $3A, $00, $00, $00, $00, $00, $00 ; Data.b $00, $36, $00, $00, $00, $28, $00, $00, $00 ; Data.b $01, $00, $00, $00, $01, $00, $00, $00, $01 ; Data.b $00, $18, $00, $00, $00, $00, $00, $04, $00 ; Data.b $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Data.b $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Data.b $80, $00, $FF, $00 ; bBlue: ; Data.b $42, $4D, $3C, $00, $00, $00, $00, $00, $00 ; Data.b $00, $36, $00, $00, $00, $28, $00, $00, $00 ; Data.b $01, $00, $00, $00, $01, $00, $00, $00, $01 ; Data.b $00, $20, $00, $00, $00, $00, $00, $00, $00 ; Data.b $00, $00, $12, $0B, $00, $00, $12, $0B, $00 ; Data.b $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Data.b $FF, $00, $00, $00, $00, $00 ; bRed: ; Data.b $42, $4D, $3C, $00, $00, $00, $00, $00, $00 ; Data.b $00, $36, $00, $00, $00, $28, $00, $00, $00 ; Data.b $01, $00, $00, $00, $01, $00, $00, $00, $01 ; Data.b $00, $20, $00, $00, $00, $00, $00, $00, $00 ; Data.b $00, $00, $12, $0B, $00, $00, $12, $0B, $00 ; Data.b $00, $00, $00, $00, $00, $00, $00, $00, $00 ; Data.b $00, $00, $FF, $00, $00, $00 ; EndDataSection ; DataSection ; Data.b $00,$01,$02,$03,$04,$05,$06,$07,$08,$09,$0A,$0B,$0C,$0D,$0E,$0F ; EndDataSection #D3D_SDK_VERSION=31 #D3D_OK=0 ; #D3DFVF_XYZ=2 #D3DFVF_XYZRHW=4 #D3DFVF_DIFFUSE=64 #D3DSWAPEFFECT_DISCARD=1 ; #D3DSWAPEFFECT_FLIP=2 ; #D3DSWAPEFFECT_COPY=3 ; #D3DSWAPEFFECT_COPY_VSYNC=4 #D3DCLEAR_TARGET=1 #D3DADAPTER_DEFAULT=0 #D3DDEVTYPE_HAL=1 ; #D3DDEVTYPE_REF=2 ; #D3DDEVTYPE_SW=3 #D3DCREATE_SOFTWARE_VERTEXPROCESSING=32 ; #D3DCREATE_HARDWARE_VERTEXPROCESSING=64 ; #D3DCREATE_MIXED_VERTEXPROCESSING=128 ; ; #D3DPT_POINTLIST=1 ; #D3DPT_LINELIST=2 ; #D3DPT_LINESTRIP=3 ; #D3DPT_TRIANGLELIST=4 #D3DPT_TRIANGLESTRIP=5 ; #D3DFMT_X1R5G5B5=24 ; #D3DFMT_A1R5G5B5=25 ; #D3DFMT_R5G6B5=23 ; #D3DFMT_X8R8G8B8=22 ; #D3DFMT_A8R8G8B8=21 ; #D3DFMT_R8G8B8=20 ; ; ; #D3DTS_PROJECTION=3 ; #D3DTS_WORLD=256 ; ; #D3DPRESENTFLAG_LOCKABLE_BACKBUFFER=1 #D3DRS_LIGHTING=137 #D3DRS_ALPHABLENDENABLE=27 ; #D3DRS_FILLMODE=8 #D3DRS_CULLMODE=22 ; #D3DRS_SRCBLEND=19 #D3DRS_DESTBLEND=20 ; #D3DRS_FOGENABLE=28 ; #D3DRS_FOGCOLOR=34 #D3DRS_BLENDOPALPHA=207 #D3DRS_ZENABLE=7 ; #D3DBLEND_INVSRCALPHA = 6 ; #D3DCULL_NONE = 1 ; ; #D3DPOOL_DEFAULT=0 ; #D3DPOOL_SYSTEMMEM=2 ; ; #D3DLOCK_NOSYSLOCK = $00000800 ; #D3DLOCK_DONOTWAIT = $00004000 Procedure D3DCOLOR_ARGB(Red, Green, Blue, Alpha=255); ProcedureReturn RGBA(Blue, Green, Red, Alpha) EndProcedure Structure D3DPresent_Parameters BackBufferWidth.l BackBufferHeight.l BackBufferFormat.l BackBufferCount.l MultiSampleType.l MultiSampleQuality.l SwapEffect.l hDeviceWindow.l Windowed.l EnableAutoDepthStencil.l AutoDepthStencilFormat.l Flags.l FullScreen_RefreshRateInHz.l FullScreen_PresentationInterval.l EndStructure Structure D3DDISPLAYMODE Width.l Height.l RefreshRate.l Format.l EndStructure Structure D3DVIEWPORT9 X.l Y.l Width.l Height.l MinZ.l MaxZ.l EndStructure Structure D3DRECT x1.l y1.l x2.l y2.l EndStructure Structure D3DADAPTER_IDENTIFIER9 Driver.b[512] Description.b[512] DeviceName.b[32] DriverVersion.Large_Integer DriverVersionLowPart.l DriverVersionHighPart.l VendorId.l DeviceId.l SubSysId.l Revision.l DeviceIdentifier.GUID WHQLLevel.l EndStructure Procedure.s GetState(state) If state=0 ProcedureReturn "OFF" ElseIf state=1 ProcedureReturn "ON" ElseIf state=-1 ProcedureReturn "" EndIf EndProcedure Procedure.s GetCrosshairColorText(crosshair) If crosshair=0 ProcedureReturn "OFF" ElseIf crosshair=1 ProcedureReturn "Green" ElseIf crosshair=2 ProcedureReturn "Red" ElseIf crosshair=3 ProcedureReturn "Blue" ElseIf crosshair=4 ProcedureReturn "Yellow" EndIf EndProcedure Procedure GetCrosshairColor(crosshair) If crosshair=1 ProcedureReturn D3DCOLOR_ARGB(0, 255, 0) ElseIf crosshair=2 ProcedureReturn D3DCOLOR_ARGB(255, 0, 0) ElseIf crosshair=3 ProcedureReturn D3DCOLOR_ARGB(0, 0, 255) ElseIf crosshair=4 ProcedureReturn D3DCOLOR_ARGB(255, 255, 0) EndIf EndProcedure ; Procedure LoadD3DFont() ; If OpenLibrary(0, "d3dx9_43.dll") ; Global D3DXCreateFont=GetFunction(0, "D3DXCreateFontA") ; If D3DXCreateFont=0 ; MessageRequester("Error", "D3DXCreateFont not found in d3dx9.dll!", #MB_ICONERROR) ; EndIf ; Else ; MessageRequester("Error", "d3dx9_43.dll not found!", #MB_ICONERROR) ; EndIf ; EndProcedure Procedure DrawMenuTextA(font.ID3DXFont, TextLeft.s, TextRight.s, Color, x, y, Width, Height) Protected fontRect.RECT If font SetRect_(@fontRect, x+2, y+2, x+Width-2, y+Height-2) If TextRight="#DT_CENTER" font\DrawTextA(0, TextLeft, -1, @fontRect, #DT_NOCLIP|#DT_CENTER|#DT_VCENTER, Color) ProcedureReturn 0 EndIf font\DrawTextA(0, TextLeft, -1, @fontRect, #DT_NOCLIP|#DT_VCENTER, Color) font\DrawTextA(0, TextRight, -1, @fontRect, #DT_NOCLIP|#DT_RIGHT|#DT_VCENTER, Color) EndIf EndProcedure Procedure DeviceSettings(pDev.IDirect3DDevice9, state) Static texture.IDirect3DTexture9 Static oldPs Static oldFVF Static oldAlpha Static oldDestBlend Static oldZ Static oldCull If state=0 pDev\GetTexture(0, @texture) pDev\GetPixelShader(@oldPs) pDev\GetFVF(@oldFVF) pDev\GetRenderState(#D3DRS_ALPHABLENDENABLE, @oldAlpha) pDev\GetRenderState(#D3DRS_DESTBLEND, @oldDestBlend) pDev\GetRenderState(#D3DRS_ZENABLE, @oldZ) pDev\GetRenderState(#D3DRS_CULLMODE, @oldCull) pDev\SetTexture(0, #Null) pDev\SetPixelShader(0) pDev\SetFVF(#D3DFVF_XYZRHW | #D3DFVF_DIFFUSE) pDev\SetRenderState(#D3DRS_ALPHABLENDENABLE, #True) pDev\SetRenderState(#D3DRS_DESTBLEND, #D3DBLEND_INVSRCALPHA) pDev\SetRenderState(#D3DRS_ZENABLE, #False) pDev\SetRenderState(#D3DRS_CULLMODE, #D3DCULL_NONE) ElseIf state=1 pDev\SetTexture(0, texture) pDev\SetPixelShader(oldPs) pDev\SetFVF(oldFVF) pDev\SetRenderState(#D3DRS_ALPHABLENDENABLE, oldAlpha) pDev\SetRenderState(#D3DRS_DESTBLEND, oldDestBlend) pDev\SetRenderState(#D3DRS_ZENABLE, oldZ) pDev\SetRenderState(#D3DRS_CULLMODE, oldCull) EndIf EndProcedure Procedure DrawBox(pDev.IDirect3DDevice9, x, y, w, h, Color) Protected texture.IDirect3DTexture9 Protected oldPs Protected oldFVF Protected oldAlpha Protected oldDestBlend Protected oldZ Protected oldCull Structure Vertex x.f y.f z.f ht.f Color.i EndStructure Structure Sub a.Vertex b.Vertex c.Vertex d.Vertex EndStructure V.Sub With V\a \x=x \y=y+h \z=0 \ht=0 \Color=Color EndWith With V\b \x=x \y=y \z=0 \ht=0 \Color=Color EndWith With V\c \x=x+w \y=y+h \z=0 \ht=0 \Color=Color EndWith With V\d \x=x+w \y=y \z=0 \ht=0 \Color=Color EndWith pDev\DrawPrimitiveUP(#D3DPT_TRIANGLESTRIP, 2, V, SizeOf(Vertex)) EndProcedure Автор: Я) Необходимые библиотеки: DroopyLib