I think what you found in his cage was urates. Urates are a waste product produced in the kidneys. When a bird or reptile defecates, they also pass urine and urates from the kidneys. When they dry, they can become quite hard like rocks. When they pass them, they can be liquid. Urates should be white and sometime they might have just a bit of yellow or orange on the tip. If the urates are yellow or orange, it is indicative that the animal is dehydrated. Dehydration can cause permanent kidney damage. Dehydration is a big problem with captive chamleons.
Honestly, can't you see the legs are bent and broken? Their bone structure is very similar to ours. From the elbow to the wrist should be basically straight, not with bends or angles.
Please take him to the vet. This is not something you can handle on your own. Very few people can keep chameleons healthy. I don't understand that because a veiled is a tough, easy chameleon to keep. They need proper lighting (none at night). They need proper temperatures and that includes a drop at night. They need good hydration and food. Please read the care sheets.