Como faço pra criar um arquivo executável?
Eu tenho isso aqui:
Reading entity
Code:
WorldToScreen
Code:
Eu tenho isso aqui:
- Client = 0x1ED7418,
- Render = 0x1E82B68,
- SceneContext = 0x1CD54D0,
- LocalPlayer = 0x1ED77D4,
Reading entity
Code:
- private List<Entity> ReadAllEntity()
- {
- var EntityList = new List<Entity>();
- //Getting Game Object;
- var GameObject = GlobalUtil.MemUtil.ReadIntPtr((GlobalUtil.ProcessBaseAdress + (int)GameOffsets.Client)) +
- (int) GameOffsets.m_ppObjects;
- GameObject = GlobalUtil.MemUtil.ReadIntPtr(GameObject + 0x0);
- var pCurrentItem = GlobalUtil.MemUtil.ReadIntPtr(GlobalUtil.MemUtil.ReadIntPtr(GameObject+0x0)); // Point to the first object
- //Skip the first two object in the loop
- pCurrentItem = GlobalUtil.MemUtil.ReadIntPtr(pCurrentItem + 0x0);
- pCurrentItem = GlobalUtil.MemUtil.ReadIntPtr(pCurrentItem + 0x0);
- var End = GlobalUtil.MemUtil.ReadIntPtr(GameObject + 0x4); //aponta para o primeiro objeto, se for o mesmo chegamos ao fim.
- var i = 0;
- do
- {
- var Entity = GlobalUtil.MemUtil.ReadIntPtr(pCurrentItem + 0xC);
- var m_pMeta = GlobalUtil.MemUtil.ReadIntPtr(Entity + 0x4);
- var EntityType = GlobalUtil.MemUtil.ReadString(GlobalUtil.MemUtil.ReadIntPtr(m_pMeta + 0xC), 12);
- var Type = GlobalUtil.MemUtil.ReadInt32(Entity);
- var ObjectId = GlobalUtil.MemUtil.ReadInt32(Entity + 0xC);
- var Position = GlobalUtil.MemUtil.ReadVector3(Entity + 0x10);
- var Yaw = GlobalUtil.MemUtil.ReadFloat(Entity + 0x38);
- var Pitch = GlobalUtil.MemUtil.ReadFloat(Entity + 0x3C);
- var isPlayer = EntityType.Contains("Avatar") || EntityType.Contains("Robot");
- var isVehicle = EntityType.Contains("Land");
- EntityList.Add(new Entity(){PlayerName = "None", TypeName = EntityType, Type = Type, ObjectId = ObjectId, isPlayer = isPlayer, Coordinates = Position, Yaw = Yaw, Pitch = Pitch, isVehicle = isVehicle });
- pCurrentItem = GlobalUtil.MemUtil.ReadIntPtr(pCurrentItem + 0x0);
- i++;
- } while (pCurrentItem != End);
- return EntityList;
- }
WorldToScreen
Code:
- public static bool WorldToScreen(Vector3 pos, out Vector2 screen, int windowWidth, int windowHeight)
- {
- screen = new Vector2();
- GlobalUtil.MemUtil.ReadViewMatrix(GlobalUtil.MemUtil.ReadIntPtr(GlobalUtil.MemUtil.ReadIntPtr(GlobalUtil.ProcessBaseAdress + (int)GameOffsets.SceneContext)+0x4)+0xC4,out float[] Matriix);
- //Matrix-vector Product, multiplying world(eye) coordinates by projection matrix = clipCoords
- Vector4 clipCoords;
- clipCoords.X = pos.X * matrix[0] + pos.Y * matrix[4] + pos.Z * matrix[8] + matrix[12];
- clipCoords.Y = pos.X * matrix[1] + pos.Y * matrix[5] + pos.Z * matrix[9] + matrix[13];
- clipCoords.Z = pos.X * matrix[2] + pos.Y * matrix[6] + pos.Z * matrix[10] + matrix[14];
- clipCoords.W = pos.X * matrix[3] + pos.Y * matrix[7] + pos.Z * matrix[11] + matrix[15];
- if (clipCoords.W < 0.1f)
- return false;
- //perspective division, dividing by clip.W = Normalized Device Coordinates
- Vector3 NDC;
- NDC.X = clipCoords.X / clipCoords.W;
- NDC.Y = clipCoords.Y / clipCoords.W;
- NDC.Z = clipCoords.Z / clipCoords.W;
- //Transform to window coordinates
- screen.X = (windowWidth / 2 * NDC.X) + (NDC.X + windowWidth / 2);
- screen.Y = -(windowHeight / 2 * NDC.Y) + (NDC.Y + windowHeight / 2);
- return true;
- }