KritIk Дата: Суббота, 21.05.2011, 02:06 | Сообщение # 1
Сообщений: 134
Репутация: 12
[Table]Вот собственно мой Source код по которому я делал чит для Cod4 Первое что мы делаем, это открываем VCExpress У меня была 2008 версия.
Создаем проект. Выбираем библиотеки классов, вводим имя и жмем ОК. Жмем проект > добавить новый элемент, выбираем фаил с расширением .h Вводим название main и жмякаем на "ОК" Вставляем этот или любой другой код: Code
// Strange hack for COD4 // Written for http://evro-studio.3dn.ru/ #define teams 0x42E090 // Where the function starts int lpteamc = teams + 0xDC; // Team Check (disable to draw both) int lpdist = teams + 0xFE; // Distance check, if drawn through walls etc // Nop'd values kekeke unsigned char Two[2] = { 0x90, 0x90 }; unsigned char Six[6] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; // Original values (if you want to make an on/off toggle etc unsigned char NameTags[6] = { 0x0F, 0x85, 0xCE, 0x00, 0x00, 0x00 }; unsigned char Distance[2] = { 0x74, 0x25 }; // memory init func proto void __stdcall Modification(unsigned int); //proto // This is the ollydbg info: (this is 1.0 INFO) /* 0042E19C |. 0F85 CE000000 |JNZ iw3mp.0042E270 0042DE94 |. 0F85 09020000 JNZ iw3mp.0042E0A3 0042E19C 0F84 CE000000 JE iw3mp.0042E270 0042DE94 0F84 09020000 JE iw3mp.0042E0A3 */
Далее создаем еще один фаил: Жмем проект > добавить новый элемент, выбираем фаил с расширением .cpp и также называем main Вставляем в него следующий код: Code
// Strange hack for COD4 // Written for http://evrostudio.3dn.ru/ // Written for COD4 1.2 #include <windows.h> #include "main.h" bool Nametags=true; // used to see if nametags is on or not. int __stdcall DllMain(void* Module, unsigned long Reason, void* Reserved) { if(Reason == 1) // if injected do code below.. { Modification(1); // turn on memory modifications return 1; } return 1; } void __stdcall Modification(unsigned int arg) { if(arg == 1) { DWORD Protection; // nametags VirtualProtect((void*)lpteamc, 6, PAGE_READWRITE, &Protection); memcpy((void*)lpteamc, (const void*)Six, 6); // nop it VirtualProtect((void*)lpteamc, 6, Protection, 0); //distance (visibility) VirtualProtect((void*)lpdist, 2, PAGE_READWRITE, &Protection); memcpy((void*)lpdist, (const void*)Two, 2); // nop it VirtualProtect((void*)lpdist, 2, Protection, 0); } }[
Далее жмем построение > построить решение В низу можем наблюдать как готовится вас чит, если все сделано верно увидите такое: Code
Компиляция... Stdafx.cpp Компиляция... AssemblyInfo.cpp hack.cpp Создание кода... Компиляция ресурсов... Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1 Copyright (C) Microsoft Corporation. All rights reserved. Компоновка... Внедрение манифеста... Журнал построения был сохранен в "file://c:\Users\¦BANEK¦\Desktop\hack\hack\Debug\BuildLog.htm" hack - ошибок 0, предупреждений 0 ========== Построение: успешно: 1, с ошибками: 0, без изменений: 0, пропущено: 0 ==========
Все, вы создали свой чит! Далее идем в >название вашего чита< >>> Debug >>> ваш чит.dll Берем его и пихаем на рабочий стол, запускаем любой инжектор, можно .ехе фаил от другого чита использовать, я взял sinJect. Важно, .ехе фаил и dll фаил должны иметь одинаковое название!!! А сейчас я приведу примеры кода: WallHack
Code
if (StreamNumber==0) { m_Stride = Stride; } return m_pD3Ddev->SetStreamSource(StreamNumber, pStreamData,OffsetInBytes, Stride); } 9) поиск drawindexprimitive и помещенный if(m_Stride == #) //#=u need to find the stride number { DWORD dwOldZEnable = D3DZB_TRUE; m_pD3Ddev->GetRenderState(D3DRS_ZENABLE, &dwOldZEnable); m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE); m_pD3Ddev->DrawIndexedPrimitive(PrimitiveType, minIndex, NumVertices, startIndex, primCount); m_pD3Ddev->SetRenderState(D3DRS_ZENABLE, dwOldZEnable); return m_pD3Ddev->DrawIndexedPrimitive(PrimitiveType, minIndex, NumVertices, startIndex, primCount);
WallHack для 1.7
Code
void __cdecl CG_R_PlayerWallhack() { HANDLE CurrentP = GetCurrentProcess(); DWORD CG_PLAYER = 0x00445480;//Addresse Inside 0x445370 BYTE PATCH[2] = {0x6A, 0x12}; WriteProcessMemory(CurrentP , (PBYTE)CG_PLAYER, &PATCH, 2, 0); } void __cdecl CG_R_GenerelWallhack() { HANDLE CurrentP = GetCurrentProcess(); DWORD CG_GENEREL = 0x00432874;//Addresse Inside 0x432820 BYTE PATCH[2] = {0x6A, 0x12}; WriteProcessMemory(CurrentP , (PBYTE)CG_GENEREL, &PATCH, 2, 0); } void __cdecl CG_R_ItemWallhack() { HANDLE CurrentP = GetCurrentProcess(); DWORD CG_ITEM = 0x00432960;//Addresse Inside 0x432890 BYTE PATCH[2] = {0x6A, 0x12}; WriteProcessMemory(CurrentP , (PBYTE)CG_ITEM, &PATCH, 2, 0); } void __cdecl CG_R_Plane_HelicopterWallhack() { HANDLE CurrentP = GetCurrentProcess(); DWORD CG_PLANEHELICOPTER = 0x0044F8B7;//Addresse Inside 0x44F7D0(Helly) & 0x4292F0(Plane) BYTE PATCH[2] = {0x6A, 0x12}; WriteProcessMemory(CurrentP , (PBYTE)CG_PLANEHELICOPTER, &PATCH, 2, 0); } void __cdecl CG_R_Cars() { HANDLE CurrentP = GetCurrentProcess(); DWORD CG_CARS = 0x00433764;//Addresse Inside 0x433700 BYTE PATCH[2] = {0x6A, 0x12}; WriteProcessMemory(CurrentP , (PBYTE)CG_CARS, &PATCH, 2, 0); } void DoIt(){ CG_R_PlayerWallhack( ); CG_R_GenerelWallhack( ); CG_R_ItemWallhack( ); CG_R_Plane_HelicopterWallhack( ); CG_R_Cars( ); }
BOXesp
Code
//reason i used abc.. instead of the numbers //is because i drew the box out on paper first //and i labeled the verts with letters. #define a 1 #define b 2 #define c 3 #define d 4 #define e 5 #define f 6 #define g 7 #define h 8 struct BoxVerts{ float x,y; }; BoxVerts Vert[256]; float hRad = 300;//height radius float wRad = 300;//width radius //remember RADIUS NOT DIAMETER //ex. box would be 600x600x600 DWORD Color1 = D3DCOLOR_ARGB(200,255,0,0); DWORD Color2 = D3DCOLOR_ARGB(140,0,0,0); Main Code: World2Screen( X-wRad, Y-hRad, Z+wRad, Vert[a].x,Vert[a].y); World2Screen( X+wRad, Y-hRad, Z+wRad, Vert[b].x,Vert[b].y); World2Screen( X-wRad, Y+hRad, Z+wRad, Vert[c].x,Vert[c].y); World2Screen( X+wRad, Y+hRad, Z+wRad, Vert[d].x,Vert[d].y); World2Screen( X-wRad, Y-hRad, Z-wRad, Vert[e].x,Vert[e].y); World2Screen( X+wRad, Y-hRad, Z-wRad, Vert[f].x,Vert[f].y); World2Screen( X-wRad, Y+hRad, Z-wRad, Vert[g].x,Vert[g].y); World2Screen( X+wRad, Y+hRad, Z-wRad, Vert[h].x,Vert[h].y); //~~~Drawing Boxes~~~// //______Vert 1 X | Vert 1 Y | Vert 2 X | Vert 2 Y | Vert 3 X | Vert 3 Y | Vert 4 X | Vert 4 Y_____// Quad2( Device, Color2, Primtexture, Vert[a].x, Vert[a].y, Vert[b].x, Vert[b].y, Vert[c].x, Vert[c].y, Vert[d].x, Vert[d].y);//Front Quad2( Device, Color2, Primtexture, Vert[e].x, Vert[e].y, Vert[f].x, Vert[f].y, Vert[g].x, Vert[g].y, Vert[h].x, Vert[h].y);//Back Quad2( Device, Color2, Primtexture, Vert[e].x, Vert[e].y, Vert[f].x, Vert[f].y, Vert[a].x, Vert[a].y, Vert[b].x, Vert[b].y);//Top Quad2( Device, Color2, Primtexture, Vert[g].x, Vert[g].y, Vert[h].x, Vert[h].y, Vert[c].x, Vert[c].y, Vert[d].x, Vert[d].y);//Bottom Quad2( Device, Color2, Primtexture, Vert[e].x, Vert[e].y, Vert[a].x, Vert[a].y, Vert[g].x, Vert[g].y, Vert[c].x, Vert[c].y);//Side 1 Quad2( Device, Color2, Primtexture, Vert[b].x, Vert[b].y, Vert[f].x, Vert[f].y, Vert[d].x, Vert[d].y, Vert[h].x, Vert[h].y);//Side 2 //~~~Outline~~~// //______Vert 1 X | Vert 1 Y | Vert 2 X | Vert 2 Y_____// DrawLine( Color1, Vert[a].x, Vert[a].y, Vert[b].x, Vert[b].y );//--| DrawLine( Color1, Vert[a].x, Vert[a].y, Vert[c].x, Vert[c].y );// | DrawLine( Color1, Vert[b].x, Vert[b].y, Vert[d].x, Vert[d].y );// |-Front Box DrawLine( Color1, Vert[c].x, Vert[c].y, Vert[d].x, Vert[d].y );//--| DrawLine( Color1, Vert[e].x, Vert[e].y, Vert[f].x, Vert[f].y );//--| DrawLine( Color1, Vert[e].x, Vert[e].y, Vert[g].x, Vert[g].y );// | DrawLine( Color1, Vert[f].x, Vert[f].y, Vert[h].x, Vert[h].y );// |-Back Box DrawLine( Color1, Vert[g].x, Vert[g].y, Vert[h].x, Vert[h].y );//--| DrawLine( Color1, Vert[b].x, Vert[b].y, Vert[f].x, Vert[f].y );//--| DrawLine( Color1, Vert[a].x, Vert[a].y, Vert[e].x, Vert[e].y );// | DrawLine( Color1, Vert[d].x, Vert[d].y, Vert[h].x, Vert[h].y );// |-Connectors DrawLine( Color1, Vert[c].x, Vert[c].y, Vert[g].x, Vert[g].y );//--| Supporting Functions: void Quad2( LPDIRECT3DDEVICE9 c_pDev, DWORD COLOR, IDirect3DTexture9 *ppD3Dtex,float Point1x,float Point1y,float Point2x,float Point2y,float Point3x,float Point3y,float Point4x,float Point4y) { struct sVerts { float x, y, z, rhw; DWORD colour; }; sVerts cQuad[] = { {Point4x, Point4y, 1, 1, COLOR}, {Point1x, Point1y, 1, 1, COLOR}, {Point2x, Point2y, 1, 1, COLOR}, {Point4x, Point4y, 1, 1, COLOR}, {Point3x, Point3y, 1, 1, COLOR}, {Point1x, Point1y, 1, 1, COLOR} }; pVerts=sizeof(cQuad)/sizeof(sVerts); pTri=pVerts/3; Device->SetTexture(0,ppD3Dtex); Device->DrawPrimitiveUP(D3DPT_TRIANGLELIST,pTri,cQuad,sizeof(sVerts)); } void DrawLine(DWORD color, float x, float y, float x2, float y2) { D3DXVECTOR2 cLine1[2]; D3DXVECTOR2 cLine2[2]; D3DXVECTOR2 cLine3[2]; D3DXVECTOR2 cLine4[2]; cLine1[0].x = x; cLine1[0].y = y; cLine1[1].x = x2; cLine1[1].y = y2; pLine->SetWidth(1); pLine->SetAntialias(false); pLine->SetGLLines(false); pLine->Begin(); pLine->Draw(vLine1, 2, color); pLine->End(); }
Меню для чита
Code
//starts here Code: void DrawRect(IDirect3DDevice9* Unidade, int baseX, int baseY, int baseW, int baseH, D3DCOLOR Cor) { D3DRECT BarRect = { baseX, baseY, baseX + baseW, baseY + baseH }; Unidade->Clear(1, &BarRect, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, Cor, 0, 0); } //front Code: void SteamBase(IDirect3DDevice9* Unidade, int baseX, int baseY, int baseW, int baseH, D3DCOLOR Linha2, D3DCOLOR Linha1, D3DCOLOR Linha3) { DrawRect(Unidade, baseX+1, baseY+1, baseW+1, baseH+1, Linha1); DrawRect(Unidade, baseX, baseY-1, baseW+1 , baseH, Linha2); DrawRect(Unidade, baseX+1, baseY, baseW , baseH , Linha3); } //back Code: void SteamFundo(IDirect3DDevice9* Unidade, char *Texto,int baseX, int baseY, int baseW, int baseH, D3DCOLOR Linha2, D3DCOLOR Linha1, D3DCOLOR Linha3) { DrawRect(Unidade, baseX+1, baseY+1, baseW+1, baseH+1, Linha1); DrawRect(Unidade, baseX, baseY-1, baseW+1 , baseH, Linha2); DrawRect(Unidade, baseX+1, baseY, baseW , baseH , Linha3); //PrintText(m_font1,baseX + baseW - 170, baseY+1, 210, 210,210,210, Texto); } //button Code: void SteamBotao(IDirect3DDevice9* Unidade, char *Texto,int baseX, int baseY, int baseW, int baseH, D3DCOLOR Linha2, D3DCOLOR Linha1, D3DCOLOR Linha3) { DrawRect(Unidade, baseX+1, baseY+1, baseW+1, baseH+1, Linha1); DrawRect(Unidade, baseX, baseY-1, baseW+1 , baseH, Linha2); DrawRect(Unidade, baseX+1, baseY, baseW , baseH , Linha3); //PrintText(m_font1,baseX + baseW - 65, baseY+4, 210, 210,210,210, Texto); } //checkbox Code: void SteamCheckBox(IDirect3DDevice9* Unidade, char *Texto,char *Texto1,int baseX, int baseY, int baseW, int baseH, D3DCOLOR Linha2, D3DCOLOR Linha1, D3DCOLOR Linha3) { DrawRect(Unidade, baseX+1, baseY+1, baseW+1, baseH+1, Linha1); DrawRect(Unidade, baseX, baseY-1, baseW+1 , baseH, Linha2); DrawRect(Unidade, baseX+1, baseY, baseW , baseH , Linha3); //PrintText(m_font1,baseX + baseW - 10, baseY, 255, 255,255,255, Texto); //PrintText(m_font1,baseX + baseW + 10, baseY+1, 255, 255,255,255, Texto1); } Вы должны добавить координаты к Вам, меню, im используют struct для меню struct menu{ int BaseX; int BaseY; int BaseW; int BaseH; } Janela; создать меню SteamFundo(m_pD3Ddev,"Menu -> COD4 ",Janela.BaseX,Janela.BaseY,180,310,D3DCOLOR_ARGB (20,132 ,132 ,132),D3DCOLOR_ARGB (20,46,46,46),D3DCOLOR_ARGB (20,110,110,110)); SteamCheckBox(m_pD3Ddev,"X","",Janela.BaseX +160,Janela.BaseY+5,15,15,D3DCOLOR_ARGB (20,132 ,132 ,132),D3DCOLOR_ARGB (20,46,46,46),D3DCOLOR_ARGB (20,110,110,110)); SteamBase(m_pD3Ddev,Janela.BaseX+5,Janela.BaseY+30,170,270,D3DCOLOR_ARGB (20,132 ,132 ,132),D3DCOLOR_ARGB (20,46,46,46),D3DCOLOR_ARGB (20,120,120,120)); SteamCheckBox(m_pD3Ddev,"","Color Tool",Janela.BaseX +90,Janela.BaseY+40,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","Chams",Janela.BaseX +10,Janela.BaseY+40,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","Esp Names",Janela.BaseX +10,Janela.BaseY+60,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","Esp Box",Janela.BaseX +10,Janela.BaseY+80,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","Esp Distance",Janela.BaseX +10,Janela.BaseY+100,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","No Smoke ",Janela.BaseX +10,Janela.BaseY+120,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","No Sky",Janela.BaseX +10,Janela.BaseY+140,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","No Spread ",Janela.BaseX +10,Janela.BaseY+160,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","No Recoil",Janela.BaseX +10,Janela.BaseY+180,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","No Snow",Janela.BaseX +10,Janela.BaseY+200,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","Crosshair",Janela.BaseX +10,Janela.BaseY+220,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","Lazer Light",Janela.BaseX +10,Janela.BaseY+240,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","ThirdPerson",Janela.BaseX +10,Janela.BaseY+260,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81)); SteamCheckBox(m_pD3Ddev,"","Clock,FPS..",Janela.BaseX +10,Janela.BaseY+280,15,15,D3DCOLOR_ARGB (20,46 ,46 ,46),D3DCOLOR_ARGB (20,112,112,112),D3DCOLOR_ARGB (20,81,81,81));
Остальное напишу посже . Статья написана мною , копирование с сайта строго запрещено и наказуемо . Статься предназначаеться для игры Call of Duty 4. [/Table]