Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "Function.h"
- #include "Colors.h"
- #include "CMenu.h"
- #include "cSound.h"
- #include "Sounds.h"
- #include "cMenu.h"
- #include "cStruct.h"
- #include "Whatafak.h"
- HRESULT APIENTRY SetTexture_hook(LPDIRECT3DDEVICE9 pDevice, DWORD Sampler, IDirect3DBaseTexture9 *pTexture)
- {
- if (InitOnce)
- {
- InitOnce = false;
- pDevice->GetViewport(&Viewport);
- ScreenCX = (float)Viewport.Width / 2.0f;
- ScreenCY = (float)Viewport.Height / 2.0f;
- LoadCfg();
- }
- if (SUCCEEDED(pDevice->GetVertexShader(&vShader)))
- if (vShader != NULL)
- if (SUCCEEDED(vShader->GetFunction(NULL, &vSize)))
- if (vShader != NULL) { vShader->Release(); vShader = NULL; }
- if (opt.d3d.wallhacks)
- {
- pDevice->SetRenderState(D3DRS_DEPTHBIAS, 0);
- if ((vSize == 2356 || vSize == 900 || vSize == 2008 || vSize == 640) || (Stride == 36 && vSize == 1436) || (Stride == 48 && vSize == 1436))
- {
- float bias = 1000.0f;
- float bias_float = static_cast<float>(-bias);
- bias_float /= 10000.0f;
- pDevice->SetRenderState(D3DRS_DEPTHBIAS, *(DWORD*)&bias_float);
- }
- if (Stride == 48 || vSize == 2008 || vSize == 2356)
- {
- D3DXMATRIX matLegs;
- D3DXMatrixScaling(&matLegs, 0.0f, 0.0f, 0.0f);
- pDevice->SetVertexShaderConstantF(20, matLegs, 1);
- D3DXMATRIX matChest;
- D3DXMatrixScaling(&matChest, 0.0f, 0.0f, 0.0f);
- pDevice->SetVertexShaderConstantF(25, matChest, 1);
- }
- if (Stride == 48 || vSize == 2300 || vSize == 900 ||
- vSize == 1952 || vSize == 640)
- AddWeapons(pDevice);
- }
- if (opt.aimbooott.aimbot == 1 > 0)
- {
- if ((Stride == 48 && vSize > 1328) || (vSize == 2356 || vSize == 2008 || vSize == 1552))
- AddWeapons(pDevice);
- }
- if (opt.d3d.frame)
- {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_WIREFRAME);
- }
- else {
- pDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID);
- }
- if (opt.d3d.asus)
- {
- pDevice->SetRenderState(D3DRS_SRCBLEND, 3);
- pDevice->SetRenderState(D3DRS_DESTBLEND, 4);
- pDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, true);
- }
- DWORD MODULEROS;
- MODULEROS = (DWORD)GetModuleHandleA("ros.exe");
- DWORD InGameAdrress = (MODULEROS + 0x1E21F28);
- DWORD* Verify = (DWORD*)(InGameAdrress);
- if (*Verify == 1)
- {
- DWORD adrMin1 = 0;
- DWORD ROS = (DWORD)GetModuleHandleA("ros.exe");
- if (opt.d3d.Chams)
- {
- if (GetAsyncKeyState(VK_NUMPAD1) & 1)
- {
- *(byte*)(ROS + Chamsxx) += 10;
- }
- if (GetAsyncKeyState(VK_NUMPAD2) & 1)
- {
- *(byte*)(ROS + Chamsxx) -= 10;
- }
- }
- if (opt.player.superman)
- {
- if (ROS > 0)
- {
- adrMin1 = ROS + (DWORD)supermanhero;
- Write1((void *)(adrMin1), (void*)(PBYTE)"\x00\x00\xA0\x41", 4);
- }
- }
- if (!opt.player.superman)
- {
- if (ROS > 0)
- {
- adrMin1 = ROS + (DWORD)supermanhero;
- Write1((void *)(adrMin1), (void*)(PBYTE)"\xCD\xCC\x4C\x3D", 4);
- }
- }
- if (opt.player.nofall)
- {
- if (ROS > 0)
- {
- adrMin1 = ROS + (DWORD)nofalldamage;
- Write1((void *)(adrMin1), (void*)(PBYTE)"\xF6\xC2\x06", 3);
- }
- }
- if (!opt.player.nofall)
- {
- if (ROS > 0)
- {
- adrMin1 = ROS + (DWORD)nofalldamage;
- Write1((void *)(adrMin1), (void*)(PBYTE)"\xF6\xC2\x02", 3);
- }
- }
- if (opt.player.prone)
- {
- if (ROS > 0)
- {
- adrMin1 = ROS + (DWORD)Prone;
- Write1((void *)(adrMin1), (void*)(PBYTE)"\x18\xFE\x8A\x87", 4);
- }
- }
- if (!opt.player.prone)
- {
- if (ROS > 0)
- {
- adrMin1 = ROS + (DWORD)Prone;
- Write1((void *)(adrMin1), (void*)(PBYTE)"\xF3\x0F\x11\x87", 4);
- }
- }
- if (opt.player.textture)
- {
- if (ROS > 0)
- {
- adrMin1 = ROS + (DWORD)flatflatbelat;
- Write1((void *)(adrMin1), (void*)(PBYTE)"\x90\x90\x90\x90\x90\x90\x90\x8B\xCE", 9);
- }
- }
- if (!opt.player.textture)
- {
- if (ROS > 0)
- {
- adrMin1 = ROS + (DWORD)flatflatbelat;
- Write1((void *)(adrMin1), (void*)(PBYTE)"\x0F\x11\x85\x58\xFE\xFF\xFF\x8B\xCE", 9);
- }
- }
- /*if (opt.player.superjump > 0)
- memcpy((void*)(ROS + 0x547110), "\xF6\xC2\x06", 3);
- if (opt.player.superjump > 0)
- if (GetAsyncKeyState(VK_SPACE) & 1)
- {
- *(float*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(ROS + 0x219B39C) + 0x0) + 0x40) + 0x4) + 0x10) + 0x9c) = 105.0f;
- }
- if (opt.player.paracute)
- {
- if (GetAsyncKeyState('F') & 1)
- {
- *(float*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(*(DWORD*)(ROS + physics) + 0x0) + 0x40) + 0x4) + 0x10) + 0xAC) = -1000.0f;
- }
- }*/
- if (opt.player.grass)
- {
- *(PFLOAT)(ROS + NoGrass) = -243773.5938;
- }
- if (opt.player.wlkwtw)
- {
- *(PFLOAT)(ROS + addyWalkInsdWtr) = 2.031882773E-43;
- }
- if (opt.weapon.zoom == 1)
- {
- *(PFLOAT)(ROS + zoomhack) = 0.00545329228;
- }
- if (opt.weapon.zoom == 2)
- {
- *(PFLOAT)(ROS + zoomhack) = 0.004f;
- }
- if (opt.player.wlkthru)
- {
- *(PFLOAT)(ROS + addyGhostMode) = -0.89999998f;
- }
- if (opt.player.nofog)
- {
- *(PFLOAT)(ROS + fog) = -1.775704964E-30;
- }
- if (opt.player.speed == 1)
- {
- *(PFLOAT)(ROS + addySpeed) = 90.0f;
- }
- if (opt.player.speed == 2)
- {
- *(PFLOAT)(ROS + addySpeed) = 100.0f;
- }
- if (opt.player.speed == 3)
- {
- *(PFLOAT)(ROS + addySpeed) = 110.0f;
- }
- if (opt.player.speed == 4)
- {
- *(PFLOAT)(ROS + addySpeed) = 120.0f;
- }
- if (opt.player.speed == 5)
- {
- *(PFLOAT)(ROS + addySpeed) = 130.0f;
- }
- if (opt.player.speed == 6)
- {
- *(PFLOAT)(ROS + addySpeed) = 140.0f;
- }
- if (opt.player.speed == 7)
- {
- *(PFLOAT)(ROS + addySpeed) = 150.0f;
- }
- if (opt.player.spectator)
- {
- *(BYTE*)(ROS + Spectate) = 2;
- }
- //default values
- //grass default
- //foliage default
- if (!opt.player.spectator)
- {
- *(BYTE*)(ROS + Spectate) = 1;
- }
- if (!opt.player.grass)
- {
- *(PFLOAT)(ROS + NoGrass) = -3.407189846;
- }
- // remove water default
- if (!opt.player.wlkwtw)
- {
- *(PFLOAT)(ROS + addyWalkInsdWtr) = 2.017869789E-43;
- }
- // speed hack default
- if (!opt.player.speed)
- {
- *(PFLOAT)(ROS + addySpeed) = 60.0f;
- }
- //no fog default
- if (!opt.player.nofog)
- {
- *(PFLOAT)(ROS + fog) = -2.709510748E-35;
- }
- //zoom hack default
- if (!opt.weapon.zoom)
- {
- *(PFLOAT)(ROS + zoomhack) = 0.0174532924;
- }
- //wtw default
- if (!opt.player.wlkthru)
- {
- *(PFLOAT)(ROS + addyGhostMode) = -0.500f;
- }
- }
- return SetTexture_orig(pDevice, Sampler, pTexture);
- }
- const char* getitemname(int a) {
- switch (a)
- {
- case 1: return "Lv 1 helmet";
- case 2: return "Lv 2 helmet";
- case 3: return "Lv 3 helmet";
- case 5: return "Lv 1 Armor";
- case 6: return "Lv 2 Armor";
- case 7: return "Lv 3 Armor";
- case 8: return "Lv 1 Backpack";
- case 9: return "Lv 2 Backpack";
- case 10: return "Lv 3 Backpack";
- case 19: return "Ghillie Suit";
- case 50: return "Fuel Barrel";
- case 101: return "Bandage";
- case 102: return "Med Kit";
- case 103: return "First Aid Kit";
- case 105: return "Sports Drink";
- case 106: return "Cardio Tonic";
- case 1001: return "M4A1 Rifle";
- case 1002: return "AKM Rifle";
- case 1003: return "M870 SG";
- case 1004: return "M1887 SG";
- case 1005: return "AA12 SG";
- case 1006: return "AWM SR";
- case 1007: return "Barett SR";
- case 1008: return "M249 MG";
- case 1009: return "M14EBR Rifle";
- case 1010: return "AR15 Rifle";
- case 1011: return "MP7 SMG";
- case 1012: return "PP19 SMG";
- case 1013: return "Thompson SMG";
- case 1014: return "G18C Pistol";
- case 1015: return "Desert Eagle";
- case 1017: return "Vector";
- case 1018: return "P90 SMG";
- case 1019: return "SAIGA-12 Shotgun";
- case 1020: return "WRO Hunting Rifle";
- case 1021: return "SVD SR";
- case 1022: return "M110 Sniper Rifle";
- case 1023: return "ACR Rifle";
- case 1024: return "AN94 Rifle";
- case 1025: return "MP5 SMG";
- case 1026: return "AUG Rifle";
- case 1027: return "QBU Sniper Rifle";
- case 1031: return "RPG Rocket Tube";
- case 1101: return "SG Ammo";
- case 1102: return "Rifle Ammo";
- case 1103: return "SR Ammo";
- case 1104: return "SMG Ammo";
- case 1105: return "Pistol Ammo";
- case 1106: return "RPG Ammo";
- case 1201: return "Rifle Silencer";
- case 1202: return "SR Silence";
- case 1204: return "SMG Silencer";
- case 1211: return "Rifle Compensator";
- case 1212: return "SR Compensator";
- case 1213: return "SMG Compensator";
- case 1221: return "Rifle Flash Hider";
- case 1222: return "SR Flash Hider";
- case 1223: return "SMG Smoke Hider";
- case 1231: return "SG Choke";
- case 1241: return "Triangle Grip";
- case 1242: return "Vertical Foregrip";
- case 1251: return "Rifle QD-Mag";
- case 1252: return "Rifle EX-Mag";
- case 1253: return "Rifle EX-QD-Mag";
- case 1261: return "SR Cheek Pad";
- case 1262: return "Tactical Stock";
- case 1263: return "SG Bullet Loop";
- case 1264: return "SR EX-Mag";
- case 1265: return "SR QD-Mag";
- case 1266: return "SR EX-QD-Mag";
- case 1271: return "Red Dot Sight";
- case 1272: return "Holo-Sight";
- case 1273: return "2x Scope";
- case 1274: return "4x Scope";
- case 1275: return "8x Scope";
- case 1276: return "SMG QD-Mag";
- case 1277: return "SMG EX-Mag";
- case 1278: return "SMG QD-EX-Mag";
- case 1279: return "Collapsible Stock";
- case 1303: return "Crowbar";
- case 1306: return "Frying Pan";
- case 1307: return "Rubber Chicken";
- case 1401: return "Grenade";
- case 1402: return "Stun Grenade";
- case 1403: return "Smoke Grenade";
- case 1404: return "Molotov Cocktail";
- case 1405: return "Chicken Grenade";
- case 1406: return "Flash Grenade";
- default:return "no name";
- break;
- }
- }
- cMenu Menu;
- copt opt;
- float ScreenCenterX = 0.0f;
- float ScreenCenterY = 0.0f;
- D3DXVECTOR3 GetMidPoint(Vector3 V1, Vector3 V2)
- {
- return D3DXVECTOR3((V1.x + V2.x) / 2, (V1.y + V2.y) / 2, (V1.z + V2.z) / 2);
- }
- DWORD WINAPI esper(IDirect3DDevice9* pDevice);
- DWORD WINAPI esper(IDirect3DDevice9* pDevice)
- {
- auto ros_base = reinterpret_cast<uintptr_t>(GetModuleHandle(NULL));
- auto Ros_Client = *(ClientApper**)(ros_base + OFFSET_CLIENT);
- auto mListItem = Ros_Client->m_pFirst->m_pStart;
- bool first = true;
- for (;;)
- {
- if (!first) mListItem = mListItem->m_pNext;
- first = false;
- if (mListItem == Ros_Client->m_pFirst->m_pEnd)
- break;
- auto entity_addy = (DWORD)(mListItem->m_pEntity ^ mListItem->m_EntityKey->Val);
- auto curEntity = (CEntity*)entity_addy;
- DWORD MyEntity = *(DWORD*)(ros_base + OFFSET_LOCAL);
- D3DXVECTOR3 MyPosition;
- if ((DWORD)curEntity == MyEntity) {
- MyPosition = GetDecryptedPos(curEntity);
- }
- pDevice->GetViewport(&Viewport);
- int width = (int)Viewport.Width;
- int height = (int)Viewport.Height;
- int m_pWorld = Memory::ReadMemory<int>(BAddress + OFFSET_PYGAME + 0x410);
- int m_pSceneContext = Memory::ReadMemory<int>(m_pWorld + 0x8);
- int cameraBase = Memory::ReadMemory<int>(m_pSceneContext + 0x4);
- if (!Memory::ReadMemoryC<D3DXMATRIX>(cameraBase + 0xC4) && ingame == true)
- {
- ingame = false;
- }
- string pMeta_str(curEntity->m_pMeta->pName);
- bool isPlayer = (std::string::npos != pMeta_str.find("Avatar"));
- bool isBot = (std::string::npos != pMeta_str.find("Robot"));
- bool isItem = (std::string::npos != pMeta_str.find("DtsProp"));
- bool isSupplyBox = (std::string::npos != pMeta_str.find("DtsPlayerHeritage"));
- bool isDead = (std::string::npos != pMeta_str.find("Heritage"));
- bool isAnoto = (std::string::npos != pMeta_str.find("No Name"));
- bool isPlane = (std::string::npos != pMeta_str.find("Plane"));
- bool isWeapon = (std::string::npos != pMeta_str.find("ClientWeaponEntity"));
- bool isCar = (std::string::npos != pMeta_str.find("LandCar"));
- bool isBicycle = (std::string::npos != pMeta_str.find("LandBike"));
- bool isExpress = (std::string::npos != pMeta_str.find("LandExpress"));
- bool isMotor = (std::string::npos != pMeta_str.find("LandMotor"));
- bool isGlider = (std::string::npos != pMeta_str.find("LandGlider"));
- bool isBoat = (std::string::npos != pMeta_str.find("LandBoat"));
- bool isBattleGround = (std::string::npos != pMeta_str.find("BattleGroundSpace"));
- D3DXMATRIX worldMatrix = Memory::ReadMemory<D3DXMATRIX>(cameraBase + 0xC4);
- D3DXVECTOR3 EntityPosition = GetDecryptedPos(curEntity);
- D3DXVECTOR3 vPlayerFoot(EntityPosition.x, EntityPosition.y, EntityPosition.z), vScreenFoot;
- D3DXVECTOR3 vPlayerHead(EntityPosition.x, EntityPosition.y, EntityPosition.z), vScreenHead;
- CPlayerBase* pBase = GetLocalPlayer();
- D3DXVECTOR3 mypos = pBase->GetDecryptedLocalPos(pBase);
- D3DXVECTOR3 pos = GetDecryptedEnemyPos(curEntity);
- D3DXVECTOR3 pRoot;
- D3DXVECTOR3 eHead;
- D3DXVECTOR3 pHead;
- int pDistance = Distance(mypos, pos, 10);
- int propID = curEntity->m_Table->pTable->Prop->mVal;
- std::string propItem = getitemname(propID);
- char* LootItems = const_cast<char*>(propItem.c_str());
- int pHealth = curEntity->m_Table->pTable->m_HpRow->HP;
- int ScreenCenterX = Viewport.Width / 2;
- int ScreenCenterY = Viewport.Height;
- float entityHeight = 21.5f;
- eHead.x = pos.x;
- eHead.y = pos.y + entityHeight;
- eHead.z = pos.z;
- ClientApp::WorldToScreen(pos, pRoot, worldMatrix, width, height);
- ClientApp::WorldToScreen(eHead, pHead, worldMatrix, width, height);
- struct Rectangle
- {
- int width;
- int height;
- int X;
- int Y;
- };
- Rectangle rect;
- rect.width = (int)(700 / pDistance);
- if (rect.width > 100)
- {
- rect.width = 100;
- }
- rect.height = (int)(pRoot.y - pHead.y);
- rect.X = (int)pRoot.x - rect.width / 2;
- rect.Y = (int)pRoot.y - rect.height;
- if (pDistance > 25)
- {
- rect.Y = (int)pRoot.y - rect.height + 15;
- }
- if (ClientApp::WorldToScreen(vPlayerFoot, vScreenFoot, worldMatrix, width, height) && ClientApp::WorldToScreen(vPlayerHead, vScreenHead, worldMatrix, width, height))
- {
- if (opt.espopt.vehicle)
- {
- if (isCar) {
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Car");
- char Distance[255];
- sprintf(Distance, "[ %dm ]", pDistance);
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
- }
- if (isBicycle) {
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Bicycle");
- char Distance[255];
- sprintf(Distance, "[ %dm ]", pDistance);
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
- }
- if (isExpress) {
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Cab Express");
- char Distance[255];
- sprintf(Distance, "[ %dm ]", pDistance);
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
- }
- if (isMotor) {
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Motorcycle");
- char Distance[255];
- sprintf(Distance, "[ %dm ]", pDistance);
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
- }
- if (isGlider) {
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Glider");
- char Distance[255];
- sprintf(Distance, "[ %dm ]", pDistance);
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
- }
- if (isPlane) {
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Plane");
- char Distance[255];
- sprintf(Distance, "[ %dm ]", pDistance);
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
- }
- if (isBoat) {
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "Motor Boat");
- char Distance[255];
- sprintf(Distance, "[ %dm ]", pDistance);
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
- }
- if (isBattleGround) {
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.YELLOW, DT_CENTER, "BattleGround");
- char Distance[255];
- sprintf(Distance, "[ %dm ]", pDistance);
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, PINK(255), DT_CENTER, Distance);
- }
- }
- if (opt.espopt.item)
- {
- if (isItem)
- {
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.WHITE, DT_CENTER, LootItems);
- }
- }
- if (opt.espopt.rare)
- {
- if (isItem)
- {
- if (strcmp(LootItems, "Lv 3 helmet") == 0 || strcmp(LootItems, "Lv 3 Armor") == 0 || strcmp(LootItems, "Lv 3 Backpack") == 0 || strcmp(LootItems, "Rifle Ammo") == 0 || strcmp(LootItems, "Med Kit") == 0 || strcmp(LootItems, "First Aid Kit") == 0 || strcmp(LootItems, "M4A1 Rifle") == 0 || strcmp(LootItems, "AKM Rifle") == 0 || strcmp(LootItems, "M14EBR Rifle") == 0 || strcmp(LootItems, "Rifle EX-QD-Mag") == 0 || strcmp(LootItems, "4x Scope") == 0 || strcmp(LootItems, "8x Scope") == 0 || strcmp(LootItems, "Rifle Silencer") == 0 || strcmp(LootItems, "SMG Silencer") == 0 || strcmp(LootItems, "SR Silence") == 0)
- {
- char Distance[100];
- sprintf(Distance, "[ %dm ]", pDistance);
- Menu.DrawLine(pDevice, ScreenCenterX, ScreenCenterY, vScreenFoot.x, vScreenFoot.y, Menu.BLUE);
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, Menu.BLUE, DT_CENTER, Distance);
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.BLUE, DT_CENTER, LootItems);
- }
- }
- }
- if (opt.espopt.supplybox)
- {
- if (isSupplyBox)
- {
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 8, Menu.PURPLE, DT_CENTER, "Loots");
- char Distance[100];
- sprintf(Distance, "[ %dm ]", pDistance);
- DrawESPText(vScreenFoot.x, vScreenFoot.y + 20, Menu.PURPLE, DT_CENTER, Distance);
- }
- }
- if (opt.espopt.health)
- {
- if (isPlayer && opt.espopt.health == 1)
- {
- Tools.Rainbowbar(pDevice, vScreenHead.x - 50, vScreenFoot.y + 25, curEntity->m_Table->pTable->m_HpRow->HP);
- }
- if (isBot && opt.espopt.health == 1)
- {
- HealthBar(vScreenHead.x, vScreenFoot.y, curEntity->m_Table->pTable->m_HpBotRow->HP, pDevice);
- }
- }
- if (opt.espopt.box2)
- {
- if ((isPlayer != 0))
- {
- Box2D(pHead, pRoot, RED(255), pDevice);
- }
- }
- if (opt.espopt.box3)
- {
- if ((isPlayer != 0))
- {
- if (opt.espopt.box3)
- {
- float dist2 = GetDistancez(mypos, pos, 10);
- Menu.Box3D(pDevice, pHead.x, pHead.y, vScreenHead.x, vScreenHead.y, dist2, Menu.RED);
- }
- }
- }
- if (opt.espopt.dist)
- {
- if ((isPlayer != 0))
- {
- char Distance[100];
- sprintf(Distance, "[ %dm ]", pDistance);
- DrawESPText(vScreenHead.x, vScreenHead.y + 34, Menu.RED, DT_CENTER, Distance);
- }
- if (isBot)
- {
- char Distance[100];
- sprintf(Distance, "[ %dm ]", pDistance);
- WriteText(pDevice, vScreenHead.x - 1, vScreenHead.y + 13, Menu.GREEN, Distance);
- }
- }
- if (opt.espopt.name)
- {
- if (isPlayer && pHealth != 0)
- {
- char buff[20];
- Menu.DrawLine(pDevice, ScreenCenterX, ScreenCenterY, vScreenFoot.x, vScreenFoot.y, Menu.ORANGE);
- sprintf_s(buff, "%s", curEntity->m_Table->pTable->m_NickRow->m_NickName);
- DrawESPText(vScreenHead.x, vScreenHead.y + 10, Menu.ORANGE, DT_CENTER, buff);
- }
- if (isBot)
- {
- Menu.DrawLine(pDevice, ScreenCenterX, ScreenCenterY, vScreenFoot.x, vScreenFoot.y, Menu.GREEN);
- WriteText(pDevice, vScreenHead.x + 15, vScreenHead.y + 3, Menu.GREEN, "BOT");
- }
- }
- }
- }
- }
- void PostReset(LPDIRECT3DDEVICE9 pDevice)
- {
- Menu.PostReset(pDevice);
- Menu.PreReset();
- return;
- }
- void cMenu::ShowMenu(LPDIRECT3DDEVICE9 pDevice)
- {
- int lm = GetAsyncKeyState(VK_LBUTTON) & 1;
- int rm = GetAsyncKeyState(VK_RBUTTON) & 1;
- int left = GetAsyncKeyState(VK_LEFT) & 1;
- int right = GetAsyncKeyState(VK_RIGHT) & 1;
- int up = GetAsyncKeyState(VK_UP) & 1;
- int down = GetAsyncKeyState(VK_DOWN) & 1;
- Init();
- PostReset(pDevice);
- if (GetAsyncKeyState(VK_INSERT) & 1)
- {
- SHOW = (!SHOW);
- SaveCfg();
- }
- if (SHOW) {
- GetCursorPos(&mpos);
- ScreenToClient(GetForegroundWindow(), &mpos);
- if (opt.options.move && GetAsyncKeyState(VK_LCONTROL))
- {
- X = (((X <= mpos.x + 4) && (X >= mpos.x)) || ((X >= mpos.x - 4) && (X <= mpos.x))) ? (X = mpos.x) : (X += ((mpos.x - X) / 4));
- Y = (((Y <= mpos.y + 4) && (Y >= mpos.y)) || ((Y >= mpos.y - 4) && (Y <= mpos.y))) ? (Y = mpos.y) : (Y += ((mpos.y - Y) / 4));
- }
- DrawBox(X, Y + 3, WIDTH, T_SPC, D3DCOLOR_ARGB(220, 50, 50, 50), 1, pDevice);
- DrawBorder(X, Y + 3, WIDTH, T_SPC, 1, D3DCOLOR_ARGB(220, 50, 50, 50), pDevice);
- DrawGameTextPixelFlag(MC_FCTR(X, MC_MAXX), Y + 5, D3DCOLOR_ARGB(255, 255, 255, 255), DT_CENTER | DT_SHADOW, "HAxCodER™");
- DrawBox(X, MC_MSY, WIDTH, (NO*I_SPC), D3DCOLOR_ARGB(220, 50, 50, 50), 1, pDevice);
- DrawBorder(X, MC_MSY, WIDTH, (NO*I_SPC), 1, D3DCOLOR_ARGB(220, 5, 5, 5), pDevice);
- NO = 0;
- acat((char *)"MAIN", (char *)"Show|Hide", &opt.d3d.main);
- aitem((char *)" Cross Hair", (char *)"[OFF]|[Rainbow]|[Crosshair]|[Circle]", &opt.d3d.cross, opt.d3d.main, 1);
- aitem((char *)" Wall Hack", (char *)"[OFF]|[ON]", &opt.d3d.wallhacks, opt.d3d.main, 1);
- aitem((char *)" Player Chams", (char *)"[OFF]|[NUMPAD1/+]|[NUMPAD2/-]", &opt.d3d.Chams, opt.d3d.main, 1);
- aitem((char *)" Asus", (char *)"[OFF]|[ON]", &opt.d3d.asus, opt.d3d.main, 1);
- aitem((char *)" Wire Frame", (char *)"[OFF]|[ON]", &opt.d3d.frame, opt.d3d.main, 1);
- acat((char *)"ESP", (char *)"Show|Hide", &opt.espopt.main);
- aitem((char *)" Distance", (char *)"[OFF]|[ON]", &opt.espopt.dist, opt.espopt.main, 1);
- aitem((char *)" Health Bar", (char *)"[OFF]|[ON]", &opt.espopt.health, opt.espopt.main, 1);
- aitem((char *)" 2D Box", (char *)"[OFF]|[ON]", &opt.espopt.box2, opt.espopt.main, 1);
- aitem((char *)" 3D Box", (char *)"[OFF]|[ON]", &opt.espopt.box3, opt.espopt.main, 1);
- aitem((char *)" Player Name", (char *)"[OFF]|[ON]", &opt.espopt.name, opt.espopt.main, 1);
- aitem((char *)" Vehicle Name", (char *)"[OFF]|[ON]", &opt.espopt.vehicle, opt.espopt.main, 1);
- aitem((char *)" Heritage & Air Drop", (char *)"[OFF]|[ON]", &opt.espopt.supplybox, opt.espopt.main, 1);
- aitem((char *)" Items Name", (char *)"[OFF]|[ON]", &opt.espopt.item, opt.espopt.main, 1);
- aitem((char *)" Rare Items", (char *)"[OFF]|[ON]", &opt.espopt.rare, opt.espopt.main, 1);
- //aitem((char *)" Skeleton", (char *)"[OFF]|[ON]", &opt.espopt.bones, opt.espopt.main, 1);
- aitem((char *)" DeadPlayer Items", (char *)"[OFF]|[ON]", &opt.espopt.dead, opt.espopt.main, 1);
- acat((char *)"AIMBOT", (char *)"Show|Hide", &opt.aimbooott.main);
- aitem((char *)" Aimbot", (char *)"[OFF]|[ON]", &opt.aimbooott.aimbot, opt.aimbooott.main, 1);
- aitem((char *)" AimFOV", (char *)"[OFF]|[5%]|[10%]|[Recommended]|[20%]|[25%]|[25%]|[30%]|[35%]|[40%]|[45%]", &opt.aimbooott.aimfov, opt.aimbooott.main, 1);
- aitem((char *)" AimKeys", (char *)"[OFF]|[Shift]|[RMouse]|[LMouse]|[Ctrl]|[Alt]|[Space]|[X]|[C]", &opt.aimbooott.aimkey, opt.aimbooott.main, 1);
- aitem((char *)" AimSens", (char *)"[OFF]|[1]|[2]|[3]|[4]|[5]|[6]|[7]|[8]|[9]|[10]|[11]|[12]|[13]|[14]|[15]|[16]|[17]|[18]|[19]|[20]", &opt.aimbooott.aimsens, opt.aimbooott.main, 1);
- aitem((char *)" AimHeight", (char *)"[OFF]|[0]|[1]|[2]|[3]|[4]|[5]|[6]|[7]|[8]|[9]|[10]", &opt.aimbooott.aimheight, opt.aimbooott.main, 1);
- aitem((char *)" TriggerBot", (char *)"[OFF]|[ON]", &opt.aimbooott.autoshoot, opt.aimbooott.main, 1);
- acat((char *)"WEAPON", (char *)"Show|Hide", &opt.weapon.main);
- aitem((char *)" NoSpread", (char *)"[OFF]|[ON]", &opt.weapon.NoSpread, opt.weapon.main, 1);
- //aitem((char *)" FastShoot /fix", (char *)"[OFF]|[ON]", &opt.weapon.FastShoot, opt.weapon.main, 1);
- aitem((char *)" Zoom", (char *)"[OFF]|[4x]|[x6]", &opt.weapon.zoom, opt.weapon.main, 1);
- acat((char *)"PLAYER", (char *)"Show|Hide", &opt.player.main);
- aitem((char *)" Spectator", (char *)"[OFF]|[ON]", &opt.player.spectator, opt.player.main, 1);
- aitem((char *)" Remove Grass", (char *)"[OFF]|[ON]", &opt.player.grass, opt.player.main, 1);
- aitem((char *)" Speed Hack", (char *)"[OFF]|[90]|[100]|[110]|[120]|[130]|[140]|[150]", &opt.player.speed, opt.player.main, 1);
- aitem((char *)" Walk Through Wall", (char *)"[OFF]|[ON]", &opt.player.wlkthru, opt.player.main, 1);
- aitem((char *)" Walk Under Water", (char *)"[OFF]|[ON]", &opt.player.wlkwtw, opt.player.main, 1);
- aitem((char *)" Grave Mode", (char *)"[OFF]|[ON]", &opt.player.prone, opt.player.main, 1);
- aitem((char *)" Flat Texture", (char *)"[OFF]|[ON]", &opt.player.textture, opt.player.main, 1);
- aitem((char *)" Sky Walk", (char *)"[OFF]|[ON]", &opt.player.superman, opt.player.main, 1);
- aitem((char *)" No Ground", (char *)"[OFF]|[ON]", &opt.player.noground, opt.player.main, 1);
- aitem((char *)" Auto Climb", (char *)"[OFF]|[H]", &opt.player.climb, opt.player.main, 1);
- aitem((char *)" Remove Fog", (char *)"[OFF]|[ON]", &opt.player.nofog, opt.player.main, 1);
- aitem((char *)" No Fall Damage", (char *)"[OFF]|[ON]", &opt.player.nofall, opt.player.main, 1);
- //outdated aitem((char *)" Walk Jump", (char *)"[OFF]|[ON]", &opt.player.walkjump, opt.player.main, 1);
- aitem((char *)" High Jump", (char *)"[OFF]|[ON]", &opt.player.superjump, opt.player.main, 1);
- aitem((char *)" Fast Drop", (char *)"[OFF]|[F]", &opt.player.paracute, opt.player.main, 1);
- acat("OPTIONS", "Show|Hide", &opt.options.main);
- aitem(" Move Menu", "[OFF]|[L-Ctrl]", &opt.options.move, opt.options.main, 1);
- aitem(" Save Set", "[OFF]|[Saving]", &opt.options.save, opt.options.main, 1);
- aitem(" Load Set", "[OFF]|[Loading]", &opt.options.load, opt.options.main, 1);
- aitem(" Reset Menu", "[OFF]|[Resetting]", &opt.options.reset, opt.options.main, 1);
- opt.options.save = 0;
- opt.options.load = 0;
- DrawBox(X, MC_ITEMY1(NO) + (F_SPC / 2), WIDTH, (F_SPC), D3DCOLOR_ARGB(220, 50, 50, 50), 1, pDevice);
- DrawBorder(X, MC_ITEMY1(NO) + (F_SPC / 2), WIDTH, (F_SPC), 1, D3DCOLOR_ARGB(220, 50, 50, 50), pDevice);
- DrawGameTextPixelFlag(MC_FCTR(X, MC_MAXX), MC_ITEMY1(NO) + (F_SPC / 2) + 2, D3DCOLOR_ARGB(255, 255, 255, 255), DT_CENTER | DT_SHADOW, "Private");
- for (int no = 0; no<NO; no++)
- {
- D3DCOLOR text;
- D3DCOLOR text2;
- D3DCOLOR text3;
- text = (*(items[no].val)>0) ? C_ON : C_OFF;
- text2 = (*(items[no].val)>0) ? C_ON2 : C_OFF2;
- text3 = (*(items[no].val)>0) ? C_ON2 : C_OFF3;
- if (items[no].type == T_CAT)
- text = C_CAT;
- if (I_CUR == no) {
- DrawBox(X, MC_ITEMY(no), WIDTH, I_SPC, D3DCOLOR_ARGB(255, 255, 255, 0), 1, pDevice);
- }
- if (mpos.x>X && mpos.x<MC_MAXX && mpos.y>MC_ITEMY(no) && mpos.y<MC_ITEMY(no) + I_SPC) {
- DrawBox(X, MC_ITEMY(no), WIDTH, I_SPC, D3DCOLOR_ARGB(255, 255, 255, 0), 1, pDevice);
- }
- if (items[no].type != T_CAT) {
- DrawBox(X + 10, MC_ITEMY(no) + 5, 5, 5, text3, 1, pDevice);
- DrawBorder(X + 10, MC_ITEMY(no) + 5, 5, 5, 1, C_BORDER, pDevice);
- }
- if (items[no].type == T_CAT) {
- text2 = C_CAT;
- DrawGameTextPixelFlag(X + I_OFS, MC_ITEMY(no) + 2, text, DT_SHADOW, items[no].title);
- }
- else {
- DrawGameTextPixelFlag(X + I_OFS + 11, MC_ITEMY(no) + 2, text, DT_SHADOW, items[no].title);
- }
- DrawGameTextPixelFlag(X + S_OFS, MC_ITEMY(no) + 2, text2, DT_RIGHT | DT_SHADOW, items[no].state);
- }
- int mno = 999;
- if (mpos.x>X && mpos.x<MC_MAXX && mpos.y<MC_ITEMY(NO) && mpos.y>Y)
- mno = ((mpos.y - T_SPC)>Y) ? ((mpos.y - Y - T_SPC - (T_SPC / 2)) / I_SPC) : (999);
- if (mno != 999 && rm && (*items[mno].val)>0)
- {
- (*items[mno].val) -= 1;
- Sound.wav.playsoundmem((LPCSTR)SWITCH);
- }
- if (mno != 999 && lm && (*items[mno].val)<(items[mno].max - 1))
- {
- (*items[mno].val) += 1;
- Sound.wav.playsoundmem((LPCSTR)SWITCH);
- }
- if (left && (*items[I_CUR].val)>0)
- {
- (*items[I_CUR].val) -= 1;
- Sound.wav.playsoundmem((LPCSTR)SWITCH);
- }
- if (right && (*items[I_CUR].val)<(items[I_CUR].max - 1))
- {
- (*items[I_CUR].val) += 1;
- Sound.wav.playsoundmem((LPCSTR)SWITCH);
- }
- if (up) {
- do {
- I_CUR = (I_CUR == 0) ? (NO - 1) : (I_CUR - 1);
- } while (items[I_CUR].type == T_TEXT);
- Sound.wav.playsoundmem((LPCSTR)MOVE);
- }
- if(down || items[I_CUR].type == T_TEXT) {
- do {
- I_CUR = (I_CUR + 1) % NO;
- } while (items[I_CUR].type == T_TEXT);
- Sound.wav.playsoundmem((LPCSTR)MOVE);
- }
- if (I_CUR>NO)I_CUR = NO - 1;
- }
- }
- HRESULT APIENTRY Present_hook(IDirect3DDevice9* pDevice, const RECT *pSourceRect, const RECT *pDestRect, HWND hDestWindowOverride, const RGNDATA *pDirtyRegion)
- {
- pDevice->GetViewport(&Viewport);
- ScreenCX = (float)Viewport.Width / 2.0f;
- ScreenCY = (float)Viewport.Height / 2.0f;
- if (Font == NULL)
- D3DXCreateFont(pDevice, 16, 0, FW_BLACK, 0, FALSE, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_DONTCARE, TEXT("Courier New"), &Font);
- if (xdxd)
- {
- id = GetCurrentProcessId();
- processHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, id);
- BAddress = (DWORD)GetModuleHandle(NULL);
- xdxd = false;
- }
- if (!Tools.Init)
- {
- D3DXCreateLine(pDevice, &Tools.pLine);
- Tools.Init = TRUE;
- }
- Menu.ShowMenu(pDevice);
- DWORD MODULEROS;
- MODULEROS = (DWORD)GetModuleHandleA("ros.exe");
- DWORD InGameAdrress = (MODULEROS + 0x1E21F28);
- DWORD* Verify = (DWORD*)(InGameAdrress);
- if (*Verify == 1)
- {
- esper(pDevice);
- }
- if (screenshot_taken && Font)
- {
- DrawCenteredString(Font, (int)Viewport.Width / 2, (int)Viewport.Height / 2, D3DCOLOR_ARGB(255, 255, 255, 255), "Someone reported you. Screenshot blocked. (gmcomplaint.jpg)");
- static DWORD lastTime = timeGetTime();
- DWORD timePassed = timeGetTime() - lastTime;
- if (timePassed > 2000)
- {
- screenshot_taken = false;
- LoadCfg();
- lastTime = timeGetTime();
- }
- }
- if (opt.d3d.cross == 1)
- {
- Tools.FillRGB(ScreenCX - 20, ScreenCY, 40, 1, D3DCOLOR_ARGB(255, 125, 0, 255), pDevice);//Purple
- Tools.FillRGB(ScreenCX, ScreenCY - 20, 1, 40, D3DCOLOR_ARGB(255, 125, 0, 255), pDevice);
- Tools.FillRGB(ScreenCX - 17, ScreenCY, 34, 1, D3DCOLOR_ARGB(255, 0, 0, 255), pDevice);//Blue
- Tools.FillRGB(ScreenCX, ScreenCY - 17, 1, 34, D3DCOLOR_ARGB(255, 0, 0, 255), pDevice);
- Tools.FillRGB(ScreenCX - 14, ScreenCY, 28, 1, D3DCOLOR_ARGB(255, 000, 139, 200), pDevice);//Cyan
- Tools.FillRGB(ScreenCX, ScreenCY - 14, 1, 28, D3DCOLOR_ARGB(255, 000, 139, 200), pDevice);
- Tools.FillRGB(ScreenCX - 11, ScreenCY, 22, 1, D3DCOLOR_ARGB(255, 0, 255, 0), pDevice);//Green
- Tools.FillRGB(ScreenCX, ScreenCY - 11, 1, 22, D3DCOLOR_ARGB(255, 0, 255, 0), pDevice);
- Tools.FillRGB(ScreenCX - 9, ScreenCY, 18, 1, D3DCOLOR_ARGB(255, 255, 255, 0), pDevice);//Yellow
- Tools.FillRGB(ScreenCX, ScreenCY - 9, 1, 18, D3DCOLOR_ARGB(255, 255, 255, 0), pDevice);
- Tools.FillRGB(ScreenCX - 6, ScreenCY, 12, 1, D3DCOLOR_ARGB(255, 255, 132, 0), pDevice);//Orange
- Tools.FillRGB(ScreenCX, ScreenCY - 6, 1, 12, D3DCOLOR_ARGB(255, 255, 132, 0), pDevice);
- Tools.FillRGB(ScreenCX - 3, ScreenCY, 6, 1, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
- Tools.FillRGB(ScreenCX, ScreenCY - 3, 1, 6, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);
- }
- if (opt.d3d.cross == 2)
- {
- Tools.DrawCircle(D3DXVECTOR2(ScreenCX - 1, ScreenCY) - 1, 8, 8, D3DCOLOR_ARGB(255, 255, 0, 0));//Red
- Tools.FillRGB(ScreenCX - 13, ScreenCY, 10, 1, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
- Tools.FillRGB(ScreenCX + 4, ScreenCY, 10, 1, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
- Tools.FillRGB(ScreenCX, ScreenCY - 13, 1, 10, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
- Tools.FillRGB(ScreenCX, ScreenCY + 4, 1, 10, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
- Tools.DrawPoint(ScreenCX, ScreenCY, 1, 1, D3DCOLOR_ARGB(255, 0, 255, 0), pDevice);//Green
- }
- if (opt.d3d.cross == 3)
- {
- Tools.DrawCircle(D3DXVECTOR2(ScreenCX, ScreenCY), 8, 8, D3DCOLOR_ARGB(255, 255, 0, 0));//Red
- Tools.FillRGB(ScreenCX - 17, ScreenCY, 10, 1, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
- Tools.FillRGB(ScreenCX + 9, ScreenCY, 10, 1, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
- Tools.FillRGB(ScreenCX, ScreenCY - 17, 1, 10, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
- Tools.FillRGB(ScreenCX, ScreenCY + 9, 1, 10, D3DCOLOR_ARGB(255, 255, 0, 0), pDevice);//Red
- Tools.DrawPoint(ScreenCX, ScreenCY, 1, 1, D3DCOLOR_ARGB(255, 0, 255, 0), pDevice);//Green
- }
- //Shift|RMouse|LMouse|Ctrl|Alt|Space|X|C
- if (opt.aimbooott.aimkey == 0) opt.aimbooott.Daimkey = 0;
- if (opt.aimbooott.aimkey == 1) opt.aimbooott.Daimkey = VK_SHIFT;
- if (opt.aimbooott.aimkey == 2) opt.aimbooott.Daimkey = VK_RBUTTON;
- if (opt.aimbooott.aimkey == 3) opt.aimbooott.Daimkey = VK_LBUTTON;
- if (opt.aimbooott.aimkey == 4) opt.aimbooott.Daimkey = VK_CONTROL;
- if (opt.aimbooott.aimkey == 5) opt.aimbooott.Daimkey = VK_MENU;
- if (opt.aimbooott.aimkey == 6) opt.aimbooott.Daimkey = VK_SPACE;
- if (opt.aimbooott.aimkey == 7) opt.aimbooott.Daimkey = 0x58;
- if (opt.aimbooott.aimkey == 8) opt.aimbooott.Daimkey = 0x43;
- if (opt.aimbooott.aimbot && WeaponEspInfo.size() != NULL)
- {
- UINT BestTarget = -1;
- DOUBLE fClosestPos = 99999;
- for (unsigned int i = 0; i < WeaponEspInfo.size(); i++)
- {
- float radiusx = (opt.aimbooott.aimfov*5.0f) * (ScreenCX / 100.0f);
- float radiusy = (opt.aimbooott.aimfov*5.0f) * (ScreenCY / 100.0f);
- if (opt.aimbooott.aimfov == 0)
- {
- radiusx = 5.0f * (ScreenCX / 100.0f);
- radiusy = 5.0f * (ScreenCY / 100.0f);
- }
- WeaponEspInfo[i].CrosshairDistance = GetDistance1(WeaponEspInfo[i].pOutX, WeaponEspInfo[i].pOutY, ScreenCX, ScreenCY);
- if (WeaponEspInfo[i].pOutX >= ScreenCX - radiusx && WeaponEspInfo[i].pOutX <= ScreenCX + radiusx && WeaponEspInfo[i].pOutY >= ScreenCY - radiusy && WeaponEspInfo[i].pOutY <= ScreenCY + radiusy)
- if (WeaponEspInfo[i].CrosshairDistance < fClosestPos)
- {
- fClosestPos = WeaponEspInfo[i].CrosshairDistance;
- BestTarget = i;
- }
- }
- if (BestTarget != -1 && WeaponEspInfo[BestTarget].RealDistance > 4.0f)
- {
- double DistX = WeaponEspInfo[BestTarget].pOutX - ScreenCX;
- double DistY = WeaponEspInfo[BestTarget].pOutY - ScreenCY;
- //DistX /= (0.5f + (float)opt.aimbooott.aimsens*0.5f);
- //DistY /= (0.5f + (float)opt.aimbooott.aimsens*0.5f);
- DistX = (int)floorf((float(DistX) / 2.0f) + opt.aimbooott.aimsens*0.5f);
- DistY = (int)floorf((float(DistY) / 2.0f) + opt.aimbooott.aimsens*0.5f);
- if (GetAsyncKeyState(opt.aimbooott.Daimkey) & 0x8000)
- mouse_event(MOUSEEVENTF_MOVE, DistX, DistY, NULL, NULL);
- if ((!GetAsyncKeyState(VK_LBUTTON) && (opt.aimbooott.autoshoot == 1) && (GetAsyncKeyState(opt.aimbooott.Daimkey) & 0x8000)))
- {
- if (opt.aimbooott.autoshoot == 1 && !IsPressed)
- {
- IsPressed = true;
- mouse_event(MOUSEEVENTF_LEFTDOWN, DistX, DistY, NULL, NULL);
- }
- }
- }
- }
- WeaponEspInfo.clear();
- if (opt.aimbooott.autoshoot == 1 && IsPressed)
- {
- if (timeGetTime() - astime >= asdelay)
- {
- IsPressed = false;
- mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
- astime = timeGetTime();
- }
- }
- return Present_orig(pDevice, pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
- }
- HRESULT APIENTRY Reset_hook(IDirect3DDevice9* pDevice, D3DPRESENT_PARAMETERS *pPresentationParameters)
- {
- if (Font)
- Font->OnLostDevice();
- if (Tools.pLine)
- Tools.pLine->OnLostDevice();
- HRESULT ResetReturn = Reset_orig(pDevice, pPresentationParameters);
- if (SUCCEEDED(ResetReturn))
- {
- if (Font)
- Font->OnResetDevice();
- if (Tools.pLine)
- Tools.pLine->OnResetDevice();
- }
- return ResetReturn;
- }
- HANDLE(WINAPI *Real_CreateFile)(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) = CreateFileW;
- HANDLE WINAPI Routed_CreateFile(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
- {
- char buffer[500];
- wcstombs(buffer, lpFileName, 500);
- if (strcmp(buffer + strlen(buffer) - 4, ".jpg") == 0)
- {
- Log("buffer == %s", buffer);
- }
- if (strcmp(buffer + strlen(buffer) - 4, ".bmp") == 0)
- {
- Log("buffer == %s", buffer);
- }
- return Real_CreateFile(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
- }
- DWORD WINAPI RosD3D(__in LPVOID lpParameter)
- {
- HMODULE dDll = NULL;
- while (!dDll)
- {
- dDll = GetModuleHandleA("d3d9.dll");
- Sleep(100);
- }
- CloseHandle(dDll);
- IDirect3D9* d3d = NULL;
- IDirect3DDevice9* d3ddev = NULL;
- HWND tmpWnd = CreateWindowA("BUTTON", "RosD3D", WS_SYSMENU | WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, 300, 300, NULL, NULL, Hand, NULL);
- if (tmpWnd == NULL)
- {
- return 0;
- }
- d3d = Direct3DCreate9(D3D_SDK_VERSION);
- if (d3d == NULL)
- {
- DestroyWindow(tmpWnd);
- return 0;
- }
- D3DPRESENT_PARAMETERS d3dpp;
- ZeroMemory(&d3dpp, sizeof(d3dpp));
- d3dpp.Windowed = TRUE;
- d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
- d3dpp.hDeviceWindow = tmpWnd;
- d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
- HRESULT result = d3d->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, tmpWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &d3ddev);
- if (result != D3D_OK)
- {
- d3d->Release();
- DestroyWindow(tmpWnd);
- return 0;
- }
- #if defined _M_X64
- DWORD64* dVtable = (DWORD64*)d3ddev;
- dVtable = (DWORD64*)dVtable[0];
- #elif defined _M_IX86
- DWORD* dVtable = (DWORD*)d3ddev;
- dVtable = (DWORD*)dVtable[0];
- #endif
- SetStreamSource_orig = (SetStreamSource_t)dVtable[100];
- SetTexture_orig = (SetTexture_t)dVtable[65];
- Reset_orig = (Reset_t)dVtable[16];
- Present_orig = (Present)dVtable[17];
- Present_orig = (Present)DetourFunction((PBYTE)Present_orig, (PBYTE)Present_hook);
- SetStreamSource_orig = (SetStreamSource_t)DetourFunction((PBYTE)SetStreamSource_orig, (PBYTE)SetStreamSource_hook);
- SetTexture_orig = (SetTexture_t)DetourFunction((PBYTE)SetTexture_orig, (PBYTE)SetTexture_hook);
- Reset_orig = (Reset_t)DetourFunction((PBYTE)Reset_orig, (PBYTE)Reset_hook);
- if (MH_CreateHook((DWORD_PTR*)dVtable[32], &hkGetRenderTargetData, reinterpret_cast<void**>(&oGetRenderTargetData)) != MH_OK) { return 1; }
- if (MH_EnableHook((DWORD_PTR*)dVtable[32]) != MH_OK) { return 1; }
- if (MH_CreateHook((DWORD_PTR*)dVtable[36], &hkCreateOffscreenPlainSurface, reinterpret_cast<void**>(&oCreateOffscreenPlainSurface)) != MH_OK) { return 1; }
- if (MH_EnableHook((DWORD_PTR*)dVtable[36]) != MH_OK) { return 1; }
- HMODULE modd = LoadLibrary(TEXT("Kernel32.dll"));
- void* ptrr = GetProcAddress(modd, "CreateFileW");
- MH_CreateHook(ptrr, Routed_CreateFile, reinterpret_cast<void**>(&Real_CreateFile));
- MH_EnableHook(ptrr);
- d3ddev->Release();
- d3d->Release();
- DestroyWindow(tmpWnd);
- return 1;
- }
- BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
- {
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- Hand = hModule;
- DisableThreadLibraryCalls(hModule);
- GetModuleFileNameA(hModule, dlldir, 512);
- for (int i = (int)strlen(dlldir); i > 0; i--)
- {
- if (dlldir[i] == '\\')
- {
- dlldir[i + 1] = 0;
- break;
- }
- }
- CreateThread(0, 0, RosD3D, 0, 0, 0);
- break;
- case DLL_PROCESS_DETACH:
- break;
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- break;
- }
- return TRUE;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement