1. Hi Guys,
    i just wanted to ask if there is any tutorial for how to use OxidePatcher (i already set it up)

    It already lists the existing Hooks.
    Unbenannt.png

    But what now?

    What am i supposed to look for and and what i have to fill in to immigrate the new hook etc. etc. such an awesome tool but so many Questions o_O
     
  2. Wulf

    Wulf Community Admin

    From where you are now:
    1. Look at each flagged hook and fix the placement by adjusting the index (if you aren't familiar with where it's supposed to go, this may be challenging)
    2. To add a new hook, browse the assembly you want to hook (ie. Assembly-CSharp) and find a location where you want to hook
    3. After you find the exact location you want, click "Hook this Method", then adjust the index, arguments, etc in the new view
    4. It will likely take a good bit of experimenting if you aren't familiar with how IL patching works
     
  3. 1. Maybe you have link where to read about "Indexing" or maybe explain what that is?

    2. Can you maybe show up where for example you found existing Hooks?
    like: "OnPlayerConnected" maybe i can learn from realised examples :)
     
  4. Wulf

    Wulf Community Admin

    You can see the existing ones by looking in the Hooks section in the patcher. The index is the line number in the IL view where you want to inject the hook, which you'd want to pick a line right before the location you want to inject.
     
  5. Okay on that "Index of line number in the IL" i go on with google :)

    With example i mean: at some time your "OnPlayerConnected" didnt exist.. So you had to do the same with OxidePatcher or?

    Where in the Assembly-CSharp(on the left side) you found that?
     
  6. Wulf

    Wulf Community Admin

    I browsed/searched the Assembly-CSharp.dll with a .NET decompiler such as JustDecompile, then matched that up in the patcher.
     
  7. And what was the Name of the Method in the Assembly?
     
  8. Wulf

    Wulf Community Admin

    Check in the existing hook list, it shows all of that. ;)
     
  9. Okay okay through JustDecompile it is way much easier and understandable.

    But maaaaaaaybe if your nice to me ( :D) could you explain the Index.
    "Number of Line in the IL" <-- This Sentence
     
  10. Wulf

    Wulf Community Admin

    Look at the IL views when you add a hook, or in the existing hooks. You'll see line numbers there.
     
  11. Yeah but Line Number of what?

    The decompiled code and for what is "IL" the Shortword?
     
  12. Wulf

    Wulf Community Admin

    Browse through the patcher a bit, you'll see where I am referring to.
     
  13. I looked/searched/googled since your Post until now .

    I dont get what u mean with ne "Number of Line" of which line?
    and whats "IL"
     
  14. Wulf

    Wulf Community Admin

    See Common Intermediate Language - Wikipedia, the free encyclopedia.

    Line numbers are shown on each line when viewing a hook's code or IL views in the patcher.
     
  15. Thanks for the link.

    To the Line thing...
    Yeah i though about that too, but none of the existing Hooks-Index are matching with the Assembly Lines o:

    How that happened? Cause the hooks already exists cause of your work :/
     
  16. Wulf

    Wulf Community Admin

    You don't match them up, the index setting in the hook is set based on what line you want to set it to from the IL view. It looks like you opened the patcher with a pre-patched DLL though, which is why all of the existing hooks are flagged. You need to start with an unpatched DLL.
     
  17. Hello back :D

    i could not retrace what u did in your existing Oxide Mod.

    Look you pointing to Index(Line): 21 in Assembly-CSharp.dll at GameManager for "OnPlayerDisconnected"

    But when i use "JustDecompile" -> decompile "Assembly-CSharp.dll" -> GoTo "GameManager" -> Jump to Line 21
    and there is only my Tickrate??

    Im not sure if i already understood the Index :/

    Unbenannt.png
     
  18. Wulf

    Wulf Community Admin

    JustDecompile is just for finding and reviewing, you use the patcher for lining up the index. See the MSIL Before and MSIL After tabs for line numbers, those are what the index would be.
     
  19. Okay now i see what u mean with "IL Viewer" etc. ^^

    Sometimes you are picking "ret" (example: onPlayerDisconnected) and sometimes "IL_001a: starg.s clientName" (onPlayerConnected)

    My Questions:
    - What is the Difference
    - On which Location i have to inject? (On the Returning part of a method?)
     
  20. Wulf

    Wulf Community Admin

    I explained this part previously. The index is the location where you want to inject the code (the hook) after.

    If I knew the location of every hook you wanted to add, I might as well add them myself. ;)