I have always wanted to implement Location Triangulation myself.
[ATTACH=full]107375[/ATTACH]
Getting locations using Geo-codes hasn’t been much of a challenge especially with these smart phones and gps gadgets. However, I have always wanted to be able to implement location detection using only phone numbers, and service provider network details and infrastructure (MNC, LAC, CID)
Theory iko mfukoni, all tools are available but I just cant sit down and make it work
Reason : Procrastination Progress : Working on how to get it going. I thought talking about it would help. I have also found some useful material and all that’s left is sitting down and doing it.
* maybe I can also learn how to make a home-made gun. For hunting Nyondes of course.
What about you ninjas. What is that thing that seems so close yet so far away and why ?
C programming language so that I can learn how kernels work, started with the syntax nikawachia katikati
Virtual Reality, hii sasa ndiyo uzembe imenishika kabisa, game engines ninazo mbili, I know how to create assets lakini making it work in VR world hapa ndio sasa kuna uzembe. Anyway nitaikalia tu chini
Ukifanya threesome, when the other dude is in the front hole and I am in the back, the pressure causes my longevity to slip out of her tanyes. I have read online there is a certain thrust of the hips that can prevent this, but so far have been too lazy to implement. I just re-ingiza and that threatens my rhythm. Also, once in a while ukiingizia bila careful checking you end up two in one, which is too homo for me.
French. Tried doing it via Duolingo app but it’s not workable since I am not able to practice what I learn. Thought of enrolling in Aliance Francaise for lessons but the nature of my work involves a lot of travel to allow for sequential learning.
Always wanted to operate and get certification for the 25K Aircraft Cargo Loader, I’m certified to operate 6-60K forklifts and RTCH that handles standard ANSI/ISO cargo.
wont help you make a gun (you need to know how to use it first)
but i can help you with the Geocoding, before we even go in to the triangulation, there is already an easier way to get coordinates using MNC, LAC and CID, below is a class that works for me. google and OSM already have a publicly available API for this so i will skip the nitty gritty
all you need to do is make a POST request to the API and you have coordinates
namespace redacted
{
public partial class redacted_from_somewhere
{
TowerCoords m_TowerCoords = new TowerCoords();
[DllImport("KERNEL32.DLL", EntryPoint = "SetProcessWorkingSetSize", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
static extern bool SetProcessWorkingSetSize(IntPtr pProcess, int dwMinimumWorkingSetSize, int dwMaximumWorkingSetSize);
[DllImport("KERNEL32.DLL", EntryPoint = "GetCurrentProcess", SetLastError = true, CallingConvention = CallingConvention.StdCall)]
static extern IntPtr GetCurrentProcess();
void some_event_rename_to_suite_your_needs(object sender, EventArgs e)
{
m_TowerCoords = GetLocation(CID, MCC, MNC, LAC);
Console.WriteLine (string.format ("LAT={0} LON={0}",m_TowerCoords.lat,m_TowerCoords.lon));
}
TowerCoords GetLocation(int towerId,int mcc,int mnc,int lac)
{
TowerCoords _towerCoords = new TowerCoords();
try
{
// Translate cell tower data into http post parameter data
byte[] formData = GetFormPostData(towerId,mcc,mnc,lac);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(new Uri("http://www.google.com/glm/mmap"));
request.Method = "POST";
request.ContentLength = formData.Length;
request.ContentType = "application/binary";
Stream outputStream = request.GetRequestStream();
// Write the cell data to the http stream
outputStream.Write(formData, 0, formData.Length);
outputStream.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
_towerCoords = ReadResponse(response);
}
catch { }
return _towerCoords;
}
TowerCoords ReadResponse(HttpWebResponse response)
{
TowerCoords _towerCoords = new TowerCoords();
byte[] responseData = new byte[response.ContentLength];
int bytesRead = 0;
// Read the response into the response byte array
while (bytesRead < responseData.Length)
{
bytesRead += response.GetResponseStream()
.Read(responseData, bytesRead, responseData.Length - bytesRead);
}
// Check the response
if (response.StatusCode == HttpStatusCode.OK)
{
int successful = Convert.ToInt32(GetCode(responseData, 3));
if (successful == 0)
{
_towerCoords.lat = GetCode(responseData, 7) / 1000000;
_towerCoords.lon = GetCode(responseData, 11) / 1000000;
}
}
else{
/*do something but dont return a null*/
}
return _towerCoords;
}
double GetCode(byte[] data, int startIndex)
{
return ((double)((data[startIndex++] << 24) |
(data[startIndex++] << 16) |
(data[startIndex++] << 8) |
(data[startIndex++])));
}
byte[] GetFormPostData(int cellTowerId, int mobileCountryCode, int mobileNetworkCode, int locationAreaCode)
{
byte[] pd = new byte[55];
pd[1] = 14; //0x0e;
pd[16] = 27; //0x1b;
pd[47] = 255; //0xff;
pd[48] = 255; //0xff;
pd[49] = 255; //0xff;
pd[50] = 255; //0xff;
pd[28] = ((Int64)cellTowerId > 65536) ? (byte)5 : (byte)3;
Shift(pd, 17, mobileNetworkCode);
Shift(pd, 21, mobileCountryCode);
Shift(pd, 31, cellTowerId);
Shift(pd, 35, locationAreaCode);
Shift(pd, 39, mobileNetworkCode);
Shift(pd, 43, mobileCountryCode);
return pd;
}
void Shift(byte[] data, int startIndex, int leftOperand)
{
int rightOperand = 24;
for (int i = 0; i < 4; i++, rightOperand -= 8)
{
data[startIndex++] = (byte)((leftOperand >> rightOperand) & 255);
}
}
void CleanUp()
{
try
{
IntPtr pHandle = GetCurrentProcess();
SetProcessWorkingSetSize(pHandle, -1, -1);
}
catch { }
}
}
internal class TowerCoords
{
double lat
{
get;set;
}
double lon
{
get;set
}
}
}