Surly not Cypher 
Code:
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int EnumVisibleObjectsDelegate(IntPtr callback, int filter);
/// <summary>
/// Acts as the callback from WoW. This function will be called for each object
/// during the enumeration. A GUID will be passed back that you can then use in the
/// ClntObjMgrGetObjectPtr function to get the actual pointer.
/// </summary>
/// <param name="guid">A GUID to use.</param>
/// <param name="filter">A filter for the object type.</param>
/// <returns>
/// Returns 0 when the enumeration should be stopped or
/// 1 when the enumeration should continue.
/// </returns>
/// <remarks>
/// If no objects are left to enumerate, the function will no longer be called.
/// </remarks>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate int EnumObjectsCallbackDelegate(ulong guid, int filter);
/// <summary>
/// Returns a pointer to an object based on GUID, IntPtr.Zero if no object exists.
/// </summary>
/// <param name="guid">The GUID of the object.</param>
/// <param name="filter">A filter for the object type.</param>
/// <returns>An pointer to the actual object.</returns>
/// <remarks>
/// This function works from the object descriptor GUID (OBJECT_FIELD_GUID).
/// Not the typical obj+0x32 GUID.
/// </remarks>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate IntPtr ClntObjMgrGetObjectPtrDelegate(ulong guid, int filter);
/// <summary>
/// Retrives the GUID of the active player which can then be passed
/// to the ClntObjMgrGetObjectPtr function.
/// </summary>
/// <returns>The GUID of the active player.</returns>
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
private delegate ulong ClntObjMgrGetActivePlayerDelegate();
private readonly EnumObjectsCallbackDelegate _Callback;
private readonly IntPtr _CallbackPtr;
private readonly ClntObjMgrGetObjectPtrDelegate ClntObjMgrGetObjectPtrWow;
private readonly ClntObjMgrGetActivePlayerDelegate ClntObjMgrGetActivePlayerWow;
private readonly EnumVisibleObjectsDelegate EnumObjects;
private readonly Dictionary<ulong, WowObject> _RealObjects = new Dictionary<ulong, WowObject>();
private ulong _frameCounter = 1;
public WowObject Me
{
get
{
return _RealObjects[_PlayerGuid];
}
}
private ulong _PlayerGuid = 0;
public ObjectManager(Wow wow, TequilaSunrise.Core.TequilaSunrise sun)
{
_Sunrise = sun;
_Wow = wow;
_Callback = ObjectManager.EnumObjectsCallbackTest;
_CallbackPtr = Marshal.GetFunctionPointerForDelegate(_Callback);
_Sunrise.PatternManager.LoadFile(new FileInfo(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "ObjectMgrPatterns.xml")), (uint)Process.GetCurrentProcess().Modules[0].BaseAddress, (uint)Process.GetCurrentProcess().Modules[0].ModuleMemorySize);
ClntObjMgrGetActivePlayerWow = _Sunrise.MemoryManager.RegisterDelegate<ClntObjMgrGetActivePlayerDelegate>(_Sunrise.PatternManager["ClntObjMgrGetActivePlayer"]);
ClntObjMgrGetObjectPtrWow = _Sunrise.MemoryManager.RegisterDelegate<ClntObjMgrGetObjectPtrDelegate>(_Sunrise.PatternManager["ClntObjMgrObjectPtr"]);
EnumObjects = _Sunrise.MemoryManager.RegisterDelegate<EnumVisibleObjectsDelegate>(_Sunrise.PatternManager["EnumVisibleObjects"]);
_Wow.Pulse += _Wow_Pulse;
}
private static int EnumObjectsCallbackTest(ulong guid, int filter)
{
return 1;
}
private int EnumObjectsCallbackHandler(ulong guid, int filter)
{
IntPtr objPtr = GetPtrByGuid(guid);
if (!_RealObjects.ContainsKey(guid))
{
WowObject tmp = new WowObject(objPtr);
switch (tmp.Type)
{
case Enums.WowObjectType.AllTypes:
break;
case Enums.WowObjectType.Object:
break;
case Enums.WowObjectType.Item:
break;
case Enums.WowObjectType.Container:
break;
case Enums.WowObjectType.Unit:
break;
case Enums.WowObjectType.Player:
break;
case Enums.WowObjectType.GameObject:
break;
case Enums.WowObjectType.DynamicObject:
break;
case Enums.WowObjectType.Corpse:
break;
case Enums.WowObjectType.AiGroup:
break;
case Enums.WowObjectType.AreaTrigger:
break;
}
_RealObjects.Add(guid, tmp);
}
else if (_RealObjects[guid] != objPtr)
{
_RealObjects[guid].UpdateObjectPointer(objPtr);
}
return 1;
}
private void _Wow_Pulse(Microsoft.DirectX.Direct3D.Device DirectXDevice)
{
if (_PlayerGuid == 0)
_PlayerGuid = ClntObjMgrGetActivePlayerWow();
foreach (WowObject value in _RealObjects.Values)
{
value.UpdateObjectPointer(IntPtr.Zero);
}
EnumObjects(_CallbackPtr, 0); //here it gets ****ed up
if (_frameCounter++ % 10 == 0)
RemoveInvalidEntries();
OnPropertyChanged(new PropertyChangedEventArgs("Me"));
OnCollectionChanged(new System.Collections.Specialized.NotifyCollectionChangedEventArgs(System.Collections.Specialized.NotifyCollectionChangedAction.Reset));
}
private void OnCollectionChanged(NotifyCollectionChangedEventArgs notifyCollectionChangedEventArgs)
{
//if (CollectionChanged != null)
//CollectionChanged(this, notifyCollectionChangedEventArgs);
}
private void OnPropertyChanged(PropertyChangedEventArgs propertyChangedEventArgs)
{
//if (PropertyChanged != null)
//PropertyChanged(this, propertyChangedEventArgs);
}
Delicios Copy & Pasta incoming 
Edit: I've found the Problem the CallbackDelegate is causing the Problem. Changed from: private delegate int EnumObjectsCallbackDelegate(ulong guid, int filter); to private delegate int EnumObjectsCallbackDelegate(int lowGuid, int hightGuid, int filter); and everything works now