Mmm, no.
We don't have much time to do modding, and can't set ourself any schedules, so it's done when it's done.
We don't have much time to do modding, and can't set ourself any schedules, so it's done when it's done.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuQuote from: 123nick on July 23, 2016, 07:41:54 AM
thanks, but can you update it again for A14? the mod author doesent seem too intend on updating it, for whatever reason.
Quote from: RawCode on July 22, 2016, 04:51:58 AM
magical binding flag is 60, (it just like 42 but 16 higher!), you can see it on 13th line from botton.
public static unsafe bool TryDetourFromTo(MethodInfo source, MethodInfo destination)
{
// keep track of detours and spit out some messaging
var sourceString = source.DeclaringType.FullName + "." + source.Name;
var destinationString = destination.DeclaringType.FullName + "." + destination.Name;
sourceMethods.Add(sourceString);
destMethods.Add(destinationString);
if (IntPtr.Size == sizeof (Int64))
{
// 64-bit systems use 64-bit absolute address and jumps
// 12 byte destructive
// Get function pointers
var Source_Base = source.MethodHandle.GetFunctionPointer().ToInt64();
var Destination_Base = destination.MethodHandle.GetFunctionPointer().ToInt64();
// Native source address
var Pointer_Raw_Source = (byte*) Source_Base;
// Pointer to insert jump address into native code
var Pointer_Raw_Address = (long*) (Pointer_Raw_Source + 0x02);
// Insert 64-bit absolute jump into native code (address in rax)
// mov rax, immediate64
// jmp [rax]
*(Pointer_Raw_Source + 0x00) = 0x48;
*(Pointer_Raw_Source + 0x01) = 0xB8;
*Pointer_Raw_Address = Destination_Base;
// ( Pointer_Raw_Source + 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09 )
*(Pointer_Raw_Source + 0x0A) = 0xFF;
*(Pointer_Raw_Source + 0x0B) = 0xE0;
}
else
{
// 32-bit systems use 32-bit relative offset and jump
// 5 byte destructive
// Get function pointers
var Source_Base = source.MethodHandle.GetFunctionPointer().ToInt32();
var Destination_Base = destination.MethodHandle.GetFunctionPointer().ToInt32();
// Native source address
var Pointer_Raw_Source = (byte*) Source_Base;
// Pointer to insert jump address into native code
var Pointer_Raw_Address = (int*) (Pointer_Raw_Source + 1);
// Jump offset (less instruction size)
var offset = Destination_Base - Source_Base - 5;
// Insert 32-bit relative jump into native code
*Pointer_Raw_Source = 0xE9;
*Pointer_Raw_Address = offset;
}
// done!
return true;
}
// added new def generators and removed redundant
var vanillaGenerateImpliedDefs_PreResolve = typeof(DefGenerator).GetMethod("GenerateImpliedDefs_PreResolve",
BindingFlags.Static | BindingFlags.Public);
var newGenerateImpliedDefs_PreResolve = typeof(RA_DefGenerator).GetMethod("GenerateImpliedDefs_PreResolve",
BindingFlags.Static | BindingFlags.Public);
TryDetourFromTo(vanillaGenerateImpliedDefs_PreResolve, newGenerateImpliedDefs_PreResolve);
Quote from: RoughPebble on June 24, 2016, 02:46:39 PM
Quick question: Do you plan on incorporating something like the EDB UI portraits for the colonists? I find it super helpful so I don't have to search all over the map for my colonists.