> For the complete documentation index, see [llms.txt](https://janehacker1.gitbook.io/dsm-ecu/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://janehacker1.gitbook.io/dsm-ecu/disassembly-with-ghidra/sleigh-hints.md).

# SLEIGH Hints

Things that help with learning SLEIGH

1. Turn on `p-code` in Ghidra UI
   1. Click `Edit the listing fields` button in the upper right of the `Listings` window.&#x20;
      * (it looks like a stack of misaligned stacked white boxes with a single yellow box in the center and an arrow pointing up under the stack. Or fifth from the right starting from the listings window's 'X'\[close window])
      * ![](https://3794348124-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbMmcGjBEeIX30liMDB%2Fuploads%2Fr4VZqkUGCDHXtz9op0hw%2FScreen%20Shot%202021-12-16%20at%209.32.51%20AM.png?alt=media\&token=2e61463a-5025-4442-9a84-7259a24fc6a7)
   2. Right Click on `p-code` field
      * ![](https://3794348124-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbMmcGjBEeIX30liMDB%2Fuploads%2F88SXLokl0YZ5EKliXOXN%2FScreen%20Shot%202021-12-16%20at%209.33.33%20AM.png?alt=media\&token=295a62a8-1cb1-4a4e-9201-aae735f4875e)
   3. Click `Enable Field`
      * ![](https://3794348124-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbMmcGjBEeIX30liMDB%2Fuploads%2FoTh5YTP3PQVgb5ykzldb%2FScreen%20Shot%202021-12-16%20at%209.33.48%20AM.png?alt=media\&token=d83dde6f-d220-49c9-b516-a59485fc5826)
   4. Now you can see the `p-code` for each operation!
2. Bind the `ReloadSleighLangauge.java` script to a key to reload `.slaspec` changes
   1. `Window -> Script Manager`
   2. Filter on "`ReloadSleighLangauge`"
   3. Right Click and then Click `Assign Key Binding`
      * ![](https://3794348124-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MbMmcGjBEeIX30liMDB%2Fuploads%2F1C0bMcpk1O2dM22KsT34%2FScreen%20Shot%202021-12-16%20at%2010.00.24%20AM.png?alt=media\&token=5dca721d-921b-48ef-a560-34fea5ad84b3)
   4. Enter a key combination that you get to make up!
   5. Click `Ok`
3. Use the `ImportSymbolsScript.py`
   * Format: `<label> 0x<addr> l | f`
   * eg.&#x20;
     * `egVal 0x0125 l`
     * `codeStart 0xCEFF f`
   * `l` is normal label
   * `f` is function
