Comments (5)
I need more details. Add Harmony.DEBUG = true
at the start and run it once. Then post the resulting harmony.log.txt from your Desktop.
from harmony.
Harmony id=com.your.unique.id, version=2.3.3.0, location=C:\Users\KURO\Downloads\ConsoleApp1\ConsoleApp1\bin\Debug\net8.0\0Harmony.dll, env/clr=8.0.2, platform=Win32NT
Started from static System.Int32 Program::Main(System.String[] args), location C:\Users\KURO\Downloads\ConsoleApp1\ConsoleApp1\bin\Debug\net8.0\ConsoleApp1.dll
At 2024-05-21 09.34.51
Patch: static System.DateTime System.DateTime::get_UtcNow()
Replacement: static System.DateTime System.DateTime::System.DateTime.get_UtcNow_Patch1()
IL_0000: Local var 0: System.UInt64
IL_0000: Local var 1: System.UInt64
IL_0000: Local var 2:
IL_0000: Local var 3: System.DateTime/LeapSecondCache
IL_0000: Local var 4: System.UInt64
IL_0000: Local var 5: System.DateTime
IL_0000: ldloca 5 (System.DateTime)
IL_0004: initobj System.DateTime
IL_000A: // start original
IL_000A: ldsfld System.LeapSecondCache::s_pfnGetSystemTimeAsFileTime
IL_000F: stloc.2
IL_0010: ldloca.s 0 (System.UInt64)
IL_0012: conv.u
IL_0013: ldloc.2
IL_0014: calli System.Void modopt(System.Runtime.CompilerServices.CallConvSuppressGCTransition) (System.UInt64*)
IL_0019: ldloc.0
IL_001A: stloc.1
IL_001B: ldsfld System.Boolean System.LeapSecondCache::s_systemSupportsLeapSeconds
IL_0020: brfalse => Label0
IL_0025: ldsfld System.LeapSecondCache System.LeapSecondCache::s_leapSecondCache
IL_002A: stloc.3
IL_002B: ldloc.1
IL_002C: ldloc.3
IL_002D: ldfld System.UInt64 System.LeapSecondCache::OSFileTimeTicksAtStartOfValidityWindow
IL_0032: sub
IL_0033: stloc.s 4 (System.UInt64)
IL_0035: ldloc.s 4 (System.UInt64)
IL_0037: ldc.i4 -1294967296
IL_003C: conv.u8
IL_003D: bge.un => Label1
IL_0042: ldloc.3
IL_0043: ldfld System.UInt64 System.LeapSecondCache::DotnetDateDataAtStartOfValidityWindow
IL_0048: ldloc.s 4 (System.UInt64)
IL_004A: add
IL_004B: newobj System.Void System.DateTime::.ctor(System.UInt64 dateData)
IL_0050: br => Label2
IL_0055: Label1
IL_0055: call static System.DateTime System.DateTime::UpdateLeapSecondCacheAndReturnUtcNow()
IL_005A: br => Label3
IL_005F: Label0
IL_005F: ldloc.1
IL_0060: ldc.i8 5116597250427387904
IL_0069: add
IL_006A: newobj System.Void System.DateTime::.ctor(System.UInt64 dateData)
IL_006F: // end original
IL_006F: Label2
IL_006F: Label3
IL_006F: stloc 5 (System.DateTime)
IL_0073: ldloca 5 (System.DateTime)
IL_0077: call static System.Void Program::PostNow(System.DateTime& __result)
IL_007C: ldloc 5 (System.DateTime)
IL_0080: ret
DONE
here is harmony.log.txt
from harmony.
it seems var2's type not get.
cause utcNow is a unsafe function. #
from harmony.
If a type cannot be used it usually means that your runtime is missing a dependency. That utcnow is unsafe has nothing to do with your problem. Either way this is not a bug in Harmony.
from harmony.
thank u
from harmony.
Related Issues (20)
- When applying a patch fails, the replacement's IL is not printed to the debug log HOT 2
- System.Exception: Parameter "xx" not found in method HOT 10
- SymbolExtensions does not resolve overriden method HOT 3
- can lib work in arm64? HOT 2
- Companion project promotion: Harmony Tools HOT 3
- PatchFunctions.UpdateWrapper NotImplementedException on MacOS HOT 11
- How do i change valuetype HOT 1
- Harmony.Patch() is a bit slow. HOT 2
- 'CORINFO_METHOD_INFO' from assembly 'System.Text.Json, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. HOT 4
- IL Compile Error when using PrefixFactory to provide a non-static Prefix method (Mono)
- x86 platform makes patch fail
- return type only support void and bool? why doesn't string work HOT 1
- Could not load type 'CORINFO_METHOD_INFO' from assembly 'System.Text.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. HOT 6
- "ref" keyword not allowed for "__runOriginal" HOT 5
- HarmonyPatchAll do not work with multiple HarmonyPatch HOT 1
- Harmony AccessTools.MakeDeepCopy fails when target contains a constant or static readonly field HOT 1
- UNITY_INCLUDE_TESTS causes harmony to not be included
- Harmony Transpiler not getting any instructions in patch method HOT 3
- Compatibility with NugetForUnity HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from harmony.