Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.83 KB | None | 0 0
  1. Imports si0n.cSDK
  2. Imports si0n.Offsets
  3. Imports si0n.cUsefulFuncs
  4. Imports si0n.ENUMS
  5. Imports System.Runtime.InteropServices
  6.  
  7. Public Class cESP
  8. Public Shared pEspPlayer As New cBasePlayer(Nothing)
  9. Dim rnd As New Random
  10.  
  11. Public Structure Color_t
  12. Dim R As Single
  13. Dim G As Single
  14. Dim B As Single
  15. Dim A As Single
  16. End Structure
  17.  
  18. Public Structure GlowObject_t
  19. Dim pEntity As Integer
  20. Dim r As Single
  21. Dim g As Single
  22. Dim b As Single
  23. Dim a As Single
  24. <MarshalAs(UnmanagedType.ByValArray, SizeConst:=16)>
  25. Public unk1 As Byte()
  26. Dim RenderWhenOccluded As Boolean
  27. Dim RenderWhenUnoccluded As Boolean
  28. Dim FullBloom As Boolean
  29. <MarshalAs(UnmanagedType.ByValArray, SizeConst:=12)>
  30. Public unk2 As Byte()
  31. End Structure
  32.  
  33. Public Structure clr_s
  34. Dim r As Byte
  35. Dim g As Byte
  36. Dim b As Byte
  37. Dim a As Byte
  38. End Structure
  39.  
  40. Public clr As New clr_s
  41. Dim Col As New Color_t
  42.  
  43. Public Sub GlowESP(Esp As Boolean, ModelColor As Boolean, Mode As Integer)
  44. If Mode = 1 Then
  45. GlowESPplayersonly(Esp, ModelColor)
  46. ElseIf Mode = 2 Then
  47. GlowESPall(Esp, ModelColor)
  48. End If
  49. End Sub
  50.  
  51. Public Sub GlowESPplayersonly(Esp As Boolean, ModelColor As Boolean)
  52. For i = 1 To MAXPLAYERS
  53. pEspPlayer.ptr = cBasePlayer.PointerByIndex(i)
  54.  
  55. If pEspPlayer.Dormant Then Continue For
  56. If pEspPlayer.Health < 1 Then Continue For
  57. If pEspPlayer.Team = pLocalPlayer.Team Then Continue For
  58.  
  59. If Esp And pEspPlayer.SpottedByMask Then
  60. pEspPlayer.Glow(Settings.ESPcolorEnemyVis.r / 255, Settings.ESPcolorEnemyVis.g / 255, Settings.ESPcolorEnemyVis.b / 255, Settings.ESPcolorEnemyVis.a / 255, True, False, False)
  61. ElseIf Esp Then
  62. pEspPlayer.Glow(Settings.ESPcolorEnemy.r / 255, Settings.ESPcolorEnemy.g / 255, Settings.ESPcolorEnemy.b / 255, Settings.ESPcolorEnemy.a / 255, True, False, False)
  63. End If
  64.  
  65. If ModelColor Then pEspPlayer.clrRender(255, 100, 0, 255)
  66. Next
  67. End Sub
  68.  
  69. Public GlowObject As GlowObject_t
  70.  
  71. Public Sub GlowESPall(Esp As Boolean, ModelColor As Boolean)
  72. If Not GetAsyncKeyState(KeyBinds.SkinchangerKey) Then
  73. Dim GlowObjectManager As Integer = mem.rdInt(mem.ClientDLL + dwGlowObjectManager)
  74. Dim GlowObjectCount As Integer = mem.rdInt(mem.ClientDLL + dwGlowObjectManager + &H4)
  75.  
  76. If GlowObjectCount > 1 Then
  77. For i = 1 To GlowObjectCount
  78. If mem.rdInt(GlowObjectManager + (i * &H38)) Then
  79. GlowObject = mem.ReadMemory(Of GlowObject_t)(GlowObjectManager + (i * &H38))
  80. If GlowObject.pEntity Then
  81. Dim ClassID As Integer = GetClassID(mem.rdInt(GlowObjectManager + (i * &H38)))
  82. GlowObject = SetColor(ClassID, GlowObject, mem.rdInt(GlowObjectManager + (i * &H38)))
  83. mem.WriteStruct(Of GlowObject_t)(GlowObjectManager + (i * &H38), GlowObject)
  84. If ModelColor Then mem.WriteStruct(Of clr_s)(mem.rdInt(GlowObjectManager + (i * &H38)) + m_clrRender, GetRenderColorFromGlowObject(GlowObject))
  85. End If
  86. End If
  87. Next
  88. End If
  89.  
  90. ElseIf GetAsyncKeyState(KeyBinds.SkinchangerKey) Then
  91. sleep(500)
  92. End If
  93. End Sub
  94.  
  95. Private Function GetClassID(add As Integer) As Integer
  96. Dim one As Integer = mem.rdInt(add + &H8)
  97. Dim two As Integer = mem.rdInt(one + 2 * &H4)
  98. Dim three As Integer = mem.rdInt(two + 1)
  99. Dim ClassID As Integer = mem.rdInt(three + 20)
  100. Return ClassID
  101. End Function
  102.  
  103. Private Function SetColor(cID As Integer, GlowObject As GlowObject_t, ptr As Integer) As GlowObject_t
  104. Select Case cID
  105. Case ClassID.CSPlayer
  106. pEspPlayer.ptr = ptr
  107. If pEspPlayer.Team <> pLocalPlayer.Team Then
  108. If pEspPlayer.SpottedByMask Then
  109. GlowObject.r = Settings.ESPcolorEnemyVis.r / 255
  110. GlowObject.g = Settings.ESPcolorEnemyVis.g / 255
  111. GlowObject.b = Settings.ESPcolorEnemyVis.b / 255
  112. GlowObject.a = Settings.ESPcolorEnemyVis.a / 255
  113.  
  114. Else
  115. GlowObject.r = Settings.ESPcolorEnemy.r / 255
  116. GlowObject.g = Settings.ESPcolorEnemy.g / 255
  117. GlowObject.b = Settings.ESPcolorEnemy.b / 255
  118. GlowObject.a = Settings.ESPcolorEnemy.a / 255
  119.  
  120. End If
  121. Else
  122. GlowObject.r = Settings.ESPcolorTeammate.r / 255
  123. GlowObject.g = Settings.ESPcolorTeammate.g / 255
  124. GlowObject.b = Settings.ESPcolorTeammate.b / 255
  125. GlowObject.a = Settings.ESPcolorTeammate.a / 255
  126. End If
  127.  
  128. Case ClassID.AK47, ClassID.DEagle, ClassID.WeaponAug, ClassID.WeaponBizon, ClassID.WeaponElite, ClassID.WeaponGalilAR, ClassID.WeaponUMP45, ClassID.WeaponMAC10, ClassID.WeaponFiveSeven, ClassID.WeaponTec9, ClassID.WeaponXM1014, ClassID.WeaponSawedoff, ClassID.WeaponAWP, ClassID.WeaponG3SG1, ClassID.WeaponGalil, ClassID.WeaponGlock, ClassID.WeaponHKP2000, ClassID.WeaponM249, ClassID.WeaponM4A1, ClassID.WeaponM3, ClassID.WeaponMP7, ClassID.WeaponMP9, ClassID.WeaponMP5Navy, ClassID.WeaponMag7, ClassID.WeaponNOVA, ClassID.WeaponNegev, ClassID.WeaponP250, ClassID.WeaponP90, ClassID.WeaponSCAR20, ClassID.SCAR17, ClassID.WeaponSG552, ClassID.WeaponSG556, ClassID.WeaponSSG08, ClassID.WeaponBizon
  129. GlowObject.r = Settings.ESPcolorWeapons.r / 255
  130. GlowObject.g = Settings.ESPcolorWeapons.g / 255
  131. GlowObject.b = Settings.ESPcolorWeapons.b / 255
  132. GlowObject.a = Settings.ESPcolorWeapons.a / 255
  133.  
  134. Case ClassID.BaseCSGrenadeProjectile, ClassID.DecoyGrenade, ClassID.DecoyProjectile, ClassID.HEGrenade, ClassID.SmokeGrenade, ClassID.MolotovGrenade, ClassID.SmokeGrenadeProjectile, ClassID.MolotovProjectile, ClassID.IncendiaryGrenade, ClassID.Flashbang, ClassID.ParticleSmokeGrenade, ClassID.ParticleFire
  135. GlowObject.r = Settings.ESPcolorGrenades.r / 255
  136. GlowObject.g = Settings.ESPcolorGrenades.g / 255
  137. GlowObject.b = Settings.ESPcolorGrenades.b / 255
  138. GlowObject.a = Settings.ESPcolorGrenades.a / 255
  139.  
  140. 'Case ClassID.Chicken, ClassID.Hostage, ClassID.HostageCarriableProp
  141. ' GlowObject.R = 1.0F
  142. ' GlowObject.G = 0.3F
  143. ' GlowObject.B = 0.5F
  144.  
  145. Case ClassID.C4, ClassID.PlantedC4
  146. GlowObject.r = Settings.ESPcolorBomb.r / 255
  147. GlowObject.g = Settings.ESPcolorBomb.g / 255
  148. GlowObject.b = Settings.ESPcolorBomb.b / 255
  149. GlowObject.a = Settings.ESPcolorBomb.a / 255
  150.  
  151. Case Else
  152. GlowObject.RenderWhenOccluded = False
  153. GlowObject.RenderWhenUnoccluded = False
  154. GlowObject.FullBloom = False
  155. Return GlowObject
  156. End Select
  157. GlowObject.RenderWhenOccluded = True
  158. GlowObject.RenderWhenUnoccluded = False
  159. GlowObject.FullBloom = False
  160. Return GlowObject
  161. End Function
  162.  
  163. Public Function GetRenderColorFromGlowObject(GlowObject As GlowObject_t) As clr_s
  164. clr.r = 255 * GlowObject.r
  165. clr.g = 255 * GlowObject.g
  166. clr.b = 255 * GlowObject.b
  167. clr.a = 255 * GlowObject.a
  168. Return clr
  169. End Function
  170. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement