Full Code of markdwags/Razor for AI

master d1c7b2404da9 cached
378 files
5.9 MB
1.6M tokens
5391 symbols
1 requests
Download .txt
Showing preview only (6,296K chars total). Download the full file or copy to clipboard to get everything.
Repository: markdwags/Razor
Branch: master
Commit: d1c7b2404da9
Files: 378
Total size: 5.9 MB

Directory structure:
gitextract_9zwc60cb/

├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   └── workflows/
│       ├── build-only.yml
│       ├── build-site.yml
│       └── build.yml
├── .gitignore
├── .gitmodules
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Crypt/
│   ├── Crypt.cpp
│   ├── Crypt.def
│   ├── Crypt.h
│   ├── Crypt.rc
│   ├── Crypt.vcxproj
│   ├── Crypt.vcxproj.filters
│   ├── LoginEncryption.cpp
│   ├── LoginEncryption.h
│   ├── MemFinder.cpp
│   ├── MemFinder.h
│   ├── OSIEncryption.cpp
│   ├── OSIEncryption.h
│   ├── OldStatusBar.cpp
│   ├── PacketInfo.cpp
│   ├── PacketInfo.h
│   ├── UOArt.cpp
│   ├── debug.h
│   ├── platform.h
│   ├── resource.h
│   ├── stdafx.cpp
│   ├── stdafx.h
│   ├── table.h
│   ├── trees.cpp
│   ├── twofish.c
│   ├── twofish.h
│   ├── uo_huffman.cpp
│   └── uo_huffman.h
├── FastColoredTextBox/
│   ├── AutocompleteItem.cs
│   ├── AutocompleteMenu.cs
│   ├── Bookmarks.cs
│   ├── Char.cs
│   ├── CommandManager.cs
│   ├── Commands.cs
│   ├── DocumentMap.cs
│   ├── EncodingDetector.cs
│   ├── ExportToHTML.cs
│   ├── ExportToRTF.cs
│   ├── FCTB_key.snk
│   ├── FastColoredTextBox.cs
│   ├── FastColoredTextBox.csproj
│   ├── FastColoredTextBox.resx
│   ├── FastColoredTextBox.xml
│   ├── FileTextSource.cs
│   ├── FindForm.Designer.cs
│   ├── FindForm.cs
│   ├── FindForm.resx
│   ├── GoToForm.Designer.cs
│   ├── GoToForm.cs
│   ├── GoToForm.resx
│   ├── Hints.cs
│   ├── Hotkeys.cs
│   ├── HotkeysEditorForm.Designer.cs
│   ├── HotkeysEditorForm.cs
│   ├── HotkeysEditorForm.resx
│   ├── LimitedStack.cs
│   ├── Line.cs
│   ├── LinesAccessor.cs
│   ├── MacrosManager.cs
│   ├── NativeMethods.cs
│   ├── Place.cs
│   ├── PlatformType.cs
│   ├── Properties/
│   │   └── AssemblyInfo.cs
│   ├── Range.cs
│   ├── ReplaceForm.Designer.cs
│   ├── ReplaceForm.cs
│   ├── ReplaceForm.resx
│   ├── Ruler.Designer.cs
│   ├── Ruler.cs
│   ├── Style.cs
│   ├── SyntaxDescriptor.cs
│   ├── SyntaxHighlighter.cs
│   ├── TextSource.cs
│   ├── TypeDescriptor.cs
│   ├── UnfocusablePanel.cs
│   └── VisualMarker.cs
├── INSTALL.md
├── LICENSE.md
├── Loader/
│   ├── Loader.cpp
│   ├── Loader.def
│   ├── Loader.h
│   ├── Loader.rc
│   ├── Loader.vcxproj
│   ├── Loader.vcxproj.filters
│   ├── resource.h
│   ├── stdafx.cpp
│   └── stdafx.h
├── Notepad++UDL.xml
├── Platform/
│   ├── Platform.cpp
│   ├── Platform.def
│   ├── Platform.h
│   ├── Platform.vcxproj
│   └── Platform.vcxproj.filters
├── README.md
├── Razor/
│   ├── Agents/
│   │   ├── Agents.cs
│   │   ├── BuyAgent.cs
│   │   ├── IgnoreAgent.cs
│   │   ├── OrganizerAgent.cs
│   │   ├── RestockAgent.cs
│   │   ├── ScavengerAgent.cs
│   │   ├── SearchExemptionAgent.cs
│   │   ├── SellAgent.cs
│   │   └── UseOnceAgent.cs
│   ├── Boat/
│   │   ├── BoatWindow.Designer.cs
│   │   ├── BoatWindow.cs
│   │   └── BoatWindow.resx
│   ├── Client/
│   │   ├── ClassicUO.cs
│   │   ├── Client.cs
│   │   ├── OSI.cs
│   │   └── UOAssist.cs
│   ├── Core/
│   │   ├── ActionQueue.cs
│   │   ├── BandageTimer.cs
│   │   ├── BodCapture.cs
│   │   ├── BuffDebuffManager.cs
│   │   ├── ClassicUOManager.cs
│   │   ├── Commands.cs
│   │   ├── ContainerLabels.cs
│   │   ├── CooldownManager.cs
│   │   ├── Counters.cs
│   │   ├── DamageTracker.cs
│   │   ├── Dress.cs
│   │   ├── DressList.cs
│   │   ├── EncodedSpeech.cs
│   │   ├── FriendsManager.cs
│   │   ├── GateTimer.cs
│   │   ├── Geometry.cs
│   │   ├── GoldPerHourTimer.cs
│   │   ├── Item.cs
│   │   ├── ItemID.cs
│   │   ├── Main.cs
│   │   ├── Map.cs
│   │   ├── MemHelper.cs
│   │   ├── MessageInBottleCapture.cs
│   │   ├── MessageManager.cs
│   │   ├── Mobile.cs
│   │   ├── MsgQueue.cs
│   │   ├── ObjectPropertyList.cs
│   │   ├── OverheadManager.cs
│   │   ├── Overrides.cs
│   │   ├── PasswordMemory.cs
│   │   ├── Ping.cs
│   │   ├── Player.cs
│   │   ├── ScreenCapture.cs
│   │   ├── Serial.cs
│   │   ├── SkillTimer.cs
│   │   ├── Spells.cs
│   │   ├── StaffToolsManager.cs
│   │   ├── StealthSteps.cs
│   │   ├── SystemMessages.cs
│   │   ├── Targeting.cs
│   │   ├── TargetingClosest.cs
│   │   ├── TargetingNextPrevious.cs
│   │   ├── TargetingRandom.cs
│   │   ├── TextFilterManager.cs
│   │   ├── Timer.cs
│   │   ├── UOEntity.cs
│   │   ├── Utility.cs
│   │   ├── WaypointManager.cs
│   │   ├── World.cs
│   │   └── ZLib.cs
│   ├── Filters/
│   │   ├── Death.cs
│   │   ├── Filter.cs
│   │   ├── Light.cs
│   │   ├── MessageFilter.cs
│   │   ├── MobileFilter.cs
│   │   ├── SoundFilters.cs
│   │   ├── SoundMusicManager.cs
│   │   ├── StaffItems.cs
│   │   ├── TargetFilterManager.cs
│   │   ├── VetRewardGump.cs
│   │   ├── WallStaticFilter.cs
│   │   └── Weather.cs
│   ├── Gumps/
│   │   ├── Gump.cs
│   │   ├── GumpButtonType.cs
│   │   ├── GumpCollection.cs
│   │   ├── GumpElement.cs
│   │   ├── GumpPage.cs
│   │   ├── GumpType.cs
│   │   └── Internal/
│   │       ├── AgentsGump.cs
│   │       ├── BoatControlGump.cs
│   │       ├── BuffGump.cs
│   │       ├── CooldownGump.cs
│   │       ├── DamageTrackerGump.cs
│   │       ├── DamageTrackerListGump.cs
│   │       ├── HotKeyGump.cs
│   │       ├── InputDialogGump.cs
│   │       ├── ItemInfoGump.cs
│   │       ├── MobileInfoGump.cs
│   │       ├── SystemMessagesGump.cs
│   │       └── TestMessageGump.cs
│   ├── HotKeys/
│   │   ├── Counters.cs
│   │   ├── HotKeys.cs
│   │   ├── Misc.cs
│   │   ├── SkillHotKeys.cs
│   │   ├── SpecialMoves.cs
│   │   └── Undress.cs
│   ├── Macros/
│   │   ├── Actions.cs
│   │   ├── Actions.resx
│   │   ├── Macro.cs
│   │   ├── MacroManager.cs
│   │   └── MacroVariables.cs
│   ├── Map/
│   │   ├── MapWindow.cs
│   │   ├── MapWindow.resx
│   │   ├── Region.cs
│   │   ├── UOMapControl.cs
│   │   ├── UOMapControl.resx
│   │   └── UOMapRuneButton.cs
│   ├── Network/
│   │   ├── Handlers.cs
│   │   ├── Loader.cs
│   │   ├── Packet.cs
│   │   ├── PacketHandler.cs
│   │   ├── PacketTable.cs
│   │   ├── PacketWriter.cs
│   │   └── Packets.cs
│   ├── Platform.cs
│   ├── Properties/
│   │   ├── AssemblyInfo.cs
│   │   ├── Resources.Designer.cs
│   │   └── Resources.resx
│   ├── Razor.csproj
│   ├── Razor.manifest
│   ├── Scripts/
│   │   ├── AgentCommands.cs
│   │   ├── Aliases.cs
│   │   ├── Commands.cs
│   │   ├── Engine/
│   │   │   ├── Interpreter.cs
│   │   │   ├── Lexer.cs
│   │   │   └── TextParser.cs
│   │   ├── Expressions.cs
│   │   ├── Helpers/
│   │   │   └── CommandHelper.cs
│   │   ├── RazorScript.cs
│   │   ├── ScriptManager.cs
│   │   ├── ScriptVariables.cs
│   │   ├── SpeechCommands.cs
│   │   └── TargetCommands.cs
│   ├── UI/
│   │   ├── AddCounter.cs
│   │   ├── AddCounter.resx
│   │   ├── ArtViewer.Designer.cs
│   │   ├── ArtViewer.cs
│   │   ├── BuffDebuffOptions.Designer.cs
│   │   ├── BuffDebuffOptions.cs
│   │   ├── BuffDebuffOptions.resx
│   │   ├── Config.cs
│   │   ├── ContainerLabels.Designer.cs
│   │   ├── ContainerLabels.cs
│   │   ├── ContainerLabels.resx
│   │   ├── Ext.cs
│   │   ├── HueEntry.cs
│   │   ├── HueEntry.resx
│   │   ├── InputBox.cs
│   │   ├── InputBox.resx
│   │   ├── InputDropdown.cs
│   │   ├── InputDropdown.resx
│   │   ├── Languages.cs
│   │   ├── MacroInsertDoWhile.cs
│   │   ├── MacroInsertDoWhile.resx
│   │   ├── MacroInsertIf.cs
│   │   ├── MacroInsertIf.resx
│   │   ├── MacroInsertWait.cs
│   │   ├── MacroInsertWait.resx
│   │   ├── MacroInsertWhile.cs
│   │   ├── MacroInsertWhile.resx
│   │   ├── MessageDialog.cs
│   │   ├── MessageDialog.resx
│   │   ├── Razor.Designer.cs
│   │   ├── Razor.cs
│   │   ├── Razor.resx
│   │   ├── SoundEntry.cs
│   │   ├── SoundEntry.resx
│   │   ├── SplashScreen.cs
│   │   ├── SplashScreen.resx
│   │   ├── WelcomeForm.cs
│   │   └── WelcomeForm.resx
│   ├── UltimaSDK/
│   │   ├── ASCIIFont.cs
│   │   ├── AnimationEdit.cs
│   │   ├── Animations.cs
│   │   ├── Animdata.cs
│   │   ├── Art.cs
│   │   ├── BwtDecompress.cs
│   │   ├── CalibrationInfo.cs
│   │   ├── Client.cs
│   │   ├── ClientHandles.cs
│   │   ├── FileIndex.cs
│   │   ├── Files.cs
│   │   ├── Gumps.cs
│   │   ├── Hues.cs
│   │   ├── Light.cs
│   │   ├── LocationPointer.cs
│   │   ├── Map.cs
│   │   ├── MultiMap.cs
│   │   ├── Multis.cs
│   │   ├── NativeMethods.cs
│   │   ├── ProcessStream.cs
│   │   ├── RadarCol.cs
│   │   ├── SkillGroups.cs
│   │   ├── Skills.cs
│   │   ├── Sound.cs
│   │   ├── SpeechList.cs
│   │   ├── StackDataReader.cs
│   │   ├── StringEntry.cs
│   │   ├── StringHelper.cs
│   │   ├── StringList.cs
│   │   ├── Textures.cs
│   │   ├── TileData.cs
│   │   ├── TileList.cs
│   │   ├── TileMatrix.cs
│   │   ├── TileMatrixPatch.cs
│   │   ├── UnicodeFont.cs
│   │   ├── ValueStringBuilder.cs
│   │   ├── Verdata.cs
│   │   └── WindowProcessStream.cs
│   ├── app.config
│   └── packages.config
├── Razor.sln
├── etc/
│   ├── Language/
│   │   ├── Razor_lang.CHS
│   │   ├── Razor_lang.PTB
│   │   ├── Razor_lang.bg
│   │   ├── Razor_lang.cht
│   │   ├── Razor_lang.deu
│   │   ├── Razor_lang.enu
│   │   ├── Razor_lang.esp
│   │   ├── Razor_lang.ita
│   │   ├── Razor_lang.pl
│   │   ├── Razor_lang.rus
│   │   ├── Razor_lang.swe
│   │   └── Razor_lang.tur
│   ├── Razor.nsi
│   ├── animdata.csv
│   ├── counters.xml
│   ├── doors.xml
│   ├── dotNet.nsh
│   ├── guardlines.def
│   ├── items.xml
│   ├── license.txt
│   ├── overrides.def
│   ├── spells.def
│   └── uorguardlines.def
└── help/
    ├── docs/
    │   ├── download.md
    │   ├── faq.md
    │   ├── guide/
    │   │   ├── commands.md
    │   │   ├── comments.md
    │   │   ├── expressions.md
    │   │   ├── index.md
    │   │   ├── keywords.md
    │   │   ├── layers.md
    │   │   └── variables.md
    │   ├── help/
    │   │   ├── advanced.md
    │   │   ├── agents.md
    │   │   ├── armdress.md
    │   │   ├── displaycounters.md
    │   │   ├── filters.md
    │   │   ├── friends.md
    │   │   ├── general.md
    │   │   ├── hotkeys.md
    │   │   ├── index.md
    │   │   ├── macros.md
    │   │   ├── options.md
    │   │   ├── screenshots.md
    │   │   ├── scripts.md
    │   │   └── skills.md
    │   ├── history.md
    │   ├── index.md
    │   ├── install/
    │   │   ├── linux.md
    │   │   └── windows.md
    │   ├── releasenotes.md
    │   ├── stylesheets/
    │   │   └── extra.css
    │   └── uoaapi.md
    ├── mkdocs.yml
    ├── overrides/
    │   └── main.html
    ├── pygments.lexers.razor
    ├── pygments.mapping.razor
    └── pygments.styles.razor

================================================
FILE CONTENTS
================================================

================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: Bug report
about: Create a report to help Razor improve
title: "[BUG]"
labels: bug
assignees: ''

---

**Please include if you are using the standard OSI client or using ClassicUO.**

Remember, **Great Bug Reports** tend to have:

- A quick summary and/or background of the issue
- Steps to reproduce
  - Be specific! This can be challenging at times in a game like UO, but the more specific you are, the easier it is to fix
  - Include screenshots, gifs, videos if possible. Free apps like ShareX and Greenshot make it easy.
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)


================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: Feature request
about: Suggest an idea for Razor
title: "[FEATURE]"
labels: enhancement
assignees: ''

---

All feature requests will be considered, but not all will be implemented but please don't let that discourage you from submitting more.

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.


================================================
FILE: .github/workflows/build-only.yml
================================================
name: Build Only

on:
  pull_request:
    branches:
      - master
    paths-ignore:
      - 'help/**'
      - '**/build-site.yml'     

jobs:

  build:

    strategy:
      matrix:
        configuration: [Release]

    runs-on: windows-2022

    env:
      Solution_Name: Razor.sln       

    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        fetch-depth: 0
    
    - name: Install .NET
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 6.0.x

    - name: Setup MSBuild.exe
      uses: microsoft/setup-msbuild@v1.1

    - name: Restore Razor
      run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
      env:
        Configuration: ${{ matrix.configuration }}

    - name: Build Razor
      run: msbuild $env:Solution_Name /t:Build /p:Configuration=$env:Configuration
      env:
        Configuration: ${{ matrix.configuration }}




================================================
FILE: .github/workflows/build-site.yml
================================================
name: Build Site

on:
  push:
    branches:
      - master
    paths:
    - 'help/**'
    - '**/build-site.yml'
  pull_request:
    branches:
      - master
    paths:
    - 'help/**'
    - '**/build-site.yml'

jobs:
  build:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: ./help
    strategy:
      matrix:
        python-version: [3.10.9]
    
    steps:
      - uses: actions/checkout@v3
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v4
        with:
          python-version: ${{ matrix.python-version }}
          
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install mkdocs
          pip install mkdocs-material                    
          pip install mkdocs-git-revision-date-localized-plugin
          pip install pillow
          pip install cairosvg 
          sudo apt-get install -y libcairo2-dev libfreetype6-dev libffi-dev libjpeg-dev libpng-dev libz-dev
      
      - name: Install and modify Pygments
        run: |

          git clone https://github.com/pygments/pygments.git
          
          # Replace with Razor files
          rm ./pygments/pygments/lexers/_mapping.py
          cp pygments.mapping.razor ./pygments/pygments/lexers/_mapping.py
          
          cp pygments.lexers.razor ./pygments/pygments/lexers/razor.py          
          cp pygments.styles.razor ./pygments/pygments/styles/razor.py

          pip install -e ./pygments/          

      # Runs a single command using the runners shell
      - name: Build site
        run: mkdocs build

      - name: Generate robots.txt
        run: |
          cat > ./site/robots.txt <<EOF
          User-agent: *
          Allow: /

          Sitemap: https://www.razorce.com/sitemap.xml
          EOF          

      # Setup AWS
      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v1
        with:
          aws-access-key-id: ${{ secrets.AWS_ACCESS_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_KEY }}
          aws-region: us-east-1

      - name: Deploy static site to S3 bucket
        run: aws s3 sync ./site s3://www.razorce.com

      # Invalidate the distributons
      - name: Create CloudFront Invalidation
        run: |
          aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_A }} --paths "/*" 
          aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_B }} --paths "/*" 

================================================
FILE: .github/workflows/build.yml
================================================
name: Build Dev Preview

on:
  push:
    branches:
      - master
    paths-ignore:
      - 'help/**'
      - '**/build-site.yml'

jobs:

  build:

    strategy:
      matrix:
        configuration: [Release]

    runs-on: windows-2022

    env:
      Solution_Name: Razor.sln       

    steps:
    - name: Checkout
      uses: actions/checkout@v2
      with:
        fetch-depth: 0
    
    - name: Install .NET
      uses: actions/setup-dotnet@v1
      with:
        dotnet-version: 6.0.x

    - name: Setup MSBuild.exe
      uses: microsoft/setup-msbuild@v1.1

    - name: Restore Razor
      run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
      env:
        Configuration: ${{ matrix.configuration }}
        
    - name: Set AssemblyInfo
      uses: dannevesdantas/set-version-assemblyinfo@v.1.0.0
      with:                     
        version: '1.10.${{ github.run_number }}.0'

    - name: Build Razor (x86)
      run: msbuild $env:Solution_Name /t:Build /p:Configuration=$env:Configuration /p:Platform="Any CPU"
      env:
        Configuration: ${{ matrix.configuration }}

    - name: Build Razor (x64)
      run: msbuild $env:Solution_Name /t:Build /p:Configuration=$env:Configuration /p:Platform=x64
      env:
        Configuration: ${{ matrix.configuration }}

    - name: Archive Razor x86 build artifacts      
      run: |
        cd bin/Win32/Release/
        7z a -tzip "Razor-dev-x86-preview.zip" "*"

    - name: Archive Razor x64 build artifacts      
      run: |
        cd bin/x64/Release/
        7z a -tzip "Razor-dev-x64-preview.zip" "*"

    - name: Delete Dev Release
      uses: dev-drprasad/delete-tag-and-release@v0.2.1
      with:
        delete_release: true
        tag_name: Razor-dev-preview
        github_token: ${{ secrets.GITHUB_TOKEN }}
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

    - name: Create Dev Release
      uses: ncipollo/release-action@v1
      with:
        name: "Razor Dev Preview"
        body: "This is built automatically after each commit to master, so it may contain bugs and/or unfinished features but is generally considered stable. Use at your own risk."
        artifacts: "bin/Win32/Release/Razor-dev-x86-preview.zip,bin/x64/Release/Razor-dev-x64-preview.zip"          
        prerelease: true
        tag: Razor-dev-preview
        token: ${{ secrets.GITHUB_TOKEN }}



================================================
FILE: .gitignore
================================================
# Visual Studio
*.vs
*.vscode
*.vcxproj.user
*.csproj.user
.vscode
packages/

# Rider
.idea

# Build Output
[Dd]ebug/
[Rr]elease/
/Crypt.quick
/wiki-github.txt
/Razor.sln.DotSettings.user
/Razor.sln.DotSettings
CSharpGuidelines.Layer.DotSettings
/help/site
/help/pygments
.cache


================================================
FILE: .gitmodules
================================================
[submodule "ScriptEngine/Steam"]
	path = ScriptEngine/Steam
	url = https://github.com/jaedan/steam-engine


================================================
FILE: CODE_OF_CONDUCT.md
================================================
## Code of Conduct

### Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.

### Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the project and community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
  address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
  professional setting

### Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

### Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

### Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

### Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

================================================
FILE: CONTRIBUTING.md
================================================
# Contributing

We want to make contributing to this project as easy and transparent as possible, whether it's:

- Reporting a bug
- Discussing the current state of the code
- Submitting a fix
- Proposing new features
- Testing the compiled version

When contributing to this repository, either through a bug report or a pull request, please first discuss the change or bug via Discord or any other method with the owners of this repository.

[![Chat on Discord status](https://img.shields.io/discord/458277173208547350.svg?logo=discord)](https://discord.gg/VdyCpjQ)

Please note we have a [code of conduct](CODE_OF_CONDUCT.md), please follow it in all your interactions with this project.

### Pull Request Process

1. Fork the repo and create your own branch from master
2. Make your code changes. If you plan on adding multiple changes, please create commits for each change instead of one commit with all the changes.
3. Create a pull request based on your branch

The pull request will be reviewed, tested and a decision to merge or not will be made.

### Your Contributions

When you submit code changes, your submissions are understood to be under the same [GPLv3](LICENSE) that covers the project.

================================================
FILE: Crypt/Crypt.cpp
================================================
#include "stdafx.h"
#include "Crypt.h"
#include "uo_huffman.h"
#include "PacketInfo.h"
#include "OSIEncryption.h"
#include "LoginEncryption.h"
#include "MemFinder.h"

//*************************************************************************************
//**************************************Variables**************************************
//*************************************************************************************
HHOOK hWndProcRetHook = NULL;
HHOOK hGetMsgHook = NULL;
HWND hUOWindow = NULL;
HWND hRazorWnd = NULL;
HWND hMapWnd = NULL;
DWORD UOProcId = 0;

HANDLE hFileMap = NULL;
HMODULE hInstance = NULL;
SOCKET CurrentConnection = 0;

HANDLE CommMutex = NULL;

char *tempBuff = NULL;

SharedMemory *pShared = NULL;

LARGE_INTEGER PerfFreq, Counter;

HWND hUOAWnd = NULL;

SIZE DesiredSize = {800,600};

unsigned long OldRecv, OldSend, OldConnect, OldCloseSocket, OldSelect, OldCreateFileA;
unsigned long RecvAddress, SendAddress, ConnectAddress, CloseSocketAddress, SelectAddress, CreateFileAAddress;

bool Seeded = false;
bool FirstRecv = true;
bool FirstSend = true;
bool LoginServer = false;
bool Active = true;
bool SmartCPU = false;
bool ServerNegotiated = false;
bool InGame = false;
bool CopyFailed = true;
bool Forwarding = false;
bool Forwarded = false;
bool ClientEncrypted = false;
bool ServerEncrypted = false;

enum CLIENT_TYPE { TWOD = 1, THREED = 2 };
CLIENT_TYPE ClientType = TWOD;

//**************************************OSI Only Stuff*********************************
DWORD CryptSeed = 0x7f000001;
OSIEncryption *ClientCrypt = NULL;
OSIEncryption *ServerCrypt = NULL;
LoginEncryption *ClientLogin = NULL;
LoginEncryption *ServerLogin = NULL;
//*************************************************************************************

//*************************************************************************************
//**************************************Functions**************************************
//*************************************************************************************
LRESULT CALLBACK WndProcRetHookFunc( int, WPARAM, LPARAM );
LRESULT CALLBACK GetMsgHookFunc( int, WPARAM, LPARAM );

bool HookFunction( const char *, const char *, int, unsigned long, unsigned long *, unsigned long * );
void FlushSendData();

bool CreateSharedMemory();
void CloseSharedMemory();

//Hooks:
int HookRecv( SOCKET, char *, int, int );
int HookSend( SOCKET, char *, int, int );
int HookConnect( SOCKET, const sockaddr *, int );
int HookCloseSocket( SOCKET );
int HookSelect( int, fd_set*, fd_set*, fd_set*, const struct timeval * );

typedef int (*NetIOFunc)(SOCKET, char *, int, int);
typedef int (*ConnFunc)(SOCKET, const sockaddr *, int);
typedef int (*CLSFunc)(SOCKET);
typedef int (*SelectFunc)( int, fd_set*, fd_set*, fd_set*, const struct timeval* );
typedef HANDLE (*CreateFileAFunc)(LPCTSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE);
typedef char *(__cdecl *GetUOVersionFunc)();

GetUOVersionFunc NativeGetUOVersion = NULL;

BOOL APIENTRY DllMain( HANDLE hModule, DWORD dwReason, LPVOID )
{
	DWORD postID, thisID;

	hInstance = (HMODULE)hModule;
	switch (dwReason)
	{
	case DLL_PROCESS_ATTACH:
		DisableThreadLibraryCalls( hInstance );
		QueryPerformanceFrequency( &PerfFreq );
		QueryPerformanceCounter( &Counter );
		break;

	case DLL_PROCESS_DETACH:
		postID = 0;
		thisID = GetCurrentProcessId();
		if ( IsWindow( hRazorWnd ) )
			GetWindowThreadProcessId( hRazorWnd, &postID );

		if ( thisID == postID || thisID == UOProcId )
		{
			if ( IsWindow( hRazorWnd ) )
				PostMessage( hRazorWnd, WM_UONETEVENT, CLOSE, 0 );

			if ( IsWindow( hUOWindow ) )
			{
				PostMessage( hUOWindow, WM_QUIT, 0, 0 );
				SetForegroundWindow( hUOWindow );
				SetFocus( hUOWindow );
			}

			CloseSharedMemory();
		}
		break;

	case DLL_THREAD_ATTACH:
	case DLL_THREAD_DETACH:
		break;
	}

	return TRUE;
}

DLLFUNCTION void *GetSharedAddress()
{
	Log( "Get shared address [0x%x]", pShared );
	return pShared;
}

DLLFUNCTION HWND FindUOWindow( void )
{
	if ( hUOWindow == NULL || !IsWindow(hUOWindow) )
	{
		HWND hWnd = FindWindow( "Ultima Online", NULL );
		if (hWnd == NULL)
			hWnd = FindWindow( "Ultima Online Third Dawn", NULL );
		return hWnd;
	}
	else
	{
		return hUOWindow;
	}
}

DLLFUNCTION void SetDataPath( const char *path )
{
	WaitForSingleObject( CommMutex, INFINITE );
	strncpy( pShared->DataPath, path, MAX_PATH);
	ReleaseMutex( CommMutex );
}

DLLFUNCTION int InstallLibrary( HWND PostWindow, DWORD pid, int flags )
{
	DWORD UOTId = 0;

	Log( "Initialize library..." );

	HWND hWnd = NULL;
	if ( pid != 0 )
	{
		hWnd = FindWindow( "Ultima Online", NULL );
		while ( hWnd != NULL )
		{
			UOTId = GetWindowThreadProcessId( hWnd, &UOProcId );
			if ( UOProcId == pid )
				break;
			hWnd = FindWindowEx( NULL, hWnd, "Ultima Online", NULL );
		}

		if ( UOProcId != pid || hWnd == NULL )
		{
			hWnd = FindWindow( "Ultima Online Third Dawn", NULL );
			while ( hWnd != NULL )
			{
				UOTId = GetWindowThreadProcessId( hWnd, &UOProcId );
				if (UOProcId == pid)
					break;
				hWnd = FindWindowEx( NULL, hWnd, "Ultima Online Third Dawn", NULL );
			}
		}

		if ( UOProcId != pid )
			return NO_TID;
	}
	else
	{
		hWnd = FindUOWindow();
		if ( hWnd != NULL )
			UOTId = GetWindowThreadProcessId( hWnd, &UOProcId );
	}

	hUOWindow = hWnd;
	hRazorWnd = PostWindow;

	if ( hUOWindow == NULL )
		return NO_UOWND;

	if ( !UOTId || !UOProcId )
		return NO_TID;

	if ( !CreateSharedMemory() )
		return NO_SHAREMEM;

	pShared->Reserved0 = false;

	hWndProcRetHook = SetWindowsHookEx( WH_CALLWNDPROCRET, WndProcRetHookFunc, hInstance, UOTId );
	if ( !hWndProcRetHook )
		return NO_HOOK;

	hGetMsgHook = SetWindowsHookEx( WH_GETMESSAGE, GetMsgHookFunc, hInstance, UOTId );
	if ( !hGetMsgHook )
		return NO_HOOK;

	WNDCLASS wc;
	wc.style = 0;
	wc.lpfnWndProc = (WNDPROC)UOAWndProc;
	wc.cbClsExtra = 0;
	wc.cbWndExtra = 0;
	wc.hInstance = hInstance;
	wc.hIcon = LoadIcon(NULL, IDI_WINLOGO);
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.hbrBackground = NULL;
	wc.lpszMenuName = NULL;
	wc.lpszClassName = "UOASSIST-TP-MSG-WND";
	RegisterClass(&wc);
	DWORD error = GetLastError();

	hUOAWnd = CreateWindow("UOASSIST-TP-MSG-WND", "UOASSIST-TP-MSG-WND", WS_OVERLAPPEDWINDOW, 0, 0, 50, 50, NULL, NULL, hInstance, 0);
	if (hUOAWnd)
		ShowWindow(hUOAWnd, FALSE);

	ServerEncrypted = (flags&0x10) != 0;
	ClientEncrypted = (flags&0x08) != 0;

	PostMessage( hUOWindow, WM_PROCREADY, (WPARAM)flags, (LPARAM)hRazorWnd );
	return SUCCESS;
}

DLLFUNCTION void WaitForWindow( DWORD pid )
{
	DWORD UOTId = 0;
	DWORD exitCode;
	HANDLE hProc = OpenProcess( PROCESS_QUERY_INFORMATION, FALSE, pid );

	UOProcId = 0;

	do
	{
		Sleep( 10 );
		HWND hWnd = FindWindow( "Ultima Online", NULL );
		while ( hWnd != NULL )
		{
			UOTId = GetWindowThreadProcessId( hWnd, &UOProcId );
			if ( UOProcId == pid )
				break;
			hWnd = FindWindowEx( NULL, hWnd, "Ultima Online", NULL );
		}

		if ( UOProcId != pid || hWnd == NULL )
		{
			hWnd = FindWindow( "Ultima Online Third Dawn", NULL );
			while ( hWnd != NULL )
			{
				UOTId = GetWindowThreadProcessId( hWnd, &UOProcId );
				if (UOProcId == pid)
					break;
				hWnd = FindWindowEx( NULL, hWnd, "Ultima Online Third Dawn", NULL );
			}
		}

		GetExitCodeProcess( hProc, &exitCode );
	} while ( UOProcId != pid && exitCode == STILL_ACTIVE );

	CloseHandle( hProc );
}

DLLFUNCTION void Shutdown( bool close )
{
	Log( "Shutdown" );

	if (hUOAWnd && IsWindow(hUOAWnd))
	{
		UnregisterClass("UOASSIST-TP-MSG-WND", hInstance);
		SendMessage(hUOAWnd, WM_CLOSE, 0, 0);
		hUOAWnd = NULL;
	}

	if ( hUOWindow && IsWindow( hUOWindow ) )
		PostMessage( hUOWindow, WM_QUIT, 0, 0 );
}

DLLFUNCTION int GetUOProcId()
{
	return UOProcId;
}

DLLFUNCTION HANDLE GetCommMutex()
{
	return CommMutex;
}

// totalsend and totalrecv are NOT mutex sync'd
DLLFUNCTION unsigned int TotalOut()
{
	if ( pShared )
		return pShared->TotalSend;
	else
		return 0;
}

DLLFUNCTION unsigned int TotalIn()
{
	if ( pShared )
		return pShared->TotalRecv;
	else
		return 0;
}

DLLFUNCTION void CalibratePosition( uint16_t x, uint16_t y, uint16_t z )
{
	Position pos;
	COPYDATASTRUCT copydata;

	pos.x = x;
	pos.y = y;
	pos.z = z;

	copydata.dwData = (ULONG_PTR)UONET_MESSAGE_COPYDATA::POSITION;
	copydata.cbData = sizeof(pos);
	copydata.lpData = &pos;

	SendMessage(hUOWindow, WM_COPYDATA, (WPARAM)hRazorWnd, (LPARAM)&copydata);
}

/* These variables are used in the UO client process address space */

/* 7.0.15.1 Client, Modified for Outlands
   Located at 0x00A72BD8 */
#pragma pack(1)
struct PositionOutlands {
	uint16_t x;
	uint16_t y;
	uint16_t z;
};
static_assert(sizeof(struct PositionOutlands) == 6, "Incorrect size\n");

/* 5.0.8.3 Client, UO Renaissance
   Located at address 0x007D7C58 */
#pragma pack(1)
struct PositionUOR {
	uint32_t z;
	uint32_t y;
	uint32_t x;
};
static_assert(sizeof(struct PositionUOR) == 12, "Incorrect size\n");
// UOR client this is at 0x007D7C60 (x is)

// Fall back search. Not always reliable.
#pragma pack(1)
struct PositionGeneric {
	uint32_t z;
	uint32_t y;
	uint32_t x;
};
static_assert(sizeof(struct PositionGeneric) == 12, "Incorrect size\n");

Position g_TestPosition = {};
Position g_LastPosition = {};
void *g_ClientMem = nullptr;

static void CheckPosition()
{
	if (g_ClientMem == nullptr) {
		if (strncmp(pShared->UOVersion, "5.0.8.3", sizeof(pShared->UOVersion)) == 0) {
			/* On UOR, we know exactly where the position is. */
			g_ClientMem = (void *)(0x007D7C60);
		}
		else if (strncmp(pShared->UOVersion, "7.0.15.1", sizeof(pShared->UOVersion)) == 0) {
			/* Similarly on Outlands, we know where the position is. */
			g_ClientMem = (void *)(0x00A72BD8);
		} else {
			/* Scan the region of memory in the client known to hold the player's position */
			for (uintptr_t addr = 0x00500000; addr < 0x00C00000; addr += 2)
			{
				if (IsBadReadPtr((void*)addr, sizeof(PositionGeneric))) {
					break;
				}

				PositionGeneric* mem = (PositionGeneric*)addr;

				if (mem->x == g_TestPosition.x && mem->y == g_TestPosition.y && mem->z == g_TestPosition.z) {
					g_ClientMem = mem;
					break;
				}
			}
		}
	}

	if (g_ClientMem != nullptr) {
		Position pos;
		if (strncmp(pShared->UOVersion, "5.0.8.3", sizeof(pShared->UOVersion)) == 0) {
			PositionUOR *mem = (PositionUOR*)g_ClientMem;
			pos.x = mem->x;
			pos.y = mem->y;
			pos.z = mem->z;
		} else if (strncmp(pShared->UOVersion, "7.0.15.1", sizeof(pShared->UOVersion)) == 0) {
			/* Similarly on Outlands, we know where the position is. */
			PositionOutlands *mem = (PositionOutlands*)g_ClientMem;
			pos.x = mem->x;
			pos.y = mem->y;
			pos.z = mem->z;
		} else {
			PositionGeneric *mem = (PositionGeneric*)g_ClientMem;
			pos.x = mem->x;
			pos.y = mem->y;
			pos.z = mem->z;
		}

		if (pos.x != g_LastPosition.x || pos.y != g_LastPosition.y || pos.z != g_LastPosition.z) {
			/* Inform Razor of a position change */

			COPYDATASTRUCT copydata;

			copydata.dwData = (ULONG_PTR)UONET_MESSAGE_COPYDATA::POSITION;
			copydata.cbData = sizeof(pos);
			copydata.lpData = &pos;

			SendMessage(hRazorWnd, WM_COPYDATA, (WPARAM)hUOWindow, (LPARAM)&copydata);
		}

		g_LastPosition = pos;
	}
}

VOID CALLBACK OnTick(HWND hwnd, UINT Message, UINT TimerId, DWORD dwTime) {
	/* Scan client memory for position updates */
	CheckPosition();

	/* Post a message to Razor to indicate a game loop tick.*/
	PostMessage(hRazorWnd, WM_UONETEVENT, ON_TICK, 0);
}

SIZE *SizePtr = NULL;
void OnSetUOWindowSize( int width )
{
	if ( width != 800 && width != 600 ) // in case it actually the height for some reason
	{
		SizePtr->cx = 640;
		SizePtr->cy = 480;
	}
	else
	{
		*SizePtr = DesiredSize;
	}
}

DLLFUNCTION void OnAttach( void *params, int paramsLen )
{
	int count = 0;
	DWORD addr = 0, oldProt;
	MemFinder mf;

	UOProcId = GetCurrentProcessId();

	if ( !CreateSharedMemory() )
		return;

		CopyFailed = false;
		mf.AddEntry("UoClientApp", 12, 0x00500000);
		mf.AddEntry("report\0", 8, 0x00500000);
		mf.AddEntry("Another copy of ", 16, 0x00500000);
		mf.AddEntry("\x00\x68\x88\x13\x00\x00\x56\xE8", 8);
		mf.AddEntry("\x68\x88\x13\x00\x00", 5, 16, 0x00400000); // (end of a push offset), push 5000, push esi
		mf.AddEntry("Electronic Arts Inc.", 20);
		mf.AddEntry("intro.bik", 10);
		mf.AddEntry("osilogo.bik", 12);
		mf.AddEntry("\x80\x02\x00\x00\xE0\x01\x00\x00", 8, 0x00500000); // current screen size
		mf.AddEntry("\x8B\x44\x24\x04\xBA\x80\x02\x00\x00\x3B\xC2\xB9\xE0\x01\x00\x00", 16); // resize screen function
		mf.AddEntry("\x57\x56\x6A\x00\x6A\x00\xE8", 7); // redraw screen/edge function
		mf.AddEntry(PACKET_TBL_STR, PACKET_TS_LEN, 10, 0x00500000);
		mf.AddEntry(CRYPT_KEY_STR, CRYPT_KEY_LEN);
		mf.AddEntry(CRYPT_KEY_STR_3D, CRYPT_KEY_3D_LEN);
		mf.AddEntry(CRYPT_KEY_STR_NEW, CRYPT_KEY_NEW_LEN);
		mf.AddEntry(CRYPT_KEY_STR_MORE_NEW, CRYPT_KEY_MORE_NEW_LEN);
		mf.AddEntry("UO Version %s", 12);
		mf.AddEntry("Multiple Instances Running", 26, 0x00500000);

		memcpy( pShared->PacketTable, StaticPacketTable, 256*sizeof(short) );

		mf.Execute();

		SizePtr = (SIZE*)mf.GetAddress("\x80\x02\x00\x00\xE0\x01\x00\x00", 8);
		if (SizePtr)
		{
			addr = mf.GetAddress("\x8B\x44\x24\x04\xBA\x80\x02\x00\x00\x3B\xC2\xB9\xE0\x01\x00\x00", 16);
			if (addr)
			{
				int i;
				DWORD origAddr = addr;

				VirtualProtect((void*)origAddr, 128, PAGE_EXECUTE_READWRITE, &oldProt);
				for (i = 16; i < 128; i++)
				{
					if (*((BYTE*)(addr + i)) == 0xE9) // find the first jmp
					{
						memset((void*)addr, 0x90, i); // nop

						// mov eax, dword [esp+4]
						*((BYTE*)(addr + 0)) = 0x8B; // mov
						*((BYTE*)(addr + 1)) = 0x44; //  eax
						*((BYTE*)(addr + 2)) = 0x24; //  [esp
						*((BYTE*)(addr + 3)) = 0x04; //      +4]
						addr += 4;

						*((BYTE*)addr) = 0x50; // push eax
						addr++;
						// call OnSetUOWindowSize
						*((BYTE*)addr) = 0xE8;
						*((DWORD*)(addr + 1)) = ((DWORD)OnSetUOWindowSize) - (addr + 5);
						addr += 5;
						break;
					}
				}
				VirtualProtect((void*)origAddr, 128, oldProt, &oldProt);
			}
		}

		int i = 0;
		while ((addr = mf.GetAddress(PACKET_TBL_STR, PACKET_TS_LEN, i++)) != 0)
		{
			memset(pShared->PacketTable, 0xFF, 512);

			addr += PACKET_TBL_OFFSET;
			if (IsBadReadPtr((void*)addr, sizeof(ClientPacketInfo) * 128))
				continue;
			ClientPacketInfo *tbl = (ClientPacketInfo*)addr;

			if (tbl[0].Id == 1 || tbl[0].Id == 2 || tbl[0].Id >= 256)
				continue;

			// this one isnt in order because OSI are idiots (0xF8)
			pShared->PacketTable[tbl[0].Id] = tbl[0].Length;

			int idx = 1;
			bool got1 = false, got2 = false;
			for (int prev = 0; prev < 255 && idx < 256; idx++)
			{
				if (IsBadReadPtr((void*)(tbl + idx), sizeof(ClientPacketInfo)) ||
					tbl[idx].Id <= prev || tbl[idx].Id >= 256)
				{
					break;
				}

				got1 |= tbl[idx].Id == 1 && tbl[idx].Length == StaticPacketTable[1];
				got2 |= tbl[idx].Id == 2 && tbl[idx].Length == StaticPacketTable[2];

				prev = tbl[idx].Id;
				if (pShared->PacketTable[prev] == 0xFFFF)
					pShared->PacketTable[prev] = tbl[idx].Length;
			}

			if (idx < 128 || !got1 || !got2)
				continue;
			else
				break;
		}

		if (!addr)
			CopyFailed = true;

		addr = mf.GetAddress(CRYPT_KEY_STR, CRYPT_KEY_LEN);
		if (!addr)
		{
			addr = mf.GetAddress(CRYPT_KEY_STR_NEW, CRYPT_KEY_NEW_LEN);

			if (!addr)
			{
				addr = mf.GetAddress(CRYPT_KEY_STR_MORE_NEW, CRYPT_KEY_MORE_NEW_LEN);
				if (!addr)
				{
					addr = mf.GetAddress(CRYPT_KEY_STR_3D, CRYPT_KEY_3D_LEN);
					if (addr)
					{
						LoginEncryption::SetKeys((const DWORD*)(addr + CRYPT_KEY_3D_LEN), (const DWORD*)(addr + CRYPT_KEY_3D_LEN + 19));
						ClientType = THREED;
					}
					else
					{
					CopyFailed = true;
					}
				}
				else
				{
					addr += CRYPT_KEY_MORE_NEW_LEN;

					const DWORD *pKey1 = *((DWORD**)addr);
					const DWORD *pKey2 = pKey1 + 1;
					if (IsBadReadPtr(pKey2, 4) || IsBadReadPtr(pKey1, 4))
						CopyFailed = true;
					else
						LoginEncryption::SetKeys(pKey1, pKey2);
				}
			}
			else
			{
				addr += CRYPT_KEY_NEW_LEN;

				const DWORD *pKey1 = *((DWORD**)addr);
				const DWORD *pKey2 = pKey1 - 1;
				if (IsBadReadPtr(pKey2, 4) || IsBadReadPtr(pKey1, 4))
					CopyFailed = true;
				else
					LoginEncryption::SetKeys(pKey1, pKey2);
			}
		}
		else
		{
			LoginEncryption::SetKeys((const DWORD*)(addr + CRYPT_KEY_LEN), (const DWORD*)(addr + CRYPT_KEY_LEN + 6));
		}

		// Multi UO
		addr = mf.GetAddress("UoClientApp", 12);
		if (addr)
		{
			VirtualProtect((void*)addr, 12, PAGE_READWRITE, &oldProt);
			_snprintf((char*)addr, 12, "UoApp%d", UOProcId);
			VirtualProtect((void*)addr, 12, oldProt, &oldProt);
		}

		addr = mf.GetAddress("Another copy of ", 16);
		if (addr)
		{
			char buff[5];

			buff[0] = 0x68; // push
			*((DWORD*)(&buff[1])) = addr;

			addr = 0x00400000;
			do {
				addr = MemFinder::Find(buff, 5, addr, 0x00600000);
				if (addr)
				{
					if ((*((unsigned char*)(addr - 5))) == 0x74) // jz?
						MemoryPatch(addr - 5, 0xEB, 1); // change to jmp
					addr += 5; // skip ahead to find the next instance
				}
			} while (addr > 0 && addr < 0x00600000);
		}

		addr = mf.GetAddress("Multiple Instances Running", 26);
		if (addr)
		{
			char buff[5];

			buff[0] = 0x68; // push
			*((DWORD*)(&buff[1])) = addr;

			addr = 0x00400000;
			do {
				addr = MemFinder::Find(buff, 5, addr, 0x00600000);
				if (addr)
				{
					char in = (*((unsigned char*)(addr - 4)));
					if (in == 0x74 || in == 0x75) { // jz or jnz
						MemoryPatch(addr - 4, 0xEB, 1); // change to jmp
					}
					addr += 5; // skip ahead to find the next instance
				}
			} while (addr > 0 && addr < 0x00600000);
		}

		addr = mf.GetAddress("report\0", 8);
		if (addr)
		{
			VirtualProtect((void*)addr, 12, PAGE_READWRITE, &oldProt);
			_snprintf((char*)addr, 8, "r%d", UOProcId);
			VirtualProtect((void*)addr, 12, oldProt, &oldProt);
		}

		// Splash screen crap:
		for (int i = 0; i < 16; i++)
		{
			addr = mf.GetAddress("\x68\x88\x13\x00\x00", 5, i);
			if (!addr)
				break;
			for (int e = 5; e < 24; e++)
			{
				if (*((BYTE*)(addr + e)) == 0x8B && *((BYTE*)(addr + e + 1)) == 0x3D)
				{
					MemoryPatch(addr + 1, 0x00000001); // change 5000ms to 1ms
					i = 99;
					break;
				}
			}
		}
		addr = mf.GetAddress("intro.bik", 10);
		if (addr)
			MemoryPatch(addr, "intro.SUX", 10);
		addr = mf.GetAddress("ostlogo.bik", 12);
		if (addr)
			MemoryPatch(addr, "osilogo.SUX", 12);

		addr = mf.GetAddress("Electronic Arts Inc.", 20);
		if (addr)
		{
			addr -= 7;
			VirtualProtect((void*)addr, 52, PAGE_EXECUTE_READWRITE, &oldProt);
			strncpy((char*)addr, "[Powered by Razor - The cutting edge UO Assistant]\0", 52);
			VirtualProtect((void*)addr, 52, oldProt, &oldProt);
		}

		NativeGetUOVersion = NULL;
		if (ClientType == TWOD)
		{
			addr = mf.GetAddress("UO Version %s", 12);
			if (addr)
			{
				char temp[8];
				temp[0] = 0x68;
				*((DWORD*)&temp[1]) = addr;

				addr = MemFinder::Find(temp, 5);

				if (addr)
				{
					count = 0;
					while (*((BYTE*)addr) != 0xE8 && count < 128)
					{
						addr--;
						count++;
					}

					if (*((BYTE*)addr) == 0xE8)
						NativeGetUOVersion = (GetUOVersionFunc)((addr + 5) + *((DWORD*)(addr + 1)));
				}
			}
		}
}

DLLFUNCTION void SetServer( unsigned int addr, unsigned short port )
{
	if (pShared)
	{
		pShared->ServerIP = addr;
		pShared->ServerPort = port;
	}
}

DLLFUNCTION const char *GetUOVersion()
{
	if ( pShared )
		return pShared->UOVersion;
	else
		return "";
}

bool CreateSharedMemory()
{
	if (pShared)
		return true;

	char name[256];

	CommMutex = NULL;
	hFileMap = NULL;
	pShared = NULL;

	Log( "Creating shared mem, proc: %x", UOProcId );

	sprintf( name, "UONetSharedCOMM_%x", UOProcId );

	CommMutex = CreateMutex( NULL, FALSE, name );
	if ( !CommMutex )
		return false;

	for (int i = 0; i < 30; i++) {
		sprintf(name, "UONetSharedFM_%x%d", UOProcId, i);
		hFileMap = CreateFileMapping(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, sizeof(SharedMemory), name);
		if (!hFileMap || hFileMap == INVALID_HANDLE_VALUE) {
			auto err = GetLastError();
			continue;
		}

		pShared = (SharedMemory*)MapViewOfFile(hFileMap, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(SharedMemory));
		if (!pShared) {
			auto err = GetLastError();
			continue;
		}

		break;
	}

	if (!pShared) {
		return false;
	}

	//memset( pShared, 0, sizeof(SharedMemory) );

	return true;
}

void CloseSharedMemory()
{
	Log( "Close shared memory" );

	if ( hWndProcRetHook )
		UnhookWindowsHookEx( hWndProcRetHook );
	if ( hGetMsgHook )
		UnhookWindowsHookEx( hGetMsgHook );

	if ( CommMutex )
		CloseHandle( CommMutex );
	CommMutex = NULL;
	if ( pShared )
		UnmapViewOfFile( pShared );
	pShared = NULL;
	if ( hFileMap )
		CloseHandle( hFileMap );
	hFileMap = NULL;

	//these are shared vars
	hWndProcRetHook = NULL;
	hGetMsgHook = NULL;

	FreeArt();

	delete ClientCrypt;
	delete ClientLogin;
	delete ServerCrypt;
	delete ServerLogin;

	ClientCrypt = NULL;
	ClientLogin = NULL;
	ServerCrypt = NULL;
	ServerLogin = NULL;
}

void CreateEncryption()
{
	delete ClientCrypt;
	delete ClientLogin;
	delete ServerCrypt;
	delete ServerLogin;

	if ( ClientEncrypted )
	{
		ClientCrypt = new OSIEncryption();
		ClientLogin = new LoginEncryption();
	}

	if ( ServerEncrypted )
	{
		ServerCrypt = new OSIEncryption();
		ServerLogin = new LoginEncryption();
	}
}

inline void Maintenance( Buffer &buff )
{
	if ( buff.Length <= 0 )
	{
		buff.Start = 0;
		buff.Length = 0;
	}
	else if ( buff.Start > SHARED_BUFF_SIZE / 2 )
	{
		//shift all the data to the begining of the buffer
		memmove( buff.Buff, &buff.Buff[buff.Start], buff.Length );
		buff.Start = 0;
	}
}

int RecvData()
{
	int len = SHARED_BUFF_SIZE;
	char buff[SHARED_BUFF_SIZE];

	int ackLen = (*(NetIOFunc)OldRecv)(CurrentConnection,buff,len,0);

	if ( ackLen == SOCKET_ERROR )
	{
		if ( WSAGetLastError() != WSAEWOULDBLOCK )
		{
			WaitForSingleObject( CommMutex, INFINITE );
			pShared->ForceDisconn = true;
			ReleaseMutex( CommMutex );
		}
		else
		{
			WSASetLastError( WSAEWOULDBLOCK );
		}

		ackLen = -1;
	}
	else if ( ackLen > 0 )
	{
		if ( FirstRecv )
		{
			Compression::Reset();
			FirstRecv = false;
		}

		WaitForSingleObject( CommMutex, INFINITE );

		pShared->TotalRecv += ackLen;

		if ( LoginServer )
		{
			memcpy( &pShared->InRecv.Buff[pShared->InRecv.Start+pShared->InRecv.Length], buff, ackLen );
			pShared->InRecv.Length += ackLen;
		}
		else
		{
			if ( ServerEncrypted )
				ServerCrypt->DecryptFromServer( (BYTE*)buff, (BYTE*)buff, ackLen );

			int blen = Compression::Decompress( (char*)&pShared->InRecv.Buff[pShared->InRecv.Start+pShared->InRecv.Length], buff, ackLen );
			pShared->InRecv.Length += blen;

			if ( !ServerNegotiated && !InGame && pShared && pShared->AllowNegotiate )
			{
				int pos = pShared->InRecv.Start;
				unsigned char *p_buff = &pShared->InRecv.Buff[pos];

				while ( pos < pShared->InRecv.Length )
				{
					int left = pShared->InRecv.Length - pos;
					int p_len = GetPacketLength( p_buff, left );

					if ( *p_buff == 0xA9 && p_len >= 1+2+1+30+30 && p_len <= left )
					{
						// character list

						unsigned char hash[16], test[16];

						memcpy( pShared->AuthBits, p_buff + 1+2+1+30+1, 8 );

						if ( p_buff[3] > 1 )
							memcpy( hash, p_buff + 1+2+1+30+30+30+1, 16 );
						else
							memcpy( hash, p_buff + 1+2+1+30+1+8, 16 );

						for ( int i = 0; i < p_buff[3]; i++ )
							memset( p_buff + 1+2+1+ 30 + 60*i, 0, 30 );

						if ( memcmp( hash, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", 16 ) != 0 )
						{
							OSIEncryption::MD5( p_buff, p_len, test );

							ServerNegotiated = memcmp( hash, test, 16 ) == 0;
						}

						if ( !ServerNegotiated )
							memset( pShared->AuthBits, 0, 8 );

						Forwarding = Forwarded = false;

						break;
					}

					if ( p_len <= 0 )
					{
						break;
					}
					else
					{
						pos += p_len;
						p_buff += p_len;
					}
				}
			}
		}

		ReleaseMutex( CommMutex );

		SendMessage( hRazorWnd, WM_UONETEVENT, RECV, 0 );
	}

	return ackLen;
}

int HookRecv( SOCKET sock, char *buff, int len, int flags )
{
	int ackLen;

	if ( sock == CurrentConnection && CurrentConnection )
	{
		WaitForSingleObject( CommMutex, INFINITE );
		if ( pShared->ForceDisconn && pShared->OutRecv.Length <= 0 )
		{
			ReleaseMutex( CommMutex );
			WSASetLastError( WSAECONNRESET );
			return -1;
		}

		if ( LoginServer )
		{
			if ( pShared->OutRecv.Length > 0 )
			{
				ackLen = pShared->OutRecv.Length;
				memcpy( buff, &pShared->OutRecv.Buff[pShared->OutRecv.Start], ackLen );

				if ( ((BYTE)buff[0]) == 0x8C )
					LoginServer = false;

				if ( Forwarding )
					Seeded = Forwarded = true;

				pShared->OutRecv.Start += ackLen;
				pShared->OutRecv.Length -= ackLen;
			}
			else
			{
				ackLen = 0;
			}
		}
		else
		{
			ackLen = 0;
			while ( pShared->OutRecv.Length > 0 )
			{
				int blen = GetPacketLength( &pShared->OutRecv.Buff[pShared->OutRecv.Start], pShared->OutRecv.Length );

				if ( blen <= 0 || blen > pShared->OutRecv.Length || ackLen+blen > len )
					break;

				ackLen += Compression::Compress( &buff[ackLen], (char*)&pShared->OutRecv.Buff[pShared->OutRecv.Start], blen );

				pShared->OutRecv.Start += blen;
				pShared->OutRecv.Length -= blen;
			}

			if ( ClientEncrypted && ackLen > 0 )
				ClientCrypt->EncryptForClient( (BYTE*)buff, (BYTE*)buff, ackLen );
		}

		Maintenance( pShared->InRecv );
		Maintenance( pShared->OutRecv );

		ReleaseMutex( CommMutex );

		if ( ackLen == 0 )
		{
			WSASetLastError( WSAEWOULDBLOCK );
			return -1;
		}
		else
		{
			return ackLen;
		}
	}
	else
	{
		return (*(NetIOFunc)OldRecv)(sock,buff,len,flags);
	}
}

int SkipSendData = 0;
int HookSend( SOCKET sock, char *buff, int len, int flags )
{
	int ackLen;

	if ( sock == CurrentConnection && CurrentConnection )
	{
		if ( !Seeded )
		{
			if ( len > 0 && ((BYTE)*buff) == ((BYTE)0xEF) )
				SkipSendData = 16;

			if ( len >= 4 )
			{
				Seeded = true;

				CryptSeed = *((DWORD*)buff);

				if ( ServerEncrypted )
				{
					ServerCrypt->Initialize( CryptSeed );
					ServerLogin->Initialize( (BYTE*)&CryptSeed );
				}

				if ( ClientEncrypted )
				{
					ClientCrypt->Initialize( CryptSeed );
					ClientLogin->Initialize( (BYTE*)&CryptSeed );
				}

				Compression::Reset();
			}

			ackLen = (*(NetIOFunc)OldSend)(sock,buff,len,flags);
			pShared->TotalSend += len;
		}
		else if ( SkipSendData < len )
		{
			SkipSendData = 0;

			if ( FirstSend )
			{
				FirstSend = false;

				if ( ClientEncrypted )
					LoginServer = ClientLogin->TestForLogin( (BYTE)buff[0] );
				else
					LoginServer = LoginEncryption::IsLoginByte( (BYTE)buff[0] );

				if ( LoginServer )
					Forwarding = Forwarded = false;
			}

			WaitForSingleObject( CommMutex, INFINITE );

			if (ClientEncrypted)
			{
				if ( Forwarded )
				{
					CryptSeed = LoginEncryption::GenerateBadSeed( CryptSeed );

					ClientCrypt->Initialize( CryptSeed );

					ClientCrypt->DecryptFromClient( (BYTE*)buff, (BYTE*)(&pShared->InSend.Buff[pShared->InSend.Start+pShared->InSend.Length]), len );
					ClientLogin->Decrypt( (BYTE*)(&pShared->InSend.Buff[pShared->InSend.Start+pShared->InSend.Length]), (BYTE*)(&pShared->InSend.Buff[pShared->InSend.Start+pShared->InSend.Length]), len );

					LoginServer = Forwarding = Forwarded = false;
				}
				else
				{
					if ( LoginServer )
					{
						ClientLogin->Decrypt( (BYTE*)(buff), (BYTE*)(&pShared->InSend.Buff[pShared->InSend.Start+pShared->InSend.Length]), len );

						if ( ((BYTE)pShared->InSend.Buff[pShared->InSend.Start+pShared->InSend.Length]) == 0xA0 )
							Forwarding = true;
					}
					else
					{
						ClientCrypt->DecryptFromClient((BYTE*)(buff), (BYTE*)(&pShared->InSend.Buff[pShared->InSend.Start + pShared->InSend.Length]), len);
					}
				}
			}
			else
				memcpy( &pShared->InSend.Buff[pShared->InSend.Start+pShared->InSend.Length], buff, len );

			pShared->InSend.Length += len;
			ReleaseMutex( CommMutex );

			SendMessage( hRazorWnd, WM_UONETEVENT, SEND, 0 );

			WaitForSingleObject( CommMutex, INFINITE );
			FlushSendData();
			Maintenance( pShared->InSend );
			ReleaseMutex( CommMutex );

			ackLen = len;//lie and say we sent it all -- or should we tell the truth? (probably not since then it could try to send it again..)
		}
		else
		{
			ackLen = (*(NetIOFunc)OldSend)(sock,buff,len,flags);
			pShared->TotalSend += len;
			SkipSendData -= len;
		}
	}
	else
	{
		ackLen = (*(NetIOFunc)OldSend)(sock,buff,len,flags);
	}

	return ackLen;
}

#define RAZOR_ID_KEY "\x9\x11\x83+\x4\x17\x83\x5\x24\x85\x7\x17\x87\x6\x19\x88"
#define RAZOR_ID_KEY_LEN 16

void FlushSendData()
{
	WaitForSingleObject( CommMutex, INFINITE );
	if ( pShared->OutSend.Length > 0 && CurrentConnection )
	{
		int ackLen = 0;
		int outLen = pShared->OutSend.Length;

		if ( !InGame && !LoginServer )
		{
			int pos = pShared->OutSend.Start;
			unsigned char *buff = &pShared->OutSend.Buff[pos];

			while ( pos < outLen )
			{
				int left = pShared->OutSend.Length - pos;
				int len = GetPacketLength( buff, left );

				if ( *buff == 0x5D && len >= 1+4+30+30 && len <= left )
				{
					// play character
					if ( pShared->AllowNegotiate && ServerNegotiated )
					{
						// the first 2 bytes are 0
						// the next 4 bytes are "flags" which say the user's client type (lbr,t2a,aos,etc)
						// the rest are ignored, so we can use them for auth
						memcpy( buff + 1 + 4 + 30 + 2 + 4, pShared->AuthBits, 8 );
						memcpy( buff + 1 + 4 + 30 + 2 + 4 + 8, RAZOR_ID_KEY, RAZOR_ID_KEY_LEN );
					}

					InGame = true;
					break;
				}
				else if ( *buff == 0x00 && (*((DWORD*)&buff[1])) == 0xEDEDEDED && len >= 1+4+4+1+30+30 && len <= left )
				{
					// char creation
					if ( pShared->AllowNegotiate && ServerNegotiated )
					{
						memcpy( buff + 1 + 4 + 4 + 1 + 30 + 15, pShared->AuthBits, 8 );
						memcpy( buff + 1 + 4 + 4 + 1 + 30 + 15 + 8, RAZOR_ID_KEY, min( 7, RAZOR_ID_KEY_LEN ) );
					}

					InGame = true;
					break;
				}

				if ( len <= 0 )
				{
					break;
				}
				else
				{
					pos += len;
					buff += len;
				}
			} // END while
		} // END if ( !InGame && !LoginServer

		if ( ServerEncrypted )
		{
			if ( tempBuff == NULL )
				tempBuff = new char[SHARED_BUFF_SIZE];

			if ( LoginServer )
				ServerLogin->Encrypt( (BYTE*)&pShared->OutSend.Buff[pShared->OutSend.Start], (BYTE*)tempBuff, outLen );
			else
				ServerCrypt->EncryptForServer( (BYTE*)&pShared->OutSend.Buff[pShared->OutSend.Start], (BYTE*)tempBuff, outLen );

			ackLen = (*(NetIOFunc)OldSend)(CurrentConnection,tempBuff,outLen,0);
		}
		else
		{
			ackLen = (*(NetIOFunc)OldSend)(CurrentConnection,(char*)&pShared->OutSend.Buff[pShared->OutSend.Start],outLen,0);
		}

		if ( ackLen == SOCKET_ERROR )
		{
			if ( WSAGetLastError() != WSAEWOULDBLOCK )
				pShared->ForceDisconn = true;
		}
		else //if ( ackLen >= 0 )
		{
			pShared->TotalSend += ackLen;

			pShared->OutSend.Start += ackLen;
			pShared->OutSend.Length -= ackLen;
		}
	}

	Maintenance( pShared->OutSend );
	ReleaseMutex( CommMutex );
}

int HookConnect( SOCKET sock, const sockaddr *addr, int addrlen )
{
	int retVal;

	if ( addr && addrlen >= sizeof(sockaddr_in) )
	{
		const sockaddr_in *old_addr = (const sockaddr_in *)addr;
		sockaddr_in useAddr;

		memcpy( &useAddr, old_addr, sizeof(sockaddr_in) );

		if ( !Forwarded && pShared->ServerIP != 0 )
		{
			useAddr.sin_addr.S_un.S_addr = pShared->ServerIP;
			useAddr.sin_port = htons( pShared->ServerPort );
		}

		retVal = (*(ConnFunc)OldConnect)( sock, (sockaddr*)&useAddr, sizeof(sockaddr_in) );

		if ( retVal != SOCKET_ERROR )
		{
			Log( "Connecting to %i", sock );

			CreateEncryption();

			Seeded = false;
			LoginServer = false;
			FirstRecv = true;
			FirstSend = true;
			Forwarding = Forwarded = false;

			WaitForSingleObject( CommMutex, INFINITE );
			CurrentConnection = sock;
			pShared->OutRecv.Length = pShared->InRecv.Length = pShared->OutSend.Length = pShared->InSend.Length = 0;
			pShared->ForceDisconn = false;
			ReleaseMutex( CommMutex );

			PostMessage( hRazorWnd, WM_UONETEVENT, CONNECT, useAddr.sin_addr.S_un.S_addr );
		}
	}
	else
	{
		retVal = (*(ConnFunc)OldConnect)( sock, addr, addrlen );
	}

	return retVal;
}

int HookCloseSocket( SOCKET sock )
{
	int retVal = (*(CLSFunc)OldCloseSocket)( sock );

	if ( sock == CurrentConnection && sock != 0 )
	{
		Log( "Closing socket %i", sock );
		CurrentConnection = 0;

		WaitForSingleObject( CommMutex, INFINITE );
		pShared->OutRecv.Length = pShared->InRecv.Length = pShared->OutSend.Length = pShared->InSend.Length = 0;
		pShared->TotalSend = pShared->TotalRecv = 0;
		pShared->ForceDisconn = false;
		ReleaseMutex( CommMutex );

		ServerNegotiated = false;
		InGame = false;

		memset( pShared->AuthBits, 0, 8 );

		PostMessage( hRazorWnd, WM_UONETEVENT, DISCONNECT, 0 );
	}

	return retVal;
}

int HookSelect( int ndfs, fd_set *readfd, fd_set *writefd, fd_set *exceptfd, const struct timeval *timeout )
{
	bool checkRecv = false;
	bool checkErr = false;
	bool modified = false;
	int realRet = 0;
	int myRet = 0;

	if ( CurrentConnection )
	{
		if ( readfd != NULL )
			checkRecv = FD_ISSET( CurrentConnection, readfd );

		if ( exceptfd != NULL )
			checkErr = FD_ISSET( CurrentConnection, exceptfd );
	}

	timeval myTimeout;

	if ( SmartCPU )
	{
		int length = 0;

		if ( Active )
		{
			LARGE_INTEGER end;
			QueryPerformanceCounter( &end );

			length = int( 1000000.0 * ((end.QuadPart-Counter.QuadPart)/double(PerfFreq.QuadPart)) );
		}

		if ( length < 33333 )
		{
			myTimeout.tv_sec = 0;
			myTimeout.tv_usec = 33333 - length;
			timeout = &myTimeout;
		}
	}

	realRet = (*(SelectFunc)OldSelect)( ndfs, readfd, writefd, exceptfd, timeout );

	if ( SmartCPU )
		QueryPerformanceCounter( &Counter );

	if ( checkRecv )
	{
		if ( FD_ISSET( CurrentConnection, readfd ) )
		{
			FD_CLR( CurrentConnection, readfd );
			RecvData();
			realRet--;
		}

		WaitForSingleObject( CommMutex, INFINITE );
		if ( pShared->OutRecv.Length > 0 || ( pShared->ForceDisconn ) )
		{
			FD_SET( CurrentConnection, readfd );
			myRet++;
		}
		ReleaseMutex( CommMutex );
	}

	if ( checkErr && !FD_ISSET( CurrentConnection, exceptfd ) )
	{
		WaitForSingleObject( CommMutex, INFINITE );
		if ( pShared->ForceDisconn && pShared->OutRecv.Length <= 0 )
		{
			FD_SET( CurrentConnection, exceptfd );
			myRet++;
		}
		ReleaseMutex( CommMutex );
	}

	if ( realRet < 0 )
	{
		return myRet;
	}
	else
	{
		return realRet + myRet;
	}
}

bool HookFunction( const char *Dll, const char *FuncName, int Ordinal, unsigned long NewAddr,
				  unsigned long *OldAddr, unsigned long *PatchAddr )
{
	DWORD baseAddr = (DWORD)GetModuleHandle(NULL);
	if ( !baseAddr )
		return false;

	IMAGE_DOS_HEADER *idh = (IMAGE_DOS_HEADER *)baseAddr;

	IMAGE_FILE_HEADER *ifh = (IMAGE_FILE_HEADER *)(baseAddr + idh->e_lfanew + sizeof(DWORD));

	IMAGE_OPTIONAL_HEADER *ioh = (IMAGE_OPTIONAL_HEADER *)((DWORD)(ifh) + sizeof(IMAGE_FILE_HEADER));

	IMAGE_IMPORT_DESCRIPTOR *iid = (IMAGE_IMPORT_DESCRIPTOR *)(baseAddr + ioh->DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);

	while( iid->Name )
	{
		if( _stricmp( Dll, (char *)(baseAddr + iid->Name) ) == 0 )
		{
			IMAGE_THUNK_DATA * pThunk = (IMAGE_THUNK_DATA *)((DWORD)iid->OriginalFirstThunk + baseAddr);
			IMAGE_THUNK_DATA * pThunk2 = (IMAGE_THUNK_DATA *)((DWORD)iid->FirstThunk + baseAddr);

			while( pThunk->u1.AddressOfData )
			{
				char *name = NULL;
				int ord;

				if( pThunk->u1.Ordinal & 0x80000000 )
				{
					// Imported by ordinal only:
					ord = pThunk->u1.Ordinal & 0xFFFF;
				}
				else
				{
					// Imported by name (with ordinal hint)
					IMAGE_IMPORT_BY_NAME * pName = (IMAGE_IMPORT_BY_NAME *)((DWORD)pThunk->u1.AddressOfData + baseAddr);
					ord = pName->Hint;
					name = (char *)pName->Name;
				}

				if ( ord == Ordinal || ( name && FuncName && !strcmp( name, FuncName ) ) )
				{
					*OldAddr = (unsigned long)pThunk2->u1.Function;
					*PatchAddr = (unsigned long)(&pThunk2->u1.Function);
					MemoryPatch( *PatchAddr, NewAddr );

					return true;
				}

				pThunk++;
				pThunk2++;
			}
		}
		iid++;
	}

	return false;
}


bool FindFunction( const char *Dll, const char *FuncName, int Ordinal, unsigned long *ImpAddr, unsigned long *CallAddr )
{
	DWORD baseAddr = (DWORD)GetModuleHandle(NULL);
	if ( !baseAddr )
		return false;

	IMAGE_DOS_HEADER *idh = (IMAGE_DOS_HEADER *)baseAddr;

	IMAGE_FILE_HEADER *ifh = (IMAGE_FILE_HEADER *)(baseAddr + idh->e_lfanew + sizeof(DWORD));

	IMAGE_OPTIONAL_HEADER *ioh = (IMAGE_OPTIONAL_HEADER *)((DWORD)(ifh) + sizeof(IMAGE_FILE_HEADER));

	IMAGE_IMPORT_DESCRIPTOR *iid = (IMAGE_IMPORT_DESCRIPTOR *)(baseAddr + ioh->DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);

	while( iid->Name )
	{
		if( _stricmp( Dll, (char *)(baseAddr + iid->Name) ) == 0 )
		{
			IMAGE_THUNK_DATA * pThunk = (IMAGE_THUNK_DATA *)((DWORD)iid->OriginalFirstThunk + baseAddr);
			IMAGE_THUNK_DATA * pThunk2 = (IMAGE_THUNK_DATA *)((DWORD)iid->FirstThunk + baseAddr);

			while( pThunk->u1.AddressOfData )
			{
				char *name = NULL;
				int ord;

				if( pThunk->u1.Ordinal & 0x80000000 )
				{
					// Imported by ordinal only:
					ord = pThunk->u1.Ordinal & 0xFFFF;
				}
				else
				{
					// Imported by name (with ordinal hint)
					IMAGE_IMPORT_BY_NAME * pName = (IMAGE_IMPORT_BY_NAME *)((DWORD)pThunk->u1.AddressOfData + baseAddr);
					ord = pName->Hint;
					name = (char *)pName->Name;
				}

				if ( ord == Ordinal || ( name && FuncName && !strcmp( name, FuncName ) ) )
				{
					*ImpAddr = (unsigned long)pThunk2->u1.Function;
					*CallAddr = (unsigned long)(&pThunk2->u1.Function);

					return true;
				}

				pThunk++;
				pThunk2++;
			}
		}
		iid++;
	}

	return false;
}

#define NOTO_HUE_STR "\0\0\0\0\x59\0\0\0\x3F\0\0\0\xb2\x03\0\0"
#define NOTO_HUE_LEN 16

DWORD NotoLoc = 0;
void SetCustomNotoHue( int hue )
{
	if ( !NotoLoc )
	{
		NotoLoc = MemFinder::Find( NOTO_HUE_STR, NOTO_HUE_LEN );
		if ( !NotoLoc )
			NotoLoc = 0xFFFFFFFF;
	}

	if ( NotoLoc != 0xFFFFFFFF )
		*((int*)(NotoLoc + 8*4)) = hue;
}

bool PatchMemory( void )
{
	Log( "Patching client functions." );

	return
		HookFunction( "wsock32.dll", "closesocket", 3, (unsigned long)HookCloseSocket, &OldCloseSocket, &CloseSocketAddress ) &&
		HookFunction( "wsock32.dll", "connect", 4, (unsigned long)HookConnect, &OldConnect, &ConnectAddress ) &&
		HookFunction( "wsock32.dll", "recv", 16, (unsigned long)HookRecv, &OldRecv, &RecvAddress ) &&
		HookFunction( "wsock32.dll", "select", 18, (unsigned long)HookSelect, &OldSelect, &SelectAddress ) &&
		HookFunction( "wsock32.dll", "send", 19, (unsigned long)HookSend, &OldSend, &SendAddress )
		;
}

void MemoryPatch( unsigned long Address, unsigned long value )
{
	MemoryPatch( Address, &value, 4 ); // sizeof(int)
}

void MemoryPatch( unsigned long Address, int value, int numBytes )
{
	MemoryPatch( Address, &value, numBytes );
}

void MemoryPatch( unsigned long Address, const void *value, int length )
{
	DWORD OldProtect;
	if ( !VirtualProtect( (void *)Address, length, PAGE_READWRITE, &OldProtect ) )
		return;

	memcpy( (void *)Address, value, length );

	VirtualProtect( (void *)Address, length, OldProtect, &OldProtect );
}

bool CheckParent( HWND hCheck, HWND hComp )
{
	hCheck = GetParent( hCheck );
	while ( hCheck != hComp && hCheck != NULL )
		hCheck = GetParent( hCheck );

	return ( hCheck == hComp );
}

void MessageProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, MSG *pMsg )
{
	HWND hFore;

	switch ( nMsg )
	{
		// Custom messages
	case WM_PROCREADY:
		hRazorWnd = (HWND)lParam;
		UOProcId = GetCurrentProcessId();
		hUOWindow = hWnd;

		if (!pShared) // If this failed the first time or was not run at all, try it once more before panicing
			OnAttach(NULL, 0);

		ClientEncrypted = (wParam & 0x08) != 0;
		ServerEncrypted = (wParam & 0x10) != 0;

		InitThemes();

		if (pShared)
		{
			pShared->AllowNegotiate = (wParam & 0x04) != 0;

			pShared->UOVersion[0] = 0;

			if (NativeGetUOVersion != NULL)
				strncpy(pShared->UOVersion, NativeGetUOVersion(), 16);
		}

		if ( !pShared )
			PostMessage( hRazorWnd, WM_UONETEVENT, NOT_READY, NO_SHAREMEM );
		else if ( CopyFailed )
			PostMessage( hRazorWnd, WM_UONETEVENT, NOT_READY, NO_COPY );
		else if ( !PatchMemory() )
			PostMessage( hRazorWnd, WM_UONETEVENT, NOT_READY, NO_PATCH );
		else
			PostMessage( hRazorWnd, WM_UONETEVENT, READY, SUCCESS );

		/* Start a timer that will call a callback each tick. We use this to implement
		 * timers as well as scan client memory for position updates. */
		SetTimer(hUOWindow, (UINT_PTR)0xAA, 25, OnTick);

		break;

	case WM_UONETEVENT:
		switch ( LOWORD(wParam) )
		{
		case SEND:
			FlushSendData();
			break;
		case STAT_BAR:
			PatchStatusBar( (BOOL)lParam );
			break;
		case NOTO_HUE:
			SetCustomNotoHue( (int)lParam );
			break;

		case SETWNDSIZE:
			DesiredSize.cx = LOWORD(lParam);
			DesiredSize.cy = HIWORD(lParam);
			break;

		case SMART_CPU:
			SmartCPU = lParam;
			break;

		case NEGOTIATE:
			if ( pShared )
				pShared->AllowNegotiate = (lParam != 0);
			break;

		case SET_MAP_HWND:
			hMapWnd = (HWND)lParam;
			break;
		}
		break;

	case WM_COPYDATA: {
		COPYDATASTRUCT *copydata = (COPYDATASTRUCT *)lParam;

		switch ((UONET_MESSAGE_COPYDATA)copydata->dwData) {
		case UONET_MESSAGE_COPYDATA::POSITION:
			g_TestPosition = *(Position *)copydata->lpData;
			break;

		}
		break;
	}

		// Macro stuff
	case WM_SYSKEYDOWN:
	case WM_KEYDOWN:
		if ( pMsg && !SendMessage( hRazorWnd, WM_UONETEVENT, KEYDOWN, wParam ) )
		{
			// dont give the key to the client
			pMsg->message = WM_NULL;
			pMsg->lParam = 0;
			pMsg->wParam = 0;
		}
		break;

	case WM_SYSKEYUP:
	case WM_KEYUP:
		if ( pMsg && wParam == VK_SNAPSHOT ) // VK_SNAPSHOT (Print Screen) Doesn't seem to send a KeyDown message
			SendMessage( hRazorWnd, WM_UONETEVENT, KEYDOWN, wParam );
		break;

	case WM_MOUSEWHEEL:
		PostMessage( hRazorWnd, WM_UONETEVENT, MOUSE, MAKELONG( 0, (((short)HIWORD(wParam)) < 0 ? -1 : 1) ) );
		break;
	case WM_MBUTTONDOWN:
		PostMessage( hRazorWnd, WM_UONETEVENT, MOUSE, MAKELONG( 1, 0 ) );
		break;
	case WM_XBUTTONDOWN:
		PostMessage( hRazorWnd, WM_UONETEVENT, MOUSE, MAKELONG( HIWORD(wParam) + 1, 0 ) );
		break;

		//Activation tracking :
	case WM_ACTIVATE:
		Active = wParam;
		PostMessage( hRazorWnd, WM_UONETEVENT, ACTIVATE, wParam );
		break;
	case WM_KILLFOCUS:
		hFore = GetForegroundWindow();
		if ( ((HWND)wParam) != hRazorWnd && hFore != hRazorWnd && ((HWND)wParam) != hMapWnd && hFore != hMapWnd
			&& !CheckParent( hFore, hRazorWnd ) )
		{
			PostMessage( hRazorWnd, WM_UONETEVENT, FOCUS, FALSE );
		}
		break;
	case WM_SETFOCUS:
		PostMessage( hRazorWnd, WM_UONETEVENT, FOCUS, TRUE );
		break;

		//Custom title bar:
	case WM_NCACTIVATE:
		Active = wParam;
		//fallthrough
	case WM_NCPAINT:
	case WM_GETICON:
	case WM_SETTEXT:
	case WM_CUSTOMTITLE:
		CheckTitlebarAttr(hWnd);
		RedrawTitleBar( hWnd, Active );
		break;
	}
}

LRESULT CALLBACK GetMsgHookFunc( int Code, WPARAM Flag, LPARAM pMsg )
{
	if ( Code >= 0 && Flag != PM_NOREMOVE ) //dont process messages until they are removed from the queue
	{
		MSG *Msg = (MSG*)pMsg;
		/*
		Msg->message ^= 0x11;
		Msg->message ^= Disabled * 101;
		Msg->message *= !(Disabled * 020);
		Msg->message ^= 0x11;
		*/
		if ( Msg->hwnd == hUOWindow || ( hUOWindow == NULL && Msg->message == WM_PROCREADY ) )
			MessageProc( Msg->hwnd, Msg->message, Msg->wParam, Msg->lParam, Msg );
	}

	return CallNextHookEx( NULL, Code, Flag, pMsg );
}

LRESULT CALLBACK WndProcRetHookFunc( int Code, WPARAM Flag, LPARAM pMsg )
{
	if ( Code >= 0 )
	{
		CWPRETSTRUCT *Msg = (CWPRETSTRUCT *)(pMsg);
		/*
		Msg->message ^= 0x11;
		Msg->message ^= Disabled * 101;
		Msg->message *= !(Disabled * 020);
		Msg->message ^= 0x11;
		*/
		if ( Msg->hwnd == hUOWindow || ( hUOWindow == NULL && Msg->message == WM_PROCREADY ) )
			MessageProc( Msg->hwnd, Msg->message, Msg->wParam, Msg->lParam, NULL );
	}

	return CallNextHookEx( NULL, Code, Flag, pMsg );
}

LRESULT CALLBACK UOAWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
{
	if (nMsg >= WM_USER + 200 && nMsg < WM_USER + 315)
	   return SendMessage(hRazorWnd, nMsg, wParam, lParam);
	else
	   return DefWindowProc(hWnd, nMsg, wParam, lParam);
}

void Log( const char *format, ... )
{
#ifdef _DEBUG
#ifdef LOGGING
	FILE *log = fopen( "Crypt.log", "a" );
	if ( log )
	{
		char timeStr[256];
		struct tm *newtime;
		time_t aclock;

		time( &aclock );
		newtime = localtime( &aclock );
		strncpy( timeStr, asctime( newtime ), 256 );
		int len = (int)strlen( timeStr );
		if ( timeStr[len-1] == '\n' )
			timeStr[len-1] = 0;

		char OutTxt[512];
		va_list argList;
		va_start( argList, format );
		_vsnprintf( OutTxt, 512, format, argList );
		va_end( argList );

		fprintf( log, "%s: %s\n", timeStr, OutTxt );
		fclose( log );
	}
#endif
#endif
}



================================================
FILE: Crypt/Crypt.def
================================================
LIBRARY	Crypt

EXPORTS
	InstallLibrary
	Shutdown
	FindUOWindow
	GetSharedAddress
	GetPacketLength
	IsDynLength
	GetUOProcId
	GetCommMutex
	TotalIn
	TotalOut
	WaitForWindow
	SetDataPath
	CalibratePosition
	OnAttach
	SetServer
	GetUOVersion


================================================
FILE: Crypt/Crypt.h
================================================
#pragma once
#pragma pack(1)

#include <stdint.h>

#define DLL_VERSION "1.4.1"

#define DLLFUNCTION __declspec(dllexport)
#define DLLVAR DLLFUNCTION

#ifdef _DEBUG
//#define LOGGING
#endif

enum IError
{
	SUCCESS,
	NO_UOWND,
	NO_TID,
	NO_HOOK,
	NO_SHAREMEM,
	LIB_DISABLED,
	NO_PATCH,
	NO_COPY,
	INVALID_PARAMS,

	UNKNOWN,
};

enum UONET_MESSAGE
{
	SEND = 1,
	RECV = 2,
	READY = 3,
	NOT_READY = 4,
	CONNECT = 5,
	DISCONNECT = 6,
	KEYDOWN = 7,
	MOUSE = 8,

	ACTIVATE = 9,
	FOCUS = 10,

	CLOSE = 11,
	STAT_BAR = 12,
	NOTO_HUE = 13,
	DLL_ERROR = 14,

	SETWNDSIZE = 19,

	SMART_CPU = 21,
	NEGOTIATE = 22,
	SET_MAP_HWND = 23,

	ON_TICK = 24,
};

enum class UONET_MESSAGE_COPYDATA
{
	POSITION = 1,
};

//#define SHARED_BUFF_SIZE 0x80000 // Client's buffers are 500k
#define SHARED_BUFF_SIZE 524288 // 262144 // 250k
struct Buffer
{
	int Length;
	int Start;
	BYTE Buff[SHARED_BUFF_SIZE];
};

#pragma pack(1)
struct Position {
	uint16_t x;
	uint16_t y;
	uint16_t z;
};
static_assert(sizeof(struct Position) == 6, "Incorrect size\n");

struct SharedMemory
{
	// Do *not* mess with this struct.  Really.  I mean it.
	Buffer InRecv;
	Buffer OutRecv;
	Buffer InSend;
	Buffer OutSend;

	char TitleBar[1024];
	bool ForceDisconn;
	unsigned int TotalSend;
	unsigned int TotalRecv;
	unsigned short PacketTable[256];
	char DataPath[256];
	bool AllowNegotiate;
	unsigned char AuthBits[16];
	bool Reserved0;
	unsigned int ServerIP;
	unsigned short ServerPort;
	char UOVersion[16];
};

class PatchInfo
{
public:
	PatchInfo( DWORD addr, int len )
	{
		Address = addr;
		Length = len;
		Data = new char[Length];
		memcpy( Data, (const void*)Address, Length );
	}

	~PatchInfo()
	{
		delete[] Data;
	}

	DWORD Address;
	int Length;
	char *Data;
};

#define WM_PROCREADY WM_USER
#define WM_UONETEVENT WM_USER+1
#define WM_CUSTOMTITLE WM_USER+2

#ifndef WM_XBUTTONDOWN
#define WM_XBUTTONDOWN                  0x020B
#endif

extern HWND hUOWindow;
extern HINSTANCE hInstance;
extern SharedMemory *pShared;
extern HANDLE CommMutex;

DLLFUNCTION int InstallLibrary( HWND PostWindow, DWORD pId );
DLLFUNCTION void Shutdown( bool closeClient );
DLLFUNCTION HWND FindUOWindow();
DLLFUNCTION void *GetSharedAddress();
DLLFUNCTION int GetPacketLength( unsigned char *data, int len );
DLLFUNCTION bool IsDynLength( unsigned char packet );
DLLFUNCTION int GetUOProcId();
DLLFUNCTION HANDLE GetCommMutex();
DLLFUNCTION unsigned int TotalIn();
DLLFUNCTION unsigned int TotalOut();
DLLFUNCTION void CalibratePosition(uint16_t x, uint16_t y, uint16_t z);
DLLFUNCTION void OnAttach(void *params, int paramsLen);
DLLFUNCTION void SetServer(unsigned int addr, unsigned short port);
DLLFUNCTION const char *GetUOVersion();


LRESULT CALLBACK UOAWndProc( HWND, UINT, WPARAM, LPARAM );
void Log( const char *format, ... );
void MemoryPatch( unsigned long, unsigned long );
void MemoryPatch( unsigned long, int, int );
void MemoryPatch( unsigned long, const void *, int );
void RedrawTitleBar( HWND, bool );
void CheckTitlebarAttr(HWND);
void FreeArt();
void InitThemes();
bool PatchStatusBar( BOOL preAOS );

//#define PACKET_TBL_STR "Got Logout OK packet!\0\0\0"
//#define PACKET_TS_LEN 24
#define PACKET_TBL_STR "\x07\0\0\0\x03\0\0\0"
#define PACKET_TS_LEN 8
#define PACKET_TBL_OFFSET (0-(8+12+12))

//search disassembly for
//static key1 C1 E2 1F D1 E8 D1 E9 0B C6 0B CA 35 static key2 81 F1 dynamic key 4D
#define CRYPT_KEY_STR "\xC1\xE2\x1F\xD1\xE8\xD1\xE9\x0B\xC6\x0B\xCA\x35"
#define CRYPT_KEY_LEN 12

//static key1 D1 E8 0B C6 C1 E2 1F 35 static key2 D1 E9 89 83 F0 00 42 00 8B 45 08 0B CA 81 F1 dynamic key 48
#define CRYPT_KEY_STR_3D "\xD1\xE8\x0B\xC6\xC1\xE2\x1F\x35"
#define CRYPT_KEY_3D_LEN 8

/* To calculate login keys:
key1 = ( Major << 23 ) | ( Minor << 14 ) | ( Revision << 4 );
key1 ^= ( Revision * Revision ) << 9;
key1 ^= ( Minor * Minor );
key1 ^= ( Minor * 11 ) << 24;
key1 ^= ( Revision * 7 ) << 19;
key1 ^= 0x2C13A5FD;
key2 = ( Major << 22 ) | ( Revision << 13 ) | ( Minor << 3 );
key2 ^= ( Revision * Revision * 3 ) << 10;
key2 ^= ( Minor * Minor );
key2 ^= ( Minor * 13 ) << 23;
key2 ^= ( Revision * 7 ) << 18;
key2 ^= 0xA31D527F;
*/
/*
.text:0041AA2F C1 E6 1F                          shl     esi, 31
.text:0041AA32 D1 E8                             shr     eax, 1
.text:0041AA34 0B C6                             or      eax, esi
.text:0041AA36 47                                inc     edi
.text:0041AA37 33 05 BC 29 6B 00                 xor     eax, LoginKey_2
.text:0041AA3D C1 E2 1F                          shl     edx, 31
.text:0041AA40 89 83 F8 00 0A 00                 mov     [ebx+0A00F8h], eax
.text:0041AA46 D1 E8                             shr     eax, 1
.text:0041AA48 0B C6                             or      eax, esi
.text:0041AA4A 8B 35 BC 29 6B 00                 mov     esi, LoginKey_2
.text:0041AA50 33 C6                             xor     eax, esi
.text:0041AA52 D1 E9                             shr     ecx, 1
.text:0041AA54 89 83 F8 00 0A 00                 mov     [ebx+0A00F8h], eax
.text:0041AA5A 0B CA                             or      ecx, edx
.text:0041AA5C 8B 15 B8 29 6B 00                 mov     edx, LoginKey_1
*/
// -- -- -- -- -- --
// 1F D1 E8 0B C6 47 33 05 memoryloc_2 C1 E2 1F 89 83 F8 00 0A 00 D1 E8 0B C6 8B 35 memoryloc_2 33 C6 D1 E9 89 83 F8 00 0A 00 0B Ca 8b 15 memoryloc_1 33 CA
#define CRYPT_KEY_STR_NEW "\x1F\xD1\xE8\x0B\xC6\x47\x33\x05"
#define CRYPT_KEY_NEW_LEN 8

/*
.text:0041C599 8B F0                             mov     esi, eax
.text:0041C59B 8B FA                             mov     edi, edx
.text:0041C59D D1 E8                             shr     eax, 1
.text:0041C59F C1 E7 1F                          shl     edi, 31
.text:0041C5A2 0B C7                             or      eax, edi
.text:0041C5A4 33 05 FC AB 6C 00                 xor     eax, dword_6CABFC
.text:0041C5AA D1 EA                             shr     edx, 1
.text:0041C5AC D1 E8                             shr     eax, 1
.text:0041C5AE C1 E6 1F                          shl     esi, 31
.text:0041C5B1 0B C7                             or      eax, edi
.text:0041C5B3 33 05 FC AB 6C 00                 xor     eax, dword_6CABFC
.text:0041C5B9 0B D6                             or      edx, esi
.text:0041C5BB 33 15 00 AC 6C 00                 xor     edx, dword_6CAC00
.text:0041C5C1 83 EB 01                          sub     ebx, 1
.text:0041C5C4 83 C5 01                          add     ebp, 1
.text:0041C5C7 85 DB                             test    ebx, ebx
*/
// E8 C1 E7 1F 0B C7 33 05 memoryloc_2
#define CRYPT_KEY_STR_MORE_NEW "\xE8\xC1\xE7\x1F\x0B\xC7\x33\x05"
#define CRYPT_KEY_MORE_NEW_LEN 8


================================================
FILE: Crypt/Crypt.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup Label="ProjectConfigurations">
    <ProjectConfiguration Include="Debug|Win32">
      <Configuration>Debug</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
    <ProjectConfiguration Include="Release|Win32">
      <Configuration>Release</Configuration>
      <Platform>Win32</Platform>
    </ProjectConfiguration>
  </ItemGroup>
  <PropertyGroup Label="Globals">
    <ProjectGuid>{B32A4D9E-3AF1-4C75-989D-D62C4E8F08B1}</ProjectGuid>
    <RootNamespace>Crypt</RootNamespace>
    <Keyword>Win32Proj</Keyword>
    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
  <PropertyGroup>
    <ConfigurationType>DynamicLibrary</ConfigurationType>
    <PlatformToolset>v143</PlatformToolset>
    <CharacterSet>MultiByte</CharacterSet>
  </PropertyGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
  <ImportGroup Label="ExtensionSettings">
  </ImportGroup>
  <ImportGroup Label="PropertySheets">
    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
    <Import Project="$(VCTargetsPath)Microsoft.CPP.UpgradeFromVC71.props" />
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup>
    <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
  </PropertyGroup>
  <PropertyGroup>
    <OutDir>$(SolutionDir)bin\$(Platform)\$(Configuration)\</OutDir>
  </PropertyGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
    <ClCompile>
      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;CRYPT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <WarningLevel>Level3</WarningLevel>
      <Optimization>Disabled</Optimization>
      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
      <CallingConvention>StdCall</CallingConvention>
    </ClCompile>
    <Link>
      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <ModuleDefinitionFile>Crypt.def</ModuleDefinitionFile>
      <GenerateDebugInformation>true</GenerateDebugInformation>
      <SubSystem>Windows</SubSystem>
      <TargetMachine>MachineX86</TargetMachine>
    </Link>
  </ItemDefinitionGroup>
  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
    <ClCompile>
      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;CRYPT_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
      <WarningLevel>Level3</WarningLevel>
      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
      <CallingConvention>StdCall</CallingConvention>
    </ClCompile>
    <Link>
      <AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
      <ModuleDefinitionFile>Crypt.def</ModuleDefinitionFile>
      <GenerateDebugInformation>false</GenerateDebugInformation>
      <SubSystem>Windows</SubSystem>
      <OptimizeReferences>true</OptimizeReferences>
      <TargetMachine>MachineX86</TargetMachine>
    </Link>
  </ItemDefinitionGroup>
  <ItemGroup>
    <ClCompile Include="Crypt.cpp" />
    <ClCompile Include="LoginEncryption.cpp" />
    <ClCompile Include="MemFinder.cpp" />
    <ClCompile Include="OldStatusBar.cpp" />
    <ClCompile Include="OSIEncryption.cpp" />
    <ClCompile Include="PacketInfo.cpp" />
    <ClCompile Include="stdafx.cpp" />
    <ClCompile Include="twofish.c" />
    <ClCompile Include="uo_huffman.cpp" />
    <ClCompile Include="UOArt.cpp" />
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="Crypt.h" />
    <ClInclude Include="debug.h" />
    <ClInclude Include="LoginEncryption.h" />
    <ClInclude Include="MemFinder.h" />
    <ClInclude Include="OSIEncryption.h" />
    <ClInclude Include="PacketInfo.h" />
    <ClInclude Include="platform.h" />
    <ClInclude Include="resource.h" />
    <ClInclude Include="stdafx.h" />
    <ClInclude Include="table.h" />
    <ClInclude Include="twofish.h" />
    <ClInclude Include="uo_huffman.h" />
  </ItemGroup>
  <ItemGroup>
    <None Include="Crypt.def" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\Razor\Razor.csproj">
      <Project>{b24e4fb1-4936-4544-9e88-f3ff9b04fdba}</Project>
      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
    </ProjectReference>
  </ItemGroup>
  <ItemGroup>
    <Image Include="App.ico" />
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="Crypt.rc" />
  </ItemGroup>
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
  <ImportGroup Label="ExtensionTargets">
  </ImportGroup>
</Project>

================================================
FILE: Crypt/Crypt.vcxproj.filters
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ItemGroup>
    <Filter Include="Source Files">
      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
    </Filter>
    <Filter Include="Header Files">
      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
    </Filter>
    <Filter Include="Resource Files">
      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
    </Filter>
  </ItemGroup>
  <ItemGroup>
    <ClCompile Include="Crypt.cpp">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="LoginEncryption.cpp">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="MemFinder.cpp">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="OldStatusBar.cpp">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="OSIEncryption.cpp">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="PacketInfo.cpp">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="stdafx.cpp">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="twofish.c">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="uo_huffman.cpp">
      <Filter>Source Files</Filter>
    </ClCompile>
    <ClCompile Include="UOArt.cpp">
      <Filter>Source Files</Filter>
    </ClCompile>
  </ItemGroup>
  <ItemGroup>
    <ClInclude Include="Crypt.h">
      <Filter>Header Files</Filter>
    </ClInclude>
    <ClInclude Include="debug.h">
      <Filter>Header Files</Filter>
    </ClInclude>
    <ClInclude Include="LoginEncryption.h">
      <Filter>Header Files</Filter>
    </ClInclude>
    <ClInclude Include="MemFinder.h">
      <Filter>Header Files</Filter>
    </ClInclude>
    <ClInclude Include="OSIEncryption.h">
      <Filter>Header Files</Filter>
    </ClInclude>
    <ClInclude Include="PacketInfo.h">
      <Filter>Header Files</Filter>
    </ClInclude>
    <ClInclude Include="platform.h">
      <Filter>Header Files</Filter>
    </ClInclude>
    <ClInclude Include="resource.h">
      <Filter>Header Files</Filter>
    </ClInclude>
    <ClInclude Include="stdafx.h">
      <Filter>Header Files</Filter>
    </ClInclude>
    <ClInclude Include="table.h">
      <Filter>Header Files</Filter>
    </ClInclude>
    <ClInclude Include="twofish.h">
      <Filter>Header Files</Filter>
    </ClInclude>
    <ClInclude Include="uo_huffman.h">
      <Filter>Header Files</Filter>
    </ClInclude>
  </ItemGroup>
  <ItemGroup>
    <None Include="Crypt.def">
      <Filter>Source Files</Filter>
    </None>
  </ItemGroup>
  <ItemGroup>
    <Image Include="App.ico">
      <Filter>Resource Files</Filter>
    </Image>
  </ItemGroup>
  <ItemGroup>
    <ResourceCompile Include="Crypt.rc">
      <Filter>Resource Files</Filter>
    </ResourceCompile>
  </ItemGroup>
</Project>

================================================
FILE: Crypt/LoginEncryption.cpp
================================================
#include "stdafx.h"

#include "Crypt.h"
#include "LoginEncryption.h"

#define N2L(C, LL) \
    LL  = ((unsigned int)(*((C)++))) << 24, \
    LL |= ((unsigned int)(*((C)++))) << 16, \
    LL |= ((unsigned int)(*((C)++))) << 8, \
    LL |= ((unsigned int)(*((C)++)))

DWORD zero = 0;

const DWORD *LoginEncryption::Key1 = &zero;
const DWORD *LoginEncryption::Key2 = &zero;

LoginEncryption::LoginEncryption()
{
	m_Table[0] = m_Table[1] = 0;
}

void LoginEncryption::SetKeys( const DWORD *k1, const DWORD *k2 )
{
	//LoginEncryption::StaticKey1  = *((DWORD*)sk1);
	LoginEncryption::Key1 = k1;
	LoginEncryption::Key2 = k2;
}

void LoginEncryption::Initialize( const BYTE *pSeed )
{
	DWORD seed;
    N2L(pSeed, seed);

	/*char temp[256];
	sprintf( temp, "Key1 = %08x, Key2 = %08x", *Key1, *Key2 );
	MessageBox( NULL, temp, "Keys", MB_OK );*/

    m_Table[0] = (((~seed) ^ 0x00001357) << 16) | ((seed ^ 0xffffaaaa) & 0x0000ffff);
    m_Table[1] = ((seed ^ 0x43210000) >> 16) | (((~seed) ^ 0xabcdffff) & 0xffff0000);
}

void LoginEncryption::Encrypt( const BYTE *in, BYTE *out, int len )
{
	for (int i=0;i<len;i++)
		out[i] = Crypt( in[i] );
}

void LoginEncryption::Decrypt( const BYTE *in, BYTE *out, int len )
{
	for (int i=0;i<len;i++)
		out[i] = Crypt( in[i] );
}

BYTE LoginEncryption::Crypt( BYTE in )
{
	//m_Table[1] = (((((pt1 >> 1) | (pt0 << 31)) ^ LOGIN_KEY_1) >> 1) | (pt0<<31)) ^ LOGIN_KEY_1;
	//m_Table[0] = ((pt0 >> 1) | (pt1 << 31)) ^ LOGIN_KEY_2;
	
	BYTE out = in ^ ((unsigned char)m_Table[0]);

	DWORD OldT1 = m_Table[1];
	m_Table[1] = ((((m_Table[1] >> 1) | (m_Table[0] << 31)) ^ ((*Key1)-1)) >> 1 | (m_Table[0] << 31)) ^ (*Key1);
	m_Table[0] = ((m_Table[0]>>1) | (OldT1<<31)) ^ (*Key2);
	
	return out;
}

bool LoginEncryption::TestForLogin( BYTE encrypted )
{
	return IsLoginByte( (BYTE)( encrypted ^ ((BYTE)m_Table[0]) ) );
}

bool LoginEncryption::IsLoginByte( BYTE unencrypted )
{
	return unencrypted == ((BYTE)0x80) || unencrypted == ((BYTE)0x48);
}

DWORD LoginEncryption::GenerateBadSeed( DWORD oldSeed )
{
	DWORD newSeed = (*Key1) ^ (*Key2);
	newSeed = ((newSeed >> 24) & 0xFF) | ((newSeed >> 8) & 0xFF00) | ((newSeed << 8) & 0xFF0000) | ((newSeed << 24) & 0xFF000000);
	return htonl( newSeed ^ htonl( oldSeed ) );
}


================================================
FILE: Crypt/LoginEncryption.h
================================================
#pragma once

class LoginEncryption
{
public:
	LoginEncryption();

	void Initialize( const BYTE *pSeed );

	static void SetKeys( const DWORD *k1, const DWORD *k2 );

	void Encrypt( const BYTE *in, BYTE *out, int len );
	void Decrypt( const BYTE *in, BYTE *out, int len );

	bool TestForLogin( BYTE encrypted );

	static DWORD GenerateBadSeed( DWORD oldSeed );

	static bool IsLoginByte( BYTE unencrypted );

private:
	static const DWORD *Key1, *Key2;

	BYTE Crypt( BYTE );

	DWORD m_Table[2];
};



================================================
FILE: Crypt/MemFinder.cpp
================================================
#include "stdafx.h"
#include "MemFinder.h"

DWORD MemFinder::Find(const void *data, int length, DWORD addressHint, DWORD addressMax)
{
	for (DWORD addr = addressHint; addr < addressMax; addr++)
	{
		if (IsBadReadPtr((void*)addr, length)) {
			continue;
		}

		__try
		{
			if (memcmp((const void*)addr, data, length) == 0)
				return addr;
		}
		__except (EXCEPTION_ACCESS_VIOLATION)
		{
			continue;
		}
	}

	return 0;
}

MemFinder::MemFinder()
{
	Clear();
}

MemFinder::~MemFinder()
{
	Clear();
}

void MemFinder::Clear()
{
	_Executed = false;
	_StartPos = 0xFFFFFFFF;

	for (unsigned int i = 0; i<_Entries.size(); i++)
		delete[] _Entries[i].Data;

	_Entries.clear();
}


void MemFinder::AddEntry(const void *data, int length, unsigned int maxResults, DWORD hint)
{
	Entry ent;

	ent.Data = new char[length];
	memcpy(ent.Data, data, length);

	ent.Length = length;
	ent.MaxResults = maxResults;
	ent.PositionHint = hint;

	if (hint < _StartPos)
		_StartPos = hint;

	_Entries.push_back(ent);
}

DWORD MemFinder::GetAddress(const void *data, int length, unsigned int idx)
{
	if (!_Executed)
		return 0;

	for (unsigned int i = 0; i < _Entries.size(); i++)
	{
		if (_Entries[i].Length != length)
			continue;

		if (!memcmp(data, _Entries[i].Data, length))
		{
			if (idx < _Entries[i].Results.size())
				return _Entries[i].Results[idx];
			else
				return 0;
		}
	}

	return 0;
}

void MemFinder::Execute()
{
	bool allDone = false;
	for (DWORD pos = _StartPos; pos < 0x02000000 && !allDone; pos++)
	{
		__try
		{
			allDone = true;
			for (unsigned int i = 0; i < _Entries.size(); i++)
			{
				Entry &e = _Entries[i];

				if (e.Results.size() >= e.MaxResults) {
					/* Already found this entry */
					continue;
				}

				if (IsBadReadPtr((void*)pos, e.Length)) {
					continue;
				}

				allDone = false;

				if (e.PositionHint > pos) {
					/* This entry always appears in memory after this position */
					continue;
				}

				if (!memcmp((void*)pos, e.Data, e.Length)) {
					e.Results.push_back(pos);
				}
			}
		}
		__except (EXCEPTION_ACCESS_VIOLATION)
		{
			break;
		}
	}

	_Executed = true;
}



================================================
FILE: Crypt/MemFinder.h
================================================
#pragma pack(1)
#pragma once

#include <vector>
using std::vector;

class MemFinder
{
public:
	static DWORD Find( const void *data, int length, DWORD hint = 0x00400000, DWORD addressMax = 0x01000000 );

	MemFinder();
	~MemFinder();

	void AddEntry( const void *data, int length, unsigned int maxResults, DWORD hint );
	void AddEntry( const void *data, int length, DWORD hint = 0x00400000 ) { AddEntry( data, length, 1, hint ); }

	DWORD GetAddress( const void *data, int length, unsigned int idx = 0 );

	void Execute();

	void Clear();

private:
	struct Entry
	{
		char *Data;
		int Length;
		DWORD PositionHint;
		unsigned int MaxResults;
		vector<DWORD> Results;
	};

	vector<Entry> _Entries;
	bool _Executed;
	DWORD _StartPos;
};


================================================
FILE: Crypt/OSIEncryption.cpp
================================================
#include "stdafx.h"

#include "Crypt.h"
#include "OSIEncryption.h"
#include "TwoFish.h"

OSIEncryption::OSIEncryption()
{
	memset( &m_Key, 0, sizeof(m_Key) );
	memset( &m_Cipher, 0, sizeof(m_Cipher) );
	memset( m_TFTable, 0, 256 );
	memset( m_XORTable, 0, 16 );

	Log( "XT: %X", m_XORTable );

	m_XORPos = m_TFPos = 0;
}

void OSIEncryption::Initialize( DWORD Seed )
{
	memset( &m_Key, 0, sizeof(m_Key) );
	memset( &m_Cipher, 0, sizeof(m_Cipher) );
	memset( m_TFTable, 0, 256 );

	makeKey( &m_Key, DIR_DECRYPT, 0x80, NULL );
	m_Key.key32[0] = m_Key.key32[1] = m_Key.key32[2] = m_Key.key32[3] = Seed;
	reKey( &m_Key );
	cipherInit( &m_Cipher, MODE_ECB, NULL );
	for(int i=0;i<256;i++)
		m_TFTable[i] = i;
	ReinitTFTable();

	MD5( m_TFTable, 256, m_XORTable );
	m_XORPos = 0;
}

void OSIEncryption::ReinitTFTable()
{
	unsigned char tmpBuff[256];
	blockEncrypt( &m_Cipher, &m_Key, m_TFTable, 256*8, tmpBuff );
	memcpy( m_TFTable, tmpBuff, 256 );
	m_TFPos = 0;
}

void OSIEncryption::Hash( BYTE *field, const BYTE *param )
{
	unsigned int a = *((unsigned int *)(field +  0));
	unsigned int b = *((unsigned int *)(field +  4));
	unsigned int c = *((unsigned int *)(field +  8));
	unsigned int d = *((unsigned int *)(field + 12));

	a = ((b & c) | (~b & d)) + *((unsigned int *)(param + 0x00)) + a - 0x28955B88;
	a = ((a << 0x07) | (a >> 0x19)) + b;
	d = ((a & b) | (~a & c)) + *((unsigned int *)(param + 0x04)) + d - 0x173848AA;
	d = ((d << 0x0c) | (d >> 0x14)) + a;
	c = ((d & a) | (~d & b)) + *((unsigned int *)(param + 0x08)) + c + 0x242070DB;
	c = ((c << 0x11) | (c >> 0x0f)) + d;
	b = ((c & d) | (~c & a)) + *((unsigned int *)(param + 0x0c)) + b - 0x3E423112;
	b = ((b << 0x16) | (b >> 0x0a)) + c;
	a = ((b & c) | (~b & d)) + *((unsigned int *)(param + 0x10)) + a - 0x0A83F051;
	a = ((a << 0x07) | (a >> 0x19)) + b;
	d = ((a & b) | (~a & c)) + *((unsigned int *)(param + 0x14)) + d + 0x4787C62A;
	d = ((d << 0x0c) | (d >> 0x14)) + a;
	c = ((d & a) | (~d & b)) + *((unsigned int *)(param + 0x18)) + c - 0x57CFB9ED;
	c = ((c << 0x11) | (c >> 0x0f)) + d;
	b = ((c & d) | (~c & a)) + *((unsigned int *)(param + 0x1c)) + b - 0x02B96AFF;
	b = ((b << 0x16) | (b >> 0x0a)) + c;
	a = ((b & c) | (~b & d)) + *((unsigned int *)(param + 0x20)) + a + 0x698098D8;
	a = ((a << 0x07) | (a >> 0x19)) + b;
	d = ((a & b) | (~a & c)) + *((unsigned int *)(param + 0x24)) + d - 0x74BB0851;
	d = ((d << 0x0c) | (d >> 0x14)) + a;
	c = ((d & a) | (~d & b)) + *((unsigned int *)(param + 0x28)) + c - 0x0000A44F;
	c = ((c << 0x11) | (c >> 0x0f)) + d;
	b = ((c & d) | (~c & a)) + *((unsigned int *)(param + 0x2C)) + b - 0x76A32842;
	b = ((b << 0x16) | (b >> 0x0a)) + c;
	a = ((b & c) | (~b & d)) + *((unsigned int *)(param + 0x30)) + a + 0x6B901122;
	a = ((a << 0x07) | (a >> 0x19)) + b;
	d = ((a & b) | (~a & c)) + *((unsigned int *)(param + 0x34)) + d - 0x02678E6D;
	d = ((d << 0x0c) | (d >> 0x14)) + a;
	c = ((d & a) | (~d & b)) + *((unsigned int *)(param + 0x38)) + c - 0x5986BC72;
	c = ((c << 0x11) | (c >> 0x0f)) + d;
	b = ((c & d) | (~c & a)) + *((unsigned int *)(param + 0x3c)) + b + 0x49B40821;
	b = ((b << 0x16) | (b >> 0x0a)) + c;

	a = ((b & d) | (~d & c)) + *((unsigned int *)(param + 0x04)) + a - 0x09E1DA9E;
	a = ((a << 0x05) | (a >> 0x1b)) + b;
	d = ((a & c) | (~c & b)) + *((unsigned int *)(param + 0x18)) + d - 0x3FBF4CC0;
	d = ((d << 0x09) | (d >> 0x17)) + a;
	c = ((d & b) | (~b & a)) + *((unsigned int *)(param + 0x2c)) + c + 0x265E5A51;
	c = ((c << 0x0e) | (c >> 0x12)) + d;
	b = ((c & a) | (~a & d)) + *((unsigned int *)(param + 0x00)) + b - 0x16493856;
	b = ((b << 0x14) | (b >> 0x0c)) + c;
	a = ((b & d) | (~d & c)) + *((unsigned int *)(param + 0x14)) + a - 0x29D0EFA3;
	a = ((a << 0x05) | (a >> 0x1b)) + b;
	d = ((a & c) | (~c & b)) + *((unsigned int *)(param + 0x28)) + d + 0x02441453;
	d = ((d << 0x09) | (d >> 0x17)) + a;
	c = ((d & b) | (~b & a)) + *((unsigned int *)(param + 0x3c)) + c - 0x275E197F;
	c = ((c << 0x0e) | (c >> 0x12)) + d;
	b = ((c & a) | (~a & d)) + *((unsigned int *)(param + 0x10)) + b - 0x182C0438;
	b = ((b << 0x14) | (b >> 0x0c)) + c;
	a = ((b & d) | (~d & c)) + *((unsigned int *)(param + 0x24)) + a + 0x21E1CDE6;
	a = ((a << 0x05) | (a >> 0x1b)) + b;
	d = ((a & c) | (~c & b)) + *((unsigned int *)(param + 0x38)) + d - 0x3CC8F82A;
	d = ((d << 0x09) | (d >> 0x17)) + a;
	c = ((d & b) | (~b & a)) + *((unsigned int *)(param + 0x0c)) + c - 0x0B2AF279;
	c = ((c << 0x0e) | (c >> 0x12)) + d;
	b = ((c & a) | (~a & d)) + *((unsigned int *)(param + 0x20)) + b + 0x455A14ED;
	b = ((b << 0x14) | (b >> 0x0c)) + c;
	a = ((b & d) | (~d & c)) + *((unsigned int *)(param + 0x34)) + a - 0x561C16FB;
	a = ((a << 0x05) | (a >> 0x1b)) + b;
	d = ((a & c) | (~c & b)) + *((unsigned int *)(param + 0x08)) + d - 0x03105C08;
	d = ((d << 0x09) | (d >> 0x17)) + a;
	c = ((d & b) | (~b & a)) + *((unsigned int *)(param + 0x1c)) + c + 0x676F02D9;
	c = ((c << 0x0e) | (c >> 0x12)) + d;
	b = ((c & a) | (~a & d)) + *((unsigned int *)(param + 0x30)) + b - 0x72D5B376;
	b = ((b << 0x14) | (b >> 0x0c)) + c;

	a = (b ^ c ^ d) + *((unsigned int *)(param + 0x14)) + a - 0x0005C6BE;
	a = ((a << 0x04) | (a >> 0x1c)) + b;
	d = (a ^ b ^ c) + *((unsigned int *)(param + 0x20)) + d - 0x788E097F;
	d = ((d << 0x0b) | (d >> 0x15)) + a;
	c = (d ^ a ^ b) + *((unsigned int *)(param + 0x2c)) + c + 0x6D9D6122;
	c = ((c << 0x10) | (c >> 0x10)) + d;
	b = (c ^ d ^ a) + *((unsigned int *)(param + 0x38)) + b - 0x021AC7F4;
	b = ((b << 0x17) | (b >> 0x09)) + c;
	a = (b ^ c ^ d) + *((unsigned int *)(param + 0x04)) + a - 0x5B4115BC;
	a = ((a << 0x04) | (a >> 0x1c)) + b;
	d = (a ^ b ^ c) + *((unsigned int *)(param + 0x10)) + d + 0x4BDECFA9;
	d = ((d << 0x0b) | (d >> 0x15)) + a;
	c = (d ^ a ^ b) + *((unsigned int *)(param + 0x1c)) + c - 0x0944B4A0;
	c = ((c << 0x10) | (c >> 0x10)) + d;
	b = (c ^ d ^ a) + *((unsigned int *)(param + 0x28)) + b - 0x41404390;
	b = ((b << 0x17) | (b >> 0x09)) + c;
	a = (b ^ c ^ d) + *((unsigned int *)(param + 0x34)) + a + 0x289B7EC6;
	a = ((a << 0x04) | (a >> 0x1c)) + b;
	d = (a ^ b ^ c) + *((unsigned int *)(param + 0x00)) + d - 0x155ED806;
	d = ((d << 0x0b) | (d >> 0x15)) + a;
	c = (d ^ a ^ b) + *((unsigned int *)(param + 0x0c)) + c - 0x2B10CF7B;
	c = ((c << 0x10) | (c >> 0x10)) + d;
	b = (c ^ d ^ a) + *((unsigned int *)(param + 0x18)) + b + 0x04881D05;
	b = ((b << 0x17) | (b >> 0x09)) + c;
	a = (b ^ c ^ d) + *((unsigned int *)(param + 0x24)) + a - 0x262B2FC7;
	a = ((a << 0x04) | (a >> 0x1c)) + b;
	d = (a ^ b ^ c) + *((unsigned int *)(param + 0x30)) + d - 0x1924661B;
	d = ((d << 0x0b) | (d >> 0x15)) + a;
	c = (d ^ a ^ b) + *((unsigned int *)(param + 0x3c)) + c + 0x1fa27cf8;
	c = ((c << 0x10) | (c >> 0x10)) + d;
	b = (c ^ d ^ a) + *((unsigned int *)(param + 0x08)) + b - 0x3B53A99B;
	b = ((b << 0x17) | (b >> 0x09)) + c;

	a = ((~d | b) ^ c)  + *((unsigned int *)(param + 0x00)) + a - 0x0BD6DDBC;
	a = ((a << 0x06) | (a >> 0x1a)) + b; 
	d = ((~c | a) ^ b)  + *((unsigned int *)(param + 0x1c)) + d + 0x432AFF97;
	d = ((d << 0x0a) | (d >> 0x16)) + a; 
	c = ((~b | d) ^ a)  + *((unsigned int *)(param + 0x38)) + c - 0x546BDC59;
	c = ((c << 0x0f) | (c >> 0x11)) + d; 
	b = ((~a | c) ^ d)  + *((unsigned int *)(param + 0x14)) + b - 0x036C5FC7;
	b = ((b << 0x15) | (b >> 0x0b)) + c; 
	a = ((~d | b) ^ c)  + *((unsigned int *)(param + 0x30)) + a + 0x655B59C3;
	a = ((a << 0x06) | (a >> 0x1a)) + b; 
	d = ((~c | a) ^ b)  + *((unsigned int *)(param + 0x0C)) + d - 0x70F3336E;
	d = ((d << 0x0a) | (d >> 0x16)) + a; 
	c = ((~b | d) ^ a)  + *((unsigned int *)(param + 0x28)) + c - 0x00100B83;
	c = ((c << 0x0f) | (c >> 0x11)) + d; 
	b = ((~a | c) ^ d)  + *((unsigned int *)(param + 0x04)) + b - 0x7A7BA22F;
	b = ((b << 0x15) | (b >> 0x0b)) + c; 
	a = ((~d | b) ^ c)  + *((unsigned int *)(param + 0x20)) + a + 0x6FA87E4F;
	a = ((a << 0x06) | (a >> 0x1a)) + b; 
	d = ((~c | a) ^ b)  + *((unsigned int *)(param + 0x3c)) + d - 0x01D31920;
	d = ((d << 0x0a) | (d >> 0x16)) + a; 
	c = ((~b | d) ^ a)  + *((unsigned int *)(param + 0x18)) + c - 0x5CFEBCEC;
	c = ((c << 0x0f) | (c >> 0x11)) + d; 
	b = ((~a | c) ^ d)  + *((unsigned int *)(param + 0x34)) + b + 0x4E0811A1;
	b = ((b << 0x15) | (b >> 0x0b)) + c; 
	a = ((~d | b) ^ c)  + *((unsigned int *)(param + 0x10)) + a - 0x08AC817E;
	a = ((a << 0x06) | (a >> 0x1a)) + b; 
	d = ((~c | a) ^ b)  + *((unsigned int *)(param + 0x2c)) + d - 0x42C50DCB;
	d = ((d << 0x0a) | (d >> 0x16)) + a; 
	c = ((~b | d) ^ a)  + *((unsigned int *)(param + 0x08)) + c + 0x2AD7D2BB;
	c = ((c << 0x0f) | (c >> 0x11)) + d; 
	b = ((~a | c) ^ d)  + *((unsigned int *)(param + 0x24)) + b - 0x14792C6F;
	b = ((b << 0x15) | (b >> 0x0b)) + c;

	*((unsigned int *)(field +  0)) += a;
	*((unsigned int *)(field +  4)) += b;
	*((unsigned int *)(field +  8)) += c;
	*((unsigned int *)(field + 12)) += d;
}

void OSIEncryption::CallHash( BYTE *key, const BYTE *challenge, unsigned int len )
{
	unsigned int *ptr1, *ptr2;
	unsigned int a, b, c;

	ptr1 = (unsigned int *)(key + 16);
	ptr2 = (unsigned int *)(key + 20);

	a = *ptr1;
	b = (a >> 3) & 0x3f;
	a += len * 8;
	*ptr1 = a;

	if ( a < (len << 3) )
		ptr2 += 4;

	*ptr2 = *ptr2 + (len >> 0x1d);

	a = 64 - b;
	c = 0;

	if ( a <= len )
	{
		memcpy( key + b + 24, challenge, a );
		Hash( key, key + 24 );

		c = a;
		a += 0x3F;

		while ( a < len )
		{
			Hash( key, challenge + a - 0x3f );
			a += 64;
			c += 64;
		}

		b = 0;
	}

	memcpy( key + b + 24, challenge + c, len - c );
}

void OSIEncryption::CalcResponse( BYTE *result, BYTE *field )
{
	BYTE buf1[0x80];
	BYTE buf2[0x80];
	int i;

	memset( buf1, 0, 0x80 );

	*buf1 = 0x80;

	memcpy( buf2, field + 16, 8 );

	i = ( int(*((unsigned int *)(buf2))) >> 3 ) & 0x3f;

	if ( i < 56 )
		i = 56 - i;
	else
		i = 120 - i;

	CallHash( field, buf1, i );
	CallHash( field, buf2, 8 );

	memcpy( result, field, 16 );
}

void OSIEncryption::MD5( const BYTE *input, int inLen, BYTE *output )
{
	BYTE field[0x80];

	memset( field, 0, 0x80 );

	field[0x0] = 0x01;
	field[0x1] = 0x23;
	field[0x2] = 0x45;
	field[0x3] = 0x67;
	field[0x4] = 0x89;
	field[0x5] = 0xAB;
	field[0x6] = 0xCD;
	field[0x7] = 0xEF;
	field[0x8] = 0xFE;
	field[0x9] = 0xDC;
	field[0xA] = 0xBA;
	field[0xB] = 0x98;
	field[0xC] = 0x76;
	field[0xD] = 0x54;
	field[0xE] = 0x32;
	field[0xF] = 0x10;

	CallHash( field, input, inLen );
	CalcResponse( output, field );
}

//going TO the client uses rotating XOR, going FROM the client uses TwoFish

void OSIEncryption::XORCrypt( const BYTE *in, BYTE *out, int len )
{
	for (int i=0;i<len;i++)
	{
		out[i] = in[i] ^ m_XORTable[m_XORPos%16];
		m_XORPos++;
	}
}

void OSIEncryption::TwoFishCrypt( const BYTE *in, BYTE *out, int len )
{
	for(int i=0;i<len;i++)
	{
		if( m_TFPos >= 256 )
			ReinitTFTable();
		out[i] = in[i] ^ m_TFTable[m_TFPos++];
	}
}

//server -> us
void OSIEncryption::DecryptFromServer( const BYTE *in, BYTE *out, int len )
{
	XORCrypt( in, out, len );
}

//us -> client
void OSIEncryption::EncryptForClient( const BYTE *in, BYTE *out, int len )
{
	XORCrypt( in, out, len );
}

//us -> server
void OSIEncryption::EncryptForServer( const BYTE *in, BYTE *out, int len )
{
	TwoFishCrypt( in, out, len );
}

//client -> us
void OSIEncryption::DecryptFromClient( const BYTE *in, BYTE *out, int len )
{
	TwoFishCrypt( in, out, len );
}




================================================
FILE: Crypt/OSIEncryption.h
================================================
#pragma once

#include "TwoFish.h"

class OSIEncryption
{
public:
	OSIEncryption();

	void Initialize( DWORD dwSeed );

	void DecryptFromServer( const BYTE *in, BYTE *out, int len );
	void DecryptFromClient( const BYTE *in, BYTE *out, int len );

	void EncryptForServer( const BYTE *in, BYTE *out, int len );
	void EncryptForClient( const BYTE *in, BYTE *out, int len );

	static void MD5( const BYTE *input, int inLen, BYTE *output );

private:
	void TwoFishCrypt( const BYTE *in, BYTE *out, int len );
	void ReinitTFTable();

	void XORCrypt( const BYTE *in, BYTE *out, int len );
	void InitializeXORTable( const BYTE* data, int dataLen );
	static void Hash( BYTE *field, const BYTE *param );
	static void CallHash( BYTE *key, const BYTE *challenge, unsigned int len );
	static void CalcResponse( BYTE *result, BYTE *field );

	keyInstance m_Key; 
	cipherInstance m_Cipher; 
	unsigned int m_TFPos;
	unsigned char m_XORPos;
	BYTE m_TFTable[256];
	BYTE m_XORTable[16];
};



================================================
FILE: Crypt/OldStatusBar.cpp
================================================
#include "StdAfx.h"
#include "Crypt.h"
#include "MemFinder.h"

DWORD GumpOutV28( DWORD OutFuncAddr, int esiOff, char TwoFourOff, DWORD CurAddr, int x, int y )
{
	int count = 0;

	memcpy( (void*)(CurAddr+count), "\x8D\x44\x24\x20", 4 ); // lea    eax, [esp+70h+var_50]
	count += 4;
	memcpy( (void*)(CurAddr+count), "\x50", 1 ); // push    eax
	count ++;

	memcpy( (void*)(CurAddr+count), "\x8B\x46", 2 ); // mov    eax, [esi+24h]
	count += 2;
	*((unsigned char*)(CurAddr+count)) = 0x24+TwoFourOff;//+esiOff;
	count ++;
	memcpy( (void*)(CurAddr+count), "\x50", 1 ); // push    eax
	count ++;

	memcpy( (void*)(CurAddr+count), "\x8B\x56", 2 ); // mov     edx, [esi+44h]
	count += 2;
	*((unsigned char*)(CurAddr+count)) = 0x44+esiOff;
	count ++;
	memcpy( (void*)(CurAddr+count), "\x8B\x42\x14", 3 ); // mov     eax, [edx+14h]
	count += 3;
	memcpy( (void*)(CurAddr+count), "\x83\xC0\x04", 3 ); // add     eax, 4
	count += 3;
	memcpy( (void*)(CurAddr+count), "\x50", 1 ); // push    eax
	count ++;

	memcpy( (void*)(CurAddr+count), "\x8D\x44\x24\x54", 4 ); // lea    eax, [esp+7Ch+var_28]
	count += 4;
	memcpy( (void*)(CurAddr+count), "\x50", 1 ); // push    eax
	count ++;

	memcpy( (void*)(CurAddr+count), "\x68\x86\x03\x00\x00", 5 ); // push    386h
	count += 5;

	memcpy( (void*)(CurAddr+count), "\x6A\x01", 2 ); // push    1
	count += 2;

	// push    y
	if ( y < 0x80 )
	{
		*((unsigned char*)(CurAddr+count)) = 0x6A;
		count ++;
		*((unsigned char*)(CurAddr+count)) = (unsigned char)y;
		count ++;
	}
	else
	{
		*((unsigned char*)(CurAddr+count)) = 0x68;
		count ++;
		*((int*)(CurAddr+count)) = y;
		count += 4;
	}

	// push    x
	if ( x < 0x80 )
	{
		*((unsigned char*)(CurAddr+count)) = 0x6A;
		count ++;
		*((unsigned char*)(CurAddr+count)) = (unsigned char)x;
		count ++;
	}
	else
	{
		*((unsigned char*)(CurAddr+count)) = 0x68;
		count ++;
		*((int*)(CurAddr+count)) = x;
		count += 4;
	}

	// call theFunction
	*((unsigned char*)(CurAddr+count)) = 0xE8;
	count ++;
	*((int*)(CurAddr+count)) = OutFuncAddr - (CurAddr+count+4);
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x83\xC4\x20", 3 ); // add    esp, 20h
	count += 3;

	return count;
}

DWORD Sprintf1UV28( DWORD sprintfAddr, DWORD fmtAddr, DWORD CurAddr, int esiOffset )
{
	int count = 0;

	memcpy( (void*)(CurAddr+count), "\x33\xC9", 2 ); // xor     ecx, ecx
	count += 2;

	memcpy( (void*)(CurAddr+count), "\x8D\x54\x24\x48", 4 ); // lea     edx, [esp+70h+var_28]
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x66\x8B\x8E", 3 ); // mov     cx, [esi+___]
	count += 3;
	*((int*)(CurAddr+count)) = esiOffset;
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x51", 1 ); // push    ecx
	count ++;

	// push offset fmtAddr
	*((unsigned char*)(CurAddr+count)) = 0x68;
	count ++;
	*((int*)(CurAddr+count)) = fmtAddr;
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x52", 1 ); // push    edx
	count ++;

	// call    _sprintf
	*((unsigned char*)(CurAddr+count)) = 0xE8;
	count ++;
	*((int*)(CurAddr+count)) = sprintfAddr - (CurAddr+count+4);
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x83\xC4\x0C", 3 ); // add    esp, 0Ch
	count += 3;

	return count;
}

DWORD Sprintf2UV28_Byte( DWORD sprintfAddr, DWORD fmtAddr, DWORD CurAddr, int offset1, int offset2 )
{
	int count = 0;

	memcpy( (void*)(CurAddr+count), "\x33\xC0", 2 ); // xor     eax, eax
	count += 2;

	memcpy( (void*)(CurAddr+count), "\x8A\x86", 2 ); // mov     al, [esi+___]
	count += 2;
	*((int*)(CurAddr+count)) = offset2;
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x50", 1 ); // push    eax
	count ++;

	memcpy( (void*)(CurAddr+count), "\x33\xC9", 2 ); // xor     ecx, ecx
	count += 2;

	memcpy( (void*)(CurAddr+count), "\x8D\x54\x24\x4C", 4 ); // lea     edx, [esp+70h+var_28]
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x8A\x8E", 2 ); // mov     cl, [esi+___]
	count += 2;
	*((int*)(CurAddr+count)) = offset1;
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x51", 1 ); // push    ecx
	count ++;

	// push offset fmtAddr
	*((unsigned char*)(CurAddr+count)) = 0x68;
	count ++;
	*((int*)(CurAddr+count)) = fmtAddr;
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x52", 1 ); // push    edx
	count ++;

	// call    _sprintf
	*((unsigned char*)(CurAddr+count)) = 0xE8;
	count ++;
	*((int*)(CurAddr+count)) = sprintfAddr - (CurAddr+count+4);
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x83\xC4\x10", 3 ); // add    esp, 10h
	count += 3;

	return count;
}

DWORD Sprintf2UV28( DWORD sprintfAddr, DWORD fmtAddr, DWORD CurAddr, int offset1, int offset2 )
{
	int count = 0;

	memcpy( (void*)(CurAddr+count), "\x33\xC0", 2 ); // xor     eax, eax
	count += 2;

	memcpy( (void*)(CurAddr+count), "\x66\x8B\x86", 3 ); // mov     ax, [esi+___]
	count += 3;
	*((int*)(CurAddr+count)) = offset2;
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x50", 1 ); // push    eax
	count ++;

	memcpy( (void*)(CurAddr+count), "\x33\xC9", 2 ); // xor     ecx, ecx
	count += 2;

	memcpy( (void*)(CurAddr+count), "\x8D\x54\x24\x4C", 4 ); // lea     edx, [esp+70h+var_28]
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x66\x8B\x8E", 3 ); // mov     cx, [esi+___]
	count += 3;
	*((int*)(CurAddr+count)) = offset1;
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x51", 1 ); // push    ecx
	count ++;

	// push offset fmtAddr
	*((unsigned char*)(CurAddr+count)) = 0x68;
	count ++;
	*((int*)(CurAddr+count)) = fmtAddr;
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x52", 1 ); // push    edx
	count ++;

	// call    _sprintf
	*((unsigned char*)(CurAddr+count)) = 0xE8;
	count ++;
	*((int*)(CurAddr+count)) = sprintfAddr - (CurAddr+count+4);
	count += 4;

	memcpy( (void*)(CurAddr+count), "\x83\xC4\x10", 3 ); // add    esp, 10h
	count += 3;

	return count;
}

/*#define STATCODE_BEG "\x8D\x54\x24\x48\x8B\xC3\x2B\xD3\x8A\x08\x88\x0C\x02\x40\x84\xC9\x75\xF6"
#define STATCODE_B_LEN 18
#define STATCODE_START_OFF (STATCODE_B_LEN+0x15)
#define STACK_OFFSET -3
#define STACK_BASE 0x28
*/
#define STATCODE_BEG "\x68\x86\x03\x00\x00\x6A\x01\x6A\x32\x6A\x28\xE8"
#define STATCODE_B_LEN 12
#define STATCODE_START_OFF (-0x1E)
#define STACK_OFFSET 6
#define STACK_BASE 0x28

#define STATCODE_END "\x51\x52\x68\x86\x03\x00\x00\x6A\x01\x68\x8F\x00\x00\x00\x00"
#define STATCODE_E_LEN 14
#define STATCODE_END_OFFSET 9

#define GUMP_STRING1 "\x53\x55\x8B\x6C\x24\x1C\x56\x57\x8B\xFD\x83\xC9\xFF\x33\xC0\xF2"
#define GS1_LEN 16
#define GS1_OFFSET 0x29

#define GID_REPL "\x6C\x2A\x00\x00"
#define GID_R_LEN 4

#define SPRINTF_STR "\x55\x8B\xEC\x83\xEC\x20\x8B\x45\x08\x56\x89\x45\xE8\x89\x45\xE0\x8D\x45\x10\xC7\x45\xEC\x42\x00\x00\x00\x50\x8D\x45\xE0\xFF\x75\x0C\xC7\x45\xE4\xFF\xFF\xFF\x7F\x50\xE8"
#define SPRINTF_LEN 42

#define LOCK_STR_1 "\x6A\x4E\x6A\x28"
#define LOCK_STR_2 "\x6A\x69\x6A\x28"
#define LOCK_STR_3 "\x68\x85\x00\x00\x00\x6A\x28"
#define LOCK_LEN_1 4
#define LOCK_LEN_2 4
#define LOCK_LEN_3 7

#define MIN_STR "\x68\xA8\x00\x00\x00\x68\x98\x01\x00\x00\x68\x92\x00\x00\x00\x68\x81\x01\x00\x00"
#define MIN_STR_LEN 20

vector<PatchInfo *> *PatchVec = NULL;
bool PatchStatusBar( BOOL preAOS )
{
	if ( !preAOS )
	{
		if ( PatchVec == NULL )
			return true;

		for(unsigned int i=0;i<PatchVec->size();i++)
		{
			PatchInfo *patch = (*PatchVec)[i];
			MemoryPatch( patch->Address, patch->Data, patch->Length );
			delete patch;
		}
		delete PatchVec;
		PatchVec = NULL;
		return true;
	}

	if ( PatchVec != NULL )
		return true;

	const unsigned int NewGumpID = 0x00000802;

	MemFinder mf;

	mf.AddEntry( GUMP_STRING1, GS1_LEN );
	mf.AddEntry( "%u/%u", 6 );
	mf.AddEntry( MIN_STR, MIN_STR_LEN );
	mf.AddEntry( STATCODE_BEG, STATCODE_B_LEN );
	mf.AddEntry( SPRINTF_STR, SPRINTF_LEN );
	mf.AddEntry( LOCK_STR_1, LOCK_LEN_1 );
	mf.AddEntry( GID_REPL, GID_R_LEN );

	mf.Execute();

	DWORD GumpString1 = mf.GetAddress( GUMP_STRING1, GS1_LEN );
	if ( !GumpString1 ) 
		return false;
	GumpString1 -= GS1_OFFSET;

	DWORD uuFmt = mf.GetAddress( "%u/%u", 6 );
	if ( !uuFmt ) 
		return false;
	DWORD uFmt = uuFmt + 3;

	DWORD MinLoc = mf.GetAddress( MIN_STR, MIN_STR_LEN );
	if ( !MinLoc ) 
		return false;
	MinLoc += 1;

	DWORD Start = mf.GetAddress( STATCODE_BEG, STATCODE_B_LEN );
	if ( !Start ) 
		return false;
	Start += STATCODE_START_OFF;

	DWORD End = Start;

	do {
		End = MemFinder::Find( STATCODE_END, STATCODE_E_LEN, End + 1 );
	} while ( End && *((unsigned char*)(End+STATCODE_E_LEN+1)) != 0xE8 );

	if ( !End )
		return false;

	End += STATCODE_E_LEN + STATCODE_END_OFFSET;

	DWORD sprintfAddr = mf.GetAddress( SPRINTF_STR, SPRINTF_LEN );
	DWORD LockLoc = mf.GetAddress( LOCK_STR_1, LOCK_LEN_1 );
	DWORD CurPos = mf.GetAddress( GID_REPL, GID_R_LEN );

	if ( !( sprintfAddr && LockLoc && CurPos ) )
		return false;

	PatchVec = new vector<PatchInfo*>();

	PatchVec->push_back( new PatchInfo( CurPos, 4 ) );
	MemoryPatch( CurPos, NewGumpID );
	CurPos = MemFinder::Find( GID_REPL, GID_R_LEN, CurPos+4 );
	if ( CurPos )
	{
		PatchVec->push_back( new PatchInfo( CurPos, 4 ) );
		MemoryPatch( CurPos, NewGumpID );
	}

	PatchVec->push_back( new PatchInfo( LockLoc+0x01, 1 ) );
	PatchVec->push_back( new PatchInfo( LockLoc+0x03, 1 ) );
	MemoryPatch( LockLoc+0x01, 0x3E, 1 );
	MemoryPatch( LockLoc+0x03, 0x26, 1 );

	LockLoc = MemFinder::Find( LOCK_STR_2, LOCK_LEN_2, LockLoc );
	if ( LockLoc )
	{
		PatchVec->push_back( new PatchInfo( LockLoc+0x01, 1 ) );
		PatchVec->push_back( new PatchInfo( LockLoc+0x03, 1 ) );
		MemoryPatch( LockLoc+0x01, 0x4A, 1 );
		MemoryPatch( LockLoc+0x03, 0x26, 1 );

		LockLoc = MemFinder::Find( LOCK_STR_3, LOCK_LEN_3, LockLoc );
		if ( LockLoc )
		{
			PatchVec->push_back( new PatchInfo( LockLoc+0x01, 4 ) );
			PatchVec->push_back( new PatchInfo( LockLoc+0x06, 1 ) );
			MemoryPatch( LockLoc+0x01, 0x56, 4 );
			MemoryPatch( LockLoc+0x06, 0x26, 1 );
		}
	}

	PatchVec->push_back( new PatchInfo( MinLoc+ 0, 4 ) );
	PatchVec->push_back( new PatchInfo( MinLoc+ 5, 4 ) );
	PatchVec->push_back( new PatchInfo( MinLoc+10, 4 ) );
	PatchVec->push_back( new PatchInfo( MinLoc+15, 4 ) );
	MemoryPatch( MinLoc+ 0, 137 );
	MemoryPatch( MinLoc+ 5, 263 );
	MemoryPatch( MinLoc+10, 111 );
	MemoryPatch( MinLoc+15, 239 );

	int len = End - Start;

	PatchVec->push_back( new PatchInfo( Start, len ) );

	DWORD OldProtect;
	if ( !VirtualProtect( (void *)(Start), len, PAGE_EXECUTE_READWRITE, &OldProtect ) )
		return false;

	CurPos = Start;

	int statOffset = *((unsigned char*)(Start + 0x31 + 0x18 + 3));
	int esiOffset = statOffset - 0xD4;
	int stackChange = STACK_BASE - *((unsigned char*)(Start + STACK_OFFSET));
	int twoFourOff = *((unsigned char*)(Start + 0x31 + 2)) - 0x24;

	bool client5 = false;
	char uuPush[5];
	uuPush[0] = 0x68;
	*((DWORD*)&uuPush[1]) = uuFmt;

	DWORD uuSP = MemFinder::Find( uuPush, 5, Start );
	if ( uuSP )
		client5 = ( *((int*)(uuSP - 10)) != (statOffset + 0x1F) );

	if ( stackChange != 0  )
	{
		memcpy( (void*)CurPos, "\x83\xC4", 2 ); // add    esp, __h
		CurPos += 2;
		*((char*)CurPos) = (char)stackChange;
		CurPos++;
	}

	if ( *((unsigned char*)(Start + 11)) != 0x46 ) // was reg is it in?
	{
		memcpy( (void*)CurPos, "\x8B\xF5", 2 ); // mov     esi, ebp
		CurPos += 2;
	}

	// name
	CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 86, 53 );

	if ( stackChange != 0  )
	{
		memcpy( (void*)CurPos, "\x83\xC4", 2 ); // add    esp, __h
		CurPos += 2;
		*((char*)CurPos) = -stackChange;
		CurPos++;
	}

	memset( (void*)CurPos, 0x90, (Start+0x31) - CurPos );

	CurPos = Start + 0x31 + 0x12;

	if ( stackChange != 0  )
	{
		memcpy( (void*)CurPos, "\x83\xC4", 2 ); // add    esp, __h
		CurPos += 2;
		*((char*)CurPos) = (char)stackChange;
		CurPos++;
	}

	if ( *((unsigned char*)(Start + 11)) != 0x46 ) // was reg is it in?
	{
		memcpy( (void*)CurPos, "\x8B\xF5", 2 ); // mov     esi, ebp
		CurPos += 2;
	}

	// str
	CurPos += Sprintf1UV28( sprintfAddr, uFmt, CurPos, statOffset+0x00 );
	CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 86, 72 );

	// dex
	CurPos += Sprintf1UV28( sprintfAddr, uFmt, CurPos, statOffset+0x02 );
	CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 86, 84 );

	// int
	CurPos += Sprintf1UV28( sprintfAddr, uFmt, CurPos, statOffset+0x04 );
	CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 86, 96 );

	// sex?
	//memcpy( (void*)(CurPos), "\xC7\x44\x24\x48Yes", 8 ); // mov     [esp+70h+var_28], __
	//CurPos += 8;
	//CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 86, 108 );

	// followers:
	if ( client5 )
	{
		CurPos += Sprintf2UV28_Byte( sprintfAddr, uuFmt, CurPos, statOffset+2+0x1E, statOffset+2+0x1F );
		CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 86, 108 );
	}
	else
	{
		CurPos += Sprintf2UV28_Byte( sprintfAddr, uuFmt, CurPos, statOffset+0x1E, statOffset+0x1F );
		CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 86, 108 );
	}

	// AR
	if ( client5 )
		CurPos += Sprintf1UV28( sprintfAddr, uFmt, CurPos, statOffset+0x1C );
	else
		CurPos += Sprintf1UV28( sprintfAddr, uFmt, CurPos, statOffset+0x1A );

	CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 86, 120 );

	// hits
	CurPos += Sprintf2UV28( sprintfAddr, uuFmt, CurPos, statOffset+0x06, statOffset+0x08 );
	CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 174, 72 );

	// stam
	CurPos += Sprintf2UV28( sprintfAddr, uuFmt, CurPos, statOffset+0x0A, statOffset+0x0C );
	CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 174, 96 );

	// mana
	CurPos += Sprintf2UV28( sprintfAddr, uuFmt, CurPos, statOffset+0x0E, statOffset+0x10 );
	CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 174, 84 );

	// gold
	CurPos += Sprintf1UV28( sprintfAddr, uFmt, CurPos, statOffset+0x14 );
	CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 174, 108 );

	if ( client5 )
	{
		CurPos += Sprintf2UV28( sprintfAddr, uuFmt, CurPos, statOffset+0x18, statOffset+0x1A );
		CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 174, 120 );
	}
	else
	{
		// Weight:
		memcpy( (void*)CurPos, "\x33\xC9", 2 ); // xor     ecx, ecx
		CurPos += 2;
		memcpy( (void*)CurPos, "\x66\x8B\x8E", 3 ); // mov     cx, [esi+___]
		CurPos += 3;
		*((int*)CurPos) = statOffset+0x00; // str
		CurPos += 4;
		memcpy( (void*)CurPos, "\x8D\x04\xCD\x00\x00\x00\x00\x2B\xC1\x99\x2B\xC2\xD1\xF8\x83\xC0\x28", 17 ); // eax = ecx*3.5 + 40
		CurPos += 17;
		memcpy( (void*)CurPos, "\x50", 1 ); // push    eax
		CurPos ++;

		memcpy( (void*)CurPos, "\x33\xC9", 2 ); // xor     ecx, ecx
		CurPos += 2;
		memcpy( (void*)CurPos, "\x8D\x54\x24\x4C", 4 ); // lea     edx, [esp+74h+var_28]
		CurPos += 4;
		memcpy( (void*)CurPos, "\x66\x8B\x8E", 3 ); // mov     cx, [esi+___]
		CurPos += 3;
		*((int*)CurPos) = statOffset+0x18; // weight
		CurPos += 4;
		memcpy( (void*)CurPos, "\x51", 1 ); // push    ecx
		CurPos ++;

		// push offset fmtAddr
		*((unsigned char*)CurPos) = 0x68;
		CurPos ++;
		*((int*)CurPos) = uuFmt;
		CurPos += 4;

		memcpy( (void*)CurPos, "\x52", 1 ); // push    edx
		CurPos ++;

		// call    _sprintf
		*((unsigned char*)CurPos) = 0xE8;
		CurPos ++;
		*((int*)CurPos) = sprintfAddr - (CurPos+4);
		CurPos += 4;

		memcpy( (void*)CurPos, "\x83\xC4\x10", 3 ); // add    esp, 10h
		CurPos += 3;

		CurPos += GumpOutV28( GumpString1, esiOffset, twoFourOff, CurPos, 174, 120 );
	}

	if ( stackChange != 0  )
	{
		memcpy( (void*)CurPos, "\x83\xC4", 2 ); // add    esp, __h
		CurPos += 2;
		*((char*)CurPos) = -stackChange;
		CurPos++;
	}

	memset( (void*)CurPos, 0x90, End-CurPos );

	VirtualProtect( (void *)(Start), len, OldProtect, &OldProtect );

	return true;
}



================================================
FILE: Crypt/PacketInfo.cpp
================================================
#include "stdafx.h"
#include "Crypt.h"

#include "PacketInfo.h"

DLLFUNCTION int GetPacketLength( unsigned char *packet, int len )
{
	if ( pShared != NULL )
	{
		int packetLen = pShared->PacketTable[(unsigned char)packet[0]];

		if ( packetLen >= 0x4000 )
		{
			if ( len < 3 )
				return 0;
			else
				return packet[1]<<8 | packet[2];
		}
		else
		{
			return packetLen;
		}
	}
	else if ( len >= 3 )
	{
		//attempt to auto detect an undefined packet
		return packet[1]<<8 | packet[2];
	}
	else
	{
		return -1;
	}
}

DLLFUNCTION bool IsDynLength( BYTE packet )
{
	if ( pShared != NULL )
		return pShared->PacketTable[packet] >= 0x8000;
	else
		return true;
}


================================================
FILE: Crypt/PacketInfo.h
================================================
#pragma once
#pragma pack(1)

struct ClientPacketInfo // 12 bytes
{
	int Id;
	int Unk;
	unsigned short Length;
	short Unk0000;
};

const unsigned short StaticPacketTable[] =
{
	0x0068, // 0x00
	0x0005, // 0x01
	0x0007, // 0x02
	0x8000, // 0x03
	0x0002, // 0x04
	0x0005, // 0x05
	0x0005, // 0x06
	0x0007, // 0x07
	0x000F, // 0x08
	0x0005, // 0x09
	0x000B, // 0x0A
	0x0007, // 0x0B
	0x8000, // 0x0C
	0x0003, // 0x0D
	0x8000, // 0x0E
	0x003D, // 0x0F
	0x00D7, // 0x10
	0x8000, // 0x11
	0x8000, // 0x12
	0x000A, // 0x13
	0x0006, // 0x14
	0x0009, // 0x15
	0x8000, // 0x16
	0x8000, // 0x17
	0x8000, // 0x18
	0x8000, // 0x19
	0x8000, // 0x1A
	0x0025, // 0x1B
	0x8000, // 0x1C
	0x0005, // 0x1D
	0x0004, // 0x1E
	0x0008, // 0x1F
	0x0013, // 0x20
	0x0008, // 0x21
	0x0003, // 0x22
	0x001A, // 0x23
	0x0007, // 0x24
	0x0015, // 0x25
	0x0005, // 0x26
	0x0002, // 0x27
	0x0005, // 0x28
	0x0001, // 0x29
	0x0005, // 0x2A
	0x0002, // 0x2B
	0x0002, // 0x2C
	0x0011, // 0x2D
	0x000F, // 0x2E
	0x000A, // 0x2F
	0x0005, // 0x30
	0x8000, // 0x31
	0x0002, // 0x32
	0x0002, // 0x33
	0x000A, // 0x34
	0x028D, // 0x35
	0x8000, // 0x36
	0x0008, // 0x37
	0x0007, // 0x38
	0x0009, // 0x39
	0x8000, // 0x3A
	0x8000, // 0x3B
	0x8000, // 0x3C
	0x0002, // 0x3D
	0x0025, // 0x3E
	0x8000, // 0x3F
	0x00C9, // 0x40
	0x8000, // 0x41
	0x8000, // 0x42
	0x0229, // 0x43
	0x02C9, // 0x44
	0x0005, // 0x45
	0x8000, // 0x46
	0x000B, // 0x47
	0x0049, // 0x48
	0x005D, // 0x49
	0x0005, // 0x4A
	0x0009, // 0x4B
	0x8000, // 0x4C
	0x8000, // 0x4D
	0x0006, // 0x4E
	0x0002, // 0x4F
	0x8000, // 0x50
	0x8000, // 0x51
	0x8000, // 0x52
	0x0002, // 0x53
	0x000C, // 0x54
	0x0001, // 0x55
	0x000B, // 0x56
	0x006E, // 0x57
	0x006A, // 0x58
	0x8000, // 0x59
	0x8000, // 0x5A
	0x0004, // 0x5B
	0x0002, // 0x5C
	0x0049, // 0x5D
	0x8000, // 0x5E
	0x0031, // 0x5F
	0x0005, // 0x60
	0x0009, // 0x61
	0x000F, // 0x62
	0x000D, // 0x63
	0x0001, // 0x64
	0x0004, // 0x65
	0x8000, // 0x66
	0x0015, // 0x67
	0x8000, // 0x68
	0x8000, // 0x69
	0x0003, // 0x6A
	0x0009, // 0x6B
	0x0013, // 0x6C
	0x0003, // 0x6D
	0x000E, // 0x6E
	0x8000, // 0x6F
	0x001C, // 0x70
	0x8000, // 0x71
	0x0005, // 0x72
	0x0002, // 0x73
	0x8000, // 0x74
	0x0023, // 0x75
	0x0010, // 0x76
	0x0011, // 0x77
	0x8000, // 0x78
	0x0009, // 0x79
	0x8000, // 0x7A
	0x0002, // 0x7B
	0x8000, // 0x7C
	0x000D, // 0x7D
	0x0002, // 0x7E
	0x8000, // 0x7F
	0x003E, // 0x80
	0x8000, // 0x81
	0x0002, // 0x82
	0x0027, // 0x83
	0x0045, // 0x84
	0x0002, // 0x85
	0x8000, // 0x86
	0x8000, // 0x87
	0x0042, // 0x88
	0x8000, // 0x89
	0x8000, // 0x8A
	0x8000, // 0x8B
	0x000B, // 0x8C
	0x8000, // 0x8D
	0x8000, // 0x8E
	0x8000, // 0x8F
	0x0013, // 0x90
	0x0041, // 0x91
	0x8000, // 0x92
	0x0063, // 0x93
	0x8000, // 0x94
	0x0009, // 0x95
	0x8000, // 0x96
	0x0002, // 0x97
	0x8000, // 0x98
	0x001A, // 0x99
	0x8000, // 0x9A
	0x0102, // 0x9B
	0x0135, // 0x9C
	0x0033, // 0x9D
	0x8000, // 0x9E
	0x8000, // 0x9F
	0x0003, // 0xA0
	0x0009, // 0xA1
	0x0009, // 0xA2
	0x0009, // 0xA3
	0x0095, // 0xA4
	0x8000, // 0xA5
	0x8000, // 0xA6
	0x0004, // 0xA7
	0x8000, // 0xA8
	0x8000, // 0xA9
	0x0005, // 0xAA
	0x8000, // 0xAB
	0x8000, // 0xAC
	0x8000, // 0xAD
	0x8000, // 0xAE
	0x000D, // 0xAF
	0x8000, // 0xB0
	0x8000, // 0xB1
	0x8000, // 0xB2
	0x8000, // 0xB3
	0x8000, // 0xB4
	0x0040, // 0xB5
	0x0009, // 0xB6
	0x8000, // 0xB7
	0x8000, // 0xB8
	0x0005, // 0xB9
	0x0006, // 0xBA
	0x0009, // 0xBB
	0x0003, // 0xBC
	0x8000, // 0xBD
	0x8000, // 0xBE
	0x8000, // 0xBF
	0x0024, // 0xC0
	0x8000, // 0xC1
	0x8000, // 0xC2
	0x8000, // 0xC3
	0x0006, // 0xC4
	0x00CB, // 0xC5
	0x0001, // 0xC6
	0x0031, // 0xC7
	0x0002, // 0xC8
	0x0006, // 0xC9
	0x0006, // 0xCA
	0x0007, // 0xCB
	0x8000, // 0xCC
	0x0001, // 0xCD
	0x8000, // 0xCE
	0x004E, // 0xCF
	0x8000, // 0xD0
	0x0002, // 0xD1
	0x0019, // 0xD2
	0x8000, // 0xD3
	0x8000, // 0xD4
	0x8000, // 0xD5
	0x8000, // 0xD6
	0x8000, // 0xD7
	0x8000, // 0xD8
	0x010C, // 0xD9
	0x8000, // 0xDA
	0x8000, // 0xDB
	0x0009, // 0xDC
	0x8000, // 0xDD
	0x8000, // 0xDE
	0x8000, // 0xDF
	0x8000, // 0xE0 
	0x8000, // 0xE1
	0x000A, // 0xE2
	0x8000, // 0xE3
	0x8000, // 0xE4
	0x8000, // 0xE5
	0x0005, // 0xE6
	0x000C, // 0xE7
	0x000D, // 0xE8
	0x004B, // 0xE9
	0x0003, // 0xEA
	0x8000, // 0xEB
	0x8000, // 0xEC
	0x8000, // 0xED
	0x8000, // 0xEE
	0x0015, // 0xEF
	0x8000, // 0xF0
	0x8000, // 0xF1
	0x8000, // 0xF2
	0x0018, // 0xF3
	0x8000, // 0xF4
	0x0015, // 0xF5
	0x8000, // 0xF6
	0x8000, // 0xF7
	0x006A, // 0xF8
	0x8000, // 0xF9
	0x8000, // 0xFA
	0x8000, // 0xFB
	0x8000, // 0xFC
	0x8000, // 0xFD
	0x0008, // 0xFE
	0x8000, // 0xFF
};

================================================
FILE: Crypt/UOArt.cpp
================================================
#include "stdafx.h"
#include "Crypt.h"
#include "Resource.h"
#include <uxtheme.h>
#include <vssym32.h>
#include <dwmapi.h>

#define Color16to32(c16) (((c16) & 0x7C00) >> 7) | (((c16) & 0x3E0) << 6) | (((c16) & 0x1F) << 19)

struct UOItem
{
    int RealWidth;
    int RealHeight;

    int Left;
    int Top;
    int Bottom;
    int Right;

    int GetWidth() const { return Right - Left; }
    int GetHeight() const { return Bottom - Top; }

    unsigned short **Data; // [ReadlWidth][RealHeight] 32bit color data

    int ItemID;
    UOItem *pNext;
};

struct ArtIdx
{
    long FilePos;
    long Length;
    long Unused;
};

struct ArtHeader
{
    long Unknown;
    short Width;
    short Height;
    //followed by short LookupTable
};

UOItem *ArtCache = NULL;
unsigned short **Hues = NULL;
int NumHues = 0;

inline int Round(float n)
{
	int i = (int)n;
	return i + (n - i >= 0.5 ? 1 : 0);
}

unsigned short *GetHue(int index)
{
	if (Hues == NULL)
	{
		if (!pShared)
			return NULL;

		char str[512];
		int length, blockCount, index;
		FILE *huesMul = NULL;

		WaitForSingleObject(CommMutex, INFINITE);
		sprintf(str, "%s/hues.mul", pShared->DataPath);
		ReleaseMutex(CommMutex);

		huesMul = fopen(str, "rb");
		if (!huesMul)
		{
			Hues = new unsigned short *[1];
			Hues[0] = new unsigned short[34];
			memset(Hues[0], 0, 34 * 2);
			NumHues = 1;
			return NULL;
		}

		fseek(huesMul, 0, SEEK_END);
		length = (int)ftell(huesMul);
		fseek(huesMul, 0, SEEK_SET);
		blockCount = length / 708;
		if (blockCount > 375)
			blockCount = 375;
		NumHues = blockCount * 8;

		Hues = new unsigned short *[NumHues];

		index = 0;
		for (int b = 0; b < blockCount; b++)
		{
			fseek(huesMul, 4, SEEK_CUR);

			for (int i = 0; i < 8; i++, index++)
			{
				Hues[index] = new unsigned short[34];
				for (int c = 0; c < 34; c++)
				{
					unsigned short color;
					fread(&color, 2, 1, huesMul);
					Hues[index][c] = color | 0x8000;
				}

				fseek(huesMul, 20, SEEK_CUR); // ignore name
			}
		}
		fclose(huesMul);
	}

	if (index > 0 && index <= NumHues)
		return Hues[index - 1];
	else
		return NULL;
}

unsigned short ApplyHueToPixel(unsigned short *hue, unsigned short pix)
{
	if (hue)
		return hue[(pix >> 10) & 31];
	else
		return pix;
}

UOItem *ReadUOItem(int item, int bh)
{
	if (item == 0 || item >= 0xFFFF || !pShared)
		return NULL;

	char str[512];
	short *Lookup;
	unsigned short *Run;

	FILE *idxMul, *artMul;
	ArtIdx idx;
	ArtHeader header;
	memset(&header, 0, sizeof(ArtHeader));

	WaitForSingleObject(CommMutex, INFINITE);
	sprintf(str, "%s/artidx.mul", pShared->DataPath);
	ReleaseMutex(CommMutex);

	idxMul = fopen(str, "rb");
	if (!idxMul)
		return NULL;
	fseek(idxMul, item * sizeof(ArtIdx), SEEK_SET);
	fread(&idx, sizeof(ArtIdx), 1, idxMul);
	fclose(idxMul);
	if (idx.FilePos == -1 || idx.Length == -1)
		return NULL;

	WaitForSingleObject(CommMutex, INFINITE);
	sprintf(str, "%s/art.mul", pShared->DataPath);
	ReleaseMutex(CommMutex);

	artMul = fopen(str, "rb");
	if (!artMul)
	{
		fclose(idxMul);
		return NULL;
	}
	fseek(artMul, idx.FilePos, SEEK_SET);
	fread(&header, sizeof(ArtHeader), 1, artMul);
	if (header.Height <= 0 || header.Width <= 0 || header.Height >= 1024 || header.Width >= 1024 || header.Unknown > 0xFFFF || header.Unknown == 0)
	{
		fclose(artMul);
		return NULL;
	}

	Run = new unsigned short[header.Width]; // it should never be wider than the whole image!
	Lookup = new short[header.Height];
	fread(Lookup, header.Height * 2, 1, artMul);
	long dataStart = ftell(artMul);

	UOItem *pNew = new UOItem;
	pNew->ItemID = item;
	pNew->pNext = ArtCache;
	ArtCache = pNew;

	unsigned short **Image = new unsigned short *[header.Width];
	for (int i = 0; i < header.Width; i++)
	{
		Image[i] = new unsigned short[header.Height];
		memset(Image[i], 0, header.Height * 2);
	}

	pNew->Left = pNew->Top = 0x7FFFFFFF;
	pNew->Right = pNew->Bottom = 0;
	for (int y = 0; y < header.Height; y++)
	{
		int x = 0;

		fseek(artMul, dataStart + Lookup[y] * 2, SEEK_SET);
		do
		{
			short RunOffset = 0, RunLength = 0;

			fread(&RunOffset, 2, 1, artMul);
			fread(&RunLength, 2, 1, artMul);

			if (RunLength <= 0 || RunOffset < 0 || RunOffset + RunLength >= 2048 || RunLength > header.Width)
				break;

			if (y > pNew->Bottom)
				pNew->Bottom = y;
			if (y < pNew->Top)
				pNew->Top = y;

			x += RunOffset;
			if (x < pNew->Left)
				pNew->Left = x;

			fread(Run, RunLength * 2, 1, artMul);
			for (int o = 0; o < RunLength; o++, x++)
				Image[x][y] = Run[o];

			if (x > pNew->Right)
				pNew->Right = x;
		} while (true);
	}
	fclose(artMul);

	delete[] Run;
	delete[] Lookup;

	float scale = float(bh) / float(pNew->GetHeight());
	if (scale > 1 || scale <= 0)
		scale = 1;

	pNew->RealHeight = (int)(header.Height * scale + 1);
	pNew->RealWidth = (int)(header.Width * scale + 1);
	pNew->Data = new unsigned short *[pNew->RealWidth];
	for (int x = 0; x < pNew->RealWidth; x++)
	{
		pNew->Data[x] = new unsigned short[pNew->RealHeight];
		memset(pNew->Data[x], 0, 2 * pNew->RealHeight);
	}

	for (int x = 0; x < header.Width; x++)
	{
		for (int y = 0; y < header.Height; y++)
			pNew->Data[(int)(x * scale)][(int)(y * scale)] |= Image[x][y];
	}

	pNew->Top = (int)(pNew->Top * scale);
	pNew->Left = (int)(pNew->Left * scale);
	pNew->Bottom = (int)(pNew->Bottom * scale);
	pNew->Right = (int)(pNew->Right * scale);

	for (int x = 0; x < header.Width; x++)
		delete[] Image[x];
	delete[] Image;

	return pNew;
}

UOItem *FindItem(int item)
{
	UOItem *node = ArtCache;
	while (node != NULL)
	{
		if (node->ItemID == item)
			return node;
		else
			node = node->pNext;
	}

	return NULL;
}

inline COLORREF Brightness(int shift, COLORREF c)
{
	return RGB(min(255, GetRValue(c) + shift), min(255, GetGValue(c) + shift), min(255, GetBValue(c) + shift));
}

int DrawUOItem(HDC hDC, RECT rect, int item, int hueIdx)
{
	item |= 0x4000;

	rect.top++;
	rect.bottom--;
	int maxHeight = rect.bottom - rect.top;

	UOItem *i = FindItem(item);
	if (i == NULL)
		i = ReadUOItem(item, maxHeight);

	if (i == NULL)
		return 0;

	if (i->GetHeight() < maxHeight)
		rect.top += (maxHeight - i->GetHeight()) / 2;

	unsigned short *hue = GetHue(hueIdx);
	for (int x = i->Left; x <= i->Right; x++)
	{
		for (int y = i->Top; y <= i->Bottom; y++)
		{
			if (i->Data[x][y] != 0)
				SetPixel(hDC, rect.left + x - i->Left, rect.top + y - i->Top, Brightness(0x30, Color16to32(ApplyHueToPixel(hue, i->Data[x][y]))));
		}
	}

	return i->GetWidth() + 3;
}

void FreeItem(UOItem *node)
{
	if (node != NULL)
	{
		FreeItem(node->pNext);
		for (int i = 0; i < node->RealWidth; i++)
			delete[] node->Data[i];
		delete[] node->Data;
		delete node;
	}
}

void FreeArt()
{
	FreeItem(ArtCache);
	if (Hues && NumHues > 0)
	{
		for (int i = 0; i < NumHues; i++)
			delete[] Hues[i];
		delete[] Hues;
	}
}

int DrawUOItem(HDC, RECT, int, int);

typedef HTHEME(__stdcall *OPENTHEMEDATA)(HWND, LPCWSTR);
OPENTHEMEDATA zOpenThemeData = NULL;
typedef HRESULT(__stdcall *DRAWTHEMEBACKGROUND)(HTHEME, HDC, int, int, const RECT *, OPTIONAL const RECT *);
DRAWTHEMEBACKGROUND zDrawThemeBackground = NULL;
typedef HRESULT(__stdcall *CLOSETHEMEDATA)(HTHEME);
CLOSETHEMEDATA zCloseThemeData = NULL;
typedef HRESULT(__stdcall *GETTHEMESYSFONT)(HTHEME, int, OUT LOGFONTW *);
GETTHEMESYSFONT zGetThemeSysFont = NULL;
typedef COLORREF(__stdcall *GETTHEMESYSCOLOR)(HTHEME, int);
GETTHEMESYSCOLOR zGetThemeSysColor = NULL;
typedef HRESULT(__stdcall *GETTHEMEMETRIC)(HTHEME, HDC, int, int, int, int *);
GETTHEMEMETRIC zGetThemeMetric = NULL;
typedef HRESULT(__stdcall *DWMSETWINDOWATTRIBUTE)(HWND, DWORD, LPCVOID, DWORD);
DWMSETWINDOWATTRIBUTE zDwmSetWindowAttribute = NULL;
HMODULE hThemes = NULL;
HMODULE hDwmApi = NULL;

void InitThemes()
{
	hThemes = LoadLibrary("UXTHEME.DLL");
	if (hThemes)
	{
		zOpenThemeData = (OPENTHEMEDATA)GetProcAddress(hThemes, "OpenThemeData");
		zDrawThemeBackground = (DRAWTHEMEBACKGROUND)GetProcAddress(hThemes, "DrawThemeBackground");
		zCloseThemeData = (CLOSETHEMEDATA)GetProcAddress(hThemes, "CloseThemeData");
		zGetThemeSysColor = (GETTHEMESYSCOLOR)GetProcAddress(hThemes, "GetThemeSysColor");
		zGetThemeSysFont = (GETTHEMESYSFONT)GetProcAddress(hThemes, "GetThemeSysFont");
		zGetThemeMetric = (GETTHEMEMETRIC)GetProcAddress(hThemes, "GetThemeMetric");
	}

	hDwmApi = LoadLibrary("DWMAPI.DLL");
	if (hDwmApi)
	{
		zDwmSetWindowAttribute = (DWMSETWINDOWATTRIBUTE)GetProcAddress(hDwmApi, "DwmSetWindowAttribute");
	}
}

inline int GetHex2(LPCSTR hex)
{
	int num = 0;
	if (!isxdigit(hex[0]) || !isxdigit(hex[1]))
		return -1;

	num = isdigit(hex[1]) ? (hex[1] - '0') : (tolower(hex[1]) - 'a' + 10);
	num += (isdigit(hex[0]) ? (hex[0] - '0') : (tolower(hex[0]) - 'a' + 10)) * 16;

	return num;
}

inline int GetHex4(LPCSTR hex)
{
	return (GetHex2(hex) << 8) | GetHex2(&hex[2]);
}

void DoStat(HDC hDC, int v, int t, int l, int h, int w)
{
	if (w <= 0)
		return;
	RECT fill;
	fill.top = t;
	fill.left = l;
	fill.bottom = t + h;
	fill.right = l + w;
	HBRUSH hBr = NULL;

	if (v == 0xFF)                                //poisoned
		hBr = CreateSolidBrush(RGB(255, 128, 0)); // orange
	else if (v <= 25)
		hBr = CreateSolidBrush(RGB(255, 0, 0)); // red
	else if (v <= 75)
		hBr = CreateSolidBrush(RGB(255, 255, 0)); // yellow
	else
		hBr = CreateSolidBrush(RGB(0, 255, 0)); // green

	FillRect(hDC, &fill, hBr);
	DeleteObject(hBr);
}

int DrawStatBar(HDC hDC, RECT rect, int width, int status, int hp, int mn, int st)
{
	HGDIOBJ hOld = NULL;
	POINT pt[2];
	rect.right = rect.left + width + 2;

	int o = (rect.bottom - rect.top - 20) / 2;
	if (o > 0)
		rect.top += o;
	rect.bottom = rect.top + 6 + 6 + 6 + 1;

	hOld = SelectObject(hDC, GetStockObject(BLACK_PEN));
	FrameRect(hDC, &rect, (HBRUSH)GetStockObject(BLACK_BRUSH));

	pt[0].x = rect.left;
	pt[1].x = rect.right;

	pt[0].y = rect.top + 6;
	pt[1].y = rect.top + 6;
	Polyline(hDC, pt, 2);

	pt[0].y = rect.top + 6 + 6;
	pt[1].y = rect.top + 6 + 6;
	Polyline(hDC, pt, 2);

	if (status == 1) // poisoned
		DoStat(hDC, 0xFF, rect.top + 1, rect.left + 1, 5, (int)((double(hp + 1) / 100.0) * width));
	else
		DoStat(hDC, hp, rect.top + 1, rect.left + 1, 5, (int)((double(hp + 1) / 100.0) * width));

	DoStat(hDC, mn, rect.top + 1 + 6, rect.left + 1, 5, (int)((double(mn + 1) / 100) * width));
	DoStat(hDC, st, rect.top + 2 + 6 + 5, rect.left + 1, 5, (int)((double(st + 1) / 100) * width));

	SelectObject(hDC, hOld);
	return width + 2;
}

void CheckTitlebarAttr(HWND hWnd)
{
	static bool curNCRP = true;
	bool newNCRP = !pShared || pShared->TitleBar[0] == '\0';

	if (curNCRP != newNCRP && zDwmSetWindowAttribute)
	{
		DWMNCRENDERINGPOLICY policy = newNCRP ? DWMNCRP_ENABLED : DWMNCRP_DISABLED;
		zDwmSetWindowAttribute(hWnd, DWMWA_NCRENDERING_POLICY, &policy, sizeof(policy));
		curNCRP = newNCRP;
	}
}

void DrawColorTitleBar(HTHEME hTheme, HWND hWnd, HDC hOutDC, bool active, bool maximized, LPCSTR str, int len, RECT orig)
{
	const COLORREF def = GetSysColor(active ? COLOR_CAPTIONTEXT : COLOR_INACTIVECAPTIONTEXT);
	COLORREF color = def;

	RECT rect;
	RECT window;
	GetWindowRect(hWnd, &window);
	rect.left = rect.top = 0;
	rect.right = window.right - window.left;
	rect.bottom = (orig.bottom - orig.top);

	HDC hDC = CreateCompatibleDC(hOutDC);
	HBITMAP hBmp = CreateCompatibleBitmap(hOutDC, rect.right, rect.bottom);
	SelectObject(hDC, hBmp);

	bool needRegFill = true;
	HFONT hFont = NULL;

	if (hThemes)
	{
		LOGFONTW lf;

		if (maximized)
		{
			needRegFill = zDrawThemeBackground(hTheme, hDC, WP_MAXCAPTION, active ? MXCS_ACTIVE : MXCS_INACTIVE, &rect, NULL) != S_OK;
		}
		else
		{
			int modTop = GetSystemMetrics(SM_CYFRAME);
			rect.top -= modTop;
			needRegFill = zDrawThemeBackground(hTheme, hDC, WP_CAPTION, active ? CS_ACTIVE : CS_INACTIVE, &rect, NULL) != S_OK;
			rect.top += modTop;
		}

		if (zGetThemeSysFont(hTheme, TMT_CAPTIONFONT, &lf) == S_OK)
		{
			hFont = CreateFontIndirectW(&lf);
			SelectObject(hDC, hFont);
		}
	}

	if (needRegFill)
		FillRect(hDC, &rect, GetSysColorBrush(active ? COLOR_ACTIVECAPTION : COLOR_INACTIVECAPTION));

	if (hFont == NULL)
		SelectObject(hDC, GetStockObject(ANSI_VAR_FONT));

	rect.left = orig.left;

	int start = 0;
	int dlen = 0;
	int t;
	SetBkMode(hDC, TRANSPARENT);
	for (int i = 0; i < len; i++)
	{
		if (rect.left >= rect.right)
			break;

		if (str[i] == '~')
		{
			switch (str[i + 1])
			{
			case '#':
				if (dlen > 0)
				{
					SetTextColor(hDC, color);
					DrawText(hDC, &str[start], dlen, &rect, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
					SIZE ext;
					GetTextExtentPoint32(hDC, &str[start], dlen, &ext);
					rect.left += ext.cx;
				}
				dlen = 0;

				if (str[i + 2] == '~')
				{
					color = def;
					SetBkMode(hDC, TRANSPARENT);
					start = i + 3;
					i += 2;
				}
				else
				{
					color = RGB(GetHex2(&str[i + 2]), GetHex2(&str[i + 4]), GetHex2(&str[i + 6]));
					start = i + 8;
					i += 7;
				}

				break;
			case 'S':
			case 's':
				// ~SSFRRGGBB
				if (dlen > 0)
				{
					SetTextColor(hDC, color);
					DrawText(hDC, &str[start], dlen, &rect, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
					SIZE ext;
					GetTextExtentPoint32(hDC, &str[start], dlen, &ext);
					rect.left += ext.cx;
				}
				dlen = 0;

				t = 30;
				switch (toupper(str[i + 2]))
				{
				case 'S':
					t = 15;
					break;
					//case 'R': w = 30; break;
				case 'M':
					t = 45;
					break;
				case 'L':
					t = 60;
					break;
				case 'X':
					t = 75;
					break;
				}

				rect.left += 1;
				rect.left += DrawStatBar(hDC, rect, t, str[i + 3] - '0', GetHex2(&str[i + 4]), GetHex2(&str[i + 6]), GetHex2(&str[i + 8]));
				rect.left += 1;

				start = i + 10;
				i += 9;

				break;
			case 'I':
			case 'i':
				if (dlen > 0)
				{
					SetTextColor(hDC, color);
					DrawText(hDC, &str[start], dlen, &rect, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
					SIZE ext;
					GetTextExtentPoint32(hDC, &str[start], dlen, &ext);
					rect.left += ext.cx;
				}
				dlen = 0;
				if (str[i + 6] == '~')
				{
					rect.left += DrawUOItem(hDC, rect, GetHex4(&str[i + 2]), 0);
					start = i + 7;
					i += 6;
				}
				else
				{
					rect.left += DrawUOItem(hDC, rect, GetHex4(&str[i + 2]), GetHex4(&str[i + 6]));
					start = i + 10;
					i += 9;
				}
				break;
			case '^':
				if (dlen > 0)
				{
					SetTextColor(hDC, color);
					DrawText(hDC, &str[start], dlen, &rect, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
					SIZE ext;
					GetTextExtentPoint32(hDC, &str[start], dlen, &ext);
					rect.left += ext.cx;
				}
				dlen = 0;

				color = RGB(0, 0, 0);
				SetBkMode(hDC, OPAQUE);
				SetBkColor(hDC, RGB(GetHex2(&str[i + 2]), GetHex2(&str[i + 4]), GetHex2(&str[i + 6])));

				start = i + 8;
				i += 7;
				break;
			case 'B':
			case 'b': // skip bold identifier
				i++;
				break;
			}
		}
		else
		{
			dlen++;
		}
	}

	if (dlen > 0)
	{
		SetTextColor(hDC, color);
		DrawText(hDC, &str[start], dlen, &rect, DT_LEFT | DT_VCENTER | DT_SINGLELINE);
	}

	BitBlt(hOutDC, orig.left, orig.top, (orig.right - orig.left), (orig.bottom - orig.top) - 1, hDC, orig.left, 0, SRCCOPY);
	DeleteDC(hDC);
	DeleteObject(hBmp);
	if (hFont)
		DeleteObject(hFont);
}

void RedrawTitleBar(HWND hWnd, bool active)
{
	if (!pShared)
		return;

	WaitForSingleObject(CommMutex, INFINITE);
	if (pShared->TitleBar[0] == 0)
	{
		ReleaseMutex(CommMutex);
		return;
	}

	int len = (int)strlen(pShared->TitleBar);
	if (len >= 1024)
		len = 1023;

	WINDOWPLACEMENT place;
	RECT rect;
	HDC hDC = GetWindowDC(hWnd); //WINDOW dc allows us to draw on the non client area

	GetWindowPlacement(hWnd, &place);
	GetWindowRect(hWnd, &rect);

	// Change the coords (believe me, okay?)
	rect.top = GetSystemMetrics(SM_CYFRAME);
	rect.bottom = rect.top + GetSystemMetrics(SM_CYCAPTION);

	rect.right = (rect.right - rect.left) - (4 * GetSystemMetrics(SM_CXSIZE) + GetSystemMetrics(SM_CXFRAME));
	rect.left = GetSystemMetrics(SM_CXSIZEFRAME) + GetSystemMetrics(SM_CXSMICON) + 5;

	if (hThemes)
	{
		HTHEME hTheme = zOpenThemeData(hWnd, L"WINDOW");
		DrawColorTitleBar(hTheme, hWnd, hDC, active, place.showCmd == SW_MAXIMIZE, pShared->TitleBar, len, rect);
		zCloseThemeData(hTheme);
	}
	else
	{
		rect.left += GetSystemMetrics(SM_CXFRAME);
		DrawColorTitleBar(NULL, hWnd, hDC, active, place.showCmd == SW_MAXIMIZE, pShared->TitleBar, len, rect);
	}

	ReleaseDC(hWnd, hDC);
	ReleaseMutex(CommMutex);
}


================================================
FILE: Crypt/debug.h
================================================
#ifdef DEBUG    /* keep these macros common so they are same for both versions */
CONST int debugCompile  =   1;
extern  int debug;
extern  void DebugIO(CONST char *s);    /* display the debug output */

#define DebugDump(x,s,R,XOR,doRot,showT,needBswap)  \
    { if (debug) _Dump(x,s,R,XOR,doRot,showT,needBswap,t0,t1); }
#define DebugDumpKey(key) { if (debug) _DumpKey(key); }
#define IV_ROUND    -100
    
void _Dump(CONST void *p,CONST char *s,int R,int XOR,int doRot,int showT,int needBswap,
           DWORD t0,DWORD t1)
    {
    char line[512]; /* build output here */
    int  i,n;
    DWORD q[4];

    if (R == IV_ROUND)
        sprintf(line,"%sIV:    ",s);
    else
        sprintf(line,"%sR[%2d]: ",s,R);
    for (n=0;line[n];n++) ;
    
    for (i=0;i<4;i++)
        {
        q[i]=((CONST DWORD *)p)[i^(XOR)];
        if (needBswap) q[i]=Bswap(q[i]);
        }

    sprintf(line+n,"x= %08lX  %08lX  %08lX  %08lX.",
            ROR(q[0],doRot*(R  )/2),
            ROL(q[1],doRot*(R  )/2),
            ROR(q[2],doRot*(R+1)/2),
            ROL(q[3],doRot*(R+1)/2));
    for (;line[n];n++) ;

    if (showT)
        sprintf(line+n,"    t0=%08lX. t1=%08lX.",t0,t1);
    for (;line[n];n++) ;

    sprintf(line+n,"\n");
    DebugIO(line);
    }

void _DumpKey(CONST keyInstance *key)
    {
    char    line[512];
    int     i;
    int     k64Cnt=(key->keyLen+63)/64; /* round up to next multiple of 64 bits */
    int     subkeyCnt = ROUND_SUBKEYS + 2*key->numRounds;

    sprintf(line,";\n;makeKey:   Input key            -->  S-box key     [%s]\n",
           (key->direction == DIR_ENCRYPT) ? "Encrypt" : "Decrypt");
    DebugIO(line);
    for (i=0;i<k64Cnt;i++)  /* display in RS format */
        {
        sprintf(line,";%12s %08lX %08lX  -->  %08lX\n","",
               key->key32[2*i+1],key->key32[2*i],key->sboxKeys[k64Cnt-1-i]);
        DebugIO(line);
        }
    sprintf(line,";%11sSubkeys\n","");
    DebugIO(line);
    for (i=0;i<subkeyCnt/2;i++)
        {
        sprintf(line,";%12s %08lX %08lX%s\n","",key->subKeys[2*i],key->subKeys[2*i+1],
              (2*i ==  INPUT_WHITEN) ? "   Input whiten" :
              (2*i == OUTPUT_WHITEN) ? "  Output whiten" :
              (2*i == ROUND_SUBKEYS) ? "  Round subkeys" : "");
        DebugIO(line);
        }
    DebugIO(";\n");
    }
#else
CONST int debugCompile  =   0;
#define DebugDump(x,s,R,XOR,doRot,showT,needBswap)
#define DebugDumpKey(key)
#endif


================================================
FILE: Crypt/platform.h
================================================
/***************************************************************************
    PLATFORM.H  -- Platform-specific defines for TWOFISH code

    Submitters:
        Bruce Schneier, Counterpane Systems
        Doug Whiting,   Hi/fn
        John Kelsey,    Counterpane Systems
        Chris Hall,     Counterpane Systems
        David Wagner,   UC Berkeley
            
    Code Author:        Doug Whiting,   Hi/fn
        
    Version  1.00       April 1998
        
    Copyright 1998, Hi/fn and Counterpane Systems.  All rights reserved.
        
    Notes:
        *   Tab size is set to 4 characters in this file

***************************************************************************/

/* use intrinsic rotate if possible */
#ifndef ROL
#define ROL(x,n) (((x) << ((n) & 0x1F)) | ((x) >> (32-((n) & 0x1F))))
#define ROR(x,n) (((x) >> ((n) & 0x1F)) | ((x) << (32-((n) & 0x1F))))
#endif

#if (0) && defined(__BORLANDC__) && (__BORLANDC__ >= 0x462)
#error "!!!This does not work for some reason!!!"
#include    <stdlib.h>                  /* get prototype for _lrotl() , _lrotr() */
#pragma inline __lrotl__
#pragma inline __lrotr__
#undef  ROL                             /* get rid of inefficient definitions */
#undef  ROR
#define ROL(x,n)    __lrotl__(x,n)      /* use compiler intrinsic rotations */
#define ROR(x,n)    __lrotr__(x,n)
#endif

#ifdef _MSC_VER
#include    <stdlib.h>                  /* get prototypes for rotation functions */
#undef  ROL
#undef  ROR
#pragma intrinsic(_lrotl,_lrotr)        /* use intrinsic compiler rotations */
#define ROL(x,n)    _lrotl(x,n)         
#define ROR(x,n)    _lrotr(x,n)
#endif

#ifndef _M_IX86
#ifdef  __BORLANDC__
#define _M_IX86                 300     /* make sure this is defined for Intel CPUs */
#endif
#endif

#ifdef _M_IX86
#define     LittleEndian        1       /* e.g., 1 for Pentium, 0 for 68K */
#define     ALIGN32             0       /* need dword alignment? (no for Pentium) */
#else   /* non-Intel platforms */
#define     LittleEndian        0       /* (assume big endian */
#define     ALIGN32             1       /* (assume need alignment for non-Intel) */
#endif

#if LittleEndian
#define     Bswap(x)            (x)     /* NOP for little-endian machines */
#define     ADDR_XOR            0       /* NOP for little-endian machines */
#else
#define     Bswap(x)            ((ROR(x,8) & 0xFF00FF00) | (ROL(x,8) & 0x00FF00FF))
#define     ADDR_XOR            3       /* convert byte address in dword */
#endif

/*  Macros for extracting bytes from dwords (correct for endianness) */
#define _b(x,N) (((BYTE *)&x)[((N) & 3) ^ ADDR_XOR]) /* pick bytes out of a dword */

#define     b0(x)           _b(x,0)     /* extract LSB of DWORD */
#define     b1(x)           _b(x,1)
#define     b2(x)           _b(x,2)
#define     b3(x)           _b(x,3)     /* extract MSB of DWORD */



================================================
FILE: Crypt/resource.h
================================================
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by Crypt.rc
//
#define IDI_ICON1                       101
#define IDI_RAZOR                       101

// Next default values for new objects
// 
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE        102
#define _APS_NEXT_COMMAND_VALUE         40001
#define _APS_NEXT_CONTROL_VALUE         1001
#define _APS_NEXT_SYMED_VALUE           101
#endif
#endif


================================================
FILE: Crypt/stdafx.cpp
================================================
// stdafx.cpp : source file that includes just the standard includes
// Crypt.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

#include "stdafx.h"

// TODO: reference any additional headers you need in STDAFX.H
// and not in this file


================================================
FILE: Crypt/stdafx.h
================================================
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once
#pragma warning(disable: 4309)
#pragma warning(disable: 4311)
#pragma warning(disable: 4312)
#pragma warning(disable: 4800)
#pragma warning(disable: 4530)
#pragma warning(disable: 4996)
#pragma comment(lib, "ws2_32.lib")

#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
// Windows Header Files:
#include <windows.h>

#pragma pack(1)

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <winsock2.h>
#include <time.h>
#include <zmouse.h>

//#include <vector>
//#include <string>
//using std::vector;
//using std::string;


================================================
FILE: Crypt/table.h
================================================
/***************************************************************************
    TABLE.H -- Tables, macros, constants for Twofish S-boxes and MDS matrix

    Submitters:
        Bruce Schneier, Counterpane Systems
        Doug Whiting,   Hi/fn
        John Kelsey,    Counterpane Systems
        Chris Hall,     Counterpane Systems
        David Wagner,   UC Berkeley
            
    Code Author:        Doug Whiting,   Hi/fn
        
    Version  1.00       April 1998
        
    Copyright 1998, Hi/fn and Counterpane Systems.  All rights reserved.
        
    Notes:
        *   Tab size is set to 4 characters in this file
        *   These definitions should be used in optimized and unoptimized
            versions to insure consistency.

***************************************************************************/

/* for computing subkeys */
#define SK_STEP         0x02020202u
#define SK_BUMP         0x01010101u
#define SK_ROTL         9

/* Reed-Solomon code parameters: (12,8) reversible code
    g(x) = x**4 + (a + 1/a) x**3 + a x**2 + (a + 1/a) x + 1
   where a = primitive root of field generator 0x14D */
#define RS_GF_FDBK      0x14D       /* field generator */
#define RS_rem(x)       \
    { BYTE  b  = (BYTE) (x >> 24);                                           \
      DWORD g2 = ((b << 1) ^ ((b & 0x80) ? RS_GF_FDBK : 0 )) & 0xFF;         \
      DWORD g3 = ((b >> 1) & 0x7F) ^ ((b & 1) ? RS_GF_FDBK >> 1 : 0 ) ^ g2 ; \
      x = (x << 8) ^ (g3 << 24) ^ (g2 << 16) ^ (g3 << 8) ^ b;                \
    }

/*  Macros for the MDS matrix
*   The MDS matrix is (using primitive polynomial 169):
*      01  EF  5B  5B
*      5B  EF  EF  01
*      EF  5B  01  EF
*      EF  01  EF  5B
*----------------------------------------------------------------
* More statistical properties of this matrix (from MDS.EXE output):
*
* Min Hamming weight (one byte difference) =  8. Max=26.  Total =  1020.
* Prob[8]:      7    23    42    20    52    95    88    94   121   128    91
*             102    76    41    24     8     4     1     3     0     0     0
* Runs[8]:      2     4     5     6     7     8     9    11
* MSBs[8]:      1     4    15     8    18    38    40    43
* HW= 8: 05040705 0A080E0A 14101C14 28203828 50407050 01499101 A080E0A0 
* HW= 9: 04050707 080A0E0E 10141C1C 20283838 40507070 80A0E0E0 C6432020 07070504 
*        0E0E0A08 1C1C1410 38382820 70705040 E0E0A080 202043C6 05070407 0A0E080E 
*        141C101C 28382038 50704070 A0E080E0 4320C620 02924B02 089A4508 
* Min Hamming weight (two byte difference) =  3. Max=28.  Total = 390150.
* Prob[3]:      7    18    55   149   270   914  2185  5761 11363 20719 32079
*           43492 51612 53851 52098 42015 31117 20854 11538  6223  2492  1033
* MDS OK, ROR:   6+  7+  8+  9+ 10+ 11+ 12+ 13+ 14+ 15+ 16+
*               17+ 18+ 19+ 20+ 21+ 22+ 23+ 24+ 25+ 26+
*/
#define MDS_GF_FDBK     0x169   /* primitive polynomial for GF(256)*/
#define LFSR1(x) ( ((x) >> 1)  ^ (((x) & 0x01) ?   MDS_GF_FDBK/2 : 0))
#define LFSR2(x) ( ((x) >> 2)  ^ (((x) & 0x02) ?   MDS_GF_FDBK/2 : 0)  \
                               ^ (((x) & 0x01) ?   MDS_GF_FDBK/4 : 0))

#define Mx_1(x) ((DWORD)  (x))      /* force result to dword so << will work */
#define Mx_X(x) ((DWORD) ((x) ^            LFSR2(x)))   /* 5B */
#define Mx_Y(x) ((DWORD) ((x) ^ LFSR1(x) ^ LFSR2(x)))   /* EF */

#define M00     Mul_1
#define M01     Mul_Y
#define M02     Mul_X
#define M03     Mul_X

#define M10     Mul_X
#define M11     Mul_Y
#define M12     Mul_Y
#define M13     Mul_1

#define M20     Mul_Y
#define M21     Mul_X
#define M22     Mul_1
#define M23     Mul_Y

#define M30     Mul_Y
#define M31     Mul_1
#define M32     Mul_Y
#define M33     Mul_X

#define Mul_1   Mx_1
#define Mul_X   Mx_X
#define Mul_Y   Mx_Y

/*  Define the fixed p0/p1 permutations used in keyed S-box lookup.  
    By changing the following constant definitions for P_ij, the S-boxes will
    automatically get changed in all the Twofish source code. Note that P_i0 is
    the "outermost" 8x8 permutation applied.  See the f32() function to see
    how these constants are to be  used.
*/
#define P_00    1                   /* "outermost" permutation */
#define P_01    0
#define P_02    0
#define P_03    (P_01^1)            /* "extend" to larger key sizes */
#define P_04    1

#define P_10    0
#define P_11    0
#define P_12    1
#define P_13    (P_11^1)
#define P_14    0

#define P_20    1
#define P_21    1
#define P_22    0
#define P_23    (P_21^1)
#define P_24    0

#define P_30    0
#define P_31    1
#define P_32    1
#define P_33    (P_31^1)
#define P_34    1

#define p8(N)   P8x8[P_##N]         /* some syntax shorthand */

/* fixed 8x8 permutation S-boxes */

/***********************************************************************
*  07:07:14  05/30/98  [4x4]  TestCnt=256. keySize=128. CRC=4BD14D9E.
* maxKeyed:  dpMax = 18. lpMax =100. fixPt =  8. skXor =  0. skDup =  6. 
* log2(dpMax[ 6..18])=   --- 15.42  1.33  0.89  4.05  7.98 12.05
* log2(lpMax[ 7..12])=  9.32  1.01  1.16  4.23  8.02 12.45
* log2(fixPt[ 0.. 8])=  1.44  1.44  2.44  4.06  6.01  8.21 11.07 14.09 17.00
* log2(skXor[ 0.. 0])
* log2(skDup[ 0.. 6])=   ---  2.37  0.44  3.94  8.36 13.04 17.99
***********************************************************************/
CONST BYTE P8x8[2][256]=
    {
/*  p0:   */
/*  dpMax      = 10.  lpMax      = 64.  cycleCnt=   1  1  1  0.         */
/* 817D6F320B59ECA4.ECB81235F4A6709D.BA5E6D90C8F32471.D7F4126E9B3085CA. */
/* Karnaugh maps:
*  0111 0001 0011 1010. 0001 1001 1100 1111. 1001 1110 0011 1110. 1101 0101 1111 1001. 
*  0101 1111 1100 0100. 1011 0101 0010 0000. 0101 1000 1100 0101. 1000 0111 0011 0010. 
*  0000 1001 1110 1101. 1011 1000 1010 0011. 0011 1001 0101 0000. 0100 0010 0101 1011. 
*  0111 0100 0001 0110. 1000 1011 1110 1001. 0011 0011 1001 1101. 1101 0101 0000 1100. 
*/
    {
    0xA9, 0x67, 0xB3, 0xE8, 0x04, 0xFD, 0xA3, 0x76, 
    0x9A, 0x92, 0x80, 0x78, 0xE4, 0xDD, 0xD1, 0x38, 
    0x0D, 0xC6, 0x35, 0x98, 0x18, 0xF7, 0xEC, 0x6C, 
    0x43, 0x75, 0x37, 0x26, 0xFA, 0x13, 0x94, 0x48, 
    0xF2, 0xD0, 0x8B, 0x30, 0x84, 0x54, 0xDF, 0x23, 
    0x19, 0x5B, 0x3D, 0x59, 0xF3, 0xAE, 0xA2, 0x82, 
    0x63, 0x01, 0x83, 0x2E, 0xD9, 0x51, 0x9B, 0x7C, 
    0xA6, 0xEB, 0xA5, 0xBE, 0x16, 0x0C, 0xE3, 0x61, 
    0xC0, 0x8C, 0x3A, 0xF5, 0x73, 0x2C, 0x25, 0x0B, 
    0xBB, 0x4E, 0x89, 0x6B, 0x53, 0x6A, 0xB4, 0xF1, 
    0xE1, 0xE6, 0xBD, 0x45, 0xE2, 0xF4, 0xB6, 0x66, 
    0xCC, 0x95, 0x03, 0x56, 0xD4, 0x1C, 0x1E, 0xD7, 
    0xFB, 0xC3, 0x8E, 0xB5, 0xE9, 0xCF, 0xBF, 0xBA, 
    0xEA, 0x77, 0x39, 0xAF, 0x33, 0xC9, 0x62, 0x71, 
    0x81, 0x79, 0x09, 0xAD, 0x24, 0xCD, 0xF9, 0xD8, 
    0xE5, 0xC5, 0xB9, 0x4D, 0x44, 0x08, 0x86, 0xE7, 
    0xA1, 0x1D, 0xAA, 0xED, 0x06, 0x70, 0xB2, 0xD2, 
    0x41, 0x7B, 0xA0, 0x11, 0x31, 0xC2, 0x27, 0x90, 
    0x20, 0xF6, 0x60, 0xFF, 0x96, 0x5C, 0xB1, 0xAB, 
    0x9E, 0x9C, 0x52, 0x1B, 0x5F, 0x93, 0x0A, 0xEF, 
    0x91, 0x85, 0x49, 0xEE, 0x2D, 0x4F, 0x8F, 0x3B, 
    0x47, 0x87, 0x6D, 0x46, 0xD6, 0x3E, 0x69, 0x64, 
    0x2A, 0xCE, 0xCB, 0x2F, 0xFC, 0x97, 0x05, 0x7A, 
    0xAC, 0x7F, 0xD5, 0x1A, 0x4B, 0x0E, 0xA7, 0x5A, 
    0x28, 0x14, 0x3F, 0x29, 0x88, 0x3C, 0x4C, 0x02, 
    0xB8, 0xDA, 0xB0, 0x17, 0x55, 0x1F, 0x8A, 0x7D, 
    0x57, 0xC7, 0x8D, 0x74, 0xB7, 0xC4, 0x9F, 0x72, 
    0x7E, 0x15, 0x22, 0x12, 0x58, 0x07, 0x99, 0x34, 
    0x6E, 0x50, 0xDE, 0x68, 0x65, 0xBC, 0xDB, 0xF8, 
    0xC8, 0xA8, 0x2B, 0x40, 0xDC, 0xFE, 0x32, 0xA4, 
    0xCA, 0x10, 0x21, 0xF0, 0xD3, 0x5D, 0x0F, 0x00, 
    0x6F, 0x9D, 0x36, 0x42, 0x4A, 0x5E, 0xC1, 0xE0
    },
/*  p1:   */
/*  dpMax      = 10.  lpMax      = 64.  cycleCnt=   2  0  0  1.         */
/* 28BDF76E31940AC5.1E2B4C376DA5F908.4C75169A0ED82B3F.B951C3DE647F208A. */
/* Karnaugh maps:
*  0011 1001 0010 0111. 1010 0111 0100 0110. 0011 0001 1111 0100. 1111 1000 0001 1100. 
*  1100 1111 1111 1010. 0011 0011 1110 0100. 1001 0110 0100 0011. 0101 0110 1011 1011. 
*  0010 0100 0011 0101. 1100 1000 1000 1110. 0111 1111 0010 0110. 0000 1010 0000 0011. 
*  1101 1000 0010 0001. 0110 1001 1110 0101. 0001 0100 0101 0111. 0011 1011 1111 0010. 
*/
    {
    0x75, 0xF3, 0xC6, 0xF4, 0xDB, 0x7B, 0xFB, 0xC8, 
    0x4A, 0xD3, 0xE6, 0x6B, 0x45, 0x7D, 0xE8, 0x4B, 
    0xD6, 0x32, 0xD8, 0xFD, 0x37, 0x71, 0xF1, 0xE1, 
    0x30, 0x0F, 0xF8, 0x1B, 0x87, 0xFA, 0x06, 0x3F, 
    0x5E, 0xBA, 0xAE, 0x5B, 0x8A, 0x00, 0xBC, 0x9D, 
    0x6D, 0xC1, 0xB1, 0x0E, 0x80, 0x5D, 0xD2, 0xD5, 
    0xA0, 0x84, 0x07, 0x14, 0xB5, 0x90, 0x2C, 0xA3, 
    0xB2, 0x73, 0x4C, 0x54, 0x92, 0x74, 0x36, 0x51, 
    0x38, 0xB0, 0xBD, 0x5A, 0xFC, 0x60, 0x62, 0x96, 
    0x6C, 0x42, 0xF7, 0x10, 0x7C, 0x28, 0x27, 0x8C, 
    0x13, 0x95, 0x9C, 0xC7, 0x24, 0x46, 0x3B, 0x70, 
    0xCA, 0xE3, 0x85, 0xCB, 0x11, 0xD0, 0x93, 0xB8, 
    0xA6, 0x83, 0x20, 0xFF, 0x9F, 0x77, 0xC3, 0xCC, 
    0x03, 0x6F, 0x08, 0xBF, 0x40, 0xE7, 0x2B, 0xE2, 
    0x79, 0x0C, 0xAA, 0x82, 0x41, 0x3A, 0xEA, 0xB9, 
    0xE4, 0x9A, 0xA4, 0x97, 0x7E, 0xDA, 0x7A, 0x17, 
    0x66, 0x94, 0xA1, 0x1D, 0x3D, 0xF0, 0xDE, 0xB3, 
    0x0B, 0x72, 0xA7, 0x1C, 0xEF, 0xD1, 0x53, 0x3E, 
    0x8F, 0x33, 0x26, 0x5F, 0xEC, 0x76, 0x2A, 0x49, 
    0x81, 0x88, 0xEE, 0x21, 0xC4, 0x1A, 0xEB, 0xD9, 
    0xC5, 0x39, 0x99, 0xCD, 0xAD, 0x31, 0x8B, 0x01, 
    0x18, 0x23, 0xDD, 0x1F, 0x4E, 0x2D, 0xF9, 0x48, 
    0x4F, 0xF2, 0x65, 0x8E, 0x78, 0x5C, 0x58, 0x19, 
    0x8D, 0xE5, 0x98, 0x57, 0x67, 0x7F, 0x05, 0x64, 
    0xAF, 0x63, 0xB6, 0xFE, 0xF5, 0xB7, 0x3C, 0xA5, 
    0xCE, 0xE9, 0x68, 0x44, 0xE0, 0x4D, 0x43, 0x69, 
    0x29, 0x2E, 0xAC, 0x15, 0x59, 0xA8, 0x0A, 0x9E, 
    0x6E, 0x47, 0xDF, 0x34, 0x35, 0x6A, 0xCF, 0xDC, 
    0x22, 0xC9, 0xC0, 0x9B, 0x89, 0xD4, 0xED, 0xAB, 
    0x12, 0xA2, 0x0D, 0x52, 0xBB, 0x02, 0x2F, 0xA9, 
    0xD7, 0x61, 0x1E, 0xB4, 0x50, 0x04, 0xF6, 0xC2, 
    0x16, 0x25, 0x86, 0x56, 0x55, 0x09, 0xBE, 0x91
    }
    };


================================================
FILE: Crypt/trees.cpp
================================================

int Trees[] = {
	0x4CCA, 0x4CCB, 0x4CCC, 0x4CCD, 0x4CD0, 0x4CD3, 0x4CD6, 0x4CD8,
	0x4CDA, 0x4CDD, 0x4CE0, 0x4CE3, 0x4CE6, 0x4CF8, 0x4CFB, 0x4CFE,
	0x4D01, 0x4D41, 0x4D42, 0x4D43, 0x4D44, 0x4D57, 0x4D58, 0x4D59,
	0x4D5A, 0x4D5B, 0x4D6E, 0x4D6F, 0x4D70, 0x4D71, 0x4D72, 0x4D84,
	0x4D85, 0x4D86, 0x52B5, 0x52B6, 0x52B7, 0x52B8, 0x52B9, 0x52BA,
	0x52BB, 0x52BC, 0x52BD,
};

int Leaves[] = {
	0x4CCE, 0x4CCF, 0x4CD1, 0x4CD2, 0x4CD4, 0x4CD5, 0x4CD7, 0x4CD9,
	0x4CDB, 0x4CDC, 0x4CDE, 0x4CDF, 0x4CE1, 0x4CE2, 0x4CE4, 0x4CE5,
	0x4CE7, 0x4CE8, 0x4CF9, 0x4CFA, 0x4CFC, 0x4CFD, 0x4CFF, 0x4D00,
	0x4D02, 0x4D03, 0x4D45, 0x4D46, 0x4D47, 0x4D48, 0x4D49, 0x4D4A,
	0x4D4B, 0x4D4C, 0x4D4D, 0x4D4E, 0x4D4F, 0x4D50, 0x4D51, 0x4D52,
	0x4D53, 0x4D5C, 0x4D5D, 0x4D5E, 0x4D5F, 0x4D60, 0x4D61, 0x4D62,
	0x4D63, 0x4D64, 0x4D65, 0x4D66, 0x4D67, 0x4D68, 0x4D69, 0x4D73,
	0x4D74, 0x4D75, 0x4D76, 0x4D77, 0x4D78, 0x4D79, 0x4D7A, 0x4D7B,
	0x4D7C, 0x4D7D, 0x4D7E, 0x4D7F, 0x4D87, 0x4D88, 0x4D89, 0x4D8A,
	0x4D8B, 0x4D8C, 0x4D8D, 0x4D8E, 0x4D8F, 0x4D90, 0x4D95, 0x4D96,
	0x4D97, 0x4D99, 0x4D9A, 0x4D9B, 0x4D9D, 0x4D9E, 0x4D9F, 0x4DA1,
	0x4DA2, 0x4DA3, 0x4DA5, 0x4DA6, 0x4DA7, 0x4DA9, 0x4DAA, 0x4DAB,
	0x52BE, 0x52BF, 0x52C0, 0x52C1, 0x52C2, 0x52C3, 0x52C4, 0x52C5,
	0x52C6, 0x52C7
};

HANDLE WINAPI NewCreateFile( LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode,
							 LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition,
                             DWORD dwFlagsAndAttributes, HANDLE hTemplateFile )
{
	strlwr( (char*)lpFileName );
	if ( strstr( lpFileName, "artidx.mul" ) && (dwDesiredAccess & GENERIC_READ) != 0 )
	{
		char path[MAX_PATH];
		GetTempPath( MAX_PATH, path );
		strcat( path, "/razor_art.tmp" );
		CopyFile( lpFileName, path, FALSE );

		int stump[3], none[3];
		FILE *f = fopen( path, "rb" );
		fseek( f, 12*0xE57, SEEK_SET );
		fread( stump, 12, 1, f );
		fseek( f, 12*0x115E, SEEK_SET );
		fread( none, 12, 1, f );
		fclose( f );

		f = fopen( path, "wb" );
		for(int i=0;Trees[i] != 0;i++)
		{
			fseek( f, 12*Trees[i], SEEK_SET );
			fwrite( stump, 12, 1, f );
		}
		for(int i=0;Leaves[i] != 0;i++)
		{
			fseek( f, 12*Leaves[i], SEEK_SET );
			fwrite( none, 12, 1, f );
		}
		fclose( f );

		return CreateFile( path, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile );
	}
	else
	{
		return CreateFile( lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile );
	}
}

#define CREATE_FILE_LOC "\x68\x00\x00\x00\xC0\x50\xFF\x15\xF8\x71\x56\x00\x83\xF8\xFF"
#define CFL_LEN 15

void PatchCreateFile()
{
	DWORD CurPos = FindInMemory( 0x00400000, CREATE_FILE_LOC, CFL_LEN );
	if ( !CurPos ) 
		return;
	CurPos += 6;
	*((unsigned char*)(CurPos)) = 0xE8; // call
	*((unsigned int*)(CurPos+1)) = int(NewCreateFile) - (CurPos+4);
	*((unsigned char*)(CurPos+5)) = 0x90; // nop
}

void PatchStartup( DWORD ProcID )
{
	HANDLE hProc = OpenProcess( PROCESS_ALL_ACCESS, FALSE, ProcID );
	if ( !hProc )
		return;

	DWORD image_base = ???; 
    IMAGE_DOS_HEADER *idh = (IMAGE_DOS_HEADER *)image_base;
    IMAGE_FILE_HEADER *ifh = (IMAGE_FILE_HEADER *)(image_base + idh->e_lfanew + sizeof(DWORD));
    IMAGE_OPTIONAL_HEADER *ioh = (IMAGE_OPTIONAL_HEADER *)((DWORD)(ifh) + sizeof(IMAGE_FILE_HEADER));

	DWORD acc = 0;
	void *addr = VirtualAllocEx( hProc, NULL, 512, MEM_COMMIT, PAGE_EXECUTE_READWRITE );
	DWORD Pos = (DWORD)addr;

	char file[256];
	acc = GetModuleFileName( GetModuleHandle(NULL), file, 256 );
	WriteProcessMemory( hProc, (void*)Pos, file, acc, &acc );
	DWORD FileLoc = Pos;
	Pos += acc;
	strcpy( file, "AttachedStart" );
	WriteProcessMemory( hProc, (void*)Pos, file, strlen(file)+1, &acc );
	DWORD ProcLoc = Pos;
	Pos += acc;

	unsigned char LoadFunc[] = {
		0x55,					// push ebp
		0x8B, 0xEC,				// mov ebp, esp
		0x53,					// push ebx
		0x56,					// push esi
		0x57,					// push edi
		0x68, 0, 0, 0, 0,		// push _address_
		0xFF,0x15,0xB8,0x71,0x56,0x00, // call ds:LoadLibraryA
		0x68, 0, 0, 0, 0,		// push _address_
		0x50,					// push eax
		0x8B, 0xF0,				// mov esi, eax
		0xFF,0x15,0xBC,0x71,0x56,0x00, // call ds:GetProcAddress
		0xFF, 0xD0,				// call eax
		//0x56,					// push esi             ; hLibModule
		//0xFF,0x15,0xC0,0x71,0x56,0x00, // call ds:FreeLibrary
		0x5F,					// pop edi
		0x5E,					// pop esi
		0x5B,					// pop ebx
		0x5D,					// pop ebp
		0xE9, 0, 0, 0, 0,		// jmp _addressoffset_
		0x90,					// nop
		0x90,					// nop
	};
	const int len = 44;

	*((int*)(LoadFunc+7)) = FileLoc - (Pos+7+4);
	*((int*)(LoadFunc+18)) = ProcLoc - (Pos+18+4);
	*((int*)(LoadFunc+38)) = (ioh->ImageBase + ioh->AddressOfEntryPoint) - (Pos+38+4);

	WriteProcessMemory( hProc, (void*)Pos, LoadFunc, len, &acc );
	ioh->AddressOfEntryPoint = Pos;
	CloseHandle( hProc );
}


================================================
FILE: Crypt/twofish.c
================================================
/***************************************************************************
    TWOFISH2.C  -- Optimized C API calls for TWOFISH AES submission

    Submitters:
        Bruce Schneier, Counterpane Systems
        Doug Whiting,   Hi/fn
        John Kelsey,    Counterpane Systems
        Chris Hall,     Counterpane Systems
        David Wagner,   UC Berkeley
            
    Code Author:        Doug Whiting,   Hi/fn
        
    Version  1.00       April 1998
        
    Copyright 1998, Hi/fn and Counterpane Systems.  All rights reserved.
        
    Notes:
        *   Optimized version
        *   Tab size is set to 4 characters in this file

***************************************************************************/

#pragma pack(1)

#include <memory.h>
#include    "twofish.h"
#include    "table.h"

#pragma warning(disable: 4005)//ignore macro re-definitions

#if   defined(min_key)  && !defined(MIN_KEY)
#define MIN_KEY     1           /* toupper() */
#elif defined(part_key) && !defined(PART_KEY)
#define PART_KEY    1
#elif defined(zero_key) && !defined(ZERO_KEY)
#define ZERO_KEY    1
#endif


#ifdef USE_ASM
extern  int useAsm;             /* ok to use ASM code? */

typedef int cdecl CipherProc
   (cipherInstance *cipher, keyInstance *key,BYTE *input,int inputLen,BYTE *outBuffer);
typedef int cdecl KeySetupProc(keyInstance *key);

extern CipherProc   *blockEncrypt_86;   /* ptr to ASM functions */
extern CipherProc   *blockDecrypt_86;
extern KeySetupProc *reKey_86;
extern DWORD        cdecl TwofishAsmCodeSize(void);
#endif

/*
+*****************************************************************************
*           Constants/Macros/Tables
-****************************************************************************/

#define     CONST                   /* help syntax from C++, NOP here */

CONST       fullSbox MDStab;        /* not actually const.  Initialized ONE time */
int         needToBuildMDS=1;       /* is MDStab initialized yet? */

#define     BIG_TAB     0

#if BIG_TAB
BYTE        bigTab[4][256][256];    /* pre-computed S-box */
#endif

/* number of rounds for various key sizes:  128, 192, 256 */
/* (ignored for now in optimized code!) */
CONST int   numRounds[4]= {0,ROUNDS_128,ROUNDS_192,ROUNDS_256};

#if REENTRANT
#define     _sBox_   key->sBox8x32
#else
static      fullSbox _sBox_;        /* permuted MDStab based on keys */
#endif
#define _sBox8_(N) (((BYTE *) _sBox_) + (N)*256)

/*------- see what level of S-box precomputation we need to do -----*/
#if   defined(ZERO_KEY)
#define MOD_STRING  "(Zero S-box keying)"
#define Fe32_128(x,R)   \
    (   MDStab[0][p8(01)[p8(02)[_b(x,R  )]^b0(SKEY[1])]^b0(SKEY[0])] ^  \
        MDStab[1][p8(11)[p8(12)[_b(x,R+1)]^b1(SKEY[1])]^b1(SKEY[0])] ^  \
        MDStab[2][p8(21)[p8(22)[_b(x,R+2)]^b2(SKEY[1])]^b2(SKEY[0])] ^  \
        MDStab[3][p8(31)[p8(32)[_b(x,R+3)]^b3(SKEY[1])]^b3(SKEY[0])] )
#define Fe32_192(x,R)   \
    (   MDStab[0][p8(01)[p8(02)[p8(03)[_b(x,R  )]^b0(SKEY[2])]^b0(SKEY[1])]^b0(SKEY[0])] ^ \
        MDStab[1][p8(11)[p8(12)[p8(13)[_b(x,R+1)]^b1(SKEY[2])]^b1(SKEY[1])]^b1(SKEY[0])] ^ \
        MDStab[2][p8(21)[p8(22)[p8(23)[_b(x,R+2)]^b2(SKEY[2])]^b2(SKEY[1])]^b2(SKEY[0])] ^ \
        MDStab[3][p8(31)[p8(32)[p8(33)[_b(x,R+3)]^b3(SKEY[2])]^b3(SKEY[1])]^b3(SKEY[0])] )
#define Fe32_256(x,R)   \
    (   MDStab[0][p8(01)[p8(02)[p8(03)[p8(04)[_b(x,R  )]^b0(SKEY[3])]^b0(SKEY[2])]^b0(SKEY[1])]^b0(SKEY[0])] ^ \
        MDStab[1][p8(11)[p8(12)[p8(13)[p8(14)[_b(x,R+1)]^b1(SKEY[3])]^b1(SKEY[2])]^b1(SKEY[1])]^b1(SKEY[0])] ^ \
        MDStab[2][p8(21)[p8(22)[p8(23)[p8(24)[_b(x,R+2)]^b2(SKEY[3])]^b2(SKEY[2])]^b2(SKEY[1])]^b2(SKEY[0])] ^ \
        MDStab[3][p8(31)[p8(32)[p8(33)[p8(34)[_b(x,R+3)]^b3(SKEY[3])]^b3(SKEY[2])]^b3(SKEY[1])]^b3(SKEY[0])] )

#define GetSboxKey  DWORD SKEY[4];  /* local copy */ \
                    memcpy(SKEY,key->sboxKeys,sizeof(SKEY));
/*----------------------------------------------------------------*/
#elif defined(MIN_KEY)
#define MOD_STRING  "(Minimal keying)"
#define Fe32_(x,R)(MDStab[0][p8(01)[_sBox8_(0)[_b(x,R  )]] ^ b0(SKEY0)] ^ \
                   MDStab[1][p8(11)[_sBox8_(1)[_b(x,R+1)]] ^ b1(SKEY0)] ^ \
                   MDStab[2][p8(21)[_sBox8_(2)[_b(x,R+2)]] ^ b2(SKEY0)] ^ \
                   MDStab[3][p8(31)[_sBox8_(3)[_b(x,R+3)]] ^ b3(SKEY0)])
#define sbSet(N,i,J,v) { _sBox8_(N)[i+J] = v; }
#define GetSboxKey  DWORD SKEY0 = key->sboxKeys[0]      /* local copy */
/*----------------------------------------------------------------*/
#elif defined(PART_KEY) 
#define MOD_STRING  "(Partial keying)"
#define Fe32_(x,R)(MDStab[0][_sBox8_(0)[_b(x,R  )]] ^ \
                   MDStab[1][_sBox8_(1)[_b(x,R+1)]] ^ \
                   MDStab[2][_sBox8_(2)[_b(x,R+2)]] ^ \
                   MDStab[3][_sBox8_(3)[_b(x,R+3)]])
#define sbSet(N,i,J,v) { _sBox8_(N)[i+J] = v; }
#define GetSboxKey  
/*----------------------------------------------------------------*/
#else   /* default is FULL_KEY */
#ifndef FULL_KEY
#define FULL_KEY    1
#endif
#if BIG_TAB
#define TAB_STR     " (Big table)"
#else
#define TAB_STR
#endif
#ifdef COMPILE_KEY
#define MOD_STRING  "(Compiled subkeys)" TAB_STR
#else
#define MOD_STRING  "(Full keying)" TAB_STR
#endif
/* Fe32_ does a full S-box + MDS lookup.  Need to #define _sBox_ before use.
   Note that we "interleave" 0,1, and 2,3 to avoid cache bank collisions
   in optimized assembly language.
*/
#define Fe32_(x,R) (_sBox_[0][2*_b(x,R  )] ^ _sBox_[0][2*_b(x,R+1)+1] ^ \
                    _sBox_[2][2*_b(x,R+2)] ^ _sBox_[2][2*_b(x,R+3)+1])
        /* set a single S-box value, given the input byte */
#define sbSet(N,i,J,v) { _sBox_[N&2][2*i+(N&1)+2*J]=MDStab[N][v]; }
#define GetSboxKey  
#endif

CONST       char *moduleDescription ="Optimized C ";
CONST       char *modeString        =MOD_STRING;


/* macro(s) for debugging help */
#define     CHECK_TABLE     0       /* nonzero --> compare against "slow" table */
#define     VALIDATE_PARMS  0       /* disable for full speed */

#include    "debug.h"               /* debug display macros */

/* end of debug macros */

#ifdef GetCodeSize
extern DWORD Here(DWORD x);         /* return caller's address! */
DWORD TwofishCodeStart(void) { return Here(0); }
#endif

/*
+*****************************************************************************
*
* Function Name:    TableOp
*
* Function:         Handle table use checking
*
* Arguments:        op  =   what to do  (see TAB_* defns in AES.H)
*
* Return:           TRUE --> done (for TAB_QUERY)       
*
* Notes: This routine is for use in generating the tables KAT file.
*        For this optimized version, we don't actually track table usage,
*        since it would make the macros incredibly ugly.  Instead we just
*        run for a fixed number of queries and then say we're done.
*
-****************************************************************************/
int TableOp(int op)
    {
    static int queryCnt=0;

    switch (op)
        {
        case TAB_DISABLE:
            break;
        case TAB_ENABLE:
            break;
        case TAB_RESET:
            queryCnt=0;
            break;
        case TAB_QUERY:
            queryCnt++;
            if (queryCnt < TAB_MIN_QUERY)
                return FALSE;
        }
    return TRUE;
    }


/*
+*****************************************************************************
*
* Function Name:    ParseHexDword
*
* Function:         Parse ASCII hex nibbles and fill in key/iv dwords
*
* Arguments:        bit         =   # bits to read
*                   srcTxt      =   ASCII source
*                   d           =   ptr to dwords to fill in
*                   dstTxt      =   where to make a copy of ASCII source
*                                   (NULL ok)
*
* Return:           Zero if no error.  Nonzero --> invalid hex or length
*
* Notes:  Note that the parameter d is a DWORD array, not a byte array.
*   This routine is coded to work both for little-endian and big-endian
*   architectures.  The character stream is interpreted as a LITTLE-ENDIAN
*   byte stream, since that is how the Pentium works, but the conversion
*   happens automatically below. 
*
-****************************************************************************/
int ParseHexDword(int bits,CONST char *srcTxt,DWORD *d,char *dstTxt)
    {
    int i;
    char c;
    DWORD b;

    union   /* make sure LittleEndian is defined correctly */
        {
        BYTE  b[4];
        DWORD d[1];
        } v;
    v.d[0]=1;
    if (v.b[0 ^ ADDR_XOR] != 1)
        return BAD_ENDIAN;      /* make sure compile-time switch is set ok */

#if VALIDATE_PARMS
  #if ALIGN32
    if (((int)d) & 3)
        return BAD_ALIGN32; 
  #endif
#endif

    for (i=0;i*32<bits;i++)
        d[i]=0;                 /* first, zero the field */

    for (i=0;i*4<bits;i++)      /* parse one nibble at a time */
        {                       /* case out the hexadecimal characters */
        c=srcTxt[i];
        if (dstTxt) dstTxt[i]=c;
        if ((c >= '0') && (c <= '9'))
            b=c-'0';
        else if ((c >= 'a') && (c <= 'f'))
            b=c-'a'+10;
        else if ((c >= 'A') && (c <= 'F'))
            b=c-'A'+10;
        else
            return BAD_KEY_MAT; /* invalid hex character */
        /* works for big and little endian! */
        d[i/8] |= b << (4*((i^1)&7));       
        }

    return 0;                   /* no error */
    }


#if CHECK_TABLE
/*
+*****************************************************************************
*
* Function Name:    f32
*
* Function:         Run four bytes through keyed S-boxes and apply MDS matrix
*
* Arguments:        x           =   input to f function
*                   k32         =   pointer to key dwords
*                   keyLen      =   total key length (k32 --> keyLey/2 bits)
*
* Return:           The output of the keyed permutation applied to x.
*
* Notes:
*   This function is a keyed 32-bit permutation.  It is the major building
*   block for the Twofish round function, including the four keyed 8x8 
*   permutations and the 4x4 MDS matrix multiply.  This function is used
*   both for generating round subkeys and within the round function on the
*   block being encrypted.  
*
*   This version is fairly slow and pedagogical, although a smartcard would
*   probably perform the operation exactly this way in firmware.   For
*   ultimate performance, the entire operation can be completed with four
*   lookups into four 256x32-bit tables, with three dword xors.
*
*   The MDS matrix is defined in TABLE.H.  To multiply by Mij, just use the
*   macro Mij(x).
*
-****************************************************************************/
DWORD f32(DWORD x,CONST DWORD *k32,int keyLen)
    {
    BYTE  b[4];
    
    /* Run each byte thru 8x8 S-boxes, xoring with key byte at each stage. */
    /* Note that each byte goes through a different combination of S-boxes.*/

    *((DWORD *)b) = Bswap(x);   /* make b[0] = LSB, b[3] = MSB */
    switch (((keyLen + 63)/64) & 3)
        {
        case 0:     /* 256 bits of key */
            b[0] = p8(04)[b[0]] ^ b0(k32[3]);
            b[1] = p8(14)[b[1]] ^ b1(k32[3]);
            b[2] = p8(24)[b[2]] ^ b2(k32[3]);
            b[3] = p8(34)[b[3]] ^ b3(k32[3]);
            /* fall thru, having pre-processed b[0]..b[3] with k32[3] */
        case 3:     /* 192 bits of key */
            b[0] = p8(03)[b[0]] ^ b0(k32[2]);
            b[1] = p8(13)[b[1]] ^ b1(k32[2]);
            b[2] = p8(23)[b[2]] ^ b2(k32[2]);
            b[3] = p8(33)[b[3]] ^ b3(k32[2]);
            /* fall thru, having pre-processed b[0]..b[3] with k32[2] */
        case 2:     /* 128 bits of key */
            b[0] = p8(00)[p8(01)[p8(02)[b[0]] ^ b0(k32[1])] ^ b0(k32[0])];
            b[1] = p8(10)[p8(11)[p8(12)[b[1]] ^ b1(k32[1])] ^ b1(k32[0])];
            b[2] = p8(20)[p8(21)[p8(22)[b[2]] ^ b2(k32[1])] ^ b2(k32[0])];
            b[3] = p8(30)[p8(31)[p8(32)[b[3]] ^ b3(k32[1])] ^ b3(k32[0])];
        }

    /* Now perform the MDS matrix multiply inline. */
    return  ((M00(b[0]) ^ M01(b[1]) ^ M02(b[2]) ^ M03(b[3]))      ) ^
            ((M10(b[0]) ^ M11(b[1]) ^ M12(b[2]) ^ M13(b[3])) <<  8) ^
            ((M20(b[0]) ^ M21(b[1]) ^ M22(b[2]) ^ M23(b[3])) << 16) ^
            ((M30(b[0]) ^ M31(b[1]) ^ M32(b[2]) ^ M33(b[3])) << 24) ;
    }
#endif  /* CHECK_TABLE */


/*
+*****************************************************************************
*
* Function Name:    RS_MDS_encode
*
* Function:         Use (12,8) Reed-Solomon code over GF(256) to produce
*                   a key S-box dword from two key material dwords.
*
* Arguments:        k0  =   1st dword
*                   k1  =   2nd dword
*
* Return:           Remainder polynomial generated using RS code
*
* Notes:
*   Since this computation is done only once per reKey per 64 bits of key,
*   the performance impact of this routine is imperceptible. The RS code
*   chosen has "simple" coefficients to allow smartcard/hardware implementation
*   without lookup tables.
*
-****************************************************************************/
DWORD RS_MDS_Encode(DWORD k0,DWORD k1)
    {
    int i,j;
    DWORD r;

    for (i=r=0;i<2;i++)
        {
        r ^= (i) ? k0 : k1;         /* merge in 32 more key bits */
        for (j=0;j<4;j++)           /* shift one byte at a time */
            RS_rem(r);              
        }
    return r;
    }


/*
+*****************************************************************************
*
* Function Name:    BuildMDS
*
* Function:         Initialize the MDStab array
*
* Arguments:        None.
*
* Return:           None.
*
* Notes:
*   Here we precompute all the fixed MDS table.  This only needs to be done
*   one time at initialization, after which the table is "CONST".
*
-****************************************************************************/
void BuildMDS(void)
    {
    int i;
    DWORD d;
    BYTE m1[2],mX[2],mY[4];

    for (i=0;i<256;i++)
        {
        m1[0]=P8x8[0][i];       /* compute all the matrix elements */
        mX[0]=(BYTE) Mul_X(m1[0]);
        mY[0]=(BYTE) Mul_Y(m1[0]);

        m1[1]=P8x8[1][i];
        mX[1]=(BYTE) Mul_X(m1[1]);
        mY[1]=(BYTE) Mul_Y(m1[1]);

#undef  Mul_1                   /* change what the pre-processor does with Mij */
#undef  Mul_X
#undef  Mul_Y
#define Mul_1   m1              /* It will now access m01[], m5B[], and mEF[] */
#define Mul_X   mX              
#define Mul_Y   mY

#define SetMDS(N)                   \
        b0(d) = M0##N[P_##N##0];    \
        b1(d) = M1##N[P_##N##0];    \
        b2(d) = M2##N[P_##N##0];    \
        b3(d) = M3##N[P_##N##0];    \
        MDStab[N][i] = d;

        SetMDS(0);              /* fill in the matrix with elements computed above */
        SetMDS(1);
        SetMDS(2);
        SetMDS(3);
        }
#undef  Mul_1
#undef  Mul_X
#undef  Mul_Y
#define Mul_1   Mx_1            /* re-enable true multiply */
#define Mul_X   Mx_X
#define Mul_Y   Mx_Y
    
#if BIG_TAB
    {
    int j,k;
    BYTE *q0,*q1;

    for (i=0;i<4;i++)
        {
        switch (i)
            {
            case 0: q0=p8(01); q1=p8(02);   break;
            case 1: q0=p8(11); q1=p8(12);   break;
            case 2: q0=p8(21); q1=p8(22);   break;
            case 3: q0=p8(31); q1=p8(32);   break;
            }
        for (j=0;j<256;j++)
            for (k=0;k<256;k++)
                bigTab[i][j][k]=q0[q1[k]^j];
        }
    }
#endif

    needToBuildMDS=0;           /* NEVER modify the table again! */
    }

/*
+*****************************************************************************
*
* Function Name:    ReverseRoundSubkeys
*
* Function:         Reverse order of round subkeys to switch between encrypt/decrypt
*
* Arguments:        key     =   ptr to keyInstance to be reversed
*                   newDir  =   new direction value
*
* Return:           None.
*
* Notes:
*   This optimization allows both blockEncrypt and blockDecrypt to use the same
*   "fallthru" switch statement based on the number of rounds.
*   Note that key->numRounds must be even and >= 2 here.
*
-****************************************************************************/
void ReverseRoundSubkeys(keyInstance *key,BYTE newDir)
    {
    DWORD t0,t1;
    register DWORD *r0=key->subKeys+ROUND_SUBKEYS;
    register DWORD *r1=r0 + 2*key->numRounds - 2;

    for (;r0 < r1;r0+=2,r1-=2)
        {
        t0=r0[0];           /* swap the order */
        t1=r0[1];
        r0[0]=r1[0];        /* but keep relative order within pairs */
        r0[1]=r1[1];
        r1[0]=t0;
        r1[1]=t1;
        }

    key->direction=newDir;
    }

/*
+*****************************************************************************
*
* Function Name:    Xor256
*
* Function:         Copy an 8-bit permutation (256 bytes), xoring with a byte
*
* Arguments:        dst     =   where to put result
*                   src     =   where to get data (can be same asa dst)
*                   b       =   byte to xor
*
* Return:           None
*
* Notes:
*   BorlandC's optimization is terrible!  When we put the code inline,
*   it generates fairly good code in the *following* segment (not in the Xor256
*   code itself).  If the call is made, the code following the call is awful!
*   The penalty is nearly 50%!  So we take the code size hit for inlining for
*   Borland, while Microsoft happily works with a call.
*
-****************************************************************************/
#if defined(__BORLANDC__)   /* do it inline */
#define Xor32(dst,src,i) { ((DWORD *)dst)[i] = ((DWORD *)src)[i] ^ tmpX; } 
#define Xor256(dst,src,b)               \
    {                                   \
    register DWORD tmpX=0x01010101u * b;\
    for (i=0;i<64;i+=4)                 \
        { Xor32(dst,src,i  ); Xor32(dst,src,i+1); Xor32(dst,src,i+2); Xor32(dst,src,i+3); } \
    }
#else                       /* do it as a function call */
void Xor256(void *dst,void *src,BYTE b)
    {
    register DWORD  x=b*0x01010101u;    /* replicate byte to all four bytes */
    register DWORD *d=(DWORD *)dst;
    register DWORD *s=(DWORD *)src;
#define X_8(N)  { d[N]=s[N] ^ x; d[N+1]=s[N+1] ^ x; }
#define X_32(N) { X_8(N); X_8(N+2); X_8(N+4); X_8(N+6); }
    X_32(0 ); X_32( 8); X_32(16); X_32(24); /* all inline */
    d+=32;  /* keep offsets small! */
    s+=32;
    X_32(0 ); X_32( 8); X_32(16); X_32(24); /* all inline */
    }
#endif

/*
+*****************************************************************************
*
* Function Name:    reKey
*
* Function:         Initialize the Twofish key schedule from key32
*
* Arguments:        key         =   ptr to keyInstance to be initialized
*
* Return:           TRUE on success
*
* Notes:
*   Here we precompute all the round subkeys, although that is not actually
*   required.  For example, on a smartcard, the round subkeys can 
*   be generated on-the-fly using f32()
*
-****************************************************************************/
int reKey(keyInstance *key)
    {
    int     i,j,k64Cnt,keyLen;
    int     subkeyCnt;
    DWORD   A=0,B=0,q;
    DWORD   sKey[MAX_KEY_BITS/64],k32e[MAX_KEY_BITS/64],k32o[MAX_KEY_BITS/64];
    BYTE    L0[256],L1[256];    /* small local 8-bit permutations */

#if VALIDATE_PARMS
  #if ALIGN32
    if (((int)key) & 3)
        return BAD_ALIGN32;
    if ((key->keyLen % 64) || (key->keyLen < MIN_KEY_BITS))
        return BAD_KEY_INSTANCE;
  #endif
#endif

    if (needToBuildMDS)         /* do this one time only */
        BuildMDS();

#define F32(res,x,k32)  \
    {                                                           \
    DWORD t=x;                                                  \
    switch (k64Cnt & 3)                                         \
        {                                                       \
        case 0:  /* same as 4 */                                \
                    b0(t)   = p8(04)[b0(t)] ^ b0(k32[3]);       \
                    b1(t)   = p8(14)[b1(t)] ^ b1(k32[3]);       \
                    b2(t)   = p8(24)[b2(t)] ^ b2(k32[3]);       \
                    b3(t)   = p8(34)[b3(t)] ^ b3(k32[3]);       \
                 /* fall thru, having pre-processed t */        \
        case 3:     b0(t)   = p8(03)[b0(t)] ^ b0(k32[2]);       \
                    b1(t)   = p8(13)[b1(t)] ^ b1(k32[2]);       \
                    b2(t)   = p8(23)[b2(t)] ^ b2(k32[2]);       \
                    b3(t)   = p8(33)[b3(t)] ^ b3(k32[2]);       \
                 /* fall thru, having pre-processed t */        \
        case 2:  /* 128-bit keys (optimize for this case) */    \
            res=    MDStab[0][p8(01)[p8(02)[b0(t)] ^ b0(k32[1])] ^ b0(k32[0])] ^    \
                    MDStab[1][p8(11)[p8(12)[b1(t)] ^ b1(k32[1])] ^ b1(k32[0])] ^    \
                    MDStab[2][p8(21)[p8(22)[b2(t)] ^ b2(k32[1])] ^ b2(k32[0])] ^    \
                    MDStab[3][p8(31)[p8(32)[b3(t)] ^ b3(k32[1])] ^ b3(k32[0])] ;    \
        }                                                       \
    }


#if !CHECK_TABLE
#if defined(USE_ASM)                /* only do this if not using assember */
if (!(useAsm & 4))
#endif
#endif
    {
    subkeyCnt = ROUND_SUBKEYS + 2*key->numRounds;
    keyLen=key->keyLen;
    k64Cnt=(keyLen+63)/64;          /* number of 64-bit key words */
    for (i=0,j=k64Cnt-1;i<k64Cnt;i++,j--)
        {                           /* split into even/odd key dwords */
        k32e[i]=key->key32[2*i  ];
        k32o[i]=key->key32[2*i+1];
        /* compute S-box keys using (12,8) Reed-Solomon code over GF(256) */
        sKey[j]=key->sboxKeys[j]=RS_MDS_Encode(k32e[i],k32o[i]);    /* reverse order */
        }
    }

#ifdef USE_ASM
if (useAsm & 4)
    {
    #if defined(COMPILE_KEY) && defined(USE_ASM)
        key->keySig     = VALID_SIG;            /* show that we are initialized */
        key->codeSize   = sizeof(key->compiledCode);    /* set size */
    #endif
    reKey_86(key);
    }
else
#endif
    {
    for (i=q=0;i<subkeyCnt/2;i++,q+=SK_STEP)    
        {                           /* compute round subkeys for PHT */
        F32(A,q        ,k32e);      /* A uses even key dwords */
        F32(B,q+SK_BUMP,k32o);      /* B uses odd  key dwords */
        B = ROL(B,8);
        key->subKeys[2*i  ] = A+B;  /* combine with a PHT */
        B = A + 2*B;
        key->subKeys[2*i+1] = ROL(B,SK_ROTL);
        }
#if !defined(ZERO_KEY)
    switch (keyLen) /* case out key length for speed in generating S-boxes */
        {
        case 128:
        #if defined(FULL_KEY) || defined(PART_KEY)
#if BIG_TAB
            #define one128(N,J) sbSet(N,i,J,L0[i+J])
            #define sb128(N) {                      \
                BYTE *qq=bigTab[N][b##N(sKey[1])];  \
                Xor256(L0,qq,b##N(sKey[0]));        \
                for (i=0;i<256;i+=2) { one128(N,0); one128(N,1); } }
#else
            #define one128(N,J) sbSet(N,i,J,p8(N##1)[L0[i+J]]^k0)
            #define sb128(N) {                  \
                Xor256(L0,p8(N##2),b##N(sKey[1]));  \
                { register DWORD k0=b##N(sKey[0]);  \
                for (i=0;i<256;i+=2) { one128(N,0); one128(N,1); } } }
#endif
        #elif defined(MIN_KEY)
            #define sb128(N) Xor256(_sBox8_(N),p8(N##2),b##N(sKey[1]))
        #endif
            sb128(0); sb128(1); sb128(2); sb128(3);
            break;
        case 192:
        #if defined(FULL_KEY) || defined(PART_KEY)
            #define one192(N,J) sbSet(N,i,J,p8(N##1)[p8(N##2)[L0[i+J]]^k1]^k0)
            #define sb192(N) {                      \
                Xor256(L0,p8(N##3),b##N(sKey[2]));  \
                { register DWORD k0=b##N(sKey[0]);  \
                  register DWORD k1=b##N(sKey[1]);  \
                  for (i=0;i<256;i+=2) { one192(N,0); one192(N,1); } } }
        #elif defined(MIN_KEY)
            #define one192(N,J) sbSet(N,i,J,p8(N##2)[L0[i+J]]^k1)
            #define sb192(N) {                      \
                Xor256(L0,p8(N##3),b##N(sKey[2]));  \
                { register DWORD k1=b##N(sKey[1]);  \
                  for (i=0;i<256;i+=2) { one192(N,0); one192(N,1); } } }
        #endif
            sb192(0); sb192(1); sb192(2); sb192(3);
            break;
        case 256:
        #if defined(FULL_KEY) || defined(PART_KEY)
            #define one256(N,J) sbSet(N,i,J,p8(N##1)[p8(N##2)[L0[i+J]]^k1]^k0)
            #define sb256(N) {                                      \
                Xor256(L1,p8(N##4),b##N(sKey[3]));                  \
                for (i=0;i<256;i+=2) {L0[i  ]=p8(N##3)[L1[i]];      \
                                      L0[i+1]=p8(N##3)[L1[i+1]]; }  \
                Xor256(L0,L0,b##N(sKey[2]));                        \
                { register DWORD k0=b##N(sKey[0]);                  \
                  register DWORD k1=b##N(sKey[1]);                  \
                  for (i=0;i<256;i+=2) { one256(N,0); one256(N,1); } } }
        #elif defined(MIN_KEY)
            #define one256(N,J) sbSet(N,i,J,p8(N##2)[L0[i+J]]^k1)
            #define sb256(N) {                                      \
                Xor256(L1,p8(N##4),b##N(sKey[3]));                  \
                for (i=0;i<256;i+=2) {L0[i  ]=p8(N##3)[L1[i]];      \
                                      L0[i+1]=p8(N##3)[L1[i+1]]; }  \
                Xor256(L0,L0,b##N(sKey[2]));                        \
                { register DWORD k1=b##N(sKey[1]);                  \
                  for (i=0;i<256;i+=2) { one256(N,0); one256(N,1); } } }
        #endif
            sb256(0); sb256(1); sb256(2); sb256(3);
            break;
        }
#endif
    }

#if CHECK_TABLE                     /* sanity check  vs. pedagogical code*/
    {
    GetSboxKey;
    for (i=0;i<subkeyCnt/2;i++)
        {
        A = f32(i*SK_STEP        ,k32e,keyLen); /* A uses even key dwords */
        B = f32(i*SK_STEP+SK_BUMP,k32o,keyLen); /* B uses odd  key dwords */
        B = ROL(B,8);
        assert(key->subKeys[2*i  ] == A+  B);
        assert(key->subKeys[2*i+1] == ROL(A+2*B,SK_ROTL));
        }
  #if !defined(ZERO_KEY)            /* any S-boxes to check? */
    for (i=q=0;i<256;i++,q+=0x01010101)
        assert(f32(q,key->sboxKeys,keyLen) == Fe32_(q,0));
  #endif
    }
#endif /* CHECK_TABLE */

    DebugDumpKey(key);

    if (key->direction == DIR_ENCRYPT)  
        ReverseRoundSubkeys(key,DIR_ENCRYPT);   /* reverse the round subkey order */

    return TRUE;
    }
/*
+*****************************************************************************
*
* Function Name:    makeKey
*
* Function:         Initialize the Twofish key schedule
*
* Arguments:        key         =   ptr to keyInstance to be initialized
*                   direction   =   DIR_ENCRYPT or DIR_DECRYPT
*                   keyLen      =   # bits of key text at *keyMaterial
*                   keyMaterial =   ptr to hex ASCII chars representing key bits
*
* Return:           TRUE on success
*                   else error code (e.g., BAD_KEY_DIR)
*
* Notes:    This parses the key bits from keyMaterial.  Zeroes out unused key bits
*
-****************************************************************************/
int makeKey(keyInstance *key, BYTE direction, int keyLen,CONST char *keyMaterial)
    {
#if VALIDATE_PARMS              /* first, sanity check on parameters */
    if (key == NULL)            
        return BAD_KEY_INSTANCE;/* must have a keyInstance to initialize */
    if ((direction != DIR_ENCRYPT) && (direction != DIR_DECRYPT))
        return BAD_KEY_DIR;     /* must have valid direction */
    if ((keyLen > MAX_KEY_BITS) || (keyLen < 8) || (keyLen & 0x3F))
        return BAD_KEY_MAT;     /* length must be valid */
    key->keySig = VALID_SIG;    /* show that we are initialized */
  #if ALIGN32
    if ((((int)key) & 3) || (((int)key->key32) & 3))
        return BAD_ALIGN32;
  #endif
#endif

    key->direction  = direction;/* set our cipher direction */
    key->keyLen     = (keyLen+63) & ~63;        /* round up to multiple of 64 */
    key->numRounds  = numRounds[(keyLen-1)/64];
    memset(key->key32,0,sizeof(key->key32));    /* zero unused bits */
    key->keyMaterial[MAX_KEY_SIZE]=0;   /* terminate ASCII string */

    if ((keyMaterial == NULL) || (keyMaterial[0]==0))
        return TRUE;            /* allow a "dummy" call */
        
    if (ParseHexDword(keyLen,keyMaterial,key->key32,key->keyMaterial))
        return BAD_KEY_MAT; 

    return reKey(key);          /* generate round subkeys */
    }


/*
+*****************************************************************************
*
* Function Name:    cipherInit
*
* Function:         Initialize the Twofish cipher in a given mode
*
* Arguments:        cipher      =   ptr to cipherInstance to be initialized
*                   mode        =   MODE_ECB, MODE_CBC, or MODE_CFB1
*                   IV          =   ptr to hex ASCII test representing IV bytes
*
* Return:           TRUE on success
*                   else error code (e.g., BAD_CIPHER_MODE)
*
-****************************************************************************/
int cipherInit(cipherInstance *cipher, BYTE mode,CONST char *IV)
    {
    int i;
#if VALIDATE_PARMS              /* first, sanity check on parameters */
    if (cipher == NULL)         
        return BAD_PARAMS;      /* must have a cipherInstance to initialize */
    if ((mode != MODE_ECB) && (mode != MODE_CBC) && (mode != MODE_CFB1))
        return BAD_CIPHER_MODE; /* must have valid cipher mode */
    cipher->cipherSig   =   VALID_SIG;
  #if ALIGN32
    if ((((int)cipher) & 3) || (((int)cipher->IV) & 3) || (((int)cipher->iv32) & 3))
        return BAD_ALIGN32;
  #endif
#endif

    if ((mode != MODE_ECB) && (IV)) /* parse the IV */
        {
        if (ParseHexDword(BLOCK_SIZE,IV,cipher->iv32,NULL))
            return BAD_IV_MAT;
        for (i=0;i<BLOCK_SIZE/32;i++)   /* make byte-oriented copy for CFB1 */
            ((DWORD *)cipher->IV)[i] = Bswap(cipher->iv32[i]);
        }

    cipher->mode        =   mode;

    return TRUE;
    }

/*
+*****************************************************************************
*
* Function Name:    blockEncrypt
*
* Function:         Encrypt block(s) of data using Twofish
*
* Arguments:        cipher      =   ptr to already initialized cipherInstance
*                   key         =   ptr to already initialized keyInstance
*                   input       =   ptr to data blocks to be encrypted
*                   inputLen    =   # bits to encrypt (multiple of blockSize)
*                   outBuffer   =   ptr to where to put encrypted blocks
*
* Return:           # bits ciphered (>= 0)
*                   else error code (e.g., BAD_CIPHER_STATE, BAD_KEY_MATERIAL)
*
* Notes: The only supported block size for ECB/CBC modes is BLOCK_SIZE bits.
*        If inputLen is not a multiple of BLOCK_SIZE bits in those modes,
*        an error BAD_INPUT_LEN is returned.  In CFB1 mode, all block 
*        sizes can be supported.
*
-****************************************************************************/
int blockEncrypt(cipherInstance *cipher, keyInstance *key,CONST BYTE *input,
                int inputLen, BYTE *outBuffer)
    {
    int   i,n;                      /* loop counters */
    DWORD x[BLOCK_SIZE/32];         /* block being encrypted */
    DWORD t0,t1;                    /* temp variables */
    int   rounds=key->numRounds;    /* number of rounds */
    BYTE  bit,bit0,ctBit,carry;     /* temps for CFB */

    /* make local copies of things for faster access */
    int   mode = cipher->mode;
    DWORD sk[TOTAL_SUBKEYS];
    DWORD IV[BLOCK_SIZE/32];

    GetSboxKey;

#if VALIDATE_PARMS
    if ((cipher == NULL) || (cipher->cipherSig != VALID_SIG))
        return BAD_CIPHER_STATE;
    if ((key == NULL) || (key->keySig != VALID_SIG))
        return BAD_KEY_INSTANCE;
    if ((rounds < 2) || (rounds > MAX_ROUNDS) || (rounds&1))
        return BAD_KEY_INSTANCE;
    if ((mode != MODE_CFB1) && (inputLen % BLOCK_SIZE))
        return BAD_INPUT_LEN;
  #if ALIGN32
    if ( (((int)cipher) & 3) || (((int)key      ) & 3) ||
         (((int)input ) & 3) || (((int)outBuffer) & 3))
        return BAD_ALIGN32;
  #endif
#endif

    if (mode == MODE_CFB1)
        {   /* use recursion here to handle CFB, one block at a time */
        cipher->mode = MODE_ECB;    /* do encryption in ECB */
        for (n=0;n<inputLen;n++)
            {
            blockEncrypt(cipher,key,cipher->IV,BLOCK_SIZE,(BYTE *)x);
            bit0  = 0x80 >> (n & 7);/* which bit position in byte */
            ctBit = (input[n/8] & bit0) ^ ((((BYTE *) x)[0] & 0x80) >> (n&7));
            outBuffer[n/8] = (outBuffer[n/8] & ~ bit0) | ctBit;
            carry = ctBit >> (7 - (n&7));
            for (i=BLOCK_SIZE/8-1;i>=0;i--)
                {
                bit = cipher->IV[i] >> 7;   /* save next "carry" from shift */
                cipher->IV[i] = (cipher->IV[i] << 1) ^ carry;
                carry = bit;
                }
            }
        cipher->mode = MODE_CFB1;   /* restore mode for next time */
        return inputLen;
        }

    /* here for ECB, CBC modes */
    if (key->direction != DIR_ENCRYPT)
        ReverseRoundSubkeys(key,DIR_ENCRYPT);   /* reverse the round subkey order */

#ifdef USE_ASM
    if ((useAsm & 1) && (inputLen))
  #ifdef COMPILE_KEY
        if (key->keySig == VALID_SIG)
            return ((CipherProc *)(key->encryptFuncPtr))(cipher,key,input,inputLen,outBuffer);
  #else 
        return (*blockEncrypt_86)(cipher,key,input,inputLen,outBuffer);
  #endif
#endif
    /* make local copy of subkeys for speed */
    memcpy(sk,key->subKeys,sizeof(DWORD)*(ROUND_SUBKEYS+2*rounds));
    if (mode == MODE_CBC)
        BlockCopy(IV,cipher->iv32)
    else
        IV[0]=IV[1]=IV[2]=IV[3]=0;

    for (n=0;n<inputLen;n+=BLOCK_SIZE,input+=BLOCK_SIZE/8,outBuffer+=BLOCK_SIZE/8)
        {
#ifdef DEBUG
        DebugDump(input,"\n",-1,0,0,0,1);
        if (cipher->mode == MODE_CBC)
            DebugDump(cipher->iv32,"",IV_ROUND,0,0,0,0);
#endif
#define LoadBlockE(N)  x[N]=Bswap(((DWORD *)input)[N]) ^ sk[INPUT_WHITEN+N] ^ IV[N]
        LoadBlockE(0);  LoadBlockE(1);  LoadBlockE(2);  LoadBlockE(3);
        DebugDump(x,"",0,0,0,0,0);
#define EncryptRound(K,R,id)    \
            t0     = Fe32##id(x[K  ],0);                    \
            t1     = Fe32##id(x[K^1],3);                    \
            x[K^3] = ROL(x[K^3],1);                         \
            x[K^2]^= t0 +   t1 + sk[ROUND_SUBKEYS+2*(R)  ]; \
            x[K^3]^= t0 + 2*t1 + sk[ROUND_SUBKEYS+2*(R)+1]; \
            x[K^2] = ROR(x[K^2],1);                         \
            DebugDump(x,"",rounds-(R),0,0,1,0);
#define     Encrypt2(R,id)  { EncryptRound(0,R+1,id); EncryptRound(2,R,id); }

#if defined(ZERO_KEY)
        switch (key->keyLen)
            {
            case 128:
                for (i=rounds-2;i>=0;i-=2)
                    Encrypt2(i,_128);
                break;
            case 192:
                for (i=rounds-2;i>=0;i-=2)
                    Encrypt2(i,_192);
                break;
            case 256:
                for (i=rounds-2;i>=0;i-=2)
                    Encrypt2(i,_256);
                break;
            }
#else
        Encrypt2(14,_);
        Encrypt2(12,_);
        Encrypt2(10,_);
        Encrypt2( 8,_);
        Encrypt2( 6,_);
        Encrypt2( 4,_);
        Encrypt2( 2,_);
        Encrypt2( 0,_);
#endif

        /* need to do (or undo, depending on your point of view) final swap */
#if LittleEndian
#define StoreBlockE(N)  ((DWORD *)outBuffer)[N]=x[N^2] ^ sk[OUTPUT_WHITEN+N]
#else
#define StoreBlockE(N)  { t0=x[N^2] ^ sk[OUTPUT_WHITEN+N]; ((DWORD *)outBuffer)[N]=Bswap(t0); }
#endif
        StoreBlockE(0); StoreBlockE(1); StoreBlockE(2); StoreBlockE(3);
        if (mode == MODE_CBC)
            {
            IV[0]=Bswap(((DWORD *)outBuffer)[0]);
            IV[1]=Bswap(((DWORD *)outBuffer)[1]);
            IV[2]=Bswap(((DWORD *)outBuffer)[2]);
            IV[3]=Bswap(((DWORD *)outBuffer)[3]);
            }
#ifdef DEBUG
        DebugDump(outBuffer,"",rounds+1,0,0,0,1);
        if (cipher->mode == MODE_CBC)
            DebugDump(cipher->iv32,"",IV_ROUND,0,0,0,0);
#endif
        }

    if (mode == MODE_CBC)
        BlockCopy(cipher->iv32,IV);

    return inputLen;
    }

/*
+*****************************************************************************
*
* Function Name:    blockDecrypt
*
* Function:         Decrypt block(s) of data using Twofish
*
* Arguments:        cipher      =   ptr to already initialized cipherInstance
*                   key         =   ptr to already initialized keyInstance
*                   input       =   ptr to data blocks to be decrypted
*                   inputLen    =   # bits to encrypt (multiple of blockSize)
*                   outBuffer   =   ptr to where to put decrypted blocks
*
* Return:           # bits ciphered (>= 0)
*                   else error code (e.g., BAD_CIPHER_STATE, BAD_KEY_MATERIAL)
*
* Notes: The only supported block size for ECB/CBC modes is BLOCK_SIZE bits.
*        If inputLen is not a multiple of BLOCK_SIZE bits in those modes,
*        an error BAD_INPUT_LEN is returned.  In CFB1 mode, all block 
*        sizes can be supported.
*
-****************************************************************************/
int blockDecrypt(cipherInstance *cipher, keyInstance *key,CONST BYTE *input,
                int inputLen, BYTE *outBuffer)
    {
    int   i,n;                      /* loop counters */
    DWORD x[BLOCK_SIZE/32];         /* block being encrypted */
    DWORD t0,t1;                    /* temp variables */
    int   rounds=key->numRounds;    /* number of rounds */
    BYTE  bit,bit0,ctBit,carry;     /* temps for CFB */

    /* make local copies of things for faster access */
    int   mode = cipher->mode;
    DWORD sk[TOTAL_SUBKEYS];
    DWORD IV[BLOCK_SIZE/32];

    GetSboxKey;

#if VALIDATE_PARMS
    if ((cipher == NULL) || (cipher->cipherSig != VALID_SIG))
        return BAD_CIPHER_STATE;
    if ((key == NULL) || (key->keySig != VALID_SIG))
        return BAD_KEY_INSTANCE;
    if ((rounds < 2) || (rounds > MAX_ROUNDS) || (rounds&1))
        return BAD_KEY_INSTANCE;
    if ((cipher->mode != MODE_CFB1) && (inputLen % BLOCK_SIZE))
        return BAD_INPUT_LEN;
  #if ALIGN32
    if ( (((int)cipher) & 3) || (((int)key      ) & 3) ||
         (((int)input)  & 3) || (((int)outBuffer) & 3))
        return BAD_ALIGN32;
  #endif
#endif

    if (cipher->mode == MODE_CFB1)
        {   /* use blockEncrypt here to handle CFB, one block at a time */
        cipher->mode = MODE_ECB;    /* do encryption in ECB */
        for (n=0;n<inputLen;n++)
            {
            blockEncrypt(cipher,key,cipher->IV,BLOCK_SIZE,(BYTE *)x);
            bit0  = 0x80 >> (n & 7);
            ctBit = input[n/8] & bit0;
            outBuffer[n/8] = (outBuffer[n/8] & ~ bit0) |
                             (ctBit ^ ((((BYTE *) x)[0] & 0x80) >> (n&7)));
            carry = ctBit >> (7 - (n&7));
            for (i=BLOCK_SIZE/8-1;i>=0;i--)
                {
                bit = cipher->IV[i] >> 7;   /* save next "carry" from shift */
                cipher->IV[i] = (cipher->IV[i] << 1) ^ carry;
                carry = bit;
                }
            }
        cipher->mode = MODE_CFB1;   /* restore mode for next time */
        return inputLen;
        }

    /* here for ECB, CBC modes */
    if (key->direction != DIR_DECRYPT)
        ReverseRoundSubkeys(key,DIR_DECRYPT);   /* reverse the round subkey order */
#ifdef USE_ASM
    if ((useAsm & 2) && (inputLen))
  #ifdef COMPILE_KEY
        if (key->keySig == VALID_SIG)
            return ((CipherProc *)(key->decryptFuncPtr))(cipher,key,input,inputLen,outBuffer);
  #else 
        return (*blockDecrypt_86)(cipher,key,input,inputLen,outBuffer);
  #endif
#endif
    /* make local copy of subkeys for speed */
    memcpy(sk,key->subKeys,sizeof(DWORD)*(ROUND_SUBKEYS+2*rounds));
    if (mode == MODE_CBC)
        BlockCopy(IV,cipher->iv32)
    else
        IV[0]=IV[1]=IV[2]=IV[3]=0;

    for (n=0;n<inputLen;n+=BLOCK_SIZE,input+=BLOCK_SIZE/8,outBuffer+=BLOCK_SIZE/8)
        {
        DebugDump(input,"\n",rounds+1,0,0,0,1);
#define LoadBlockD(N) x[N^2]=Bswap(((DWORD *)input)[N]) ^ sk[OUTPUT_WHITEN+N]
        LoadBlockD(0);  LoadBlockD(1);  LoadBlockD(2);  LoadBlockD(3);

#define DecryptRound(K,R,id)                                \
            t0     = Fe32##id(x[K  ],0);                    \
            t1     = Fe32##id(x[K^1],3);                    \
            DebugDump(x,"",(R)+1,0,0,1,0);                  \
            x[K^2] = ROL (x[K^2],1);                        \
            x[K^2]^= t0 +   t1 + sk[ROUND_SUBKEYS+2*(R)  ]; \
            x[K^3]^= t0 + 2*t1 + sk[ROUND_SUBKEYS+2*(R)+1]; \
            x[K^3] = ROR (x[K^3],1);                        \

#define     Decrypt2(R,id)  { DecryptRound(2,R+1,id); DecryptRound(0,R,id); }

#if defined(ZERO_KEY)
        switch (key->keyLen)
            {
            case 128:
                for (i=rounds-2;i>=0;i-=2)
                    Decrypt2(i,_128);
                break;
            case 192:
                for (i=rounds-2;i>=0;i-=2)
                    Decrypt2(i,_192);
                break;
            case 256:
                for (i=rounds-2;i>=0;i-=2)
                    Decrypt2(i,_256);
                break;
            }
#else
        {
        Decrypt2(14,_);
        Decrypt2(12,_);
        Decrypt2(10,_);
        Decrypt2( 8,_);
        Decrypt2( 6,_);
        Decrypt2( 4,_);
        Decrypt2( 2,_);
        Decrypt2( 0,_);
        }
#endif
        DebugDump(x,"",0,0,0,0,0);
        if (cipher->mode == MODE_ECB)
            {
#if LittleEndian
#define StoreBlockD(N)  ((DWORD *)outBuffer)[N] = x[N] ^ sk[INPUT_WHITEN+N]
#else
#define StoreBlockD(N)  { t0=x[N]^sk[INPUT_WHITEN+N]; ((DWORD *)outBuffer)[N] = Bswap(t0); }
#endif
            StoreBlockD(0); StoreBlockD(1); StoreBloc
Download .txt
gitextract_9zwc60cb/

├── .github/
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   └── feature_request.md
│   └── workflows/
│       ├── build-only.yml
│       ├── build-site.yml
│       └── build.yml
├── .gitignore
├── .gitmodules
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Crypt/
│   ├── Crypt.cpp
│   ├── Crypt.def
│   ├── Crypt.h
│   ├── Crypt.rc
│   ├── Crypt.vcxproj
│   ├── Crypt.vcxproj.filters
│   ├── LoginEncryption.cpp
│   ├── LoginEncryption.h
│   ├── MemFinder.cpp
│   ├── MemFinder.h
│   ├── OSIEncryption.cpp
│   ├── OSIEncryption.h
│   ├── OldStatusBar.cpp
│   ├── PacketInfo.cpp
│   ├── PacketInfo.h
│   ├── UOArt.cpp
│   ├── debug.h
│   ├── platform.h
│   ├── resource.h
│   ├── stdafx.cpp
│   ├── stdafx.h
│   ├── table.h
│   ├── trees.cpp
│   ├── twofish.c
│   ├── twofish.h
│   ├── uo_huffman.cpp
│   └── uo_huffman.h
├── FastColoredTextBox/
│   ├── AutocompleteItem.cs
│   ├── AutocompleteMenu.cs
│   ├── Bookmarks.cs
│   ├── Char.cs
│   ├── CommandManager.cs
│   ├── Commands.cs
│   ├── DocumentMap.cs
│   ├── EncodingDetector.cs
│   ├── ExportToHTML.cs
│   ├── ExportToRTF.cs
│   ├── FCTB_key.snk
│   ├── FastColoredTextBox.cs
│   ├── FastColoredTextBox.csproj
│   ├── FastColoredTextBox.resx
│   ├── FastColoredTextBox.xml
│   ├── FileTextSource.cs
│   ├── FindForm.Designer.cs
│   ├── FindForm.cs
│   ├── FindForm.resx
│   ├── GoToForm.Designer.cs
│   ├── GoToForm.cs
│   ├── GoToForm.resx
│   ├── Hints.cs
│   ├── Hotkeys.cs
│   ├── HotkeysEditorForm.Designer.cs
│   ├── HotkeysEditorForm.cs
│   ├── HotkeysEditorForm.resx
│   ├── LimitedStack.cs
│   ├── Line.cs
│   ├── LinesAccessor.cs
│   ├── MacrosManager.cs
│   ├── NativeMethods.cs
│   ├── Place.cs
│   ├── PlatformType.cs
│   ├── Properties/
│   │   └── AssemblyInfo.cs
│   ├── Range.cs
│   ├── ReplaceForm.Designer.cs
│   ├── ReplaceForm.cs
│   ├── ReplaceForm.resx
│   ├── Ruler.Designer.cs
│   ├── Ruler.cs
│   ├── Style.cs
│   ├── SyntaxDescriptor.cs
│   ├── SyntaxHighlighter.cs
│   ├── TextSource.cs
│   ├── TypeDescriptor.cs
│   ├── UnfocusablePanel.cs
│   └── VisualMarker.cs
├── INSTALL.md
├── LICENSE.md
├── Loader/
│   ├── Loader.cpp
│   ├── Loader.def
│   ├── Loader.h
│   ├── Loader.rc
│   ├── Loader.vcxproj
│   ├── Loader.vcxproj.filters
│   ├── resource.h
│   ├── stdafx.cpp
│   └── stdafx.h
├── Notepad++UDL.xml
├── Platform/
│   ├── Platform.cpp
│   ├── Platform.def
│   ├── Platform.h
│   ├── Platform.vcxproj
│   └── Platform.vcxproj.filters
├── README.md
├── Razor/
│   ├── Agents/
│   │   ├── Agents.cs
│   │   ├── BuyAgent.cs
│   │   ├── IgnoreAgent.cs
│   │   ├── OrganizerAgent.cs
│   │   ├── RestockAgent.cs
│   │   ├── ScavengerAgent.cs
│   │   ├── SearchExemptionAgent.cs
│   │   ├── SellAgent.cs
│   │   └── UseOnceAgent.cs
│   ├── Boat/
│   │   ├── BoatWindow.Designer.cs
│   │   ├── BoatWindow.cs
│   │   └── BoatWindow.resx
│   ├── Client/
│   │   ├── ClassicUO.cs
│   │   ├── Client.cs
│   │   ├── OSI.cs
│   │   └── UOAssist.cs
│   ├── Core/
│   │   ├── ActionQueue.cs
│   │   ├── BandageTimer.cs
│   │   ├── BodCapture.cs
│   │   ├── BuffDebuffManager.cs
│   │   ├── ClassicUOManager.cs
│   │   ├── Commands.cs
│   │   ├── ContainerLabels.cs
│   │   ├── CooldownManager.cs
│   │   ├── Counters.cs
│   │   ├── DamageTracker.cs
│   │   ├── Dress.cs
│   │   ├── DressList.cs
│   │   ├── EncodedSpeech.cs
│   │   ├── FriendsManager.cs
│   │   ├── GateTimer.cs
│   │   ├── Geometry.cs
│   │   ├── GoldPerHourTimer.cs
│   │   ├── Item.cs
│   │   ├── ItemID.cs
│   │   ├── Main.cs
│   │   ├── Map.cs
│   │   ├── MemHelper.cs
│   │   ├── MessageInBottleCapture.cs
│   │   ├── MessageManager.cs
│   │   ├── Mobile.cs
│   │   ├── MsgQueue.cs
│   │   ├── ObjectPropertyList.cs
│   │   ├── OverheadManager.cs
│   │   ├── Overrides.cs
│   │   ├── PasswordMemory.cs
│   │   ├── Ping.cs
│   │   ├── Player.cs
│   │   ├── ScreenCapture.cs
│   │   ├── Serial.cs
│   │   ├── SkillTimer.cs
│   │   ├── Spells.cs
│   │   ├── StaffToolsManager.cs
│   │   ├── StealthSteps.cs
│   │   ├── SystemMessages.cs
│   │   ├── Targeting.cs
│   │   ├── TargetingClosest.cs
│   │   ├── TargetingNextPrevious.cs
│   │   ├── TargetingRandom.cs
│   │   ├── TextFilterManager.cs
│   │   ├── Timer.cs
│   │   ├── UOEntity.cs
│   │   ├── Utility.cs
│   │   ├── WaypointManager.cs
│   │   ├── World.cs
│   │   └── ZLib.cs
│   ├── Filters/
│   │   ├── Death.cs
│   │   ├── Filter.cs
│   │   ├── Light.cs
│   │   ├── MessageFilter.cs
│   │   ├── MobileFilter.cs
│   │   ├── SoundFilters.cs
│   │   ├── SoundMusicManager.cs
│   │   ├── StaffItems.cs
│   │   ├── TargetFilterManager.cs
│   │   ├── VetRewardGump.cs
│   │   ├── WallStaticFilter.cs
│   │   └── Weather.cs
│   ├── Gumps/
│   │   ├── Gump.cs
│   │   ├── GumpButtonType.cs
│   │   ├── GumpCollection.cs
│   │   ├── GumpElement.cs
│   │   ├── GumpPage.cs
│   │   ├── GumpType.cs
│   │   └── Internal/
│   │       ├── AgentsGump.cs
│   │       ├── BoatControlGump.cs
│   │       ├── BuffGump.cs
│   │       ├── CooldownGump.cs
│   │       ├── DamageTrackerGump.cs
│   │       ├── DamageTrackerListGump.cs
│   │       ├── HotKeyGump.cs
│   │       ├── InputDialogGump.cs
│   │       ├── ItemInfoGump.cs
│   │       ├── MobileInfoGump.cs
│   │       ├── SystemMessagesGump.cs
│   │       └── TestMessageGump.cs
│   ├── HotKeys/
│   │   ├── Counters.cs
│   │   ├── HotKeys.cs
│   │   ├── Misc.cs
│   │   ├── SkillHotKeys.cs
│   │   ├── SpecialMoves.cs
│   │   └── Undress.cs
│   ├── Macros/
│   │   ├── Actions.cs
│   │   ├── Actions.resx
│   │   ├── Macro.cs
│   │   ├── MacroManager.cs
│   │   └── MacroVariables.cs
│   ├── Map/
│   │   ├── MapWindow.cs
│   │   ├── MapWindow.resx
│   │   ├── Region.cs
│   │   ├── UOMapControl.cs
│   │   ├── UOMapControl.resx
│   │   └── UOMapRuneButton.cs
│   ├── Network/
│   │   ├── Handlers.cs
│   │   ├── Loader.cs
│   │   ├── Packet.cs
│   │   ├── PacketHandler.cs
│   │   ├── PacketTable.cs
│   │   ├── PacketWriter.cs
│   │   └── Packets.cs
│   ├── Platform.cs
│   ├── Properties/
│   │   ├── AssemblyInfo.cs
│   │   ├── Resources.Designer.cs
│   │   └── Resources.resx
│   ├── Razor.csproj
│   ├── Razor.manifest
│   ├── Scripts/
│   │   ├── AgentCommands.cs
│   │   ├── Aliases.cs
│   │   ├── Commands.cs
│   │   ├── Engine/
│   │   │   ├── Interpreter.cs
│   │   │   ├── Lexer.cs
│   │   │   └── TextParser.cs
│   │   ├── Expressions.cs
│   │   ├── Helpers/
│   │   │   └── CommandHelper.cs
│   │   ├── RazorScript.cs
│   │   ├── ScriptManager.cs
│   │   ├── ScriptVariables.cs
│   │   ├── SpeechCommands.cs
│   │   └── TargetCommands.cs
│   ├── UI/
│   │   ├── AddCounter.cs
│   │   ├── AddCounter.resx
│   │   ├── ArtViewer.Designer.cs
│   │   ├── ArtViewer.cs
│   │   ├── BuffDebuffOptions.Designer.cs
│   │   ├── BuffDebuffOptions.cs
│   │   ├── BuffDebuffOptions.resx
│   │   ├── Config.cs
│   │   ├── ContainerLabels.Designer.cs
│   │   ├── ContainerLabels.cs
│   │   ├── ContainerLabels.resx
│   │   ├── Ext.cs
│   │   ├── HueEntry.cs
│   │   ├── HueEntry.resx
│   │   ├── InputBox.cs
│   │   ├── InputBox.resx
│   │   ├── InputDropdown.cs
│   │   ├── InputDropdown.resx
│   │   ├── Languages.cs
│   │   ├── MacroInsertDoWhile.cs
│   │   ├── MacroInsertDoWhile.resx
│   │   ├── MacroInsertIf.cs
│   │   ├── MacroInsertIf.resx
│   │   ├── MacroInsertWait.cs
│   │   ├── MacroInsertWait.resx
│   │   ├── MacroInsertWhile.cs
│   │   ├── MacroInsertWhile.resx
│   │   ├── MessageDialog.cs
│   │   ├── MessageDialog.resx
│   │   ├── Razor.Designer.cs
│   │   ├── Razor.cs
│   │   ├── Razor.resx
│   │   ├── SoundEntry.cs
│   │   ├── SoundEntry.resx
│   │   ├── SplashScreen.cs
│   │   ├── SplashScreen.resx
│   │   ├── WelcomeForm.cs
│   │   └── WelcomeForm.resx
│   ├── UltimaSDK/
│   │   ├── ASCIIFont.cs
│   │   ├── AnimationEdit.cs
│   │   ├── Animations.cs
│   │   ├── Animdata.cs
│   │   ├── Art.cs
│   │   ├── BwtDecompress.cs
│   │   ├── CalibrationInfo.cs
│   │   ├── Client.cs
│   │   ├── ClientHandles.cs
│   │   ├── FileIndex.cs
│   │   ├── Files.cs
│   │   ├── Gumps.cs
│   │   ├── Hues.cs
│   │   ├── Light.cs
│   │   ├── LocationPointer.cs
│   │   ├── Map.cs
│   │   ├── MultiMap.cs
│   │   ├── Multis.cs
│   │   ├── NativeMethods.cs
│   │   ├── ProcessStream.cs
│   │   ├── RadarCol.cs
│   │   ├── SkillGroups.cs
│   │   ├── Skills.cs
│   │   ├── Sound.cs
│   │   ├── SpeechList.cs
│   │   ├── StackDataReader.cs
│   │   ├── StringEntry.cs
│   │   ├── StringHelper.cs
│   │   ├── StringList.cs
│   │   ├── Textures.cs
│   │   ├── TileData.cs
│   │   ├── TileList.cs
│   │   ├── TileMatrix.cs
│   │   ├── TileMatrixPatch.cs
│   │   ├── UnicodeFont.cs
│   │   ├── ValueStringBuilder.cs
│   │   ├── Verdata.cs
│   │   └── WindowProcessStream.cs
│   ├── app.config
│   └── packages.config
├── Razor.sln
├── etc/
│   ├── Language/
│   │   ├── Razor_lang.CHS
│   │   ├── Razor_lang.PTB
│   │   ├── Razor_lang.bg
│   │   ├── Razor_lang.cht
│   │   ├── Razor_lang.deu
│   │   ├── Razor_lang.enu
│   │   ├── Razor_lang.esp
│   │   ├── Razor_lang.ita
│   │   ├── Razor_lang.pl
│   │   ├── Razor_lang.rus
│   │   ├── Razor_lang.swe
│   │   └── Razor_lang.tur
│   ├── Razor.nsi
│   ├── animdata.csv
│   ├── counters.xml
│   ├── doors.xml
│   ├── dotNet.nsh
│   ├── guardlines.def
│   ├── items.xml
│   ├── license.txt
│   ├── overrides.def
│   ├── spells.def
│   └── uorguardlines.def
└── help/
    ├── docs/
    │   ├── download.md
    │   ├── faq.md
    │   ├── guide/
    │   │   ├── commands.md
    │   │   ├── comments.md
    │   │   ├── expressions.md
    │   │   ├── index.md
    │   │   ├── keywords.md
    │   │   ├── layers.md
    │   │   └── variables.md
    │   ├── help/
    │   │   ├── advanced.md
    │   │   ├── agents.md
    │   │   ├── armdress.md
    │   │   ├── displaycounters.md
    │   │   ├── filters.md
    │   │   ├── friends.md
    │   │   ├── general.md
    │   │   ├── hotkeys.md
    │   │   ├── index.md
    │   │   ├── macros.md
    │   │   ├── options.md
    │   │   ├── screenshots.md
    │   │   ├── scripts.md
    │   │   └── skills.md
    │   ├── history.md
    │   ├── index.md
    │   ├── install/
    │   │   ├── linux.md
    │   │   └── windows.md
    │   ├── releasenotes.md
    │   ├── stylesheets/
    │   │   └── extra.css
    │   └── uoaapi.md
    ├── mkdocs.yml
    ├── overrides/
    │   └── main.html
    ├── pygments.lexers.razor
    ├── pygments.mapping.razor
    └── pygments.styles.razor
Download .txt
Showing preview only (466K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (5391 symbols across 250 files)

FILE: Crypt/Crypt.cpp
  type CLIENT_TYPE (line 52) | enum CLIENT_TYPE { TWOD = 1, THREED = 2 }
  type timeval (line 80) | struct timeval
  type timeval (line 85) | struct timeval
  function BOOL (line 91) | BOOL APIENTRY DllMain( HANDLE hModule, DWORD dwReason, LPVOID )
  function DLLFUNCTION (line 134) | DLLFUNCTION void *GetSharedAddress()
  function DLLFUNCTION (line 140) | DLLFUNCTION HWND FindUOWindow( void )
  function DLLFUNCTION (line 155) | DLLFUNCTION void SetDataPath( const char *path )
  function DLLFUNCTION (line 162) | DLLFUNCTION int InstallLibrary( HWND PostWindow, DWORD pid, int flags )
  function DLLFUNCTION (line 249) | DLLFUNCTION void WaitForWindow( DWORD pid )
  function DLLFUNCTION (line 287) | DLLFUNCTION void Shutdown( bool close )
  function DLLFUNCTION (line 302) | DLLFUNCTION int GetUOProcId()
  function DLLFUNCTION (line 307) | DLLFUNCTION HANDLE GetCommMutex()
  function TotalOut (line 313) | DLLFUNCTION unsigned int TotalOut()
  function TotalIn (line 321) | DLLFUNCTION unsigned int TotalIn()
  function DLLFUNCTION (line 329) | DLLFUNCTION void CalibratePosition( uint16_t x, uint16_t y, uint16_t z )
  type PositionOutlands (line 350) | struct PositionOutlands {
  type PositionOutlands (line 355) | struct PositionOutlands
  type PositionUOR (line 360) | struct PositionUOR {
  type PositionUOR (line 365) | struct PositionUOR
  type PositionGeneric (line 370) | struct PositionGeneric {
  type PositionGeneric (line 375) | struct PositionGeneric
  function CheckPosition (line 381) | static void CheckPosition()
  function VOID (line 445) | VOID CALLBACK OnTick(HWND hwnd, UINT Message, UINT TimerId, DWORD dwTime) {
  function OnSetUOWindowSize (line 454) | void OnSetUOWindowSize( int width )
  function DLLFUNCTION (line 467) | DLLFUNCTION void OnAttach( void *params, int paramsLen )
  function DLLFUNCTION (line 750) | DLLFUNCTION void SetServer( unsigned int addr, unsigned short port )
  function DLLFUNCTION (line 759) | DLLFUNCTION const char *GetUOVersion()
  function CreateSharedMemory (line 767) | bool CreateSharedMemory()
  function CloseSharedMemory (line 812) | void CloseSharedMemory()
  function CreateEncryption (line 848) | void CreateEncryption()
  function Maintenance (line 868) | inline void Maintenance( Buffer &buff )
  function RecvData (line 883) | int RecvData()
  function HookRecv (line 992) | int HookRecv( SOCKET sock, char *buff, int len, int flags )
  function HookSend (line 1069) | int HookSend( SOCKET sock, char *buff, int len, int flags )
  function FlushSendData (line 1184) | void FlushSendData()
  function HookConnect (line 1277) | int HookConnect( SOCKET sock, const sockaddr *addr, int addrlen )
  function HookCloseSocket (line 1325) | int HookCloseSocket( SOCKET sock )
  function HookSelect (line 1351) | int HookSelect( int ndfs, fd_set *readfd, fd_set *writefd, fd_set *excep...
  function HookFunction (line 1434) | bool HookFunction( const char *Dll, const char *FuncName, int Ordinal, u...
  function FindFunction (line 1494) | bool FindFunction( const char *Dll, const char *FuncName, int Ordinal, u...
  function SetCustomNotoHue (line 1555) | void SetCustomNotoHue( int hue )
  function PatchMemory (line 1568) | bool PatchMemory( void )
  function MemoryPatch (line 1581) | void MemoryPatch( unsigned long Address, unsigned long value )
  function MemoryPatch (line 1586) | void MemoryPatch( unsigned long Address, int value, int numBytes )
  function MemoryPatch (line 1591) | void MemoryPatch( unsigned long Address, const void *value, int length )
  function CheckParent (line 1602) | bool CheckParent( HWND hCheck, HWND hComp )
  function MessageProc (line 1611) | void MessageProc( HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam, MS...
  function LRESULT (line 1760) | LRESULT CALLBACK GetMsgHookFunc( int Code, WPARAM Flag, LPARAM pMsg )
  function LRESULT (line 1778) | LRESULT CALLBACK WndProcRetHookFunc( int Code, WPARAM Flag, LPARAM pMsg )
  function LRESULT (line 1796) | LRESULT CALLBACK UOAWndProc(HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM ...
  function Log (line 1804) | void Log( const char *format, ... )

FILE: Crypt/Crypt.h
  type IError (line 15) | enum IError
  type UONET_MESSAGE (line 30) | enum UONET_MESSAGE
  function UONET_MESSAGE_COPYDATA (line 58) | enum class UONET_MESSAGE_COPYDATA
  type Buffer (line 65) | struct Buffer
  type Position (line 73) | struct Position {
  type Position (line 78) | struct Position
  type SharedMemory (line 80) | struct SharedMemory
  function class (line 102) | class PatchInfo

FILE: Crypt/LoginEncryption.cpp
  function BYTE (line 54) | BYTE LoginEncryption::Crypt( BYTE in )
  function DWORD (line 78) | DWORD LoginEncryption::GenerateBadSeed( DWORD oldSeed )

FILE: Crypt/LoginEncryption.h
  function class (line 3) | class LoginEncryption

FILE: Crypt/MemFinder.cpp
  function DWORD (line 4) | DWORD MemFinder::Find(const void *data, int length, DWORD addressHint, D...
  function DWORD (line 65) | DWORD MemFinder::GetAddress(const void *data, int length, unsigned int idx)

FILE: Crypt/MemFinder.h
  function class (line 7) | class MemFinder
  type Entry (line 25) | struct Entry

FILE: Crypt/OSIEncryption.h
  function class (line 5) | class OSIEncryption

FILE: Crypt/OldStatusBar.cpp
  function DWORD (line 5) | DWORD GumpOutV28( DWORD OutFuncAddr, int esiOff, char TwoFourOff, DWORD ...
  function DWORD (line 87) | DWORD Sprintf1UV28( DWORD sprintfAddr, DWORD fmtAddr, DWORD CurAddr, int...
  function DWORD (line 126) | DWORD Sprintf2UV28_Byte( DWORD sprintfAddr, DWORD fmtAddr, DWORD CurAddr...
  function DWORD (line 176) | DWORD Sprintf2UV28( DWORD sprintfAddr, DWORD fmtAddr, DWORD CurAddr, int...
  function PatchStatusBar (line 263) | bool PatchStatusBar( BOOL preAOS )

FILE: Crypt/PacketInfo.cpp
  function DLLFUNCTION (line 6) | DLLFUNCTION int GetPacketLength( unsigned char *packet, int len )
  function DLLFUNCTION (line 35) | DLLFUNCTION bool IsDynLength( BYTE packet )

FILE: Crypt/PacketInfo.h
  type ClientPacketInfo (line 4) | struct ClientPacketInfo // 12 bytes

FILE: Crypt/UOArt.cpp
  type UOItem (line 10) | struct UOItem
    method GetWidth (line 20) | int GetWidth() const { return Right - Left; }
    method GetHeight (line 21) | int GetHeight() const { return Bottom - Top; }
  type ArtIdx (line 29) | struct ArtIdx
  type ArtHeader (line 36) | struct ArtHeader
  function Round (line 48) | inline int Round(float n)
  function ApplyHueToPixel (line 116) | unsigned short ApplyHueToPixel(unsigned short *hue, unsigned short pix)
  function UOItem (line 124) | UOItem *ReadUOItem(int item, int bh)
    method GetWidth (line 20) | int GetWidth() const { return Right - Left; }
    method GetHeight (line 21) | int GetHeight() const { return Bottom - Top; }
  function UOItem (line 256) | UOItem *FindItem(int item)
    method GetWidth (line 20) | int GetWidth() const { return Right - Left; }
    method GetHeight (line 21) | int GetHeight() const { return Bottom - Top; }
  function COLORREF (line 270) | inline COLORREF Brightness(int shift, COLORREF c)
  function DrawUOItem (line 275) | int DrawUOItem(HDC hDC, RECT rect, int item, int hueIdx)
  function FreeItem (line 306) | void FreeItem(UOItem *node)
  function FreeArt (line 318) | void FreeArt()
  function InitThemes (line 348) | void InitThemes()
  function GetHex2 (line 368) | inline int GetHex2(LPCSTR hex)
  function GetHex4 (line 380) | inline int GetHex4(LPCSTR hex)
  function DoStat (line 385) | void DoStat(HDC hDC, int v, int t, int l, int h, int w)
  function DrawStatBar (line 409) | int DrawStatBar(HDC hDC, RECT rect, int width, int status, int hp, int m...
  function CheckTitlebarAttr (line 446) | void CheckTitlebarAttr(HWND hWnd)
  function DrawColorTitleBar (line 459) | void DrawColorTitleBar(HTHEME hTheme, HWND hWnd, HDC hOutDC, bool active...
  function RedrawTitleBar (line 654) | void RedrawTitleBar(HWND hWnd, bool active)

FILE: Crypt/debug.h
  function _Dump (line 11) | void _Dump(CONST void *p,CONST char *s,int R,int XOR,int doRot,int showT...
  function _DumpKey (line 45) | void _DumpKey(CONST keyInstance *key)

FILE: Crypt/trees.cpp
  function HANDLE (line 28) | HANDLE WINAPI NewCreateFile( LPCSTR lpFileName, DWORD dwDesiredAccess, D...
  function PatchCreateFile (line 72) | void PatchCreateFile()
  function PatchStartup (line 83) | void PatchStartup( DWORD ProcID )

FILE: Crypt/twofish.c
  function DWORD (line 159) | DWORD TwofishCodeStart(void) { return Here(0); }
  function TableOp (line 179) | int TableOp(int op)
  function ParseHexDword (line 223) | int ParseHexDword(int bits,CONST char *srcTxt,DWORD *d,char *dstTxt)
  function DWORD (line 298) | DWORD f32(DWORD x,CONST DWORD *k32,int keyLen)
  function DWORD (line 356) | DWORD RS_MDS_Encode(DWORD k0,DWORD k1)
  function BuildMDS (line 387) | void BuildMDS(void)
  function ReverseRoundSubkeys (line 471) | void ReverseRoundSubkeys(keyInstance *key,BYTE newDir)
  function Xor256 (line 520) | void Xor256(void *dst,void *src,BYTE b)
  function reKey (line 551) | int reKey(keyInstance *key)
  function makeKey (line 745) | int makeKey(keyInstance *key, BYTE direction, int keyLen,CONST char *key...
  function cipherInit (line 792) | int cipherInit(cipherInstance *cipher, BYTE mode,CONST char *IV)
  function blockEncrypt (line 842) | int blockEncrypt(cipherInstance *cipher, keyInstance *key,CONST BYTE *in...
  function blockDecrypt (line 1011) | int blockDecrypt(cipherInstance *cipher, keyInstance *key,CONST BYTE *in...
  function DWORD (line 1159) | DWORD TwofishCodeSize(void)

FILE: Crypt/twofish.h
  type BYTE (line 82) | typedef unsigned char BYTE;
  type DWORD (line 83) | typedef unsigned long DWORD;
  type DWORD (line 84) | typedef DWORD fullSbox[4][256];
  type keyInstance (line 87) | typedef struct
  type cipherInstance (line 118) | typedef struct

FILE: Crypt/uo_huffman.h
  function class (line 3) | class Compression

FILE: FastColoredTextBox/AutocompleteItem.cs
  class AutocompleteItem (line 10) | public class AutocompleteItem
    method AutocompleteItem (line 21) | public AutocompleteItem()
    method AutocompleteItem (line 25) | public AutocompleteItem(string text)
    method AutocompleteItem (line 30) | public AutocompleteItem(string text, int imageIndex)
    method AutocompleteItem (line 36) | public AutocompleteItem(string text, int imageIndex, string menuText)
    method AutocompleteItem (line 42) | public AutocompleteItem(string text, int imageIndex, string menuText, ...
    method GetTextForReplace (line 52) | public virtual string GetTextForReplace()
    method Compare (line 60) | public virtual CompareResult Compare(string fragmentText)
    method ToString (line 72) | public override string ToString()
    method OnSelected (line 80) | public virtual void OnSelected(AutocompleteMenu popupMenu, SelectedEve...
  type CompareResult (line 133) | public enum CompareResult
  class SnippetAutocompleteItem (line 155) | public class SnippetAutocompleteItem : AutocompleteItem
    method SnippetAutocompleteItem (line 157) | public SnippetAutocompleteItem(string snippet)
    method ToString (line 164) | public override string ToString()
    method GetTextForReplace (line 169) | public override string GetTextForReplace()
    method OnSelected (line 174) | public override void OnSelected(AutocompleteMenu popupMenu, SelectedEv...
    method Compare (line 207) | public override CompareResult Compare(string fragmentText)
  class MethodAutocompleteItem (line 220) | public class MethodAutocompleteItem : AutocompleteItem
    method MethodAutocompleteItem (line 225) | public MethodAutocompleteItem(string text)
    method Compare (line 231) | public override CompareResult Compare(string fragmentText)
    method GetTextForReplace (line 248) | public override string GetTextForReplace()
  class SuggestItem (line 258) | public class SuggestItem : AutocompleteItem
    method SuggestItem (line 260) | public SuggestItem(string text, int imageIndex) : base(text, imageIndex)
    method Compare (line 264) | public override CompareResult Compare(string fragmentText)

FILE: FastColoredTextBox/AutocompleteMenu.cs
  class AutocompleteMenu (line 14) | [Browsable(false)]
    method AutocompleteMenu (line 101) | public AutocompleteMenu(FastColoredTextBox tb)
    method OnOpening (line 125) | new internal void OnOpening(CancelEventArgs args)
    method Close (line 131) | public new void Close()
    method CalcSize (line 137) | internal void CalcSize()
    method OnSelecting (line 142) | public virtual void OnSelecting()
    method SelectNext (line 147) | public void SelectNext(int shift)
    method OnSelecting (line 152) | internal void OnSelecting(SelectingEventArgs args)
    method OnSelected (line 158) | public void OnSelected(SelectedEventArgs args)
    method Show (line 173) | public void Show(bool forced)
    method Dispose (line 214) | protected override void Dispose(bool disposing)
  class AutocompleteListView (line 222) | [System.ComponentModel.ToolboxItem(false)]
    method AutocompleteListView (line 293) | internal AutocompleteListView(FastColoredTextBox tb)
    method ListMouseDown (line 342) | private void ListMouseDown(object sender, MouseEventArgs e)
    method ToolTip_Popup (line 347) | private void ToolTip_Popup(object sender, PopupEventArgs e)
    method Dispose (line 353) | protected override void Dispose(bool disposing)
    method SafetyClose (line 378) | void SafetyClose()
    method tb_KeyPressed (line 384) | void tb_KeyPressed(object sender, KeyPressEventArgs e)
    method timer_Tick (line 398) | void timer_Tick(object sender, EventArgs e)
    method ResetTimer (line 404) | void ResetTimer(System.Windows.Forms.Timer timer)
    method DoAutocomplete (line 410) | internal void DoAutocomplete()
    method DoAutocomplete (line 415) | internal void DoAutocomplete(bool forced)
    method tb_SelectionChanged (line 485) | void tb_SelectionChanged(object sender, EventArgs e)
    method tb_KeyDown (line 519) | void tb_KeyDown(object sender, KeyEventArgs e)
    method AdjustScroll (line 543) | void AdjustScroll()
    method OnPaint (line 556) | protected override void OnPaint(PaintEventArgs e)
    method OnScroll (line 604) | protected override void OnScroll(ScrollEventArgs se)
    method OnMouseClick (line 610) | protected override void OnMouseClick(MouseEventArgs e)
    method OnMouseDoubleClick (line 622) | protected override void OnMouseDoubleClick(MouseEventArgs e)
    method OnSelecting (line 630) | internal virtual void OnSelecting()
    method DoAutocomplete (line 675) | private void DoAutocomplete(AutocompleteItem item, Range fragment)
    method PointToItemIndex (line 720) | int PointToItemIndex(Point p)
    method ProcessCmdKey (line 725) | protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
    method ProcessKey (line 732) | private bool ProcessKey(Keys keyData, Keys keyModifiers)
    method SelectNext (line 765) | public void SelectNext(int shift)
    method DoSelectedVisible (line 772) | private void DoSelectedVisible()
    method SetToolTip (line 788) | private void SetToolTip(AutocompleteItem autocompleteItem)
    method SetAutocompleteItems (line 826) | public void SetAutocompleteItems(ICollection<string> items)
    method SetAutocompleteItems (line 834) | public void SetAutocompleteItems(IEnumerable<AutocompleteItem> items)
  class SelectingEventArgs (line 840) | public class SelectingEventArgs : EventArgs
  class SelectedEventArgs (line 848) | public class SelectedEventArgs : EventArgs

FILE: FastColoredTextBox/Bookmarks.cs
  class BaseBookmarks (line 12) | public abstract class BaseBookmarks : ICollection<Bookmark>, IDisposable
    method Add (line 16) | public abstract void Add(Bookmark item);
    method Clear (line 17) | public abstract void Clear();
    method Contains (line 18) | public abstract bool Contains(Bookmark item);
    method CopyTo (line 19) | public abstract void CopyTo(Bookmark[] array, int arrayIndex);
    method Remove (line 22) | public abstract bool Remove(Bookmark item);
    method GetEnumerator (line 23) | public abstract IEnumerator<Bookmark> GetEnumerator();
    method GetEnumerator (line 25) | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnume...
    method Dispose (line 34) | public abstract void Dispose();
    method Add (line 40) | public abstract void Add(int lineIndex, string bookmarkName);
    method Add (line 41) | public abstract void Add(int lineIndex);
    method Contains (line 42) | public abstract bool Contains(int lineIndex);
    method Remove (line 43) | public abstract bool Remove(int lineIndex);
    method GetBookmark (line 44) | public abstract Bookmark GetBookmark(int i);
  class Bookmarks (line 52) | public class Bookmarks : BaseBookmarks
    method Bookmarks (line 58) | public Bookmarks(FastColoredTextBox tb)
    method tb_LineRemoved (line 65) | protected virtual void tb_LineRemoved(object sender, LineRemovedEventA...
    method tb_LineInserted (line 100) | protected virtual void tb_LineInserted(object sender, LineInsertedEven...
    method Dispose (line 114) | public override void Dispose()
    method GetEnumerator (line 120) | public override IEnumerator<Bookmark> GetEnumerator()
    method Add (line 126) | public override void Add(int lineIndex, string bookmarkName)
    method Add (line 131) | public override void Add(int lineIndex)
    method Clear (line 136) | public override void Clear()
    method Add (line 142) | public override void Add(Bookmark bookmark)
    method Contains (line 153) | public override bool Contains(Bookmark item)
    method Contains (line 158) | public override bool Contains(int lineIndex)
    method CopyTo (line 166) | public override void CopyTo(Bookmark[] array, int arrayIndex)
    method Remove (line 181) | public override bool Remove(Bookmark item)
    method Remove (line 190) | public override bool Remove(int lineIndex)
    method GetBookmark (line 209) | public override Bookmark GetBookmark(int i)
  class Bookmark (line 218) | public class Bookmark
    method DoVisible (line 240) | public virtual void DoVisible()
    method Bookmark (line 247) | public Bookmark(FastColoredTextBox tb, string name, int lineIndex)
    method Paint (line 255) | public virtual void Paint(Graphics gr, Rectangle lineRect)

FILE: FastColoredTextBox/Char.cs
  type Char (line 8) | public struct Char
    method Char (line 21) | public Char(char c)

FILE: FastColoredTextBox/CommandManager.cs
  class CommandManager (line 6) | public class CommandManager
    method CommandManager (line 16) | public CommandManager(TextSource ts)
    method ExecuteCommand (line 23) | public virtual void ExecuteCommand(Command cmd)
    method Undo (line 62) | public void Undo()
    method EndDisableCommands (line 94) | private void EndDisableCommands()
    method BeginDisableCommands (line 99) | private void BeginDisableCommands()
    method EndAutoUndoCommands (line 106) | public void EndAutoUndoCommands()
    method BeginAutoUndoCommands (line 114) | public void BeginAutoUndoCommands()
    method ClearHistory (line 119) | internal void ClearHistory()
    method Redo (line 126) | internal void Redo()
  class Command (line 168) | public abstract class Command
    method Execute (line 171) | public abstract void Execute();
  class RangeInfo (line 174) | internal class RangeInfo
    method RangeInfo (line 179) | public RangeInfo(Range r)
  class UndoableCommand (line 196) | public abstract class UndoableCommand : Command
    method UndoableCommand (line 202) | public UndoableCommand(TextSource ts)
    method Undo (line 208) | public virtual void Undo()
    method Execute (line 213) | public override void Execute()
    method OnTextChanged (line 219) | protected virtual void OnTextChanged(bool invert)
    method Clone (line 238) | public abstract UndoableCommand Clone();

FILE: FastColoredTextBox/Commands.cs
  class InsertCharCommand (line 10) | public class InsertCharCommand : UndoableCommand
    method InsertCharCommand (line 20) | public InsertCharCommand(TextSource ts, char c) : base(ts)
    method Undo (line 28) | public override void Undo()
    method Execute (line 68) | public override void Execute()
    method InsertChar (line 89) | internal static void InsertChar(char c, ref char deletedChar, TextSour...
    method InsertLine (line 141) | internal static void InsertLine(TextSource ts)
    method MergeLines (line 160) | internal static void MergeLines(int i, TextSource ts)
    method BreakLines (line 186) | internal static void BreakLines(int iLine, int pos, TextSource ts)
    method Clone (line 196) | public override UndoableCommand Clone()
  class InsertTextCommand (line 205) | public class InsertTextCommand : UndoableCommand
    method InsertTextCommand (line 214) | public InsertTextCommand(TextSource ts, string insertedText) : base(ts)
    method Undo (line 222) | public override void Undo()
    method Execute (line 234) | public override void Execute()
    method InsertText (line 241) | internal static void InsertText(string insertedText, TextSource ts)
    method Clone (line 274) | public override UndoableCommand Clone()
  class ReplaceTextCommand (line 283) | public class ReplaceTextCommand : UndoableCommand
    method ReplaceTextCommand (line 295) | public ReplaceTextCommand(TextSource ts, List<Range> ranges, string in...
    method Undo (line 314) | public override void Undo()
    method Execute (line 343) | public override void Execute()
    method Clone (line 371) | public override UndoableCommand Clone()
    method ClearSelected (line 376) | internal static void ClearSelected(TextSource ts)
  class ClearSelectedCommand (line 405) | public class ClearSelectedCommand : UndoableCommand
    method ClearSelectedCommand (line 413) | public ClearSelectedCommand(TextSource ts) : base(ts)
    method Undo (line 420) | public override void Undo()
    method Execute (line 433) | public override void Execute()
    method ClearSelected (line 448) | internal static void ClearSelected(TextSource ts)
    method Clone (line 476) | public override UndoableCommand Clone()
  class ReplaceMultipleTextCommand (line 485) | public class ReplaceMultipleTextCommand : UndoableCommand
    class ReplaceRange (line 490) | public class ReplaceRange
    method ReplaceMultipleTextCommand (line 501) | public ReplaceMultipleTextCommand(TextSource ts, List<ReplaceRange> ra...
    method Undo (line 519) | public override void Undo()
    method Execute (line 545) | public override void Execute()
    method Clone (line 569) | public override UndoableCommand Clone()
  class RemoveLinesCommand (line 578) | public class RemoveLinesCommand : UndoableCommand
    method RemoveLinesCommand (line 589) | public RemoveLinesCommand(TextSource ts, List<int> iLines)
    method Undo (line 602) | public override void Undo()
    method Execute (line 641) | public override void Execute()
    method Clone (line 665) | public override UndoableCommand Clone()
  class MultiRangeCommand (line 674) | public class MultiRangeCommand : UndoableCommand
    method MultiRangeCommand (line 680) | public MultiRangeCommand(UndoableCommand command) : base(command.ts)
    method Execute (line 686) | public override void Execute()
    method ExecuteInsertTextCommand (line 727) | private void ExecuteInsertTextCommand(ref int iChar, string text)
    method ExecuteCommand (line 757) | private void ExecuteCommand(ref int iChar)
    method Undo (line 770) | public override void Undo()
    method Clone (line 791) | public override UndoableCommand Clone()
  class SelectCommand (line 800) | public class SelectCommand : UndoableCommand
    method SelectCommand (line 802) | public SelectCommand(TextSource ts) : base(ts)
    method Execute (line 806) | public override void Execute()
    method OnTextChanged (line 812) | protected override void OnTextChanged(bool invert)
    method Undo (line 816) | public override void Undo()
    method Clone (line 822) | public override UndoableCommand Clone()

FILE: FastColoredTextBox/DocumentMap.cs
  class DocumentMap (line 15) | public class DocumentMap : Control
    method GetScale (line 47) | public float GetScale()
    method SetScale (line 55) | public void SetScale(float value)
    method DocumentMap (line 76) | public DocumentMap()
    method Application_Idle (line 85) | void Application_Idle(object sender, EventArgs e)
    method OnTargetChanged (line 91) | protected virtual void OnTargetChanged()
    method UnSubscribe (line 99) | protected virtual void UnSubscribe(FastColoredTextBox target)
    method Subscribe (line 106) | protected virtual void Subscribe(FastColoredTextBox target)
    method Target_VisibleRangeChanged (line 113) | protected virtual void Target_VisibleRangeChanged(object sender, Event...
    method Target_SelectionChanged (line 118) | protected virtual void Target_SelectionChanged(object sender, EventArg...
    method Target_Scroll (line 123) | protected virtual void Target_Scroll(object sender, ScrollEventArgs e)
    method OnResize (line 128) | protected override void OnResize(EventArgs e)
    method NeedRepaint (line 134) | public void NeedRepaint()
    method OnPaint (line 139) | protected override void OnPaint(PaintEventArgs e)
    method OnMouseDown (line 208) | protected override void OnMouseDown(MouseEventArgs e)
    method OnMouseMove (line 215) | protected override void OnMouseMove(MouseEventArgs e)
    method Scroll (line 222) | private void Scroll(Point point)
    method OnScroll (line 239) | private void OnScroll()
    method Dispose (line 245) | protected override void Dispose(bool disposing)

FILE: FastColoredTextBox/EncodingDetector.cs
  class EncodingDetector (line 12) | public static class EncodingDetector
    method DetectTextFileEncoding (line 18) | public static Encoding DetectTextFileEncoding(string InputFilename)
    method DetectTextFileEncoding (line 26) | public static Encoding DetectTextFileEncoding(FileStream InputFileStre...
    method DetectTextFileEncoding (line 32) | public static Encoding DetectTextFileEncoding(FileStream InputFileStre...
    method DetectBOMBytes (line 73) | public static Encoding DetectBOMBytes(byte[] BOMBytes)
    method DetectUnicodeInByteSampleByHeuristics (line 113) | public static Encoding DetectUnicodeInByteSampleByHeuristics(byte[] Sa...
    method IsCommonUSASCIIByte (line 238) | private static bool IsCommonUSASCIIByte(byte testByte)
    method DetectSuspiciousUTF8SequenceLength (line 256) | private static int DetectSuspiciousUTF8SequenceLength(byte[] SampleByt...

FILE: FastColoredTextBox/ExportToHTML.cs
  class ExportToHTML (line 11) | public class ExportToHTML
    method ExportToHTML (line 48) | public ExportToHTML()
    method GetHtml (line 56) | public string GetHtml(FastColoredTextBox tb)
    method GetHtml (line 64) | public string GetHtml(Range r)
    method GetCss (line 154) | private string GetCss(StyleIndex styleIndex)
    method GetColorAsString (line 203) | public static string GetColorAsString(Color color)
    method GetStyleName (line 210) | string GetStyleName(StyleIndex styleIndex)
    method Flush (line 215) | private void Flush(StringBuilder sb, StringBuilder tempSB, StyleIndex ...

FILE: FastColoredTextBox/ExportToRTF.cs
  class ExportToRTF (line 12) | public class ExportToRTF
    method ExportToRTF (line 27) | public ExportToRTF()
    method GetRtf (line 32) | public string GetRtf(FastColoredTextBox tb)
    method GetRtf (line 40) | public string GetRtf(Range r)
    method GetRtfDescriptor (line 131) | private RTFStyleDescriptor GetRtfDescriptor(StyleIndex styleIndex)
    method GetColorAsString (line 174) | public static string GetColorAsString(Color color)
    method Flush (line 181) | private void Flush(StringBuilder sb, StringBuilder tempSB, StyleIndex ...
    method GetColorTableNumber (line 205) | private int GetColorTableNumber(Color color)
  class RTFStyleDescriptor (line 217) | public class RTFStyleDescriptor

FILE: FastColoredTextBox/FastColoredTextBox.cs
  class FastColoredTextBox (line 46) | public partial class FastColoredTextBox : UserControl, ISupportInitialize
    method FastColoredTextBox (line 131) | public FastColoredTextBox()
    method SetFont (line 1526) | private void SetFont(Font newFont)
    method ClearHints (line 1691) | public void ClearHints()
    method AddHint (line 1705) | public virtual Hint AddHint(Range range, Control innerControl, bool sc...
    method AddHint (line 1720) | public Hint AddHint(Range range, Control innerControl)
    method AddHint (line 1733) | public virtual Hint AddHint(Range range, string text, bool scrollToHin...
    method AddHint (line 1748) | public Hint AddHint(Range range, string text)
    method OnHintClick (line 1757) | public virtual void OnHintClick(Hint hint)
    method timer3_Tick (line 1763) | private void timer3_Tick(object sender, EventArgs e)
    method OnToolTip (line 1769) | protected virtual void OnToolTip()
    method OnVisibleRangeChanged (line 1804) | public virtual void OnVisibleRangeChanged()
    method Invalidate (line 1818) | public new void Invalidate()
    method OnCharSizeChanged (line 1826) | protected virtual void OnCharSizeChanged()
    method GetStylesOfChar (line 2018) | public List<Style> GetStylesOfChar(Place place)
    method CreateTextSource (line 2039) | protected virtual TextSource CreateTextSource()
    method SetAsCurrentTB (line 2044) | private void SetAsCurrentTB()
    method InitTextSource (line 2049) | protected virtual void InitTextSource(TextSource ts)
    method ts_RecalcWordWrap (line 2087) | private void ts_RecalcWordWrap(object sender, TextSource.TextChangedEv...
    method ts_TextChanging (line 2092) | private void ts_TextChanging(object sender, TextChangingEventArgs e)
    method ts_RecalcNeeded (line 2102) | private void ts_RecalcNeeded(object sender, TextSource.TextChangedEven...
    method NeedRecalc (line 2116) | public void NeedRecalc()
    method NeedRecalc (line 2124) | public void NeedRecalc(bool forced)
    method NeedRecalc (line 2132) | public void NeedRecalc(bool forced, bool wordWrapRecalc)
    method ts_TextChanged (line 2146) | private void ts_TextChanged(object sender, TextSource.TextChangedEvent...
    method ts_LineRemoved (line 2158) | private void ts_LineRemoved(object sender, LineRemovedEventArgs e)
    method ts_LineInserted (line 2164) | private void ts_LineInserted(object sender, LineInsertedEventArgs e)
    method NavigateForward (line 2199) | public bool NavigateForward()
    method NavigateBackward (line 2223) | public bool NavigateBackward()
    method Navigate (line 2247) | public void Navigate(int iLine)
    method OnLoad (line 2255) | protected override void OnLoad(EventArgs e)
    method timer2_Tick (line 2261) | private void timer2_Tick(object sender, EventArgs e)
    method AddVisualMarker (line 2276) | public void AddVisualMarker(VisualMarker marker)
    method timer_Tick (line 2281) | private void timer_Tick(object sender, EventArgs e)
    method OnTextChangedDelayed (line 2297) | public virtual void OnTextChangedDelayed(Range changedRange)
    method OnSelectionChangedDelayed (line 2303) | public virtual void OnSelectionChangedDelayed()
    method OnVisibleRangeChangedDelayed (line 2326) | public virtual void OnVisibleRangeChangedDelayed()
    method ResetTimer (line 2334) | private void ResetTimer(Timer timer)
    method OnHandleCreated (line 2349) | protected override void OnHandleCreated(EventArgs e)
    method AddStyle (line 2363) | public int AddStyle(Style style)
    method CheckStylesBufferSize (line 2383) | public int CheckStylesBufferSize()
    method ShowFindDialog (line 2400) | public virtual void ShowFindDialog()
    method ShowFindDialog (line 2408) | public virtual void ShowFindDialog(string findText)
    method ShowReplaceDialog (line 2426) | public virtual void ShowReplaceDialog()
    method ShowReplaceDialog (line 2434) | public virtual void ShowReplaceDialog(string findText)
    method GetLineLength (line 2456) | public int GetLineLength(int iLine)
    method GetLine (line 2468) | public Range GetLine(int iLine)
    method Copy (line 2482) | public virtual void Copy()
    method OnCreateClipboardData (line 2498) | protected virtual void OnCreateClipboardData(DataObject data)
    method SetClipboard (line 2513) | protected void SetClipboard(DataObject data)
    method PrepareHtmlForClipboard (line 2529) | public static MemoryStream PrepareHtmlForClipboard(string html)
    method Cut (line 2566) | public virtual void Cut()
    method Paste (line 2603) | public virtual void Paste()
    method SelectAll (line 2638) | public void SelectAll()
    method GoEnd (line 2646) | public void GoEnd()
    method GoHome (line 2659) | public void GoHome()
    method Clear (line 2671) | public virtual void Clear()
    method ClearStylesBuffer (line 2690) | public void ClearStylesBuffer()
    method ClearStyle (line 2699) | public void ClearStyle(StyleIndex styleIndex)
    method ClearUndo (line 2714) | public void ClearUndo()
    method InsertText (line 2722) | public virtual void InsertText(string text)
    method InsertText (line 2731) | public virtual void InsertText(string text, bool jumpToCaret)
    method InsertText (line 2767) | public virtual Range InsertText(string text, Style style)
    method InsertText (line 2775) | public virtual Range InsertText(string text, Style style, bool jumpToC...
    method InsertTextAndRestoreSelection (line 2796) | public virtual Range InsertTextAndRestoreSelection(Range replaceRange,...
    method AppendText (line 2821) | public virtual void AppendText(string text)
    method AppendText (line 2829) | public virtual void AppendText(string text, Style style)
    method GetStyleIndex (line 2874) | public int GetStyleIndex(Style style)
    method GetStyleIndexMask (line 2884) | public StyleIndex GetStyleIndexMask(Style[] styles)
    method GetOrSetStyleLayerIndex (line 2897) | internal int GetOrSetStyleLayerIndex(Style style)
    method GetCharSize (line 2905) | public static SizeF GetCharSize(Font font, char c)
    method WndProc (line 2915) | protected override void WndProc(ref Message m)
    method HideHints (line 2932) | void HideHints()
    method RestoreHints (line 2946) | void RestoreHints()
    method OnScroll (line 2963) | public void OnScroll(ScrollEventArgs se, bool alignByLines)
    method OnScroll (line 2991) | protected override void OnScroll(ScrollEventArgs se)
    method InsertChar (line 2996) | protected virtual void InsertChar(char c)
    method InsertVirtualSpaces (line 3019) | private void InsertVirtualSpaces()
    method ClearSelected (line 3038) | public virtual void ClearSelected()
    method ClearCurrentLine (line 3050) | public void ClearCurrentLine()
    method Recalc (line 3063) | private void Recalc()
    method CalcMinAutosizeWidth (line 3114) | private void CalcMinAutosizeWidth(out int minWidth, ref int maxLineLen...
    method RecalcScrollByOneLine (line 3136) | private void RecalcScrollByOneLine(int iLine)
    method RecalcMaxLineLength (line 3152) | private int RecalcMaxLineLength()
    method GetMaxLineWordWrapedWidth (line 3177) | private int GetMaxLineWordWrapedWidth()
    method RecalcWordWrap (line 3193) | private void RecalcWordWrap(int fromLine, int toLine)
    method CalcCutOffs (line 3251) | public static void CalcCutOffs(List<int> cutOffPositions, int maxChars...
    method IsCJKLetter (line 3295) | public static bool IsCJKLetter(char c)
    method OnClientSizeChanged (line 3323) | protected override void OnClientSizeChanged(EventArgs e)
    method DoVisibleRectangle (line 3341) | internal void DoVisibleRectangle(Rectangle rect)
    method UpdateScrollbars (line 3388) | public void UpdateScrollbars()
    method OnScrollbarsUpdated (line 3403) | protected virtual void OnScrollbarsUpdated()
    method DoCaretVisible (line 3412) | public void DoCaretVisible()
    method ScrollLeft (line 3424) | public void ScrollLeft()
    method DoSelectionVisible (line 3435) | public void DoSelectionVisible()
    method DoRangeVisible (line 3459) | public void DoRangeVisible(Range range)
    method DoRangeVisible (line 3467) | public void DoRangeVisible(Range range, bool tryToCentre)
    method OnKeyUp (line 3495) | protected override void OnKeyUp(KeyEventArgs e)
    method OnKeyDown (line 3510) | protected override void OnKeyDown(KeyEventArgs e)
    method ProcessDialogKey (line 3537) | protected override bool ProcessDialogKey(Keys keyData)
    method ProcessKey (line 3560) | public virtual bool ProcessKey(Keys keyData)
    method DoAction (line 3609) | private void DoAction(FCTBAction action)
    method OnCustomAction (line 4035) | protected virtual void OnCustomAction(CustomActionEventArgs e)
    method RestoreFontSize (line 4043) | private void RestoreFontSize()
    method GotoNextBookmark (line 4052) | public bool GotoNextBookmark(int iLine)
    method GotoPrevBookmark (line 4091) | public bool GotoPrevBookmark(int iLine)
    method BookmarkLine (line 4129) | public virtual void BookmarkLine(int iLine)
    method UnbookmarkLine (line 4138) | public virtual void UnbookmarkLine(int iLine)
    method MoveSelectedLinesDown (line 4146) | public virtual void MoveSelectedLinesDown()
    method MoveSelectedLinesUp (line 4176) | public virtual void MoveSelectedLinesUp()
    method GoHome (line 4203) | private void GoHome(bool shift)
    method UpperCase (line 4228) | public virtual void UpperCase()
    method LowerCase (line 4239) | public virtual void LowerCase()
    method TitleCase (line 4250) | public virtual void TitleCase()
    method SentenceCase (line 4261) | public virtual void SentenceCase()
    method CommentSelected (line 4274) | public void CommentSelected()
    method CommentSelected (line 4282) | public virtual void CommentSelected(string commentPrefix)
    method OnKeyPressing (line 4294) | public void OnKeyPressing(KeyPressEventArgs args)
    method OnKeyPressing (line 4300) | private bool OnKeyPressing(char c)
    method OnKeyPressed (line 4314) | public void OnKeyPressed(char c)
    method ProcessMnemonic (line 4321) | protected override bool ProcessMnemonic(char charCode)
    method ProcessKeyMessage (line 4334) | protected override bool ProcessKeyMessage(ref Message m)
    method ProcessKey (line 4345) | public virtual bool ProcessKey(char c, Keys modifiers)
    method DoAutoIndentChars (line 4464) | public void DoAutoIndentChars(int iLine)
    method DoAutoIndentChars (line 4480) | protected void DoAutoIndentChars(int iLine, Regex regex)
    method DoAutocompleteBrackets (line 4616) | private bool DoAutocompleteBrackets(char c)
    method InsertBrackets (line 4639) | private bool InsertBrackets(char left, char right)
    method FindChar (line 4674) | protected virtual void FindChar(char c)
    method DoAutoIndentIfNeed (line 4691) | public virtual void DoAutoIndentIfNeed()
    method RemoveSpacesAfterCaret (line 4707) | private void RemoveSpacesAfterCaret()
    method DoAutoIndent (line 4720) | public virtual void DoAutoIndent(int iLine)
    method CalcAutoIndent (line 4752) | public virtual int CalcAutoIndent(int iLine)
    method CalcAutoIndentShiftByCodeFolding (line 4797) | internal virtual void CalcAutoIndentShiftByCodeFolding(object sender, ...
    method GetMinStartSpacesCount (line 4818) | protected int GetMinStartSpacesCount(int fromLine, int toLine)
    method GetMaxStartSpacesCount (line 4834) | protected int GetMaxStartSpacesCount(int fromLine, int toLine)
    method Undo (line 4853) | public virtual void Undo()
    method Redo (line 4863) | public virtual void Redo()
    method IsInputKey (line 4870) | protected override bool IsInputKey(Keys keyData)
    method OnPaintBackground (line 4911) | protected override void OnPaintBackground(PaintEventArgs e)
    method DrawText (line 4925) | public void DrawText(Graphics gr, Place start, Size size)
    method OnPaint (line 4979) | protected override void OnPaint(PaintEventArgs e)
    method DrawMarkers (line 5242) | private void DrawMarkers(PaintEventArgs e, Pen servicePen)
    method DrawRecordingHint (line 5263) | private void DrawRecordingHint(Graphics graphics)
    method DrawTextAreaBorder (line 5293) | private void DrawTextAreaBorder(Graphics graphics)
    method PaintHintBrackets (line 5319) | private void PaintHintBrackets(Graphics gr)
    method DrawFoldingLines (line 5362) | protected virtual void DrawFoldingLines(PaintEventArgs e, int startLin...
    method DrawLineChars (line 5395) | private void DrawLineChars(Graphics gr, int firstChar, int lastChar, i...
    method FlushRendering (line 5453) | private void FlushRendering(Graphics gr, StyleIndex styleIndex, Point ...
    method OnEnter (line 5480) | protected override void OnEnter(EventArgs e)
    method OnMouseUp (line 5488) | protected override void OnMouseUp(MouseEventArgs e)
    method OnMouseDown (line 5500) | protected override void OnMouseDown(MouseEventArgs e)
    method OnMouseClickText (line 5578) | private void OnMouseClickText(MouseEventArgs e)
    method CheckAndChangeSelectionType (line 5607) | protected virtual void CheckAndChangeSelectionType()
    method OnMouseWheel (line 5621) | protected override void OnMouseWheel(MouseEventArgs e)
    method DoScrollVertical (line 5645) | private void DoScrollVertical(int countLines, int direction)
    method GetControlPanelWheelScrollLinesValue (line 5682) | private static int GetControlPanelWheelScrollLinesValue()
    method ChangeFontSize (line 5699) | public void ChangeFontSize(int step)
    method OnZoomChanged (line 5727) | protected virtual void OnZoomChanged()
    method DoZoom (line 5733) | private void DoZoom(float koeff)
    method OnMouseLeave (line 5758) | protected override void OnMouseLeave(EventArgs e)
    method OnMouseMove (line 5767) | protected override void OnMouseMove(MouseEventArgs e)
    method CancelToolTip (line 5853) | private void CancelToolTip()
    method OnMouseDoubleClick (line 5863) | protected override void OnMouseDoubleClick(MouseEventArgs e)
    method SelectWord (line 5872) | private void SelectWord(Place p)
    method YtoLineIndex (line 5898) | private int YtoLineIndex(int y)
    method PointToPlace (line 5912) | public Place PointToPlace(Point point)
    method PointToPlaceSimple (line 5965) | private Place PointToPlaceSimple(Point point)
    method PointToPosition (line 5980) | public int PointToPosition(Point point)
    method OnTextChanging (line 5988) | public virtual void OnTextChanging(ref string text)
    method OnTextChanging (line 6002) | public virtual void OnTextChanging()
    method OnTextChanged (line 6011) | public virtual void OnTextChanged()
    method OnTextChanged (line 6021) | public virtual void OnTextChanged(int fromLine, int toLine)
    method OnTextChanged (line 6032) | public virtual void OnTextChanged(Range r)
    method BeginUpdate (line 6040) | public void BeginUpdate()
    method EndUpdate (line 6050) | public void EndUpdate()
    method OnTextChanged (line 6065) | protected virtual void OnTextChanged(TextChangedEventArgs args)
    method ClearFoldingState (line 6131) | private void ClearFoldingState(Range range)
    method MarkLinesAsChanged (line 6139) | private void MarkLinesAsChanged(Range range)
    method OnSelectionChanged (line 6149) | public virtual void OnSelectionChanged()
    method HighlightFoldings (line 6170) | private void HighlightFoldings()
    method OnFoldingHighlightChanged (line 6215) | protected virtual void OnFoldingHighlightChanged()
    method OnGotFocus (line 6221) | protected override void OnGotFocus(EventArgs e)
    method OnLostFocus (line 6228) | protected override void OnLostFocus(EventArgs e)
    method PlaceToPosition (line 6241) | public int PlaceToPosition(Place point)
    method PositionToPlace (line 6258) | public Place PositionToPlace(int pos)
    method PositionToPoint (line 6284) | public Point PositionToPoint(int pos)
    method PlaceToPoint (line 6294) | public Point PlaceToPoint(Place place)
    method GetRange (line 6318) | public Range GetRange(int fromPos, int toPos)
    method GetRange (line 6332) | public Range GetRange(Place fromPlace, Place toPlace)
    method GetRanges (line 6342) | public IEnumerable<Range> GetRanges(string regexPattern)
    method GetRanges (line 6356) | public IEnumerable<Range> GetRanges(string regexPattern, RegexOptions ...
    method GetLineText (line 6370) | public string GetLineText(int iLine)
    method ExpandFoldedBlock (line 6384) | public virtual void ExpandFoldedBlock(int iLine)
    method AdjustFolding (line 6405) | public virtual void AdjustFolding()
    method ExpandBlock (line 6418) | public virtual void ExpandBlock(int fromLine, int toLine)
    method ExpandBlock (line 6434) | public void ExpandBlock(int iLine)
    method CollapseAllFoldingBlocks (line 6464) | public virtual void CollapseAllFoldingBlocks()
    method ExpandAllFoldingBlocks (line 6485) | public virtual void ExpandAllFoldingBlocks()
    method CollapseFoldingBlock (line 6501) | public virtual void CollapseFoldingBlock(int iLine)
    method FindEndOfFoldingBlock (line 6518) | private int FindEndOfFoldingBlock(int iStartLine)
    method FindEndOfFoldingBlock (line 6523) | protected virtual int FindEndOfFoldingBlock(int iStartLine, int maxLines)
    method GetLineFoldingStartMarker (line 6582) | public string GetLineFoldingStartMarker(int iLine)
    method GetLineFoldingEndMarker (line 6592) | public string GetLineFoldingEndMarker(int iLine)
    method RecalcFoldingLines (line 6599) | protected virtual void RecalcFoldingLines()
    method CollapseBlock (line 6646) | public virtual void CollapseBlock(int fromLine, int toLine)
    method FindNextVisibleLine (line 6681) | internal int FindNextVisibleLine(int iLine)
    method FindPrevVisibleLine (line 6696) | internal int FindPrevVisibleLine(int iLine)
    method FindVisualMarkerForPoint (line 6710) | private VisualMarker FindVisualMarkerForPoint(Point p)
    method IncreaseIndent (line 6721) | public virtual void IncreaseIndent()
    method DecreaseIndent (line 6802) | public virtual void DecreaseIndent()
    method DecreaseIndentOfSingleLine (line 6890) | protected virtual void DecreaseIndentOfSingleLine()
    method DoAutoIndent (line 6951) | public virtual void DoAutoIndent()
    method InsertLinePrefix (line 6977) | public virtual void InsertLinePrefix(string prefix)
    method RemoveLinePrefix (line 7006) | public virtual void RemoveLinePrefix(string prefix)
    method BeginAutoUndo (line 7040) | public void BeginAutoUndo()
    method EndAutoUndo (line 7049) | public void EndAutoUndo()
    method OnVisualMarkerClick (line 7054) | public virtual void OnVisualMarkerClick(MouseEventArgs args, StyleVisu...
    method OnMarkerClick (line 7061) | protected virtual void OnMarkerClick(MouseEventArgs args, VisualMarker...
    method OnMarkerDoubleClick (line 7097) | protected virtual void OnMarkerDoubleClick(VisualMarker marker)
    method ClearBracketsPositions (line 7107) | private void ClearBracketsPositions()
    method HighlightBrackets (line 7118) | private void HighlightBrackets(char LeftBracket, char RightBracket, re...
    method HighlightBrackets1 (line 7132) | private void HighlightBrackets1(char LeftBracket, char RightBracket, r...
    method GetBracketsRange (line 7158) | public Range GetBracketsRange(Place placeInsideBrackets, char leftBrac...
    method HighlightBrackets2 (line 7211) | private void HighlightBrackets2(char LeftBracket, char RightBracket, r...
    method SelectNext (line 7284) | public bool SelectNext(string regexPattern, bool backward = false, Reg...
    method OnSyntaxHighlight (line 7303) | public virtual void OnSyntaxHighlight(TextChangedEventArgs args)
    method InitializeComponent (line 7337) | private void InitializeComponent()
    method Print (line 7350) | public virtual void Print(Range range, PrintDialogSettings settings)
    method PrepareHtmlText (line 7402) | protected virtual string PrepareHtmlText(string s)
    method wb_StatusTextChanged (line 7407) | private void wb_StatusTextChanged(object sender, EventArgs e)
    method Print (line 7441) | public void Print(PrintDialogSettings settings)
    method Print (line 7449) | public void Print()
    method SelectHTMLRangeScript (line 7456) | private string SelectHTMLRangeScript()
    method SetPageSetupSettings (line 7476) | private static void SetPageSetupSettings(PrintDialogSettings settings)
    method Dispose (line 7486) | protected override void Dispose(bool disposing)
    method OnPaintLine (line 7517) | protected virtual void OnPaintLine(PaintLineEventArgs e)
    method OnLineInserted (line 7523) | internal void OnLineInserted(int index)
    method OnLineInserted (line 7528) | internal void OnLineInserted(int index, int count)
    method OnLineRemoved (line 7534) | internal void OnLineRemoved(int index, int count, List<int> removedLin...
    method OpenFile (line 7544) | public void OpenFile(string fileName, Encoding enc)
    method OpenFile (line 7570) | public void OpenFile(string fileName)
    method OpenBindingFile (line 7594) | public void OpenBindingFile(string fileName, Encoding enc)
    method CloseBindingFile (line 7619) | public void CloseBindingFile()
    method SaveToFile (line 7638) | public void SaveToFile(string fileName, Encoding enc)
    method SetVisibleState (line 7649) | public void SetVisibleState(int iLine, VisibleState state)
    method GetVisibleState (line 7660) | public VisibleState GetVisibleState(int iLine)
    method ShowGoToDialog (line 7668) | public void ShowGoToDialog()
    method OnUndoRedoStateChanged (line 7685) | public void OnUndoRedoStateChanged()
    method FindLines (line 7694) | public List<int> FindLines(string searchPattern, RegexOptions options)
    method RemoveLines (line 7706) | public void RemoveLines(List<int> iLines)
    method BeginInit (line 7717) | void ISupportInitialize.BeginInit()
    method EndInit (line 7722) | void ISupportInitialize.EndInit()
    method OnDragEnter (line 7736) | protected override void OnDragEnter(DragEventArgs e)
    method OnDragDrop (line 7747) | protected override void OnDragDrop(DragEventArgs e)
    method DoDragDrop_old (line 7770) | private void DoDragDrop_old(Place place, string text)
    method DoDragDrop (line 7882) | protected virtual void DoDragDrop(Place place, string text)
    method OnDragOver (line 8065) | protected override void OnDragOver(DragEventArgs e)
    method OnDragLeave (line 8081) | protected override void OnDragLeave(EventArgs e)
    method ActivateMiddleClickScrollingMode (line 8101) | private void ActivateMiddleClickScrollingMode(MouseEventArgs e)
    method DeactivateMiddleClickScrollingMode (line 8124) | private void DeactivateMiddleClickScrollingMode()
    method RestoreScrollsAfterMiddleClickScrollingMode (line 8141) | private void RestoreScrollsAfterMiddleClickScrollingMode()
    method middleClickScrollingTimer_Tick (line 8160) | void middleClickScrollingTimer_Tick(object sender, EventArgs e)
    method DrawMiddleClickScrolling (line 8269) | private void DrawMiddleClickScrolling(Graphics gr)
    method DrawTriangle (line 8300) | private void DrawTriangle(Graphics g, Brush brush)
    class LineYComparer (line 8312) | private class LineYComparer : IComparer<LineInfo>
      method LineYComparer (line 8316) | public LineYComparer(int Y)
      method Compare (line 8323) | public int Compare(LineInfo x, LineInfo y)
  class PaintLineEventArgs (line 8337) | public class PaintLineEventArgs : PaintEventArgs
    method PaintLineEventArgs (line 8339) | public PaintLineEventArgs(int iLine, Rectangle rect, Graphics gr, Rect...
  class LineInsertedEventArgs (line 8349) | public class LineInsertedEventArgs : EventArgs
    method LineInsertedEventArgs (line 8351) | public LineInsertedEventArgs(int index, int count)
  class LineRemovedEventArgs (line 8368) | public class LineRemovedEventArgs : EventArgs
    method LineRemovedEventArgs (line 8370) | public LineRemovedEventArgs(int index, int count, List<int> removedLin...
  class TextChangedEventArgs (line 8396) | public class TextChangedEventArgs : EventArgs
    method TextChangedEventArgs (line 8401) | public TextChangedEventArgs(Range changedRange)
  class TextChangingEventArgs (line 8412) | public class TextChangingEventArgs : EventArgs
  class WordWrapNeededEventArgs (line 8422) | public class WordWrapNeededEventArgs : EventArgs
    method WordWrapNeededEventArgs (line 8428) | public WordWrapNeededEventArgs(List<int> cutOffPositions, bool imeAllo...
  type WordWrapMode (line 8436) | public enum WordWrapMode
  class PrintDialogSettings (line 8464) | public class PrintDialogSettings
    method PrintDialogSettings (line 8466) | public PrintDialogSettings()
  class AutoIndentEventArgs (line 8503) | public class AutoIndentEventArgs : EventArgs
    method AutoIndentEventArgs (line 8505) | public AutoIndentEventArgs(int iLine, string lineText, string prevLine...
  type HighlightingRangeType (line 8539) | public enum HighlightingRangeType
  type FindEndOfFoldingBlockStrategy (line 8560) | public enum FindEndOfFoldingBlockStrategy
  type BracketsHighlightStrategy (line 8569) | public enum BracketsHighlightStrategy
  class ToolTipNeededEventArgs (line 8578) | public class ToolTipNeededEventArgs : EventArgs
    method ToolTipNeededEventArgs (line 8580) | public ToolTipNeededEventArgs(Place place, string hoveredWord)
  class HintClickEventArgs (line 8596) | public class HintClickEventArgs : EventArgs
    method HintClickEventArgs (line 8598) | public HintClickEventArgs(Hint hint)
  class CustomActionEventArgs (line 8609) | public class CustomActionEventArgs : EventArgs
    method CustomActionEventArgs (line 8613) | public CustomActionEventArgs(FCTBAction action)
  type TextAreaBorderType (line 8619) | public enum TextAreaBorderType
  type ScrollDirection (line 8626) | [Flags]
  class ServiceColors (line 8636) | [Serializable]
    method ServiceColors (line 8646) | public ServiceColors()
  type StyleIndex (line 8661) | [Flags]
  type StyleIndex (line 8705) | [Flags]

FILE: FastColoredTextBox/FileTextSource.cs
  class FileTextSource (line 14) | public class FileTextSource : TextSource, IDisposable
    method FileTextSource (line 31) | public FileTextSource(FastColoredTextBox currentTB)
    method timer_Tick (line 41) | void timer_Tick(object sender, EventArgs e)
    method UnloadUnusedLines (line 54) | private void UnloadUnusedLines()
    method OpenFile (line 72) | public void OpenFile(string fileName, Encoding enc)
    method DefineShift (line 179) | private int DefineShift(Encoding enc)
    method DefineEncoding (line 199) | private static Encoding DefineEncoding(Encoding enc, FileStream fs)
    method CloseFile (line 235) | public void CloseFile()
    method SaveToFile (line 255) | public override void SaveToFile(string fileName, Encoding enc)
    method ReadLine (line 321) | private string ReadLine(StreamReader sr, int i)
    method ClearIsChanged (line 333) | public override void ClearIsChanged()
    method LoadLineFromSourceFile (line 354) | private void LoadLineFromSourceFile(int i)
    method InsertLine (line 382) | public override void InsertLine(int index, Line line)
    method RemoveLine (line 388) | public override void RemoveLine(int index, int count)
    method Clear (line 394) | public override void Clear()
    method GetLineLength (line 399) | public override int GetLineLength(int i)
    method LineHasFoldingStartMarker (line 407) | public override bool LineHasFoldingStartMarker(int iLine)
    method LineHasFoldingEndMarker (line 415) | public override bool LineHasFoldingEndMarker(int iLine)
    method Dispose (line 423) | public override void Dispose()
    method UnloadLine (line 431) | internal void UnloadLine(int iLine)
  class LineNeededEventArgs (line 438) | public class LineNeededEventArgs : EventArgs
    method LineNeededEventArgs (line 448) | public LineNeededEventArgs(string sourceLineText, int displayedLineIndex)
  class LinePushedEventArgs (line 456) | public class LinePushedEventArgs : EventArgs
    method LinePushedEventArgs (line 472) | public LinePushedEventArgs(string sourceLineText, int displayedLineInd...
  class CharReader (line 481) | class CharReader : TextReader
    method Read (line 483) | public override int Read()

FILE: FastColoredTextBox/FindForm.Designer.cs
  class FindForm (line 3) | partial class FindForm
    method Dispose (line 14) | protected override void Dispose(bool disposing)
    method InitializeComponent (line 29) | private void InitializeComponent()

FILE: FastColoredTextBox/FindForm.cs
  class FindForm (line 8) | public partial class FindForm : Form
    method FindForm (line 14) | public FindForm(FastColoredTextBox tb)
    method btClose_Click (line 20) | private void btClose_Click(object sender, EventArgs e)
    method btFindNext_Click (line 25) | private void btFindNext_Click(object sender, EventArgs e)
    method FindNext (line 30) | public virtual void FindNext(string pattern)
    method tbFind_KeyPress (line 80) | private void tbFind_KeyPress(object sender, KeyPressEventArgs e)
    method FindForm_FormClosing (line 97) | private void FindForm_FormClosing(object sender, FormClosingEventArgs e)
    method ProcessCmdKey (line 108) | protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
    method OnActivated (line 119) | protected override void OnActivated(EventArgs e)
    method ResetSerach (line 125) | void ResetSerach()
    method cbMatchCase_CheckedChanged (line 130) | private void cbMatchCase_CheckedChanged(object sender, EventArgs e)

FILE: FastColoredTextBox/GoToForm.Designer.cs
  class GoToForm (line 3) | partial class GoToForm
    method Dispose (line 14) | protected override void Dispose(bool disposing)
    method InitializeComponent (line 29) | private void InitializeComponent()

FILE: FastColoredTextBox/GoToForm.cs
  class GoToForm (line 6) | public partial class GoToForm : Form
    method GoToForm (line 11) | public GoToForm()
    method OnLoad (line 16) | protected override void OnLoad(EventArgs e)
    method OnShown (line 25) | protected override void OnShown(EventArgs e)
    method btnOk_Click (line 32) | private void btnOk_Click(object sender, EventArgs e)
    method btnCancel_Click (line 47) | private void btnCancel_Click(object sender, EventArgs e)

FILE: FastColoredTextBox/Hints.cs
  class Hints (line 14) | public class Hints : ICollection<Hint>, IDisposable
    method Hints (line 19) | public Hints(FastColoredTextBox tb)
    method OnTextBoxKeyDown (line 27) | protected virtual void OnTextBoxKeyDown(object sender, System.Windows....
    method OnTextBoxTextChanged (line 33) | protected virtual void OnTextBoxTextChanged(object sender, TextChanged...
    method Dispose (line 38) | public void Dispose()
    method OnTextBoxVisibleRangeChanged (line 45) | void OnTextBoxVisibleRangeChanged(object sender, EventArgs e)
    method LayoutHint (line 58) | private void LayoutHint(Hint hint)
    method GetEnumerator (line 111) | public IEnumerator<Hint> GetEnumerator()
    method GetEnumerator (line 117) | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnume...
    method Clear (line 125) | public void Clear()
    method Add (line 156) | public void Add(Hint hint)
    method Contains (line 183) | public bool Contains(Hint item)
    method CopyTo (line 188) | public void CopyTo(Hint[] array, int arrayIndex)
    method Remove (line 206) | public bool Remove(Hint item)
  class Hint (line 215) | public class Hint
    method DoVisible (line 351) | public virtual void DoVisible()
    method Hint (line 359) | private Hint(Range range, Control innerControl, string text, bool inli...
    method Hint (line 378) | public Hint(Range range, string text, bool inline, bool dock)
    method Hint (line 388) | public Hint(Range range, string text)
    method Hint (line 400) | public Hint(Range range, Control innerControl, bool inline, bool dock)
    method Hint (line 410) | public Hint(Range range, Control innerControl)
    method Init (line 415) | protected virtual void Init()
    method OnClick (line 444) | protected virtual void OnClick(object sender, EventArgs e)

FILE: FastColoredTextBox/Hotkeys.cs
  class HotkeysMapping (line 21) | public class HotkeysMapping : SortedDictionary<Keys, FCTBAction>
    method InitDefault (line 23) | public virtual void InitDefault()
    method ToString (line 97) | public override string ToString()
    method Parse (line 115) | public static HotkeysMapping Parse(string s)
  type FCTBAction (line 141) | public enum FCTBAction
  class HotkeysEditor (line 232) | internal class HotkeysEditor : UITypeEditor
    method GetEditStyle (line 234) | public override UITypeEditorEditStyle GetEditStyle(System.ComponentMod...
    method EditValue (line 239) | public override object EditValue(ITypeDescriptorContext context, IServ...

FILE: FastColoredTextBox/HotkeysEditorForm.Designer.cs
  class HotkeysEditorForm (line 3) | partial class HotkeysEditorForm
    method Dispose (line 14) | protected override void Dispose(bool disposing)
    method InitializeComponent (line 29) | private void InitializeComponent()

FILE: FastColoredTextBox/HotkeysEditorForm.cs
  class HotkeysEditorForm (line 11) | public partial class HotkeysEditorForm : Form
    method HotkeysEditorForm (line 15) | public HotkeysEditorForm(HotkeysMapping hotkeys)
    method CompereKeys (line 22) | int CompereKeys(Keys key1, Keys key2)
    method BuildWrappers (line 31) | private void BuildWrappers(HotkeysMapping hotkeys)
    method GetHotkeys (line 45) | public HotkeysMapping GetHotkeys()
    method btAdd_Click (line 54) | private void btAdd_Click(object sender, EventArgs e)
    method dgv_RowsAdded (line 59) | private void dgv_RowsAdded(object sender, DataGridViewRowsAddedEventAr...
    method btResore_Click (line 78) | private void btResore_Click(object sender, EventArgs e)
    method btRemove_Click (line 85) | private void btRemove_Click(object sender, EventArgs e)
    method HotkeysEditorForm_FormClosing (line 92) | private void HotkeysEditorForm_FormClosing(object sender, FormClosingE...
    method GetUnAssignedActions (line 109) | private string GetUnAssignedActions()
  class HotkeyWrapper (line 129) | internal class HotkeyWrapper
    method HotkeyWrapper (line 131) | public HotkeyWrapper(Keys keyData, FCTBAction action)
    method ToKeyData (line 142) | public Keys ToKeyData()

FILE: FastColoredTextBox/LimitedStack.cs
  class LimitedStack (line 8) | public class LimitedStack<T>
    method LimitedStack (line 34) | public LimitedStack(int maxItemCount)
    method Pop (line 44) | public T Pop()
    method Peek (line 66) | public T Peek()
    method Push (line 77) | public void Push(T item)
    method Clear (line 90) | public void Clear()
    method ToArray (line 97) | public T[] ToArray()

FILE: FastColoredTextBox/Line.cs
  class Line (line 11) | public class Line : IList<Char>
    method Line (line 44) | internal Line(int uid)
    method ClearStyle (line 54) | public void ClearStyle(StyleIndex styleIndex)
    method ClearFoldingMarkers (line 83) | public void ClearFoldingMarkers()
    method IndexOf (line 106) | public int IndexOf(Char item)
    method Insert (line 111) | public void Insert(int index, Char item)
    method RemoveAt (line 116) | public void RemoveAt(int index)
    method Add (line 127) | public void Add(Char item)
    method Clear (line 132) | public void Clear()
    method Contains (line 137) | public bool Contains(Char item)
    method CopyTo (line 142) | public void CopyTo(Char[] array, int arrayIndex)
    method Remove (line 160) | public bool Remove(Char item)
    method GetEnumerator (line 165) | public IEnumerator<Char> GetEnumerator()
    method GetEnumerator (line 170) | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnume...
    method RemoveRange (line 175) | public virtual void RemoveRange(int index, int count)
    method TrimExcess (line 182) | public virtual void TrimExcess()
    method AddRange (line 187) | public virtual void AddRange(IEnumerable<Char> collection)
  type LineInfo (line 193) | public struct LineInfo
    method LineInfo (line 210) | public LineInfo(int startY)
    method GetWordWrapStringStartPosition (line 254) | internal int GetWordWrapStringStartPosition(int iWordWrapLine)
    method GetWordWrapStringFinishPosition (line 259) | internal int GetWordWrapStringFinishPosition(int iWordWrapLine, Line l...
    method GetWordWrapStringIndex (line 269) | public int GetWordWrapStringIndex(int iChar)
  type VisibleState (line 279) | public enum VisibleState : byte
  type IndentMarker (line 286) | public enum IndentMarker

FILE: FastColoredTextBox/LinesAccessor.cs
  class LinesAccessor (line 7) | public class LinesAccessor : IList<string>
    method LinesAccessor (line 11) | public LinesAccessor(IList<Line> ts)
    method IndexOf (line 16) | public int IndexOf(string item)
    method Insert (line 25) | public void Insert(int index, string item)
    method RemoveAt (line 30) | public void RemoveAt(int index)
    method Add (line 41) | public void Add(string item)
    method Clear (line 46) | public void Clear()
    method Contains (line 51) | public bool Contains(string item)
    method CopyTo (line 60) | public void CopyTo(string[] array, int arrayIndex)
    method Remove (line 76) | public bool Remove(string item)
    method GetEnumerator (line 81) | public IEnumerator<string> GetEnumerator()
    method GetEnumerator (line 87) | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnume...

FILE: FastColoredTextBox/MacrosManager.cs
  class MacrosManager (line 14) | public class MacrosManager
    method MacrosManager (line 18) | internal MacrosManager(FastColoredTextBox ctrl)
    method ExecuteMacros (line 53) | public void ExecuteMacros()
    method AddCharToMacros (line 81) | public void AddCharToMacros(char c, Keys modifiers)
    method AddKeyToMacros (line 89) | public void AddKeyToMacros(Keys keyData)
    method ClearMacros (line 97) | public void ClearMacros()
    method ProcessKey (line 103) | internal void ProcessKey(Keys keyData)
    method ProcessKey (line 109) | internal void ProcessKey(char c, Keys modifiers)

FILE: FastColoredTextBox/NativeMethods.cs
  class NativeMethodWrapper (line 6) | public static class NativeMethodWrapper {
    method GetNativeSystemInfo (line 7) | public static void GetNativeSystemInfo(ref Win32NativeMethods.SYSTEM_I...
    method GetSystemInfo (line 13) | public static void GetSystemInfo(ref Win32NativeMethods.SYSTEM_INFO sy...
    method ShowCaret (line 19) | public static void ShowCaret(IntPtr handle)
    method SetCaretPos (line 25) | public static void SetCaretPos(int carX, int carY)
    method CreateCaret (line 30) | public static void CreateCaret(IntPtr handle, int i, int carWidth, int...
    method HideCaret (line 36) | public static void HideCaret(IntPtr handle)
    method SendMessage (line 42) | public static void SendMessage(IntPtr handle, int wmSetredraw, int i, ...
    method ImmGetContext (line 48) | public static IntPtr ImmGetContext(IntPtr handle)
    method CloseClipboard (line 55) | public static void CloseClipboard()
    method ImmAssociateContext (line 61) | public static void ImmAssociateContext(IntPtr handle, IntPtr mHImc)
  class Win32NativeMethods (line 68) | public static class Win32NativeMethods
    method CreateCaret (line 70) | [DllImport("User32.dll")]
    method SetCaretPos (line 73) | [DllImport("User32.dll")]
    method DestroyCaret (line 76) | [DllImport("User32.dll")]
    method ShowCaret (line 79) | [DllImport("User32.dll")]
    method HideCaret (line 82) | [DllImport("User32.dll")]
    method ImmGetContext (line 85) | [DllImport("Imm32.dll")]
    method ImmAssociateContext (line 88) | [DllImport("Imm32.dll")]
    method GetOpenClipboardWindow (line 91) | [DllImport("user32.dll")]
    method CloseClipboard (line 94) | [DllImport("user32.dll")]
    method SendMessage (line 97) | [DllImport("user32.dll")]
    method GetNativeSystemInfo (line 100) | [DllImport("kernel32.dll")]
    method GetSystemInfo (line 103) | [DllImport("kernel32.dll")]
    type SYSTEM_INFO (line 106) | [StructLayout(LayoutKind.Sequential)]

FILE: FastColoredTextBox/Place.cs
  type Place (line 8) | public struct Place : IEquatable<Place>
    method Place (line 13) | public Place(int iChar, int iLine)
    method Offset (line 19) | public void Offset(int dx, int dy)
    method Equals (line 25) | public bool Equals(Place other)
    method Equals (line 30) | public override bool Equals(object obj)
    method GetHashCode (line 35) | public override int GetHashCode()
    method ToString (line 94) | public override string ToString()

FILE: FastColoredTextBox/PlatformType.cs
  class PlatformType (line 8) | public static class PlatformType
    method GetOperationSystemPlatform (line 16) | public static Platform GetOperationSystemPlatform()
  type Platform (line 49) | public enum Platform

FILE: FastColoredTextBox/Range.cs
  class Range (line 12) | public class Range : IEnumerable<Place>
    method Range (line 27) | public Range(FastColoredTextBox tb)
    method Range (line 59) | public Range(FastColoredTextBox tb, int iStartChar, int iStartLine, in...
    method Range (line 69) | public Range(FastColoredTextBox tb, Place start, Place end)
    method Range (line 79) | public Range(FastColoredTextBox tb, int iLine)
    method Contains (line 86) | public bool Contains(Place place)
    method GetIntersectionWith (line 120) | public virtual Range GetIntersectionWith(Range range)
    method GetUnionWith (line 141) | public Range GetUnionWith(Range range)
    method SelectAll (line 156) | public void SelectAll()
    method GetText (line 273) | internal void GetText(out string text, out List<Place> charIndexToPlace)
    method GetCharsBeforeStart (line 351) | public string GetCharsBeforeStart(int charsCount)
    method GetCharsAfterStart (line 362) | public string GetCharsAfterStart(int charsCount)
    method Clone (line 371) | public Range Clone()
    method GoRight (line 416) | public bool GoRight()
    method GoRightThroughFolded (line 427) | public virtual bool GoRightThroughFolded()
    method GoLeft (line 450) | public bool GoLeft()
    method GoLeftThroughFolded (line 463) | public bool GoLeftThroughFolded()
    method GoLeft (line 481) | public void GoLeft(bool shift)
    method GoRight (line 512) | public void GoRight(bool shift)
    method GoUp (line 544) | internal void GoUp(bool shift)
    method GoPageUp (line 584) | internal void GoPageUp(bool shift)
    method GoDown (line 623) | internal void GoDown(bool shift)
    method GoPageDown (line 664) | internal void GoPageDown(bool shift)
    method GoHome (line 703) | internal void GoHome(bool shift)
    method GoEnd (line 723) | internal void GoEnd(bool shift)
    method SetStyle (line 745) | public void SetStyle(Style style)
    method SetStyle (line 758) | public void SetStyle(Style style, string regexPattern)
    method SetStyle (line 768) | public void SetStyle(Style style, Regex regex)
    method SetStyle (line 779) | public void SetStyle(Style style, string regexPattern, RegexOptions op...
    method SetStyle (line 789) | public void SetStyle(StyleIndex styleLayer, string regexPattern, Regex...
    method SetStyle (line 803) | public void SetStyle(StyleIndex styleLayer, Regex regex)
    method SetStyle (line 814) | public void SetStyle(StyleIndex styleIndex)
    method SetFoldingMarkers (line 841) | public void SetFoldingMarkers(string startFoldingPattern, string finis...
    method SetFoldingMarkers (line 851) | public void SetFoldingMarkers(string startFoldingPattern, string finis...
    method SetFoldingMarkers (line 872) | public void SetFoldingMarkers(string foldingPattern, RegexOptions opti...
    method GetRanges (line 889) | public IEnumerable<Range> GetRanges(string regexPattern)
    method GetRanges (line 899) | public IEnumerable<Range> GetRanges(string regexPattern, RegexOptions ...
    method GetRangesByLines (line 929) | public IEnumerable<Range> GetRangesByLines(string regexPattern, RegexO...
    method GetRangesByLines (line 943) | public IEnumerable<Range> GetRangesByLines(Regex regex)
    method GetRangesByLinesReversed (line 974) | public IEnumerable<Range> GetRangesByLinesReversed(string regexPattern...
    method GetRanges (line 1009) | public IEnumerable<Range> GetRanges(Regex regex)
    method ClearStyle (line 1033) | public void ClearStyle(params Style[] styles)
    method ClearStyle (line 1048) | public void ClearStyle(StyleIndex styleIndex)
    method ClearFoldingMarkers (line 1076) | public void ClearFoldingMarkers()
    method OnSelectionChanged (line 1089) | void OnSelectionChanged()
    method BeginUpdate (line 1104) | public void BeginUpdate()
    method EndUpdate (line 1112) | public void EndUpdate()
    method ToString (line 1119) | public override string ToString()
    method Normalize (line 1127) | public void Normalize()
    method Inverse (line 1136) | public void Inverse()
    method Expand (line 1146) | public void Expand()
    method GetEnumerator (line 1153) | IEnumerator<Place> IEnumerable<Place>.GetEnumerator()
    method GetEnumerator (line 1177) | System.Collections.IEnumerator System.Collections.IEnumerable.GetEnume...
    method GetFragment (line 1218) | public Range GetFragment(string allowedSymbolsPattern)
    method GetFragment (line 1228) | public Range GetFragment(Style style, bool allowLineBreaks)
    method GetFragment (line 1270) | public Range GetFragment(string allowedSymbolsPattern, RegexOptions op...
    method IsIdentifierChar (line 1300) | bool IsIdentifierChar(char c)
    method IsSpaceChar (line 1305) | bool IsSpaceChar(char c)
    method GoWordLeft (line 1310) | public void GoWordLeft(bool shift)
    method GoWordRight (line 1344) | public void GoWordRight(bool shift, bool goToStartOfNextWord = false)
    method GoFirst (line 1396) | internal void GoFirst(bool shift)
    method GoLast (line 1410) | internal void GoLast(bool shift)
    method ToStyleIndex (line 1424) | public static StyleIndex ToStyleIndex(int i)
    method GetSubRanges (line 1441) | public IEnumerable<Range> GetSubRanges(bool includeEmpty)
    method IsReadOnlyLeftChar (line 1545) | public bool IsReadOnlyLeftChar()
    method IsReadOnlyRightChar (line 1565) | public bool IsReadOnlyRightChar()
    method GetPlacesCyclic (line 1581) | public IEnumerable<Place> GetPlacesCyclic(Place startPlace, bool backw...
    method GetIntersectionWith_ColumnSelectionMode (line 1621) | private Range GetIntersectionWith_ColumnSelectionMode(Range range)
    method GoRightThroughFolded_ColumnSelectionMode (line 1633) | private bool GoRightThroughFolded_ColumnSelectionMode()
    method GetEnumerator_ColumnSelectionMode (line 1659) | private IEnumerable<Place> GetEnumerator_ColumnSelectionMode()
    method Length_ColumnSelectionMode (line 1698) | private int Length_ColumnSelectionMode(bool withNewLines)
    method GoDown_ColumnSelectionMode (line 1719) | internal void GoDown_ColumnSelectionMode()
    method GoUp_ColumnSelectionMode (line 1725) | internal void GoUp_ColumnSelectionMode()
    method GoRight_ColumnSelectionMode (line 1731) | internal void GoRight_ColumnSelectionMode()
    method GoLeft_ColumnSelectionMode (line 1736) | internal void GoLeft_ColumnSelectionMode()
  type RangeRect (line 1745) | public struct RangeRect
    method RangeRect (line 1747) | public RangeRect(int iStartLine, int iStartChar, int iEndLine, int iEn...

FILE: FastColoredTextBox/ReplaceForm.Designer.cs
  class ReplaceForm (line 3) | partial class ReplaceForm
    method Dispose (line 14) | protected override void Dispose(bool disposing)
    method InitializeComponent (line 29) | private void InitializeComponent()

FILE: FastColoredTextBox/ReplaceForm.cs
  class ReplaceForm (line 8) | public partial class ReplaceForm : Form
    method ReplaceForm (line 14) | public ReplaceForm(FastColoredTextBox tb)
    method btClose_Click (line 20) | private void btClose_Click(object sender, EventArgs e)
    method btFindNext_Click (line 25) | private void btFindNext_Click(object sender, EventArgs e)
    method FindAll (line 38) | public List<Range> FindAll(string pattern)
    method Find (line 55) | public bool Find(string pattern)
    method tbFind_KeyPress (line 97) | private void tbFind_KeyPress(object sender, KeyPressEventArgs e)
    method ProcessCmdKey (line 105) | protected override bool ProcessCmdKey(ref Message msg, Keys keyData) /...
    method ReplaceForm_FormClosing (line 116) | private void ReplaceForm_FormClosing(object sender, FormClosingEventAr...
    method btReplace_Click (line 127) | private void btReplace_Click(object sender, EventArgs e)
    method btReplaceAll_Click (line 142) | private void btReplaceAll_Click(object sender, EventArgs e)
    method OnActivated (line 180) | protected override void OnActivated(EventArgs e)
    method ResetSerach (line 186) | void ResetSerach()
    method cbMatchCase_CheckedChanged (line 191) | private void cbMatchCase_CheckedChanged(object sender, EventArgs e)

FILE: FastColoredTextBox/Ruler.Designer.cs
  class Ruler (line 3) | partial class Ruler
    method Dispose (line 14) | protected override void Dispose(bool disposing)
    method InitializeComponent (line 29) | private void InitializeComponent()

FILE: FastColoredTextBox/Ruler.cs
  class Ruler (line 12) | public partial class Ruler : UserControl
    method Ruler (line 40) | public Ruler()
    method OnTargetChanged (line 55) | protected virtual void OnTargetChanged()
    method UnSubscribe (line 61) | protected virtual void UnSubscribe(FastColoredTextBox target)
    method Subscribe (line 68) | protected virtual void Subscribe(FastColoredTextBox target)
    method target_VisibleRangeChanged (line 75) | void target_VisibleRangeChanged(object sender, EventArgs e)
    method target_SelectionChanged (line 80) | void target_SelectionChanged(object sender, EventArgs e)
    method target_Scroll (line 85) | protected virtual void target_Scroll(object sender, ScrollEventArgs e)
    method OnResize (line 90) | protected override void OnResize(EventArgs e)
    method OnPaint (line 96) | protected override void OnPaint(PaintEventArgs e)

FILE: FastColoredTextBox/Style.cs
  class Style (line 12) | public abstract class Style : IDisposable
    method Style (line 27) | public Style()
    method Draw (line 38) | public abstract void Draw(Graphics gr, Point position, Range range);
    method OnVisualMarkerClick (line 43) | public virtual void OnVisualMarkerClick(FastColoredTextBox tb, VisualM...
    method AddVisualMarker (line 53) | protected virtual void AddVisualMarker(FastColoredTextBox tb, StyleVis...
    method GetSizeOfRange (line 58) | public static Size GetSizeOfRange(Range range)
    method GetRoundedRectangle (line 63) | public static GraphicsPath GetRoundedRectangle(Rectangle rect, int d)
    method Dispose (line 76) | public virtual void Dispose()
    method GetCSS (line 85) | public virtual string GetCSS()
    method GetRTF (line 94) | public virtual RTFStyleDescriptor GetRTF()
  class TextStyle (line 104) | public class TextStyle : Style
    method TextStyle (line 114) | public TextStyle(Brush foreBrush, Brush backgroundBrush, FontStyle fon...
    method Draw (line 122) | public override void Draw(Graphics gr, Point position, Range range)
    method GetCSS (line 168) | public override string GetCSS()
    method GetRTF (line 198) | public override RTFStyleDescriptor GetRTF()
  class FoldedBlockStyle (line 224) | public class FoldedBlockStyle : TextStyle
    method FoldedBlockStyle (line 226) | public FoldedBlockStyle(Brush foreBrush, Brush backgroundBrush, FontSt...
    method Draw (line 231) | public override void Draw(Graphics gr, Point position, Range range)
  class SelectionStyle (line 267) | public class SelectionStyle : Style
    method SelectionStyle (line 278) | public SelectionStyle(Brush backgroundBrush, Brush foregroundBrush = n...
    method Draw (line 284) | public override void Draw(Graphics gr, Point position, Range range)
  class MarkerStyle (line 314) | public class MarkerStyle : Style
    method MarkerStyle (line 318) | public MarkerStyle(Brush backgroundBrush)
    method Draw (line 324) | public override void Draw(Graphics gr, Point position, Range range)
    method GetCSS (line 337) | public override string GetCSS()
  class ShortcutStyle (line 355) | public class ShortcutStyle : Style
    method ShortcutStyle (line 359) | public ShortcutStyle(Pen borderPen)
    method Draw (line 364) | public override void Draw(Graphics gr, Point position, Range range)
  class WavyLineStyle (line 383) | public class WavyLineStyle : Style
    method WavyLineStyle (line 387) | public WavyLineStyle(int alpha, Color color)
    method Draw (line 392) | public override void Draw(Graphics gr, Point pos, Range range)
    method DrawWavyLine (line 400) | private void DrawWavyLine(Graphics graphics, Point start, Point end)
    method Dispose (line 420) | public override void Dispose()
  class ReadOnlyStyle (line 433) | public class ReadOnlyStyle : Style
    method ReadOnlyStyle (line 435) | public ReadOnlyStyle()
    method Draw (line 440) | public override void Draw(Graphics gr, Point position, Range range)

FILE: FastColoredTextBox/SyntaxDescriptor.cs
  class SyntaxDescriptor (line 7) | public class SyntaxDescriptor : IDisposable
    method Dispose (line 18) | public void Dispose()
  class RuleDesc (line 25) | public class RuleDesc
  class FoldingDesc (line 46) | public class FoldingDesc

FILE: FastColoredTextBox/SyntaxHighlighter.cs
  class SyntaxHighlighter (line 11) | public class SyntaxHighlighter : IDisposable
    method SyntaxHighlighter (line 84) | public SyntaxHighlighter(FastColoredTextBox currentTb)
    method Dispose (line 91) | public void Dispose()
    method HighlightSyntax (line 102) | public virtual void HighlightSyntax(Language language, Range range)
    method HighlightSyntax (line 110) | public virtual void HighlightSyntax(string XMLdescriptionFile, Range r...
    method AutoIndentNeeded (line 128) | public virtual void AutoIndentNeeded(object sender, AutoIndentEventArg...
    method AddXmlDescription (line 143) | public virtual void AddXmlDescription(string descriptionFileName, XmlD...
    method AddResilientStyle (line 156) | public virtual void AddResilientStyle(Style style)
    method ParseXmlDescription (line 163) | public static SyntaxDescriptor ParseXmlDescription(XmlDocument doc)
    method ParseFolding (line 218) | protected static FoldingDesc ParseFolding(XmlNode foldingNode)
    method ParseRule (line 232) | protected static RuleDesc ParseRule(XmlNode ruleNode, Dictionary<strin...
    method ParseStyle (line 252) | protected static Style ParseStyle(XmlNode styleNode)
    method ParseColor (line 274) | protected static Color ParseColor(string s)
    method HighlightSyntax (line 288) | public void HighlightSyntax(SyntaxDescriptor desc, Range range)
    method RestoreBrackets (line 319) | protected void RestoreBrackets(FastColoredTextBox tb, char[] oldBrackets)
    method RememberBrackets (line 327) | protected char[] RememberBrackets(FastColoredTextBox tb)
    method InitStyleSchema (line 332) | public void InitStyleSchema(Language lang)
    method InitRazorRegex (line 345) | protected void InitRazorRegex()
    method RazorSyntaxHighlight (line 377) | public virtual void RazorSyntaxHighlight(Range range)
    method RazorAutoIndentNeeded (line 418) | protected void RazorAutoIndentNeeded(object sender, AutoIndentEventArg...
  type Language (line 472) | public enum Language

FILE: FastColoredTextBox/TextSource.cs
  class TextSource (line 14) | public class TextSource : IList<Line>, IDisposable
    method ClearIsChanged (line 77) | public virtual void ClearIsChanged()
    method CreateLine (line 83) | public virtual Line CreateLine()
    method OnCurrentTBChanged (line 88) | private void OnCurrentTBChanged()
    method TextSource (line 100) | public TextSource(FastColoredTextBox currentTB)
    method InitDefaultStyle (line 114) | public virtual void InitDefaultStyle()
    method IsLineLoaded (line 125) | public virtual bool IsLineLoaded(int iLine)
    method GetLines (line 133) | public virtual IList<string> GetLines()
    method GetEnumerator (line 138) | public IEnumerator<Line> GetEnumerator()
    method GetEnumerator (line 143) | IEnumerator System.Collections.IEnumerable.GetEnumerator()
    method BinarySearch (line 148) | public virtual int BinarySearch(Line item, IComparer<Line> comparer)
    method GenerateUniqueLineId (line 153) | public virtual int GenerateUniqueLineId()
    method InsertLine (line 158) | public virtual void InsertLine(int index, Line line)
    method OnLineInserted (line 164) | public virtual void OnLineInserted(int index)
    method OnLineInserted (line 169) | public virtual void OnLineInserted(int index, int count)
    method RemoveLine (line 175) | public virtual void RemoveLine(int index)
    method RemoveLine (line 185) | public virtual void RemoveLine(int index, int count)
    method OnLineRemoved (line 199) | public virtual void OnLineRemoved(int index, int count, List<int> remo...
    method OnTextChanged (line 206) | public virtual void OnTextChanged(int fromLine, int toLine)
    class TextChangedEventArgs (line 212) | public class TextChangedEventArgs : EventArgs
      method TextChangedEventArgs (line 217) | public TextChangedEventArgs(int iFromLine, int iToLine)
    method IndexOf (line 224) | public virtual int IndexOf(Line item)
    method Insert (line 229) | public virtual void Insert(int index, Line item)
    method RemoveAt (line 234) | public virtual void RemoveAt(int index)
    method Add (line 239) | public virtual void Add(Line item)
    method Clear (line 244) | public virtual void Clear()
    method Contains (line 249) | public virtual bool Contains(Line item)
    method CopyTo (line 254) | public virtual void CopyTo(Line[] array, int arrayIndex)
    method Remove (line 272) | public virtual bool Remove(Line item)
    method NeedRecalc (line 284) | public virtual void NeedRecalc(TextChangedEventArgs args)
    method OnRecalcWordWrap (line 290) | public virtual void OnRecalcWordWrap(TextChangedEventArgs args)
    method OnTextChanging (line 296) | public virtual void OnTextChanging()
    method OnTextChanging (line 302) | public virtual void OnTextChanging(ref string text)
    method GetLineLength (line 316) | public virtual int GetLineLength(int i)
    method LineHasFoldingStartMarker (line 321) | public virtual bool LineHasFoldingStartMarker(int iLine)
    method LineHasFoldingEndMarker (line 326) | public virtual bool LineHasFoldingEndMarker(int iLine)
    method Dispose (line 331) | public virtual void Dispose()
    method SaveToFile (line 336) | public virtual void SaveToFile(string fileName, Encoding enc)

FILE: FastColoredTextBox/TypeDescriptor.cs
  class FCTBDescriptionProvider (line 10) | class FCTBDescriptionProvider : TypeDescriptionProvider
    method FCTBDescriptionProvider (line 12) | public FCTBDescriptionProvider(Type type)
    method GetDefaultTypeProvider (line 17) | private static TypeDescriptionProvider GetDefaultTypeProvider(Type type)
    method GetTypeDescriptor (line 23) | public override ICustomTypeDescriptor GetTypeDescriptor(Type objectTyp...
  class FCTBTypeDescriptor (line 30) | class FCTBTypeDescriptor : CustomTypeDescriptor
    method FCTBTypeDescriptor (line 35) | public FCTBTypeDescriptor(ICustomTypeDescriptor parent, object instance)
    method GetComponentName (line 42) | public override string GetComponentName()
    method GetEvents (line 48) | public override EventDescriptorCollection GetEvents()
  class FooTextChangedDescriptor (line 63) | class FooTextChangedDescriptor : EventDescriptor
    method FooTextChangedDescriptor (line 65) | public FooTextChangedDescriptor(MemberDescriptor desc)
    method AddEventHandler (line 70) | public override void AddEventHandler(object component, Delegate value)
    method RemoveEventHandler (line 90) | public override void RemoveEventHandler(object component, Delegate value)

FILE: FastColoredTextBox/UnfocusablePanel.cs
  class UnfocusablePanel (line 10) | [System.ComponentModel.ToolboxItem(false)]
    method UnfocusablePanel (line 18) | public UnfocusablePanel()
    method OnPaint (line 25) | protected override void OnPaint(PaintEventArgs e)

FILE: FastColoredTextBox/VisualMarker.cs
  class VisualMarker (line 9) | public class VisualMarker
    method VisualMarker (line 13) | public VisualMarker(Rectangle rectangle)
    method Draw (line 18) | public virtual void Draw(Graphics gr, Pen pen)
  class CollapseFoldingMarker (line 28) | public class CollapseFoldingMarker : VisualMarker
    method CollapseFoldingMarker (line 32) | public CollapseFoldingMarker(int iLine, Rectangle rectangle)
    method Draw (line 38) | public void Draw(Graphics gr, Pen pen, Brush backgroundBrush, Pen fore...
  class ExpandFoldingMarker (line 48) | public class ExpandFoldingMarker : VisualMarker
    method ExpandFoldingMarker (line 52) | public ExpandFoldingMarker(int iLine, Rectangle rectangle)
    method Draw (line 58) | public void Draw(Graphics gr, Pen pen, Brush backgroundBrush, Pen fore...
  class FoldedAreaMarker (line 70) | public class FoldedAreaMarker : VisualMarker
    method FoldedAreaMarker (line 74) | public FoldedAreaMarker(int iLine, Rectangle rectangle)
    method Draw (line 80) | public override void Draw(Graphics gr, Pen pen)
  class StyleVisualMarker (line 86) | public class StyleVisualMarker : VisualMarker
    method StyleVisualMarker (line 90) | public StyleVisualMarker(Rectangle rectangle, Style style)
  class VisualMarkerEventArgs (line 97) | public class VisualMarkerEventArgs : MouseEventArgs
    method VisualMarkerEventArgs (line 102) | public VisualMarkerEventArgs(Style style, StyleVisualMarker marker, Mo...

FILE: Loader/Loader.cpp
  function BOOL (line 4) | BOOL APIENTRY DllMain( HANDLE hModule, DWORD dwReason, LPVOID lpReserved )
  type ERROR_TYPE (line 16) | enum ERROR_TYPE
  function DWORD (line 33) | __declspec(dllexport) DWORD __stdcall Load( const char *exe, const char ...

FILE: Loader/Loader.h
  function class (line 14) | class LOADER_API CLoader {

FILE: Platform/Platform.cpp
  function BOOL (line 7) | BOOL APIENTRY DllMain(HANDLE hModule, DWORD dwReason, LPVOID)
  function DLLFUNCTION (line 27) | DLLFUNCTION HBITMAP CaptureScreen(HWND hUOWindow, BOOL full, const char ...
  function DLLFUNCTION (line 85) | DLLFUNCTION void BringToFront(HWND hWnd)

FILE: Razor/Agents/Agents.cs
  class Agent (line 26) | public abstract class Agent
    method InvokeMobileCreated (line 37) | public static void InvokeMobileCreated(Mobile m)
    method InvokeItemCreated (line 45) | public static void InvokeItemCreated(Item i)
    method Add (line 53) | public static void Add(Agent a)
    method ClearAll (line 58) | public static void ClearAll()
    method SaveProfile (line 66) | public static void SaveProfile(XmlTextWriter xml)
    method LoadProfile (line 76) | public static void LoadProfile(XmlElement xml)
    method Redraw (line 102) | public static void Redraw(ComboBox list, GroupBox gb, params Button[] ...
    method Select (line 124) | public static void Select(int idx, ComboBox agents, ListBox subList, G...
    method ToString (line 152) | public override string ToString()
    method Save (line 160) | public abstract void Save(XmlTextWriter xml);
    method Load (line 161) | public abstract void Load(XmlElement node);
    method Clear (line 162) | public abstract void Clear();
    method OnSelected (line 163) | public abstract void OnSelected(ListBox subList, params Button[] butto...
    method OnButtonPress (line 164) | public abstract void OnButtonPress(int num);

FILE: Razor/Agents/BuyAgent.cs
  class BuyAgent (line 30) | public class BuyAgent : Agent
    class BuyEntry (line 32) | public class BuyEntry
      method BuyEntry (line 34) | public BuyEntry(ItemID id, ushort amount)
      method ToString (line 43) | public override string ToString()
    class ItemXYComparer (line 49) | private class ItemXYComparer : IComparer<Item>
      method ItemXYComparer (line 53) | private ItemXYComparer()
      method Compare (line 57) | public int Compare(Item x, Item y)
    method Initialize (line 79) | public static void Initialize()
    method BuyAgent (line 107) | public BuyAgent(int num)
    method DisplayBuy (line 113) | private static void DisplayBuy(PacketReader p, PacketHandlerEventArgs ...
    method ExtBuyInfo (line 275) | private static void ExtBuyInfo(PacketReader p, PacketHandlerEventArgs ...
    method EndVendorBuy (line 310) | private static void EndVendorBuy(PacketReader p, PacketHandlerEventArg...
    method Clear (line 339) | public override void Clear()
    method OnDisconnected (line 344) | internal static void OnDisconnected()
    method OnSelected (line 355) | public override void OnSelected(ListBox subList, params Button[] buttons)
    method OnButtonPress (line 391) | public override void OnButtonPress(int num)
    method OnTarget (line 445) | private void OnTarget(bool location, Serial serial, Point3D loc, ushor...
    method OnItemTargetAmountResponse (line 459) | private bool OnItemTargetAmountResponse(int gfx, string input)
    method OnItemChangeAmountResponse (line 500) | private bool OnItemChangeAmountResponse(int entryId, string input)
    method AddItemTarget (line 556) | public void AddItemTarget(bool fromGump = false)
    method AddItem (line 564) | public void AddItem(BuyEntry entry)
    method RemoveItem (line 573) | public void RemoveItem(int itemId)
    method SetItemAmount (line 586) | public void SetItemAmount(int itemId, bool fromGump = false)
    method Save (line 600) | public override void Save(XmlTextWriter xml)
    method Load (line 619) | public override void Load(XmlElement node)

FILE: Razor/Agents/IgnoreAgent.cs
  class IgnoreAgent (line 28) | public class IgnoreAgent : Agent
    method Initialize (line 32) | public static void Initialize()
    method HandleMobileMessage (line 39) | public static void HandleMobileMessage(Packet p, PacketHandlerEventArg...
    method IsIgnored (line 52) | public static bool IsIgnored(Serial ser)
    method IgnoreAgent (line 63) | public IgnoreAgent()
    method Clear (line 76) | public override void Clear()
    method IsEnabled (line 82) | public static bool IsEnabled()
    method IsSerialIgnored (line 87) | public bool IsSerialIgnored(Serial ser)
    method OnSelected (line 108) | public override void OnSelected(ListBox subList, params Button[] buttons)
    method AddToIgnoreList (line 134) | public void AddToIgnoreList()
    method RemoveFromIgnoreList (line 140) | public void RemoveFromIgnoreList()
    method OnButtonPress (line 146) | public override void OnButtonPress(int num)
    method OPLCheckIgnore (line 214) | private void OPLCheckIgnore(Mobile m)
    method OnAddTarget (line 222) | private void OnAddTarget(bool location, Serial serial, Point3D loc, us...
    method Add2List (line 245) | private void Add2List(Serial s)
    method OnRemoveTarget (line 273) | private void OnRemoveTarget(bool location, Serial serial, Point3D loc,...
    method Save (line 304) | public override void Save(XmlTextWriter xml)
    method Load (line 326) | public override void Load(XmlElement node)

FILE: Razor/Agents/OrganizerAgent.cs
  class OrganizerAgent (line 30) | public class OrganizerAgent : Agent
    method Initialize (line 34) | public static void Initialize()
    method OrganizerAgent (line 59) | public OrganizerAgent(int num)
    method CheckContOPL (line 74) | public void CheckContOPL(Item item)
    method OnSingleClick (line 82) | private void OnSingleClick(PacketReader pvSrc, PacketHandlerEventArgs ...
    method OnSelected (line 108) | public override void OnSelected(ListBox subList, params Button[] buttons)
    method SetHotBag (line 144) | public void SetHotBag()
    method OnButtonPress (line 150) | public override void OnButtonPress(int num)
    method Organize (line 198) | public void Organize()
    method OrganizeChildren (line 225) | private int OrganizeChildren(Item container)
    method OrganizeChildren (line 245) | private int OrganizeChildren(Item container, object dest)
    method OnTarget (line 273) | private void OnTarget(bool location, Serial serial, Point3D loc, ushor...
    method AddItemTarget (line 292) | public void AddItemTarget(bool fromGump = false)
    method AddItem (line 300) | public void AddItem(ushort gfx)
    method RemoveItem (line 316) | public void RemoveItem(int itemId)
    method OnTargetBag (line 329) | private void OnTargetBag(bool location, Serial serial, Point3D loc, us...
    method Clear (line 365) | public override void Clear()
    method Save (line 375) | public override void Save(XmlTextWriter xml)
    method Load (line 388) | public override void Load(XmlElement node)

FILE: Razor/Agents/RestockAgent.cs
  class RestockAgent (line 31) | public class RestockAgent : Agent
    method Initialize (line 35) | public static void Initialize()
    method RestockAgent (line 59) | public RestockAgent(int num)
    method CheckHBOPL (line 76) | public void CheckHBOPL(Item item)
    method OnSingleClick (line 84) | private void OnSingleClick(PacketReader pvSrc, PacketHandlerEventArgs ...
    method Clear (line 101) | public override void Clear()
    method OnSelected (line 115) | public override void OnSelected(ListBox subList, params Button[] buttons)
    method OnButtonPress (line 152) | public override void OnButtonPress(int num)
    method SetHBText (line 224) | private void SetHBText()
    method SetHB (line 232) | public void SetHB()
    method OnHBTarget (line 238) | private void OnHBTarget(bool location, Serial serial, Point3D loc, ush...
    method OnHotKey (line 273) | public void OnHotKey()
    method OnRestockTarget (line 284) | private void OnRestockTarget(bool location, Serial serial, Point3D loc...
    method DoRestock (line 339) | private void DoRestock()
    method Recurse (line 373) | private int Recurse(Item pack, List<Item> items, RestockItem ri, ref i...
    method OnItemTarget (line 401) | private void OnItemTarget(bool location, Serial serial, Point3D loc, u...
    method OnItemTargetAmountResponse (line 423) | private bool OnItemTargetAmountResponse(int gfx, string input)
    method OnItemTargetChangeResponse (line 460) | private bool OnItemTargetChangeResponse(int restockId, string input)
    method AddItemTarget (line 512) | public void AddItemTarget(bool fromGump = false)
    method AddItem (line 520) | public void AddItem(RestockItem item)
    method RemoveItem (line 537) | public void RemoveItem(int itemId)
    method SetItemAmount (line 550) | public void SetItemAmount(int itemId, bool fromGump = false)
    method Save (line 564) | public override void Save(XmlTextWriter xml)
    method Load (line 579) | public override void Load(XmlElement node)
    class RestockItem (line 614) | public class RestockItem
      method RestockItem (line 619) | public RestockItem(ItemID id, int amount)
      method ToString (line 625) | public override string ToString()

FILE: Razor/Agents/ScavengerAgent.cs
  class ScavengerAgent (line 27) | public class ScavengerAgent : Agent
    method Initialize (line 38) | public static void Initialize()
    method ScavengerAgent (line 52) | public ScavengerAgent()
    method ToggleEnabled (line 68) | public void ToggleEnabled()
    method Disable (line 73) | public void Disable()
    method Enable (line 80) | public void Enable()
    method OnEnableDisable (line 87) | private void OnEnableDisable()
    method OnAddToHotBag (line 102) | public void OnAddToHotBag()
    method OnSetHotBag (line 108) | public void OnSetHotBag()
    method CheckBagOPL (line 114) | private void CheckBagOPL(Item item)
    method OnSingleClick (line 122) | private void OnSingleClick(PacketReader pvSrc, PacketHandlerEventArgs ...
    method Clear (line 139) | public override void Clear()
    method OnSelected (line 159) | public override void OnSelected(ListBox subList, params Button[] buttons)
    method UpdateEnableButton (line 187) | private void UpdateEnableButton()
    method OnButtonPress (line 195) | public override void OnButtonPress(int num)
    method ClearCache (line 235) | public void ClearCache()
    method OnTarget (line 249) | private void OnTarget(bool location, Serial serial, Point3D loc, ushor...
    method Add (line 267) | public void Add(ItemID itemId)
    method OnTargetBag (line 277) | private void OnTargetBag(bool location, Serial serial, Point3D loc, us...
    method Uncache (line 309) | public void Uncache(Serial s)
    method Scavenge (line 317) | public void Scavenge(Item item)
    method DebugLog (line 358) | private static void DebugLog(string str, params object[] args)
    method Save (line 372) | public override void Save(XmlTextWriter xml)
    method Load (line 391) | public override void Load(XmlElement node)

FILE: Razor/Agents/SearchExemptionAgent.cs
  class SearchExemptionAgent (line 27) | public class SearchExemptionAgent : Agent
    method Initialize (line 36) | public static void Initialize()
    method IsExempt (line 41) | public static bool IsExempt(Item item)
    method Contains (line 51) | public static bool Contains(Item item)
    method SearchExemptionAgent (line 61) | public SearchExemptionAgent()
    method Clear (line 66) | public override void Clear()
    method CheckExempt (line 71) | private bool CheckExempt(Item item)
    method OnSelected (line 101) | public override void OnSelected(ListBox subList, params Button[] buttons)
    method OnButtonPress (line 140) | public override void OnButtonPress(int num)
    method OnTarget (line 176) | private void OnTarget(bool location, Serial serial, Point3D loc, ushor...
    method OnTargetType (line 198) | private void OnTargetType(bool location, Serial serial, Point3D loc, u...
    method OnTargetRemove (line 212) | private void OnTargetRemove(bool location, Serial serial, Point3D loc,...
    method Save (line 239) | public override void Save(XmlTextWriter xml)
    method Load (line 257) | public override void Load(XmlElement node)

FILE: Razor/Agents/SellAgent.cs
  class SellAgent (line 28) | public class SellAgent : Agent
    method Initialize (line 32) | public static void Initialize()
    method SellAgent (line 45) | public SellAgent()
    method CheckHBOPL (line 59) | private void CheckHBOPL(Item item)
    method OnSingleClick (line 67) | private void OnSingleClick(PacketReader pvSrc, PacketHandlerEventArgs ...
    method Clear (line 84) | public override void Clear()
    method OnVendorSell (line 89) | private void OnVendorSell(PacketReader pvSrc, PacketHandlerEventArgs a...
    method OnSelected (line 172) | public override void OnSelected(ListBox subList, params Button[] buttons)
    method OnButtonPress (line 213) | public override void OnButtonPress(int num)
    method OnChangeSellMaxAmount (line 274) | private bool OnChangeSellMaxAmount(int gfx, string amount)
    method SetHBText (line 287) | private void SetHBText()
    method OnTarget (line 295) | private void OnTarget(bool location, Serial serial, Point3D loc, ushor...
    method Add (line 304) | public void Add(ItemID itemId)
    method OnHBTarget (line 312) | private void OnHBTarget(bool location, Serial serial, Point3D loc, ush...
    method SetHotBag (line 329) | public void SetHotBag()
    method Save (line 367) | public override void Save(XmlTextWriter xml)
    method Load (line 392) | public override void Load(XmlElement node)

FILE: Razor/Agents/UseOnceAgent.cs
  class UseOnceAgent (line 27) | public class UseOnceAgent : Agent
    method Initialize (line 31) | public static void Initialize()
    method UseOnceAgent (line 39) | public UseOnceAgent()
    method Clear (line 52) | public override void Clear()
    method CheckItemOPL (line 57) | private void CheckItemOPL(Item newItem)
    method OnSingleClick (line 73) | private void OnSingleClick(PacketReader pvSrc, PacketHandlerEventArgs ...
    method OnSelected (line 113) | public override void OnSelected(ListBox subList, params Button[] buttons)
    method OnButtonPress (line 155) | public override void OnButtonPress(int num)
    method OnAdd (line 194) | public void OnAdd()
    method OnAddContainer (line 200) | public void OnAddContainer()
    method OnTarget (line 206) | private void OnTarget(bool location, Serial serial, Point3D loc, ushor...
    method OnTargetRemove (line 235) | private void OnTargetRemove(bool location, Serial serial, Point3D loc,...
    method OnTargetBag (line 274) | private void OnTargetBag(bool location, Serial serial, Point3D loc, us...
    method Save (line 309) | public override void Save(XmlTextWriter xml)
    method Load (line 327) | public override void Load(XmlElement node)
    method OnHotKey (line 343) | public void OnHotKey()

FILE: Razor/Boat/BoatWindow.Designer.cs
  class BoatWindow (line 5) | partial class BoatWindow
    method Dispose (line 16) | protected override void Dispose(bool disposing)
    method InitializeComponent (line 31) | private void InitializeComponent()

FILE: Razor/Boat/BoatWindow.cs
  class BoatWindow (line 24) | public partial class BoatWindow : Form
    type Orientation (line 26) | private enum Orientation
    method SendMessage (line 40) | [System.Runtime.InteropServices.DllImport("user32.dll")]
    method ReleaseCapture (line 43) | [System.Runtime.InteropServices.DllImport("user32.dll")]
    method BoatWindow (line 49) | public BoatWindow()
    method BoatWindow_Load (line 56) | private void BoatWindow_Load(object sender, EventArgs e)
    method BoatWindow_MouseDown (line 61) | private void BoatWindow_MouseDown(object sender, System.Windows.Forms....
    method SendBoatCommand (line 70) | private void SendBoatCommand(string command, bool directionCommand = t...
    method boatNorth_MouseClick (line 93) | private void boatNorth_MouseClick(object sender, MouseEventArgs e)
    method boatNorthwest_Click (line 139) | private void boatNorthwest_Click(object sender, MouseEventArgs e)
    method boatSouth_Click (line 181) | private void boatSouth_Click(object sender, EventArgs e)
    method boatSoutheast_Click (line 203) | private void boatSoutheast_Click(object sender, MouseEventArgs e)
    method boatSouthwest_Click (line 244) | private void boatSouthwest_Click(object sender, MouseEventArgs e)
    method boatWest_Click (line 285) | private void boatWest_Click(object sender, EventArgs e)
    method boatNortheast_Click (line 307) | private void boatNortheast_Click(object sender, MouseEventArgs e)
    method boatEast_Click (line 348) | private void boatEast_Click(object sender, EventArgs e)
    method boatTurnRight_Click (line 370) | private void boatTurnRight_Click(object sender, EventArgs e)
    method boatTurnLeft_Click (line 391) | private void boatTurnLeft_Click(object sender, EventArgs e)
    method boatTurnAround_Click (line 412) | private void boatTurnAround_Click(object sender, EventArgs e)
    method boatAnchor_Click (line 433) | private void boatAnchor_Click(object sender, EventArgs e)
    method boatT2a_Click (line 447) | private void boatT2a_Click(object sender, EventArgs e)
    method alwaysOnTop_CheckedChanged (line 461) | private void alwaysOnTop_CheckedChanged(object sender, EventArgs e)
    method boatGoto1_Click (line 466) | private void boatGoto1_Click(object sender, EventArgs e)
    method boatGoto2_Click (line 471) | private void boatGoto2_Click(object sender, EventArgs e)
    method boatGoto3_Click (line 476) | private void boatGoto3_Click(object sender, EventArgs e)
    method boatGoto4_Click (line 481) | private void boatGoto4_Click(object sender, EventArgs e)
    method boatGoto5_Click (line 486) | private void boatGoto5_Click(object sender, EventArgs e)
    method boatGoto6_Click (line 491) | private void boatGoto6_Click(object sender, EventArgs e)
    method boatGoto7_Click (line 496) | private void boatGoto7_Click(object sender, EventArgs e)
    method boatGoto8_Click (line 501) | private void boatGoto8_Click(object sender, EventArgs e)
    method boatGoto9_Click (line 506) | private void boatGoto9_Click(object sender, EventArgs e)
    method boatStart_Click (line 511) | private void boatStart_Click(object sender, EventArgs e)
    method boatContinue_Click (line 516) | private void boatContinue_Click(object sender, EventArgs e)
    method boatNav_Click (line 521) | private void boatNav_Click(object sender, EventArgs e)
    method boatWindowsBorder_CheckedChanged (line 526) | private void boatWindowsBorder_CheckedChanged(object sender, EventArgs e)
    method boatStop_Click (line 531) | private void boatStop_Click(object sender, EventArgs e)
    method boatClose_Click (line 536) | private void boatClose_Click(object sender, EventArgs e)

FILE: Razor/Client/ClassicUO.cs
  class Engine (line 35) | public partial class Engine
    method Install (line 37) | public static unsafe void Install(PluginHeader* plugin)
  class ClassicUOClient (line 124) | public class ClassicUOClient : Client
    method SetMapWndHandle (line 159) | public override void SetMapWndHandle(Form mapWnd)
    method RequestStatbarPatch (line 163) | public override void RequestStatbarPatch(bool preAOS)
    method SetCustomNotoHue (line 167) | public override void SetCustomNotoHue(int hue)
    method SetSmartCPU (line 171) | public override void SetSmartCPU(bool enabled)
    method SetGameSize (line 175) | public override void SetGameSize(int x, int y)
    method LaunchClient (line 179) | public override Loader_Error LaunchClient(string client)
    method Install (line 190) | public unsafe bool Install(PluginHeader* header)
    method InstallHooks (line 245) | public unsafe override bool InstallHooks(IntPtr pluginPtr)
    method Tick (line 251) | private void Tick()
    method OnPlayerPositionChanged (line 256) | private void OnPlayerPositionChanged(int x, int y, int z)
    method OnRecv (line 261) | private unsafe bool OnRecv(ref byte[] data, ref int length)
    method OnSend (line 298) | private unsafe bool OnSend(ref byte[] data, ref int length)
    method OnMouseHandler (line 334) | private void OnMouseHandler(int button, int wheel)
    type SDL_Keymod (line 348) | private enum SDL_Keymod
    type SDL_Keycode_Ignore (line 365) | private enum SDL_Keycode_Ignore
    method OnHotKeyHandler (line 375) | private bool OnHotKeyHandler(int key, int mod, bool ispressed)
    method OnDisconnected (line 393) | private void OnDisconnected()
    method OnConnected (line 423) | private void OnConnected()
    method OnClientClosing (line 428) | private void OnClientClosing()
    method OnInitialize (line 440) | private void OnInitialize()
    method SetConnectionInfo (line 451) | public override void SetConnectionInfo(IPAddress addr, int port)
    method SetNegotiate (line 455) | public override void SetNegotiate(bool negotiate)
    method Attach (line 459) | public override bool Attach(int pid)
    method Close (line 464) | public override void Close()
    method UpdateTitleBar (line 468) | public override void UpdateTitleBar()
    method SetTitleStr (line 509) | public override void SetTitleStr(string str)
    method OnMessage (line 514) | public override bool OnMessage(MainForm razor, uint wParam, int lParam)
    method OnCopyData (line 519) | public override bool OnCopyData(IntPtr wparam, IntPtr lparam)
    method SendToServer (line 524) | public override void SendToServer(Packet p)
    method SendToServer (line 531) | public override void SendToServer(PacketReader pr)
    method SendToClient (line 536) | public override void SendToClient(Packet p)
    method SendPacketToClient (line 544) | public override void SendPacketToClient(byte[] packet, int length)
    method ForceSendToClient (line 549) | public override unsafe void ForceSendToClient(Packet p)
    method ForceSendToServer (line 565) | public override unsafe void ForceSendToServer(Packet p)
    method SetPosition (line 581) | public override void SetPosition(uint x, uint y, uint z, byte dir)
    method GetClientVersion (line 585) | public override string GetClientVersion()
    method GetUoFilePath (line 590) | public override string GetUoFilePath()
    method GetWindowHandle (line 595) | public override IntPtr GetWindowHandle()
    method TotalDataIn (line 600) | public override uint TotalDataIn()
    method TotalDataOut (line 605) | public override uint TotalDataOut()
    method RequestMove (line 610) | internal override void RequestMove(Direction m_Dir)
    method OnFocusGained (line 615) | public void OnFocusGained()
    method OnFocusLost (line 648) | public void OnFocusLost()

FILE: Razor/Client/Client.cs
  class FeatureBit (line 28) | public class FeatureBit
  class Client (line 62) | public abstract class Client
    method Init (line 67) | internal static void Init(bool isOSI)
    method AllowBit (line 84) | public bool AllowBit(int bit)
    method SetFeatures (line 89) | public void SetFeatures(ulong features)
    method SetMapWndHandle (line 100) | public abstract void SetMapWndHandle(Form mapWnd);
    method RequestStatbarPatch (line 102) | public abstract void RequestStatbarPatch(bool preAOS);
    method SetCustomNotoHue (line 104) | public abstract void SetCustomNotoHue(int hue);
    method SetSmartCPU (line 106) | public abstract void SetSmartCPU(bool enabled);
    method SetGameSize (line 108) | public abstract void SetGameSize(int x, int y);
    type Loader_Error (line 110) | public enum Loader_Error
    method LaunchClient (line 127) | public abstract Loader_Error LaunchClient(string client);
    method InstallHooks (line 133) | public abstract bool InstallHooks(IntPtr mainWindow);
    method SetConnectionInfo (line 135) | public abstract void SetConnectionInfo(IPAddress addr, int port);
    method SetNegotiate (line 137) | public abstract void SetNegotiate(bool negotiate);
    method Attach (line 139) | public abstract bool Attach(int pid);
    method Close (line 141) | public abstract void Close();
    method SetTitleStr (line 143) | public abstract void SetTitleStr(string str);
    method OnMessage (line 145) | public abstract bool OnMessage(MainForm razor, uint wParam, int lParam);
    method OnCopyData (line 147) | public abstract bool OnCopyData(IntPtr wparam, IntPtr lparam);
    method SendToServer (line 149) | public abstract void SendToServer(Packet p);
    method SendToServer (line 151) | public abstract void SendToServer(PacketReader pr);
    method SendToClient (line 153) | public abstract void SendToClient(Packet p);
    method SendPacketToClient (line 154) | public abstract void SendPacketToClient(byte[] packet, int length);
    method ForceSendToClient (line 156) | public abstract void ForceSendToClient(Packet p);
    method ForceSendToServer (line 158) | public abstract void ForceSendToServer(Packet p);
    method SetPosition (line 160) | public abstract void SetPosition(uint x, uint y, uint z, byte dir);
    method GetClientVersion (line 162) | public abstract string GetClientVersion();
    method GetUoFilePath (line 164) | public abstract string GetUoFilePath();
    method GetWindowHandle (line 166) | public abstract IntPtr GetWindowHandle();
    method TotalDataIn (line 168) | public abstract uint TotalDataIn();
    method TotalDataOut (line 170) | public abstract uint TotalDataOut();
    method RequestMove (line 171) | internal abstract void RequestMove(Direction m_Dir);
    method RequestTitlebarUpdate (line 174) | public void RequestTitlebarUpdate()
    class TitleBarThrottle (line 184) | private class TitleBarThrottle : Timer
      method TitleBarThrottle (line 186) | public TitleBarThrottle() : base(TimeSpan.FromSeconds(0.25))
      method OnTick (line 190) | protected override void OnTick()
    method ResetTitleBarBuilder (line 200) | public void ResetTitleBarBuilder()
    method UpdateTitleBar (line 207) | public virtual void UpdateTitleBar()
    method MakePacketFrom (line 309) | public Packet MakePacketFrom(PacketReader pr)

FILE: Razor/Client/OSI.cs
  class OSIClient (line 34) | public unsafe class OSIClient : Client
    type UONetMessage (line 36) | public enum UONetMessage
    type UONetMessageCopyData (line 59) | public enum UONetMessageCopyData
    type InitError (line 64) | private enum InitError
    type Buffer (line 81) | [StructLayout(LayoutKind.Explicit, Size = 8 + SHARED_BUFF_SIZE)]
    method InstallLibrary (line 89) | [DllImport("Crypt.dll")]
    method Shutdown (line 92) | [DllImport("Crypt.dll")]
    method FindUOWindow (line 95) | [DllImport("Crypt.dll")]
    method GetSharedAddress (line 98) | [DllImport("Crypt.dll")]
    method GetCommMutex (line 101) | [DllImport("Crypt.dll")]
    method TotalIn (line 104) | [DllImport("Crypt.dll")]
    method TotalOut (line 107) | [DllImport("Crypt.dll")]
    method WaitForWindow (line 110) | [DllImport("Crypt.dll")]
    method SetDataPath (line 113) | [DllImport("Crypt.dll")]
    method CalibratePosition (line 116) | [DllImport("Crypt.dll")]
    method SetServer (line 119) | [DllImport("Crypt.dll")]
    method GetUOVersion (line 122) | [DllImport("Crypt.dll")]
    method Load (line 125) | [DllImport("Loader.dll")]
    method SetMapWndHandle (line 178) | public override void SetMapWndHandle(Form mapWnd)
    method RequestStatbarPatch (line 183) | public override void RequestStatbarPatch(bool preAOS)
    method SetCustomNotoHue (line 189) | public override void SetCustomNotoHue(int hue)
    method SetSmartCPU (line 194) | public override void SetSmartCPU(bool enabled)
    method SetGameSize (line 209) | public override void SetGameSize(int x, int y)
    method LaunchClient (line 215) | public override Loader_Error LaunchClient(string client)
    method InstallHooks (line 255) | public override bool InstallHooks(IntPtr mainWindow)
    method SetConnectionInfo (line 288) | public override void SetConnectionInfo(IPAddress addr, int port)
    method SetNegotiate (line 296) | public override void SetNegotiate(bool negotiate)
    method Attach (line 302) | public override bool Attach(int pid)
    method Close (line 309) | public override void Close()
    method EncodeColorStat (line 317) | private string EncodeColorStat(int val, int max)
    method UpdateTitleBar (line 330) | public override void UpdateTitleBar()
    method SetTitleStr (line 387) | public override void SetTitleStr(string str)
    method FatalInit (line 411) | private void FatalInit(InitError error)
    method OnLogout (line 421) | private void OnLogout(bool fake)
    method OnMessage (line 460) | public override bool OnMessage(MainForm razor, uint wParam, int lParam)
    type CopyData (line 647) | [StructLayout(LayoutKind.Sequential, Pack = 1)]
    type Position (line 655) | [StructLayout(LayoutKind.Sequential, Pack = 1)]
    method OnCopyData (line 663) | public override bool OnCopyData(IntPtr wparam, IntPtr lparam)
    method SendToServer (line 688) | public override void SendToServer(Packet p)
    method SendToServer (line 703) | public override void SendToServer(PacketReader pr)
    method SendToClient (line 711) | public override void SendToClient(Packet p)
    method SendPacketToClient (line 726) | public override void SendPacketToClient(byte[] packet, int length)
    method ForceSendToClient (line 731) | public override void ForceSendToClient(Packet p)
    method ForceSendToServer (line 745) | public override void ForceSendToServer(Packet p)
    method InitSendFlush (line 763) | private void InitSendFlush()
    method CopyToBuffer (line 769) | private void CopyToBuffer(Buffer* buffer, byte* data, int len)
    method HandleComm (line 778) | private void HandleComm(Buffer* inBuff, Buffer* outBuff, Queue<Packet>...
    method OnRecv (line 872) | private void OnRecv()
    method OnSend (line 879) | private void OnSend()
    method SetPosition (line 886) | public override void SetPosition(uint x, uint y, uint z, byte dir)
    method KeyPress (line 893) | public void KeyPress(int keyCode)
    method GetClientVersion (line 898) | public override string GetClientVersion()
    method GetUoFilePath (line 903) | public override string GetUoFilePath()
    method GetWindowHandle (line 908) | public override IntPtr GetWindowHandle()
    method TotalDataIn (line 913) | public override uint TotalDataIn()
    method TotalDataOut (line 918) | public override uint TotalDataOut()
    type KeyboardDir (line 923) | private enum KeyboardDir
    method RequestMove (line 935) | internal override void RequestMove(Direction m_Dir)

FILE: Razor/Client/UOAssist.cs
  class UOAssist (line 27) | public unsafe sealed class UOAssist
    type UOAMessage (line 31) | public enum UOAMessage
    class WndCmd (line 73) | private class WndCmd
      method WndCmd (line 75) | public WndCmd(uint msg, IntPtr handle, string cmd)
      method MyCallback (line 85) | private void MyCallback(string[] args)
    class WndRegEnt (line 103) | private class WndRegEnt
      method WndRegEnt (line 118) | public WndRegEnt(int hWnd, int type)
    method UOAssist (line 133) | static UOAssist()
    method OnUOAMessage (line 138) | public static int OnUOAMessage(MainForm razor, int Msg, int wParam, in...
    method PostCounterUpdate (line 341) | public static void PostCounterUpdate(int counter, int count)
    method PostSpellCast (line 346) | public static void PostSpellCast(int spell)
    method PostLogin (line 351) | public static void PostLogin(int serial)
    method PostLogout (line 356) | public static void PostLogout()
    method PostMacroStop (line 363) | public static void PostMacroStop()
    method PostMapChange (line 368) | public static void PostMapChange(int map)
    method PostSkillUpdate (line 373) | public static void PostSkillUpdate(int skill, int val)
    method PostRemoveMulti (line 380) | public static void PostRemoveMulti(Item item)
    method PostAddMulti (line 398) | public static void PostAddMulti(ItemID iid, Point3D Position)
    method PostHitsUpdate (line 413) | public static void PostHitsUpdate()
    method PostManaUpdate (line 419) | public static void PostManaUpdate()
    method PostStamUpdate (line 425) | public static void PostStamUpdate()
    method PostToWndReg (line 431) | private static void PostToWndReg(uint Msg, IntPtr wParam, IntPtr lParam)
    method PostMessage (line 451) | [DllImport("user32.dll")]
    method GlobalAddAtom (line 454) | [DllImport("kernel32.dll")]
    method GlobalDeleteAtom (line 457) | [DllImport("kernel32.dll")]
    method GlobalGetAtomName (line 460) | [DllImport("kernel32.dll")]

FILE: Razor/Core/ActionQueue.cs
  class DragDropManager (line 29) | public class DragDropManager
    type ProcStatus (line 31) | public enum ProcStatus
    method Log (line 41) | private static void Log(string str, params object[] args)
    class LiftReq (line 61) | private class LiftReq
      method LiftReq (line 65) | public LiftReq(Serial s, int a, bool cli, bool last)
      method ToString (line 80) | public override string ToString()
    class DropReq (line 86) | private class DropReq
      method DropReq (line 88) | public DropReq(Serial s, Point3D pt)
      method DropReq (line 94) | public DropReq(Serial s, Layer layer)
    method Initialize (line 105) | public static void Initialize()
    method DropCurrent (line 118) | public static void DropCurrent()
    method Clear (line 166) | public static void Clear()
    method DragDrop (line 179) | public static void DragDrop(Item i, Serial to)
    method DragDrop (line 185) | public static void DragDrop(Item i, Item to)
    method DragDrop (line 191) | public static void DragDrop(Item i, Point3D dest)
    method DragDrop (line 197) | public static void DragDrop(Item i, int amount, Item to)
    method DragDrop (line 203) | public static void DragDrop(Item i, Mobile to, Layer layer, bool doLast)
    method DragDrop (line 209) | public static void DragDrop(Item i, Mobile to, Layer layer)
    method Drag (line 215) | public static int Drag(Item i, int amount, bool fromClient)
    method Drag (line 220) | public static int Drag(Item i, int amount)
    method Drag (line 235) | public static int Drag(Item i, int amount, bool fromClient, bool doLast)
    method Drop (line 277) | public static bool Drop(Item i, Mobile to, Layer layer)
    method Drop (line 320) | public static bool Drop(Item i, Serial dest, Point3D pt)
    method Drop (line 363) | public static bool Drop(Item i, Item to, Point3D pt)
    method Drop (line 368) | public static bool Drop(Item i, Item to)
    method LiftReject (line 373) | public static bool LiftReject()
    method HasDragFor (line 386) | public static bool HasDragFor(Serial s)
    method CancelDragFor (line 397) | public static bool CancelDragFor(Serial s)
    method EndHolding (line 435) | public static bool EndHolding(Serial s)
    method DequeueDropFor (line 449) | private static DropReq DequeueDropFor(Serial s)
    method GracefulStop (line 463) | public static void GracefulStop()
    method ProcessNext (line 475) | public static ProcStatus ProcessNext(int numPending)
  class ActionQueue (line 573) | public class ActionQueue
    method DoubleClick (line 580) | public static void DoubleClick(bool silent, Serial s)
    method SignalLift (line 601) | public static void SignalLift(bool silent)
    method Stop (line 611) | public static void Stop()
    class ProcTimer (line 655) | private class ProcTimer : Timer
      method ProcTimer (line 665) | public ProcTimer() : base(TimeSpan.Zero, TimeSpan.Zero)
      method StartMe (line 669) | public void StartMe()
      method OnTick (line 681) | protected override void OnTick()

FILE: Razor/Core/BandageTimer.cs
  class BandageTimer (line 24) | public class BandageTimer
    method BandageTimer (line 56) | static BandageTimer()
    method OnSystemMessage (line 63) | private static void OnSystemMessage(Packet p, PacketHandlerEventArgs a...
    method OnLocalizedMessage (line 115) | public static void OnLocalizedMessage(int num)
    method Start (line 156) | private static void Start()
    method Stop (line 169) | public static void Stop()
    method ShowBandagingStatusMessage (line 175) | private static void ShowBandagingStatusMessage(string msg)
    class InternalTimer (line 187) | private class InternalTimer : Timer
      method InternalTimer (line 189) | public InternalTimer() : base(TimeSpan.FromSeconds(1), TimeSpan.From...
      method OnTick (line 193) | protected override void OnTick()

FILE: Razor/Core/BodCapture.cs
  class BodCapture (line 25) | public class BodCapture
    class Bod (line 27) | private class Bod
    method IsBodGump (line 42) | public static bool IsBodGump(uint gumpId)
    method CaptureBod (line 47) | public static void CaptureBod(List<string> bodGumpString)
    method CheckFile (line 64) | public static void CheckFile()
    method ParseBodGumpData (line 111) | private static List<Bod> ParseBodGumpData(List<string> gumpData)

FILE: Razor/Core/BuffDebuffManager.cs
  type BuffIconType (line 29) | public enum BuffIconType : ushort
  class BuffDebuff (line 221) | public class BuffDebuff
    method ToString (line 230) | public override string ToString()
  class BuffDebuffManager (line 236) | public static class BuffDebuffManager
    method IsBuff (line 473) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
    method IsDebuff (line 479) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
    method IsState (line 485) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
    method IsValid (line 491) | [MethodImpl(MethodImplOptions.AggressiveInlining)]
    method GetGraphicId (line 500) | public static ushort GetGraphicId(string name)
    method DisplayOverheadBuff (line 521) | public static void DisplayOverheadBuff(BuffDebuff buff, bool ignoreAct...
    method DisplayOverheadDebuff (line 547) | public static void DisplayOverheadDebuff(BuffIconType debuffIconType)
    method ReloadFilter (line 579) | public static void ReloadFilter()
    method IsFiltered (line 592) | private static bool IsFiltered(string name)
    method Start (line 611) | public static void Start()
    method Stop (line 621) | public static void Stop()
    class InternalTimer (line 630) | private class InternalTimer : Timer
      method InternalTimer (line 632) | public InternalTimer() : base(TimeSpan.FromSeconds(1), TimeSpan.From...
      method OnTick (line 636) | protected override void OnTick()

FILE: Razor/Core/ClassicUOManager.cs
  class ClassicUOManager (line 28) | public static class ClassicUOManager
    method GetAllProperties (line 36) | public static List<string> GetAllProperties()
    method IsValidProperty (line 71) | public static string IsValidProperty(string property)
    method ProfilePropertySet (line 87) | public static void ProfilePropertySet(string propertyName, bool enable)
    method ProfilePropertySet (line 121) | public static void ProfilePropertySet(string propertyName, int value)
    method ProfilePropertySet (line 155) | public static void ProfilePropertySet(string propertyName, string value)

FILE: Razor/Core/Commands.cs
  class Commands (line 33) | public class Commands
    method Initialize (line 35) | public static void Initialize()
    method Cooldown (line 79) | private static void Cooldown(string[] param)
    method PlaySound (line 116) | private static void PlaySound(string[] param)
    method ClassicUoProfile (line 127) | private static void ClassicUoProfile(string[] param)
    method ShowBuyGump (line 180) | private static void ShowBuyGump(string[] param)
    method ShowOrgGump (line 210) | private static void ShowOrgGump(string[] param)
    method ShowRestockGump (line 240) | private static void ShowRestockGump(string[] param)
    method ShowUsableSkills (line 270) | private static void ShowUsableSkills(string[] param)
    method GetSystemMessages (line 275) | private static void GetSystemMessages(string[] param)
    method ShowHotKeyGump (line 281) | private static void ShowHotKeyGump(string[] param)
    method ShowBoatControlGump (line 287) | private static void ShowBoatControlGump(string[] param)
    method CreateGump (line 293) | private static void CreateGump(string[] param)
    method Resync (line 308) | private static void Resync(string[] param)
    method DamageTrackerReport (line 321) | private static void DamageTrackerReport(string[] param)
    method Track (line 327) | private static void Track(string[] param)
    method SetMacroVariable (line 352) | private static void SetMacroVariable(string[] param)
    method OnMacroVariableAddTarget (line 369) | private static void OnMacroVariableAddTarget(bool ground, Serial seria...
    method SetWeather (line 409) | private static void SetWeather(string[] param)
    method SetSeason (line 417) | private static void SetSeason(string[] param)
    method GetGumpInfo (line 425) | private static void GetGumpInfo(string[] param)
    method GetItemHue (line 430) | private static void GetItemHue(string[] param)
    method OnGetItemHueTarget (line 437) | private static void OnGetItemHueTarget(bool ground, Serial serial, Poi...
    method GetMobile (line 448) | private static void GetMobile(string[] param)
    method Echo (line 453) | private static void Echo(string[] param)
    method AddUseOnce (line 462) | private static void AddUseOnce(string[] param)
    method Time (line 476) | private static void Time(string[] param)
    method Where (line 482) | private static void Where(string[] param)
    method Ping (line 513) | private static void Ping(string[] param)
    method MacroCmd (line 525) | private static void MacroCmd(string[] param)
    method ScriptCmd (line 545) | private static void ScriptCmd(string[] param)
  class Command (line 561) | public class Command
    method Command (line 567) | static Command()
    method ListCommands (line 573) | public static void ListCommands(string[] param)
    method Register (line 586) | public static void Register(string cmd, CommandCallback callback)
    method FindCommand (line 591) | public static CommandCallback FindCommand(string cmd)
    method RemoveCommand (line 596) | public static void RemoveCommand(string cmd)
    method OnSpeech (line 606) | public static void OnSpeech(Packet pvSrc, PacketHandlerEventArgs args)

FILE: Razor/Core/ContainerLabels.cs
  class ContainerLabels (line 25) | public class ContainerLabels
    class ContainerLabel (line 27) | public class ContainerLabel
    method Save (line 40) | public static void Save(XmlTextWriter xml)
    method Load (line 54) | public static void Load(XmlElement node)
    method HandleLabelMessage (line 82) | private static void HandleLabelMessage(Packet p, PacketHandlerEventArg...
    method ClearAll (line 126) | public static void ClearAll()

FILE: Razor/Core/CooldownManager.cs
  class CooldownManager (line 29) | public static class CooldownManager
    method Initialize (line 36) | public static void Initialize()
    method Start (line 44) | public static void Start()
    method Stop (line 54) | public static void Stop()
    class InternalTimer (line 65) | private class InternalTimer : Timer
      method InternalTimer (line 67) | public InternalTimer() : base(TimeSpan.FromSeconds(0), TimeSpan.From...
      method OnTick (line 71) | protected override void OnTick()
    method AddCooldown (line 91) | public static void AddCooldown(Cooldown cooldown)
    method AddCooldown (line 101) | public static void AddCooldown(string name, int seconds, int hue = 0, ...
    method RemoveExpired (line 120) | public static void RemoveExpired()
  class Cooldown (line 146) | public class Cooldown

FILE: Razor/Core/Counters.cs
  class CounterLVIComparer (line 30) | public class CounterLVIComparer : IComparer
    method CounterLVIComparer (line 44) | public CounterLVIComparer()
    method Compare (line 48) | public int Compare(object a, object b)
  class ItemCountCache (line 54) | public class ItemCountCache
    method Add (line 58) | public long Add(Item item)
    method Remove (line 73) | public long Remove(Item item)
    method Reset (line 86) | public void Reset()
  type CounterID (line 92) | public struct CounterID
    method CounterID (line 94) | public CounterID(ItemID itemID, ushort hue = 0xFFFF)
  class CounterChangeSet (line 104) | public class CounterChangeSet
    method AddValue (line 108) | private void AddValue(CounterID id, long diff)
    method Add (line 125) | public void Add(CounterChangeSet other)
    method Add (line 133) | public void Add(Item item, long diff)
    method Reset (line 139) | public void Reset()
  class ItemChangeTracker (line 145) | public class ItemChangeTracker
    method Add (line 149) | public void Add(Item item, ref CounterChangeSet changes)
    method Remove (line 158) | public void Remove(Item item, ref CounterChangeSet changes)
    method Reset (line 167) | public void Reset()
  class RecursiveItemChangeTracker (line 173) | public class RecursiveItemChangeTracker
    method Add (line 177) | public void Add(Item item, ref CounterChangeSet changes)
    method Remove (line 187) | public void Remove(Item item, ref CounterChangeSet changes)
    method Reset (line 197) | public void Reset()
  class ItemTypeCounter (line 203) | public class ItemTypeCounter
    method Count (line 208) | public CounterChangeSet Count(Item item)
    method Uncount (line 216) | public CounterChangeSet Uncount(Item item)
    method GetValue (line 224) | public ulong GetValue(ItemID itemID, ushort hue)
    method GetValue (line 229) | public ulong GetValue(CounterID id)
    method Reset (line 239) | public void Reset()
  class Counter (line 246) | public class Counter : IComparable
    method Counter (line 259) | public Counter(string name, string fmt, ushort iid, int hue, bool disp...
    method Counter (line 275) | public Counter(XmlElement node)
    method Save (line 289) | public void Save(XmlTextWriter xml)
    method Set (line 343) | public void Set(ushort iid, int hue, string name, string fmt, bool dis...
    method GetTitlebarString (line 355) | public string GetTitlebarString(bool dispImg, bool dispColor)
    method GetCount (line 388) | public static int GetCount(ItemID itemID, int hue)
    method FindCounter (line 394) | public static Counter FindCounter(string name)
    method OnUpdate (line 407) | private void OnUpdate()
    method SetEnabled (line 473) | public void SetEnabled(bool value)
    method CompareTo (line 507) | public int CompareTo(object comp)
    method ToString (line 523) | public override string ToString()
    method Counter (line 538) | static Counter()
    method Load (line 555) | private static void Load()
    method Save (line 582) | public static void Save()
    method SaveProfile (line 616) | public static void SaveProfile(XmlTextWriter xml)
    method Default (line 632) | public static void Default()
    method DisableAll (line 647) | public static void DisableAll()
    method LoadProfile (line 653) | public static void LoadProfile(XmlElement xml)
    method GetText (line 695) | private static string GetText(XmlElement node, string defaultValue)
    method GetInt (line 703) | private static int GetInt(string value, int def)
    method Register (line 722) | public static void Register(Counter c)
    method OnCountsChanged (line 729) | private static void OnCountsChanged(CounterChangeSet changes)
    method Uncount (line 740) | public static void Uncount(Item item)
    method Count (line 746) | public static void Count(Item item)
    method QuickRecount (line 752) | public static void QuickRecount()
    method FullRecount (line 766) | public static void FullRecount()
    method Reset (line 798) | public static void Reset()
    method Redraw (line 810) | public static void Redraw(ListView list)

FILE: Razor/Core/DamageTracker.cs
  class DamageTracker (line 28) | public class DamageTracker
    method DamageTracker (line 47) | static DamageTracker()
    method Start (line 55) | public static void Start()
    method Stop (line 78) | public static void Stop()
    method SendReport (line 94) | public static void SendReport()
    method GetTotalDamageList (line 125) | public static List<KeyValuePair<string, int>> GetTotalDamageList()
    class InternalTimer (line 134) | private class InternalTimer : Timer
      method InternalTimer (line 138) | public InternalTimer() : base(TimeSpan.FromSeconds(1), TimeSpan.From...
      method OnTick (line 142) | protected override void OnTick()
    method AddDamage (line 173) | public static void AddDamage(uint serial, ushort damage)

FILE: Razor/Core/Dress.cs
  class Dress (line 21) | public static class Dress
    method ToggleRight (line 25) | public static void ToggleRight()
    method ToggleLeft (line 59) | public static void ToggleLeft()
    method Equip (line 92) | public static bool Equip(Item item, Layer layer)
    method Unequip (line 107) | public static bool Unequip(Layer layer)

FILE: Razor/Core/DressList.cs
  class DressList (line 28) | public class DressList
    method SetControls (line 34) | public static void SetControls(ListBox dressList, ListBox dressItems)
    method Redraw (line 40) | public static void Redraw()
    method ClearAll (line 48) | public static void ClearAll()
    method Find (line 57) | public static DressList Find(string name)
    method FindUndressBag (line 69) | public static Item FindUndressBag(Item item)
    method Load (line 93) | public static void Load(XmlElement xml)
    method Save (line 143) | public static void Save(XmlTextWriter xml)
    method Add (line 167) | public static void Add(DressList list)
    method Remove (line 194) | public static void Remove(DressList list)
    method DressList (line 217) | public DressList(string name)
    method DressList (line 224) | public DressList(XmlElement xml)
    method ToString (line 229) | public override string ToString()
    method SetUndressBag (line 237) | public void SetUndressBag(Serial serial)
    method Toggle (line 245) | public void Toggle()
    method Undress (line 283) | public void Undress()
    method GetLayerFor (line 335) | public static Layer GetLayerFor(Item item)
    method Dress (line 344) | public void Dress()

FILE: Razor/Core/EncodedSpeech.cs
  class EncodedSpeech (line 26) | public class EncodedSpeech
    class SpeechEntry (line 28) | internal class SpeechEntry : IComparable<SpeechEntry>
      method SpeechEntry (line 33) | internal SpeechEntry(int idKeyword, string keyword)
      method CompareTo (line 39) | public int CompareTo(SpeechEntry entry)
    method LoadSpeechTable (line 64) | internal static unsafe void LoadSpeechTable()
    method GetKeywords (line 95) | internal static List<ushort> GetKeywords(string text)
    method IsMatch (line 150) | private static bool IsMatch(string input, string[] split)

FILE: Razor/Core/FriendsManager.cs
  class FriendsManager (line 29) | public static class FriendsManager
    method SetControls (line 36) | public static void SetControls(ComboBox friendsGroup, ListBox friendsL...
    method OnTargetAddFriend (line 42) | public static void OnTargetAddFriend(FriendGroup group)
    class Friend (line 48) | public class Friend
      method ToString (line 53) | public override string ToString()
    class FriendGroup (line 59) | public class FriendGroup
      method FriendGroup (line 69) | public FriendGroup()
      method AddHotKeys (line 74) | public void AddHotKeys()
      method RemoveHotKeys (line 99) | public void RemoveHotKeys()
      method AddFriendToGroup (line 120) | public void AddFriendToGroup()
      method ToggleFriendGroup (line 126) | private void ToggleFriendGroup()
      method ToString (line 142) | public override string ToString()
      method OnAddFriendTarget (line 147) | public void OnAddFriendTarget(bool location, Serial serial, Point3D ...
      method AddFriend (line 170) | public bool AddFriend(string friendName, Serial friendSerial)
      method AddAllMobileAsFriends (line 195) | public void AddAllMobileAsFriends()
      method AddAllHumanoidsAsFriends (line 212) | public void AddAllHumanoidsAsFriends()
    method IsFriendOverhead (line 231) | public static bool IsFriendOverhead(Serial serial, ref FriendGroup group)
    method IsFriend (line 251) | public static bool IsFriend(Serial serial)
    method EnableFriendsGroup (line 269) | public static void EnableFriendsGroup(FriendGroup group, bool enabled)
    method FriendsGroupExists (line 281) | public static bool FriendsGroupExists(string group)
    method IsFriendsGroupEnabled (line 294) | public static bool IsFriendsGroupEnabled(FriendGroup group)
    method RemoveFriend (line 307) | public static bool RemoveFriend(FriendGroup group, int index)
    method ClearFriendGroup (line 324) | public static void ClearFriendGroup(string group)
    method DeleteFriendGroup (line 336) | public static bool DeleteFriendGroup(FriendGroup group)
    method AddFriendGroup (line 349) | public static void AddFriendGroup(string group)
    method SetOverheadFormat (line 368) | public static void SetOverheadFormat(FriendGroup group, string format)
    method SetOverheadHue (line 380) | public static void SetOverheadHue(FriendGroup group, int hue)
    method SetOverheadFormatEnabled (line 392) | public static void SetOverheadFormatEnabled(FriendGroup group, bool en...
    method ShowOverhead (line 404) | public static void ShowOverhead(Mobile mobile)
    method Save (line 421) | public static void Save(XmlTextWriter xml)
    method Load (line 444) | public static void Load(XmlElement node)
    method ClearAll (line 504) | public static void ClearAll()
    method RedrawAll (line 514) | private static void RedrawAll()
    method RedrawGroup (line 528) | public static void RedrawGroup()
    method RedrawList (line 549) | public static void RedrawList(FriendGroup group)

FILE: Razor/Core/GateTimer.cs
  class GateTimer (line 25) | public class GateTimer
    method GateTimer (line 34) | static GateTimer()
    method OnSystemMessage (line 46) | private static void OnSystemMessage(Packet p, PacketHandlerEventArgs a...
    method Start (line 69) | public static void Start()
    method Stop (line 82) | public static void Stop()
    class InternalTimer (line 88) | private class InternalTimer : Timer
      method InternalTimer (line 90) | public InternalTimer() : base(TimeSpan.FromSeconds(1), TimeSpan.From...
      method OnTick (line 94) | protected override void OnTick()

FILE: Razor/Core/Geometry.cs
  type IPoint2D (line 23) | public interface IPoint2D
  type IPoint3D (line 29) | public interface IPoint3D : IPoint2D
  type Point2D (line 34) | public struct Point2D : IPoint2D
    method Point2D (line 42) | public Point2D(int x, int y)
    method Point2D (line 48) | public Point2D(IPoint2D p) : this(p.X, p.Y)
    method ToString (line 64) | public override string ToString()
    method Equals (line 69) | public override bool Equals(object o)
    method GetHashCode (line 78) | public override int GetHashCode()
  type Point3D (line 164) | public struct Point3D : IPoint3D
    method Point3D (line 173) | public Point3D(int x, int y, int z)
    method Point3D (line 180) | public Point3D(IPoint3D p) : this(p.X, p.Y, p.Z)
    method Point3D (line 184) | public Point3D(IPoint2D p, int z) : this(p.X, p.Y, z)
    method ToString (line 206) | public override string ToString()
    method Equals (line 211) | public override bool Equals(object o)
    method GetHashCode (line 220) | public override int GetHashCode()
    method Parse (line 225) | public static Point3D Parse(string value)
  type Line2D (line 276) | public struct Line2D
    method Line2D (line 280) | public Line2D(IPoint2D start, IPoint2D end)
    method Fix (line 287) | public void Fix()
    method ToString (line 328) | public override string ToString()
    method Equals (line 333) | public override bool Equals(object o)
    method GetHashCode (line 342) | public override int GetHashCode()
  type Rectangle2D (line 378) | public struct Rectangle2D
    method Rectangle2D (line 383) | public Rectangle2D(IPoint2D start, IPoint2D end)
    method Rectangle2D (line 389) | public Rectangle2D(int x, int y, int width, int height)
    method Set (line 395) | public void Set(int x, int y, int width, int height)
    method Parse (line 401) | public static Rectangle2D Parse(string value)
    method MakeHold (line 463) | public void MakeHold(Rectangle2D r)
    method Insersects (line 479) | public bool Insersects(Rectangle2D test)
    method Contains (line 487) | public bool Contains(Rectangle2D test)
    method Contains (line 495) | public bool Contains(Point3D p)
    method Contains (line 501) | public bool Contains(Point2D p)
    method Contains (line 507) | public bool Contains(IPoint2D p)
    method ToString (line 512) | public override string ToString()

FILE: Razor/Core/GoldPerHourTimer.cs
  class GoldPerHourTimer (line 23) | public class GoldPerHourTimer
    method GoldPerHourTimer (line 36) | static GoldPerHourTimer()
    method Start (line 49) | public static void Start()
    method Stop (line 66) | public static void Stop()
    class InternalTimer (line 72) | private class InternalTimer : Timer
      method InternalTimer (line 74) | public InternalTimer() : base(TimeSpan.FromSeconds(1), TimeSpan.From...
      method OnTick (line 78) | protected override void OnTick()

FILE: Razor/Core/Item.cs
  type Layer (line 27) | public enum Layer : byte
  class Item (line 69) | public class Item : UOEntity
    method AfterLoad (line 93) | public override void AfterLoad()
    method Item (line 117) | public Item(Serial serial) : base(serial)
    method FindItemById (line 199) | public Item FindItemById(ItemID id)
    method FindItemsById (line 204) | public List<Item> FindItemsById(ItemID id)
    method FindItemById (line 209) | public Item FindItemById(ItemID id, bool recurse)
    method FindItemsById (line 230) | public List<Item> FindItemsById(ItemID id, bool recurse)
    method FindItemByName (line 256) | public Item FindItemByName(string name, bool recurse)
    method FindItemsByName (line 278) | public List<Item> FindItemsByName(string name, bool recurse)
    method GetCount (line 302) | public int GetCount(ushort iid)
    method GetTotalCount (line 319) | public int GetTotalCount()
    method UpdateContainer (line 373) | public bool UpdateContainer()
    method UpdateContainers (line 433) | public static void UpdateContainers()
    method AutoStackResource (line 447) | public void AutoStackResource()
    method IsChildOf (line 480) | public bool IsChildOf(object parent)
    method GetWorldPosition (line 503) | public Point3D GetWorldPosition()
    method AddItem (line 518) | private void AddItem(Item item)
    method RemoveItem (line 529) | private void RemoveItem(Item item)
    method GetPacketFlags (line 534) | public byte GetPacketFlags()
    method DistanceTo (line 551) | public int DistanceTo(Mobile m)
    method ProcessPacketFlags (line 559) | public void ProcessPacketFlags(byte flags)
    method RemoveRequest (line 567) | public void RemoveRequest()
    method CancelRemove (line 577) | public bool CancelRemove()
    method Remove (line 590) | public override void Remove()
    method ToString (line 762) | public override string ToString()
    method MakeHousePacket (line 791) | public void MakeHousePacket()

FILE: Razor/Core/ItemID.cs
  type ItemID (line 23) | public struct ItemID
    method ItemID (line 27) | public ItemID(ushort id)
    method ToString (line 47) | public override string ToString()
    method GetHashCode (line 74) | public override int GetHashCode()
    method Equals (line 79) | public override bool Equals(object o)

FILE: Razor/Core/Main.cs
  class Engine (line 33) | public partial class Engine
    method CurrentDomain_UnhandledException (line 35) | private static void CurrentDomain_UnhandledException(object sender, Un...
    method LogCrash (line 49) | public static void LogCrash(object exception)
    method Load (line 252) | public static void Load()
    method Close (line 340) | public static void Close()
    method RunUI (line 350) | public static void RunUI()
    method Main (line 359) | [STAThread]
    method EnsureDirectory (line 424) | public static void EnsureDirectory(string dir)
    method Initialize (line 430) | private static void Initialize(Assembly a)
    method Resolve (line 445) | private static IPAddress Resolve(string addr)

FILE: Razor/Core/Map.cs
  class MultiTileEntry (line 24) | public class MultiTileEntry
  class Map (line 32) | public class Map
    method GetMap (line 34) | public static Ultima.Map GetMap(int mapNum)
    method Parse (line 48) | public static int Parse(string name)
    method GetTileNear (line 69) | public static HuedTile GetTileNear(int mapNum, int x, int y, int z)
    method GetAverageZ (line 92) | private static void GetAverageZ(Ultima.Map map, int x, int y, ref int ...
    method ZTop (line 127) | public static sbyte ZTop(int mapNum, int xCheck, int yCheck, int oldZ)

FILE: Razor/Core/MemHelper.cs
  class MemoryHelperThinggie (line 23) | public class MemoryHelperThinggie : Timer
    method Initialize (line 29) | public static void Initialize()
    method MemoryHelperThinggie (line 35) | private MemoryHelperThinggie() : base(TimeSpan.Zero, Frequency)
    method SetProcessWorkingSetSize (line 39) | [System.Runtime.InteropServices.DllImport("Kernel32")]
    method OnTick (line 42) | protected override void OnTick()

FILE: Razor/Core/MessageInBottleCapture.cs
  class MessageInBottleCapture (line 25) | public class MessageInBottleCapture
    method IsMibGump (line 33) | public static bool IsMibGump(string layout)
    method CaptureMibCoordinates (line 39) | public static void CaptureMibCoordinates(string coords, bool hasXY)
    method ConvertCoords (line 75) | private static void ConvertCoords(string coords, ref int xAxis, ref in...

FILE: Razor/Core/MessageManager.cs
  class MessageManager (line 27) | public static class MessageManager
    method Initialize (line 36) | public static void Initialize()
    method HandleMessage (line 41) | public static void HandleMessage(Packet p, PacketHandlerEventArgs args...
    method HandleMobileMessage (line 117) | public static void HandleMobileMessage(Packet p, PacketHandlerEventArg...

FILE: Razor/Core/Mobile.cs
  type Direction (line 28) | [Flags]
  class Mobile (line 54) | public class Mobile : UOEntity
    method AfterLoad (line 85) | public override void AfterLoad()
    method Mobile (line 99) | public Mobile(Serial serial) : base(serial)
    method ClilocConversion (line 131) | private static string ClilocConversion(string old)
    method OnNotoChange (line 286) | protected virtual void OnNotoChange(byte old, byte cur)
    method GetNotorietyColor (line 316) | public uint GetNotorietyColor()
    method GetNotorietyColorInt (line 324) | public int GetNotorietyColorInt()
    method GetStatusCode (line 332) | public byte GetStatusCode()
    method OnMapChange (line 390) | public virtual void OnMapChange(byte old, byte cur)
    method AddItem (line 394) | public void AddItem(Item item)
    method RemoveItem (line 399) | public void RemoveItem(Item item)
    method Remove (line 404) | public override void Remove()
    method GetItemOnLayer (line 428) | public Item GetItemOnLayer(Layer layer)
    method FindItemByID (line 458) | public Item FindItemByID(ItemID id)
    method OnPositionChanging (line 470) | public override void OnPositionChanging(Point3D oldPos)
    method OnDirectionChanging (line 478) | public virtual void OnDirectionChanging(Direction oldDir)
    method GetPacketFlags (line 482) | public int GetPacketFlags()
    method ProcessPacketFlags (line 516) | public void ProcessPacketFlags(byte flags)
    method OverheadMessageFrom (line 535) | internal void OverheadMessageFrom(int hue, string from, string format,...
    method OverheadMessageFrom (line 540) | internal void OverheadMessageFrom(int hue, string from, string text, b...
    method OverheadMessageFrom (line 561) | internal void OverheadMessageFrom(int hue, string from, string text)
    method OverheadMessage (line 568) | internal void OverheadMessage(string text)
    method OverheadMessage (line 573) | internal void OverheadMessage(string format, params object[] args)
    method OverheadMessage (line 578) | internal void OverheadMessage(int hue, string format, params object[] ...
    method OverheadMessage (line 583) | internal void OverheadMessage(int hue, string text)
    method OverheadMessage (line 588) | internal void OverheadMessage(LocString str)
    method OverheadMessage (line 593) | internal void OverheadMessage(LocString str, params object[] args)
    method ResetLayerHue (line 632) | internal void ResetLayerHue()
    method SetLayerHue (line 651) | internal void SetLayerHue(int hue)
    method SetMobileHue (line 666) | internal Packet SetMobileHue(Packet p, int hue)
    method WriteHueToPacket (line 676) | private static Packet WriteHueToPacket(Packet p, ushort color)

FILE: Razor/Core/MsgQueue.cs
  class MessageQueue (line 25) | public class MessageQueue
    class MsgInfo (line 27) | private class MsgInfo
      method MsgInfo (line 29) | public MsgInfo(Serial ser, Mobile m, ushort body, MessageType type, ...
    class MessageTimer (line 55) | private class MessageTimer : Timer
      method MessageTimer (line 57) | public MessageTimer() : base(TimeSpan.FromSeconds(0.1), TimeSpan.Fro...
      method OnTick (line 61) | protected override void OnTick()
    method MessageQueue (line 115) | static MessageQueue()
    method Enqueue (line 120) | public static bool Enqueue(Mobile m, int hue, string lang, string text)
    method Enqueue (line 125) | public static bool Enqueue(Serial ser, Mobile mobile, ushort body, Mes...

FILE: Razor/Core/ObjectPropertyList.cs
  class ObjectPropertyList (line 25) | public class ObjectPropertyList
    class OPLEntry (line 27) | private class OPLEntry
      method OPLEntry (line 32) | public OPLEntry(int num) : this(num, null)
      method OPLEntry (line 36) | public OPLEntry(int num, string args)
    method ObjectPropertyList (line 70) | public ObjectPropertyList(UOEntity owner)
    method Read (line 82) | public void Read(PacketReader p)
    method Add (line 133) | public void Add(int number)
    method AddHash (line 145) | public void AddHash(int val)
    method Add (line 151) | public void Add(int number, string arguments)
    method Add (line 160) | public void Add(int number, string format, object arg0)
    method Add (line 165) | public void Add(int number, string format, object arg0, object arg1)
    method Add (line 170) | public void Add(int number, string format, object arg0, object arg1, o...
    method Add (line 175) | public void Add(int number, string format, params object[] args)
    method GetStringNumber (line 193) | private int GetStringNumber()
    method Add (line 209) | public void Add(string text)
    method Add (line 214) | public void Add(string format, string arg0)
    method Add (line 219) | public void Add(string format, string arg0, string arg1)
    method Add (line 224) | public void Add(string format, string arg0, string arg1, string arg2)
    method Add (line 229) | public void Add(string format, params object[] args)
    method Remove (line 234) | public bool Remove(int number)
    method Remove (line 292) | public bool Remove(string str)
    method BuildPacket (line 343) | public Packet BuildPacket()
  class OPLInfo (line 422) | public class OPLInfo : Packet
    method OPLInfo (line 424) | public OPLInfo(Serial ser, int hash) : base(0xDC, 9)

FILE: Razor/Core/OverheadManager.cs
  class OverheadMessage (line 30) | public class OverheadMessage
  class OverheadManager (line 38) | public static class OverheadManager
    method SetControls (line 44) | public static void SetControls(ListView listView)
    method Save (line 49) | public static void Save(XmlTextWriter xml)
    method Load (line 62) | public static void Load(XmlElement node)
    method ClearAll (line 91) | public static void ClearAll()
    method Remove (line 96) | public static void Remove(string text)
    method RedrawList (line 108) | public static void RedrawList()
    method DisplayOverheadMessage (line 132) | public static void DisplayOverheadMessage(string text)
    method SetOverheadHue (line 166) | public static void SetOverheadHue()
    method GetHue (line 196) | public static int GetHue(string id)
    method SetOverheadSound (line 211) | public static void SetOverheadSound()

FILE: Razor/Core/Overrides.cs
  class Overrides (line 47) | public static class Overrides
    method Load (line 51) | public static void Load()

FILE: Razor/Core/PasswordMemory.cs
  class PasswordMemory (line 27) | public class PasswordMemory
    class Entry (line 29) | private class Entry
      method Entry (line 31) | public Entry()
      method Entry (line 35) | public Entry(string u, string p, IPAddress a)
    method Encrypt (line 49) | public static string Encrypt(string source)
    method Decrypt (line 68) | public static string Decrypt(string source)
    method Load (line 120) | public static void Load(XmlElement xml)
    method Save (line 145) | public static void Save(XmlTextWriter xml)
    method ClearAll (line 170) | public static void ClearAll()
    method Add (line 175) | public static void Add(string user, string pass, IPAddress addr)
    method Find (line 194) | public static string Find(string user, IPAddress addr)

FILE: Razor/Core/Ping.cs
  class Ping (line 23) | public class Ping
    method Response (line 31) | public static bool Response(byte seq)
    method StartPing (line 64) | public static void StartPing(int count)
    method DoPing (line 81) | private static void DoPing()

FILE: Razor/Core/Player.cs
  type LockType (line 32) | public enum LockType : byte
  type MsgLevel (line 39) | public enum MsgLevel
  class Skill (line 49) | public class Skill
    method Skill (line 58) | public Skill(int idx)
  type MaleSounds (line 121) | public enum MaleSounds
  type FemaleSounds (line 175) | public enum FemaleSounds
  class PlayerData (line 226) | public class PlayerData : Mobile
    method PlayerData (line 276) | public PlayerData(Serial serial) : base(serial)
    class DoorOpenTimer (line 452) | private class DoorOpenTimer : Timer
      method DoorOpenTimer (line 455) | public DoorOpenTimer() : base(TimeSpan.FromMilliseconds(5), 1)
      method OnTick (line 459) | protected override void OnTick()
    method AutoOpenDoors (line 467) | private void AutoOpenDoors(bool onDirChange)
    method OnPositionChanging (line 506) | public override void OnPositionChanging(Point3D oldPos)
    method OnDirectionChanging (line 552) | public override void OnDirectionChanging(Direction oldDir)
    method OnMapChange (line 557) | public override void OnMapChange(byte old, byte cur)
    method OnNotoChange (line 600) | protected override void OnNotoChange(byte old, byte cur)
    method ResetCriminalTimer (line 618) | public void ResetCriminalTimer()
    class CriminalTimer (line 630) | private class CriminalTimer : Timer
      method CriminalTimer (line 634) | public CriminalTimer(PlayerData player) : base(TimeSpan.FromSeconds(...
      method OnTick (line 639) | protected override void OnTick()
    method SendMessage (line 645) | internal void SendMessage(MsgLevel lvl, LocString loc, params object[]...
    method SendMessage (line 650) | internal void SendMessage(MsgLevel lvl, LocString loc)
    method SendMessage (line 655) | internal void SendMessage(LocString loc, params object[] args)
    method SendMessage (line 660) | internal void SendMessage(LocString loc)
    method SendMessage (line 665) | internal void SendMessage(int hue, string text)
    method SendMessage (line 671) | internal void SendMessage(MsgLevel lvl, string format, params object[]...
    method SendMessage (line 676) | internal void SendMessage(string format, params object[] args)
    method SendMessage (line 681) | internal void SendMessage(string text)
    method SendMessage (line 686) | internal void SendMessage(MsgLevel lvl, string text)
    method Say (line 721) | internal void Say(int hue, string msg)
    method Say (line 737) | internal void Say(string msg)
    method Whisper (line 742) | internal void Whisper(string msg, int hue)
    method Yell (line 748) | internal void Yell(string msg, int hue)
    method Emote (line 754) | internal void Emote(string msg, int hue)
    method Guild (line 762) | internal void Guild(string msg, int hue)
    method Alliance (line 768) | internal void Alliance(string msg, int hue)
    class GumpInfo (line 792) | public class GumpInfo
      method GumpInfo (line 816) | public GumpInfo(uint serial, uint gumpId, List<string> gumpContext)
      method GumpInfo (line 823) | public GumpInfo(uint serial, uint gumpId)
    method CancelPrompt (line 832) | public void CancelPrompt()
    method ResponsePrompt (line 839) | public void ResponsePrompt(string text)
    type SeasonFlag (line 868) | public enum SeasonFlag
    method SetSeason (line 893) | public void SetSeason(byte defaultSeason = 0)
    class SeasonTimer (line 914) | private class SeasonTimer : Timer
      method SeasonTimer (line 916) | public SeasonTimer() : base(TimeSpan.FromSeconds(3), TimeSpan.FromSe...
      method OnTick (line 920) | protected override void OnTick()
    method UseItem (line 966) | public bool UseItem(Item cont, ushort find)
    method DoubleClick (line 991) | public static bool DoubleClick(object clicked)
    method DoubleClick (line 996) | public static bool DoubleClick(object clicked, bool silent)
    type InvokeVirtues (line 1048) | public enum InvokeVirtues
    method InvokeVirtue (line 1055) | public static void InvokeVirtue(InvokeVirtues virtue)
    method RenameMobile (line 1060) | public static void RenameMobile(Serial serial, string newName)

FILE: Razor/Core/ScreenCapture.cs
  class ScreenCapManager (line 29) | public class ScreenCapManager
    method DeleteObject (line 31) | [System.Runtime.InteropServices.DllImport("Gdi32.dll")]
    method Initialize (line 38) | public static void Initialize()
    method DeathCapture (line 43) | public static void DeathCapture(double delay)
    method CaptureNow (line 48) | public static void CaptureNow()
    method GetFormat (line 117) | private static ImageFormat GetFormat(string fmt)
    method DisplayTo (line 140) | public static void DisplayTo(ListBox list)
    method AddFiles (line 161) | public static void AddFiles(ListBox list, string path, string ext)
    method CaptureWindow (line 172) | public static Image CaptureWindow(IntPtr handle)
    method CaptureWindowToFile (line 208) | public static void CaptureWindowToFile(IntPtr handle, string filename,...
    method CaptureScreenToFile (line 219) | public static void CaptureScreenToFile(string filename, ImageFormat fo...
    method CaptureScreen (line 225) | public static Image CaptureScreen()
    class GDI32 (line 233) | private class GDI32
      method BitBlt (line 237) | [DllImport("gdi32.dll")]
      method CreateCompatibleBitmap (line 242) | [DllImport("gdi32.dll")]
      method CreateCompatibleDC (line 246) | [DllImport("gdi32.dll")]
      method DeleteDC (line 249) | [DllImport("gdi32.dll")]
      method DeleteObject (line 252) | [DllImport("gdi32.dll")]
      method SelectObject (line 255) | [DllImport("gdi32.dll")]
    class User32 (line 262) | private class User32
      type RECT (line 264) | [StructLayout(LayoutKind.Sequential)]
      method GetDesktopWindow (line 273) | [DllImport("user32.dll")]
      method GetWindowDC (line 276) | [DllImport("user32.dll")]
      method ReleaseDC (line 279) | [DllImport("user32.dll")]
      method GetWindowRect (line 282) | [DllImport("user32.dll")]

FILE: Razor/Core/Serial.cs
  type Serial (line 24) | public struct Serial : IComparable
    method Serial (line 32) | private Serial(uint serial)
    method GetHashCode (line 57) | public override int GetHashCode()
    method CompareTo (line 62) | public int CompareTo(object o)
    method Equals (line 74) | public override bool Equals(object o)
    method ToString (line 111) | public override string ToString()
    method Parse (line 116) | public static Serial Parse(string s)

FILE: Razor/Core/SkillTimer.cs
  class SkillTimer (line 23) | public class SkillTimer
    method SkillTimer (line 28) | static SkillTimer()
    method Start (line 43) | public static void Start()
    method Stop (line 56) | public static void Stop()
    class InternalTimer (line 62) | private class InternalTimer : Timer
      method InternalTimer (line 64) | public InternalTimer() : base(TimeSpan.FromSeconds(1), TimeSpan.From...
      method OnTick (line 68) | protected override void OnTick()

FILE: Razor/Core/Spells.cs
  type SpellFlag (line 30) | public enum SpellFlag
  type SpellKind (line 38) | public enum SpellKind
  method Spell (line 59) | public Spell(char flag, int n, int c, string power, string[] reags)
  method ToString (line 146) | public override string ToString()
  method GetName (line 151) | public string GetName()
  method GetID (line 156) | public int GetID()
  method GetHue (line 161) | public int GetHue(int def)
  method OnCast (line 183) | public void OnCast(PacketReader p)
  method OnCast (line 189) | public void OnCast(Packet p)
  class UnflagTimer (line 269) | private class UnflagTimer : Timer
    method UnflagTimer (line 271) | public UnflagTimer() : base(TimeSpan.FromSeconds(30.0))
    method OnTick (line 275) | protected override void OnTick()

FILE: Razor/Core/StaffToolsManager.cs
  class StaffToolsManager (line 31) | public static class StaffToolsManager
    method Initialize (line 33) | public static void Initialize()
    method LoadItems (line 38) | public static void LoadItems(TreeView tree)
    method LoadDoors (line 59) | public static void LoadDoors(TreeView tree)
    method AddItemTreeNode (line 80) | private static void AddItemTreeNode(XmlNode xmlNode, TreeNode treeNode)
    method AddDoorTreeNode (line 127) | private static void AddDoorTreeNode(XmlNode xmlNode, TreeNode treeNode)
    method AddDoor (line 170) | public static void AddDoor(DoorInfo door, string facing)
    method GetDoorOffset (line 178) | public static int GetDoorOffset(string facing)
  class DoorInfo (line 219) | public class DoorInfo
    method DoorInfo (line 239) | private DoorInfo()
    method FromXmlNode (line 247) | public static DoorInfo FromXmlNode(XmlNode xNode)

FILE: Razor/Core/StealthSteps.cs
  class StealthSteps (line 21) | public class StealthSteps
    method OnMove (line 41) | public static void OnMove()
    method Hide (line 66) | public static void Hide()
    method Unhide (line 72) | public static void Unhide()

FILE: Razor/Core/SystemMessages.cs
  class SystemMessages (line 24) | public static class SystemMessages
    method Initialize (line 28) | public static void Initialize()
    method HandleSystemMessage (line 33) | private static void HandleSystemMessage(Packet p, PacketHandlerEventAr...
    method Add (line 70) | public static void Add(string text)
    method Exists (line 85) | public static bool Exists(string text)

FILE: Razor/Core/Targeting.cs
  class TargetInfo (line 28) | public class TargetInfo
  class Targeting (line 39) | public partial class Targeting
    type TargetType (line 113) | public enum TargetType
    method Initialize (line 136) | public static void Initialize()
    method CombatantChange (line 160) | private static void CombatantChange(PacketReader p, PacketHandlerEvent...
    method AttackLastComb (line 167) | private static void AttackLastComb()
    method AttackLastTarg (line 177) | public static void AttackLastTarg()
    method ShowAttackOverhead (line 203) | public static void ShowAttackOverhead(Serial serial)
    method OnClearQueue (line 221) | public static void OnClearQueue()
    method OneTimeTarget (line 235) | internal static void OneTimeTarget(TargetResponseCallback onTarget)
    method OneTimeTarget (line 240) | internal static void OneTimeTarget(TargetResponseCallback onTarget, bo...
    method OneTimeTarget (line 247) | internal static void OneTimeTarget(bool ground, TargetResponseCallback...
    method OneTimeTarget (line 252) | internal static void OneTimeTarget(TargetResponseCallback onTarget, Ca...
    method OneTimeTarget (line 257) | internal static void OneTimeTarget(bool ground, TargetResponseCallback...
    method CancelOneTimeTarget (line 284) | internal static void CancelOneTimeTarget()
    method TargetSetLastTarget (line 294) | public static void TargetSetLastTarget()
    method SetLastTarget (line 304) | public static void SetLastTarget(Mobile mobile)
    method SetLastTarget (line 312) | public static void SetLastTarget(Item item)
    method SetLastTarget (line 320) | public static void SetLastTarget(Serial serial)
    method OnSetLastTargetCancel (line 328) | private static void OnSetLastTargetCancel()
    method OnSetLastTarget (line 334) | private static void OnSetLastTarget(bool location, Serial serial, Poin...
    method SetLastTargetBeneficial (line 368) | private static void SetLastTargetBeneficial()
    method OnSLTBeneficialCancel (line 384) | private static void OnSLTBeneficialCancel()
    method OnSetLastTargetBeneficial (line 390) | private static void OnSetLastTargetBeneficial(bool location, Serial se...
    method SetLastTargetHarmful (line 424) | private static void SetLastTargetHarmful()
    method OnSLTHarmfulCancel (line 439) | private static void OnSLTHarmfulCancel()
    method OnSetLastTargetHarmful (line 445) | private static void OnSetLastTargetHarmful(bool location, Serial seria...
    method RemoveTextFlags (line 478) | private static void RemoveTextFlags(UOEntity m)
    method AddTextFlags (line 493) | private static void AddTextFlags(UOEntity m)
    method LastTargetChanged (line 525) | private static void LastTargetChanged()
    method LastBeneficialTargetChanged (line 569) | private static void LastBeneficialTargetChanged()
    method LastHarmfulTargetChanged (line 605) | private static void LastHarmfulTargetChanged()
    method SetLastTargetTo (line 648) | public static void SetLastTargetTo(Mobile m)
    method SetLastTargetTo (line 653) | public static void SetLastTargetTo(Mobile m, byte flagType)
    method EndIntercept (line 692) | private static void EndIntercept()
    method TargetSelf (line 700) | public static void TargetSelf()
    method TargetSelf (line 705) | public static void TargetSelf(bool forceQ)
    method DoTargetSelf (line 736) | public static bool DoTargetSelf()
    method LastTarget (line 770) | public static void LastTarget()
    method LastTarget (line 775) | public static void LastTarget(bool forceQ)
    method DoLastTarget (line 806) | public static bool DoLastTarget()
    method ClearQueue (line 908) | public static void ClearQueue()
    method OneTimeResponse (line 915) | private static void OneTimeResponse(object state)
    method CancelTarget (line 942) | public static void CancelTarget()
    method CancelClientTarget (line 958) | private static void CancelClientTarget()
    method Target (line 968) | public static void Target(TargetInfo info)
    method Target (line 986) | public static void Target(Point3D pt)
    method Target (line 1000) | public static void Target(Point3D pt, int gfx)
    method Target (line 1014) | public static void Target(Serial s)
    method Target (line 1047) | public static void Target(object o)
    method CheckTextFlags (line 1088) | public static void CheckTextFlags(Mobile m)
    method IsLastTarget (line 1116) | public static bool IsLastTarget(Mobile m)
    method IsBeneficialTarget (line 1135) | public static bool IsBeneficialTarget(Mobile m)
    method IsHarmfulTarget (line 1154) | public static bool IsHarmfulTarget(Mobile m)
    method CheckLastTargetRange (line 1173) | public static void CheckLastTargetRange(Mobile m)
    method CheckHealPoisonTarg (line 1192) | private static bool CheckHealPoisonTarg(uint targID, Serial ser)
    method TargetResponse (line 1213) | private static void TargetResponse(PacketReader p, PacketHandlerEventA...
    method NewTarget (line 1371) | private static void NewTarget(PacketReader p, PacketHandlerEventArgs a...
    method ResendTarget (line 1451) | public static void ResendTarget()
    method OverheadTargetMessage (line 1463) | public static void OverheadTargetMessage(TargetInfo info)
    method IsSmartTargetingEnabled (line 1500) | private static bool IsSmartTargetingEnabled()

FILE: Razor/Core/TargetingClosest.cs
  class Targeting (line 26) | public partial class Targeting
    method InitClosestTargets (line 28) | private static void InitClosestTargets()
    method TargetCloseNonFriendly (line 85) | public static void TargetCloseNonFriendly()
    method TargetCloseNonFriendlyHumanoid (line 91) | public static void TargetCloseNonFriendlyHumanoid()
    method TargetCloseNonFriendlyMonster (line 97) | public static void TargetCloseNonFriendlyMonster()
    method TargetCloseFriendly (line 103) | public static void TargetCloseFriendly()
    method TargetCloseFriendlyHumanoid (line 108) | public static void TargetCloseFriendlyHumanoid()
    method TargetCloseFriendlyMonster (line 113) | public static void TargetCloseFriendlyMonster()
    method TargetCloseEnemy (line 118) | public static void TargetCloseEnemy()
    method TargetCloseEnemyHumanoid (line 123) | public static void TargetCloseEnemyHumanoid()
    method TargetCloseEnemyMonster (line 128) | public static void TargetCloseEnemyMonster()
    method TargetCloseRed (line 133) | public static void TargetCloseRed()
    method TargetCloseRedMonster (line 138) | public static void TargetCloseRedMonster()
    method TargetCloseRedHumanoid (line 143) | public static void TargetCloseRedHumanoid()
    method TargetCloseGrey (line 148) | public static void TargetCloseGrey()
    method TargetCloseGreyMonster (line 153) | public static void TargetCloseGreyMonster()
    method TargetCloseGreyHumanoid (line 158) | public static void TargetCloseGreyHumanoid()
    method TargetCloseCriminal (line 163) | public static void TargetCloseCriminal()
    method TargetCloseCriminalHumanoid (line 168) | public static void TargetCloseCriminalHumanoid()
    method TargetCloseCriminalMonster (line 173) | public static void TargetCloseCriminalMonster()
    method TargetCloseInnocent (line 178) | public static void TargetCloseInnocent()
    method TargetCloseInnocentHumanoid (line 183) | public static void TargetCloseInnocentHumanoid()
    method TargetCloseInnocentMonster (line 188) | public static void TargetCloseInnocentMonster()
    method TargetClosestFriend (line 193) | public static void TargetClosestFriend()
    method TargetClosest (line 198) | public static void TargetClosest()
    method ClosestTarget (line 203) | public static void ClosestTarget(params int[] noto)
    method ClosestHumanoidTarget (line 251) | public static void ClosestHumanoidTarget(params int[] noto)
    method ClosestMonsterTarget (line 304) | public static void ClosestMonsterTarget(params int[] noto)
    method ClosestFriendTarget (line 357) | public static void ClosestFriendTarget()

FILE: Razor/Core/TargetingNextPrevious.cs
  class Targeting (line 29) | public partial class Targeting
    method InitNextPrevTargets (line 36) | private static void InitNextPrevTargets()
    method IsNextPrevFriend (line 124) | public static bool IsNextPrevFriend(Mobile mobile)
    method NextPrevTarget (line 138) | public static void NextPrevTarget(List<Mobile> targets, bool nextTarge...
    method NextTarget (line 244) | public static void NextTarget()
    method NextTargetHumanoid (line 252) | public static void NextTargetHumanoid()
    method NextTargetEnemyHumanoid (line 262) | public static void NextTargetEnemyHumanoid()
    method NextTargetEnemyMonster (line 272) | public static void NextTargetEnemyMonster()
    method NextTargetMonster (line 282) | public static void NextTargetMonster()
    method NextTargetFriend (line 292) | public static void NextTargetFriend()
    method NextTargetNonFriend (line 301) | public static void NextTargetNonFriend()
    method PrevTarget (line 315) | public static void PrevTarget()
    method PrevTargetHumanoid (line 323) | public static void PrevTargetHumanoid()
    method PrevTargetEnemyHumanoid (line 333) | public static void PrevTargetEnemyHumanoid()
    method PrevTargetEnemyMonster (line 343) | public static void PrevTargetEnemyMonster()
    method PrevTargetMonster (line 353) | public static void PrevTargetMonster()
    method PrevTargetFriend (line 363) | public static void PrevTargetFriend()
    method NextTargetCriminalHumanoid (line 372) | public static void NextTargetCriminalHumanoid()
    method NextTargetMurdererHumanoid (line 382) | public static void NextTargetMurdererHumanoid()
    method NextTargetInnocentHumanoid (line 392) | public static void NextTargetInnocentHumanoid()
    method NextTargetCriminalMonster (line 402) | public static void NextTargetCriminalMonster()
    method NextTargetMurdererMonster (line 412) | public static void NextTargetMurdererMonster()
    method NextTargetInnocentMonster (line 422) | public static void NextTargetInnocentMonster()
    method PrevTargetCriminalHumanoid (line 432) | public static void PrevTargetCriminalHumanoid()
    method PrevTargetCriminalMonster (line 442) | public static void PrevTargetCriminalMonster()
    method PrevTargetMurdererHumanoid (line 452) | public static void PrevTargetMurdererHumanoid()
    method PrevTargetMurdererMonster (line 462) | public static void PrevTargetMurdererMonster()
    method PrevTargetInnocentHumanoid (line 472) | public static void PrevTargetInnocentHumanoid()
    method PrevTargetInnocentMonster (line 482) | public static void PrevTargetInnocentMonster()
    method NextTargetFriendlyHumanoid (line 492) | public static void NextTargetFriendlyHumanoid()
    method NextTargetFriendly (line 505) | public static void NextTargetFriendly()
    method NextTargetFriendlyMonster (line 518) | public static void NextTargetFriendlyMonster()
    method NextTargetGreyHumanoid (line 531) | public static void NextTargetGreyHumanoid()
    method NextTargetGreyMonster (line 543) | public static void NextTargetGreyMonster()
    method NextTargetNonFriendlyHumanoid (line 555) | public static void NextTargetNonFriendlyHumanoid()
    method NextTargetNonFriendlyMonster (line 569) | public static void NextTargetNonFriendlyMonster()
    method PrevTargetFriendlyHumanoid (line 583) | public static void PrevTargetFriendlyHumanoid()
    method PrevTargetFriendly (line 596) | public static void PrevTargetFriendly()
    method PrevTargetFriendlyMonster (line 609) | public static void PrevTargetFriendlyMonster()
    method PrevTargetGreyHumanoid (line 622) | public static void PrevTargetGreyHumanoid()
    method PrevTargetGreyMonster (line 634) | public static void PrevTargetGreyMonster()
    method PrevTargetNonFriendlyHumanoid (line 646) | public static void PrevTargetNonFriendlyHumanoid()
    method PrevTargetNonFriendlyMonster (line 660) | public static void PrevTargetNonFriendlyMonster()
    method PrevTargetNonFriend (line 674) | public static void PrevTargetNonFriend()
    method NextPrevTargetNotoriety (line 688) | public static void NextPrevTargetNotoriety(bool next, params int[] not...
    method NextPrevTargetNotorietyMonster (line 699) | public static void NextPrevTargetNotorietyMonster(bool next, params in...
    method NextPrevTargetNotorietyHumanoid (line 710) | public static void NextPrevTargetNotorietyHumanoid(bool next, params i...

FILE: Razor/Core/TargetingRandom.cs
  class Targeting (line 26) | public partial class Targeting
    method InitRandomTarget (line 28) | private static void InitRandomTarget()
    method TargetRandNonFriendly (line 84) | public static void TargetRandNonFriendly()
    method TargetRandNonFriendlyHumanoid (line 90) | public static void TargetRandNonFriendlyHumanoid()
    method TargetRandNonFriendlyMonster (line 96) | public static void TargetRandNonFriendlyMonster()
    method TargetRandFriendly (line 102) | public static void TargetRandFriendly()
    method TargetRandFriendlyHumanoid (line 107) | public static void TargetRandFriendlyHumanoid()
    method TargetRandFriendlyMonster (line 112) | public static void TargetRandFriendlyMonster()
    method TargetRandEnemy (line 117) | public static void TargetRandEnemy()
    method TargetRandEnemyMonster (line 122) | public static void TargetRandEnemyMonster()
    method TargetRandEnemyHumanoid (line 127) | public static void TargetRandEnemyHumanoid()
    method TargetRandRed (line 132) | public static void TargetRandRed()
    method TargetRandRedHumanoid (line 137) | public static void TargetRandRedHumanoid()
    method TargetRandRedMonster (line 142) | public static void TargetRandRedMonster()
    method TargetRandGrey (line 147) | public static void TargetRandGrey()
    method TargetRandGreyMonster (line 152) | public static void TargetRandGreyMonster()
    method TargetRandGreyHumanoid (line 157) | public static void TargetRandGreyHumanoid()
    method TargetRandCriminal (line 162) | public static void TargetRandCriminal()
    method TargetRandCriminalHumanoid (line 167) | public static void TargetRandCriminalHumanoid()
    method TargetRandCriminalMonster (line 172) | public static void TargetRandCriminalMonster()
    method TargetRandInnocent (line 177) | public static void TargetRandInnocent()
    method TargetRandInnocentHumanoid (line 182) | public static void TargetRandInnocentHumanoid()
    method TargetRandInnocentMonster (line 187) | public static void TargetRandInnocentMonster()
    method TargetRandFriend (line 192) | public static void TargetRandFriend()
    method TargetRandAnyone (line 197) | public static void TargetRandAnyone()
    method RandomTarget (line 202) | public static void RandomTarget(params int[] noto)
    method RandomHumanoidTarget (line 236) | public static void RandomHumanoidTarget(params int[] noto)
    method RandomMonsterTarget (line 275) | public static void RandomMonsterTarget(params int[] noto)
    method RandomFriendTarget (line 314) | public static void RandomFriendTarget()

FILE: Razor/Core/TextFilterManager.cs
  class TextFilterManager (line 30) | public static class TextFilterManager
    method Initialize (line 36) | public static void Initialize()
    method HandleMobileMessage (line 41) | public static void HandleMobileMessage(Packet p, PacketHandlerEventArg...
    method SetControls (line 60) | public static void SetControls(ListBox filterTextList)
    method AddFilter (line 65) | public static void AddFilter(string filter)
    method RemoveFilter (line 72) | public static void RemoveFilter(string filter)
    method Save (line 79) | public static void Save(XmlTextWriter xml)
    method IsFiltered (line 89) | public static bool IsFiltered(string text)
    method Load (line 105) | public static void Load(XmlElement node)
    method ClearAll (line 124) | public static void ClearAll()
    method RedrawList (line 129) | public static void RedrawList()

FILE: Razor/Core/Timer.cs
  class MinHeap (line 24) | public class MinHeap
    method MinHeap (line 29) | public MinHeap() : this(1)
    method MinHeap (line 33) | public MinHeap(int capacity)
    method MinHeap (line 40) | public MinHeap(ICollection c) : this(c.Count)
    method Heapify (line 48) | public void Heapify()
    method PercolateDown (line 54) | private void PercolateDown(int hole)
    method Peek (line 74) | public IComparable Peek()
    method Pop (line 79) | public IComparable Pop()
    method Remove (line 89) | public void Remove(IComparable o)
    method Clear (line 103) | public void Clear()
    method Add (line 113) | public void Add(IComparable o)
    method AddMultiple (line 127) | public void AddMultiple(ICollection col)
    method GetRawList (line 156) | public ArrayList GetRawList()
  class Timer (line 169) | public abstract class Timer : IComparable
    method OnTick (line 177) | protected abstract void OnTick();
    method Timer (line 179) | public Timer(TimeSpan delay) : this(delay, TimeSpan.Zero, 1)
    method Timer (line 183) | public Timer(TimeSpan interval, int count) : this(interval, interval, ...
    method Timer (line 187) | public Timer(TimeSpan delay, TimeSpan interval) : this(delay, interval...
    method Timer (line 191) | public Timer(TimeSpan delay, TimeSpan interval, int count)
    method Start (line 198) | public void Start()
    method Stop (line 210) | public void Stop()
    method CompareTo (line 220) | public int CompareTo(object obj)
    method ChangedNextTick (line 252) | private static void ChangedNextTick()
    method ChangedNextTick (line 257) | private static void ChangedNextTick(bool allowImmediate)
    method Slice (line 274) | public static void Slice()
    class OneTimeTimer (line 307) | private class OneTimeTimer : Timer
      method OneTimeTimer (line 311) | public OneTimeTimer(TimeSpan d, TimerCallback call) : base(d)
      method OnTick (line 316) | protected override void OnTick()
    method DelayedCallback (line 322) | public static Timer DelayedCallback(TimeSpan delay, TimerCallback call)
    class OneTimeTimerState (line 327) | private class OneTimeTimerState : Timer
      method OneTimeTimerState (line 332) | public OneTimeTimerState(TimeSpan d, TimerCallbackState call, object...
      method OnTick (line 338) | protected override void OnTick()
    method DelayedCallbackState (line 344) | public static Timer DelayedCallbackState(TimeSpan delay, TimerCallback...

FILE: Razor/Core/UOEntity.cs
  class UOEntity (line 24) | public class UOEntity
    class ContextMenuList (line 26) | public class ContextMenuList : List<KeyValuePair<ushort, ushort>>
      method Add (line 28) | public void Add(ushort key, ushort value)
    method AfterLoad (line 47) | public virtual void AfterLoad()
    method UOEntity (line 51) | public UOEntity(Serial ser)
    method Remove (line 94) | public virtual void Remove()
    method OnPositionChanging (line 99) | public virtual void OnPositionChanging(Point3D oldPos)
    method GetHashCode (line 103) | public override int GetHashCode()
    method ReadPropertyList (line 129) | public void ReadPropertyList(PacketReader p)
    method OPLChanged (line 139) | public void OPLChanged()

FILE: Razor/Core/Utility.cs
  class Utility (line 29) | public class Utility
    method Random (line 33) | public static int Random(int min, int max)
    method Random (line 38) | public static int Random(int num)
    method InRange (line 43) | public static bool InRange(IPoint2D from, IPoint2D to, int range)
    method Distance (line 51) | public static int Distance(int fx, int fy, int tx, int ty)
    method Distance (line 59) | public static int Distance(IPoint2D from, IPoint2D to)
    method DistanceSqrt (line 67) | public static double DistanceSqrt(IPoint2D from, IPoint2D to)
    method Offset (line 75) | public static void Offset(Direction d, ref int x, ref int y)
    method FormatBuffer (line 110) | public static void FormatBuffer(TextWriter output, Stream input, int l...
    method FormatBuffer (line 205) | public static unsafe void FormatBuffer(TextWriter output, byte* buff, ...
    method PathDisplayStr (line 302) | public static string PathDisplayStr(string path, int maxLen)
    method FormatSize (line 320) | public static string FormatSize(long size)
    method FormatTime (line 330) | public static string FormatTime(int sec)
    method FormatTimeMS (line 338) | public static string FormatTimeMS(int ms)
    method ToInt32 (line 354) | public static int ToInt32(string str, int def)
    method ToUInt32 (line 374) | public static uint ToUInt32(string str, uint def)
    method ToDouble (line 391) | public static double ToDouble(string str, double def)
    method ToUInt16 (line 401) | public static ushort ToUInt16(string str, ushort def)
    method ToLong (line 418) | public static long ToLong(string str, ushort def)
    method LaunchBrowser (line 435) | public static void LaunchBrowser(string url)

FILE: Razor/Core/WaypointManager.cs
  class WaypointManager (line 28) | public static class WaypointManager
    method Initialize (line 38) | public static void Initialize()
    method SetControls (line 45) | public static void SetControls(ListBox waypointList)
    class Waypoint (line 52) | public class Waypoint
      method ToString (line 58) | public override string ToString()
    method NextWaypoint (line 64) | public static void NextWaypoint()
    method PrevWaypoint (line 74) | public static void PrevWaypoint()
    method AddWaypoint (line 84) | public static void AddWaypoint(Waypoint waypoint)
    method RemoveWaypoint (line 91) | public static void RemoveWaypoint(Waypoint waypoint)
    method ShowWaypoint (line 100) | public static void ShowWaypoint(Waypoint waypoint)
    method ClearWaypoint (line 114) | public static void ClearWaypoint()
    method ResetTimer (line 123) | public static void ResetTimer()
    method StartTimer (line 138) | public static void StartTimer()
    method StopTimer (line 143) | public static void StopTimer()
    method SendMessage (line 148) | private static void SendMessage(string msg)
    class WaypointDistanceTimer (line 160) | private class WaypointDistanceTimer : Timer
      method WaypointDistanceTimer (line 162) | public WaypointDistanceTimer() : base(TimeSpan.FromSeconds(Config.Ge...
      method OnTick (line 167) | protected override void OnTick()
    method Save (line 192) | public static void Save(XmlTextWriter xml)
    method Load (line 204) | public static void Load(XmlElement node)
    method ClearAll (line 230) | public static void ClearAll()
    method RedrawList (line 235) | public static void RedrawList()

FILE: Razor/Core/World.cs
  class World (line 24) | public class World
    method World (line 32) | static World()
    method FindItem (line 55) | internal static Item FindItem(Serial serial)
    method FindItemByType (line 61) | internal static Item FindItemByType(int itemId)
    method FindItemsByName (line 72) | internal static List<Item> FindItemsByName(string name)
    method FindItemsById (line 85) | internal static List<Item> FindItemsById(ushort id)
    method FindMobile (line 98) | internal static Mobile FindMobile(Serial serial)
    method FindMobilesByName (line 104) | internal static List<Mobile> FindMobilesByName(string name)
    method MobilesInRange (line 116) | internal static List<Mobile> MobilesInRange(int range)
    method MobilesInRange (line 132) | internal static List<Mobile> MobilesInRange()
    method AddItem (line 140) | internal static void AddItem(Item item)
    method AddMobile (line 145) | internal static void AddMobile(Mobile mob)
    method RequestMobileStatus (line 150) | internal static void RequestMobileStatus(Mobile m)
    method RemoveMobile (line 155) | internal static void RemoveMobile(Mobile mob)
    method RemoveItem (line 160) | internal static void RemoveItem(Item item)

FILE: Razor/Core/ZLib.cs
  type ZLibError (line 25) | public enum ZLibError : int
  type ZLibCompressionLevel (line 38) | [Flags]
  class ZLib (line 47) | public class ZLib
    method zlibVersion (line 49) | [DllImport("zlib")]
    method compress (line 52) | [DllImport("zlib")]
    method compress2 (line 55) | [DllImport("zlib")]
    method uncompress (line 59) | [DllImport("zlib")]
  class GZBlockOut (line 68) | public class GZBlockOut : Stream
    method GZBlockOut (line 145) | public GZBlockOut(string filename, int blockSize)
    method Write (line 156) | public override void Write(byte[] buffer, int offset, int count)
    method WriteByte (line 170) | public override void WriteByte(byte value)
    method FlushBuffer (line 186) | public void FlushBuffer()
    method Flush (line 209) | public override void Flush()
    method ForceFlush (line 215) | public void ForceFlush()
    method Seek (line 223) | public override long Seek(long offset, SeekOrigin origin)
    method SetLength (line 231) | public override void SetLength(long value)
    method Read (line 236) | public override int Read(byte[] buffer, int offset, int count)
    method Close (line 241) | public override void Close()
  class GZBlockIn (line 262) | public class GZBlockIn : Stream
    method GZBlockIn (line 325) | public GZBlockIn(string filename)
    method Write (line 334) | public override void Write(byte[] buffer, int offset, int count)
    method Flush (line 338) | public override void Flush()
    method Seek (line 347) | public override long Seek(long offset, SeekOrigin origin)
    method SetLength (line 391) | public override void SetLength(long value)
    method Read (line 395) | public override int Read(byte[] buffer, int offset, int count)
    method Close (line 439) | public override void Close()

FILE: Razor/Filters/Death.cs
  class DeathFilter (line 21) | public class DeathFilter : Filter
    method Initialize (line 23) | public static void Initialize()
    method DeathFilter (line 28) | private DeathFilter()
    method OnFilter (line 42) | public override void OnFilter(PacketReader p, PacketHandlerEventArgs a...

FILE: Razor/Filters/Filter.cs
  class Filter (line 26) | public abstract class Filter
    method Register (line 35) | public static void Register(Filter filter)
    method Load (line 40) | public static void Load(XmlElement xml)
    method DisableAll (line 71) | public static void DisableAll()
    method Save (line 77) | public static void Save(XmlTextWriter xml)
    method Draw (line 92) | public static void Draw(CheckedListBox list)
    method OnFilter (line 107) | public abstract void OnFilter(PacketReader p, PacketHandlerEventArgs a...
    method Filter (line 119) | protected Filter()
    method ToString (line 125) | public override string ToString()
    method OnEnable (line 130) | public virtual void OnEnable()
    method OnDisable (line 137) | public virtual void OnDisable()
    method OnCheckChanged (line 144) | public void OnCheckChanged(CheckState newValue)

FILE: Razor/Filters/Light.cs
  class LightFilter (line 21) | public class LightFilter : Filter
    method Initialize (line 23) | public static void Initialize()
    method LightFilter (line 28) | private LightFilter()
    method OnFilter (line 42) | public override void OnFilter(PacketReader p, PacketHandlerEventArgs a...
    method OnEnable (line 55) | public override void OnEnable()
    method OnDisable (line 69) | public override void OnDisable()

FILE: Razor/Filters/MessageFilter.cs
  class AsciiMessageFilter (line 21) | public class AsciiMessageFilter : Filter
    method AsciiMessageFilter (line 27) | private AsciiMessageFilter(LocString name, MessageType type, string[] ...
    method OnFilter (line 44) | public override void OnFilter(PacketReader p, PacketHandlerEventArgs a...
  class LocMessageFilter (line 73) | public class LocMessageFilter : Filter
    method Initialize (line 75) | public static void Initialize()
    method LocMessageFilter (line 83) | private LocMessageFilter(LocString name, MessageType type, int[] msgs)
    method OnFilter (line 100) | public override void OnFilter(PacketReader p, PacketHandlerEventArgs a...

FILE: Razor/Filters/MobileFilter.cs
  class MobileFilter (line 23) | public static class MobileFilter
    method Load (line 27) | public static void Load()
    method Apply (line 36) | public static void Apply(Packet p, Mobile m)
    method Apply (line 41) | public static void Apply(Packet p, ushort body)
    method Get (line 65) | private static int Get(ushort body)
    method ApplyToMobiles (line 85) | public static void ApplyToMobiles()

FILE: Razor/Filters/SoundFilters.cs
  class SoundFilter (line 21) | public class SoundFilter : Filter
    method Initialize (line 23) | public static void Initialize()
    method GetRange (line 52) | public static ushort[] GetRange(ushort min, ushort max)
    method SoundFilter (line 66) | private SoundFilter(LocString name, params ushort[] blockSounds)
    method OnFilter (line 82) | public override void OnFilter(PacketReader p, PacketHandlerEventArgs a...

FILE: Razor/Filters/SoundMusicManager.cs
  class SoundMusicManager (line 29) | public static class SoundMusicManager
    method SetControls (line 39) | public static void SetControls(CheckedListBox soundFilterList, ComboBo...
    class Sound (line 45) | public class Sound
      method ToString (line 50) | public override string ToString()
    class Music (line 56) | public class Music
      method ToString (line 62) | public override string ToString()
    method IsFilteredSound (line 68) | public static bool IsFilteredSound(Serial serial, out string name)
    method IsFilteredSound (line 83) | public static bool IsFilteredSound(ushort serial, out string name)
    method GetSoundName (line 98) | public static string GetSoundName(ushort soundId)
    method GetSoundId (line 114) | public static int GetSoundId(string name)
    method GetAllSounds (line 130) | public static List<Sound> GetAllSounds()
    method GetMusicName (line 138) | public static string GetMusicName(int musicId, out bool loop)
    method AddSoundFilter (line 156) | public static void AddSoundFilter(Sound filter)
    method RemoveSoundFilter (line 166) | public static void RemoveSoundFilter(Sound filter)
    method LoadMusic (line 176) | public static void LoadMusic()
    method LoadSounds (line 683) | public static void LoadSounds()
    method Save (line 706) | public static void Save(XmlTextWriter xml)
    method Load (line 717) | public static void Load(XmlElement node)
    method ClearAll (line 749) | public static void ClearAll()
    method RedrawList (line 754) | public static void RedrawList()

FILE: Razor/Filters/StaffItems.cs
  class StaffItemFilter (line 21) | public class StaffItemFilter : Filter
    method Initialize (line 23) | public static void Initialize()
    method StaffItemFilter (line 28) | private StaffItemFilter()
    method IsStaffItem (line 42) | private static bool IsStaffItem(ItemID itemID)
    method IsStaffItem (line 50) | private static bool IsStaffItem(Item i)
    method OnFilter (line 55) | public override void OnFilter(PacketReader p, PacketHandlerEventArgs a...
    method OnEnable (line 89) | public override void OnEnable()
    method OnDisable (line 103) | public override void OnDisable()

FILE: Razor/Filters/TargetFilterManager.cs
  class TargetFilterManager (line 28) | public static class TargetFilterM
Condensed preview — 378 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (6,540K chars).
[
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 697,
    "preview": "---\nname: Bug report\nabout: Create a report to help Razor improve\ntitle: \"[BUG]\"\nlabels: bug\nassignees: ''\n\n---\n\n**Pleas"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "chars": 743,
    "preview": "---\nname: Feature request\nabout: Suggest an idea for Razor\ntitle: \"[FEATURE]\"\nlabels: enhancement\nassignees: ''\n\n---\n\nAl"
  },
  {
    "path": ".github/workflows/build-only.yml",
    "chars": 916,
    "preview": "name: Build Only\n\non:\n  pull_request:\n    branches:\n      - master\n    paths-ignore:\n      - 'help/**'\n      - '**/build"
  },
  {
    "path": ".github/workflows/build-site.yml",
    "chars": 2536,
    "preview": "name: Build Site\n\non:\n  push:\n    branches:\n      - master\n    paths:\n    - 'help/**'\n    - '**/build-site.yml'\n  pull_r"
  },
  {
    "path": ".github/workflows/build.yml",
    "chars": 2392,
    "preview": "name: Build Dev Preview\n\non:\n  push:\n    branches:\n      - master\n    paths-ignore:\n      - 'help/**'\n      - '**/build-"
  },
  {
    "path": ".gitignore",
    "chars": 279,
    "preview": "# Visual Studio\n*.vs\n*.vscode\n*.vcxproj.user\n*.csproj.user\n.vscode\npackages/\n\n# Rider\n.idea\n\n# Build Output\n[Dd]ebug/\n[R"
  },
  {
    "path": ".gitmodules",
    "chars": 106,
    "preview": "[submodule \"ScriptEngine/Steam\"]\n\tpath = ScriptEngine/Steam\n\turl = https://github.com/jaedan/steam-engine\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "chars": 3201,
    "preview": "## Code of Conduct\n\n### Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as\ncontributors a"
  },
  {
    "path": "CONTRIBUTING.md",
    "chars": 1205,
    "preview": "# Contributing\n\nWe want to make contributing to this project as easy and transparent as possible, whether it's:\n\n- Repor"
  },
  {
    "path": "Crypt/Crypt.cpp",
    "chars": 46566,
    "preview": "#include \"stdafx.h\"\r\n#include \"Crypt.h\"\r\n#include \"uo_huffman.h\"\r\n#include \"PacketInfo.h\"\r\n#include \"OSIEncryption.h\"\r\n#"
  },
  {
    "path": "Crypt/Crypt.def",
    "chars": 258,
    "preview": "LIBRARY\tCrypt\r\n\r\nEXPORTS\r\n\tInstallLibrary\r\n\tShutdown\r\n\tFindUOWindow\r\n\tGetSharedAddress\r\n\tGetPacketLength\r\n\tIsDynLength\r\n"
  },
  {
    "path": "Crypt/Crypt.h",
    "chars": 6854,
    "preview": "#pragma once\r\n#pragma pack(1)\r\n\r\n#include <stdint.h>\r\n\r\n#define DLL_VERSION \"1.4.1\"\r\n\r\n#define DLLFUNCTION __declspec(dl"
  },
  {
    "path": "Crypt/Crypt.vcxproj",
    "chars": 4948,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.micro"
  },
  {
    "path": "Crypt/Crypt.vcxproj.filters",
    "chars": 3303,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbui"
  },
  {
    "path": "Crypt/LoginEncryption.cpp",
    "chars": 2319,
    "preview": "#include \"stdafx.h\"\r\n\r\n#include \"Crypt.h\"\r\n#include \"LoginEncryption.h\"\r\n\r\n#define N2L(C, LL) \\\r\n    LL  = ((unsigned in"
  },
  {
    "path": "Crypt/LoginEncryption.h",
    "chars": 525,
    "preview": "#pragma once\r\n\r\nclass LoginEncryption\r\n{\r\npublic:\r\n\tLoginEncryption();\r\n\r\n\tvoid Initialize( const BYTE *pSeed );\r\n\r\n\tsta"
  },
  {
    "path": "Crypt/MemFinder.cpp",
    "chars": 2243,
    "preview": "#include \"stdafx.h\"\r\n#include \"MemFinder.h\"\r\n\r\nDWORD MemFinder::Find(const void *data, int length, DWORD addressHint, DW"
  },
  {
    "path": "Crypt/MemFinder.h",
    "chars": 771,
    "preview": "#pragma pack(1)\r\n#pragma once\r\n\r\n#include <vector>\r\nusing std::vector;\r\n\r\nclass MemFinder\r\n{\r\npublic:\r\n\tstatic DWORD Fin"
  },
  {
    "path": "Crypt/OSIEncryption.cpp",
    "chars": 11509,
    "preview": "#include \"stdafx.h\"\r\n\r\n#include \"Crypt.h\"\r\n#include \"OSIEncryption.h\"\r\n#include \"TwoFish.h\"\r\n\r\nOSIEncryption::OSIEncrypt"
  },
  {
    "path": "Crypt/OSIEncryption.h",
    "chars": 1009,
    "preview": "#pragma once\r\n\r\n#include \"TwoFish.h\"\r\n\r\nclass OSIEncryption\r\n{\r\npublic:\r\n\tOSIEncryption();\r\n\r\n\tvoid Initialize( DWORD dw"
  },
  {
    "path": "Crypt/OldStatusBar.cpp",
    "chars": 16063,
    "preview": "#include \"StdAfx.h\"\r\n#include \"Crypt.h\"\r\n#include \"MemFinder.h\"\r\n\r\nDWORD GumpOutV28( DWORD OutFuncAddr, int esiOff, char"
  },
  {
    "path": "Crypt/PacketInfo.cpp",
    "chars": 701,
    "preview": "#include \"stdafx.h\"\r\n#include \"Crypt.h\"\r\n\r\n#include \"PacketInfo.h\"\r\n\r\nDLLFUNCTION int GetPacketLength( unsigned char *pa"
  },
  {
    "path": "Crypt/PacketInfo.h",
    "chars": 4800,
    "preview": "#pragma once\r\n#pragma pack(1)\r\n\r\nstruct ClientPacketInfo // 12 bytes\r\n{\r\n\tint Id;\r\n\tint Unk;\r\n\tunsigned short Length;\r\n\t"
  },
  {
    "path": "Crypt/UOArt.cpp",
    "chars": 16989,
    "preview": "#include \"stdafx.h\"\r\n#include \"Crypt.h\"\r\n#include \"Resource.h\"\r\n#include <uxtheme.h>\r\n#include <vssym32.h>\r\n#include <dw"
  },
  {
    "path": "Crypt/debug.h",
    "chars": 2508,
    "preview": "#ifdef DEBUG    /* keep these macros common so they are same for both versions */\r\nCONST int debugCompile  =   1;\r\nexter"
  },
  {
    "path": "Crypt/platform.h",
    "chars": 2931,
    "preview": "/***************************************************************************\r\n    PLATFORM.H  -- Platform-specific defin"
  },
  {
    "path": "Crypt/resource.h",
    "chars": 493,
    "preview": "//{{NO_DEPENDENCIES}}\r\n// Microsoft Visual C++ generated include file.\r\n// Used by Crypt.rc\r\n//\r\n#define IDI_ICON1      "
  },
  {
    "path": "Crypt/stdafx.cpp",
    "chars": 292,
    "preview": "// stdafx.cpp : source file that includes just the standard includes\r\n// Crypt.pch will be the pre-compiled header\r\n// s"
  },
  {
    "path": "Crypt/stdafx.h",
    "chars": 772,
    "preview": "// stdafx.h : include file for standard system include files,\r\n// or project specific include files that are used freque"
  },
  {
    "path": "Crypt/table.h",
    "chars": 10033,
    "preview": "/***************************************************************************\r\n    TABLE.H -- Tables, macros, constants f"
  },
  {
    "path": "Crypt/trees.cpp",
    "chars": 4966,
    "preview": "\r\nint Trees[] = {\r\n\t0x4CCA, 0x4CCB, 0x4CCC, 0x4CCD, 0x4CD0, 0x4CD3, 0x4CD6, 0x4CD8,\r\n\t0x4CDA, 0x4CDD, 0x4CE0, 0x4CE3, 0x"
  },
  {
    "path": "Crypt/twofish.c",
    "chars": 43893,
    "preview": "/***************************************************************************\r\n    TWOFISH2.C  -- Optimized C API calls f"
  },
  {
    "path": "Crypt/twofish.h",
    "chars": 7084,
    "preview": "/* aes.h */\r\n\r\n/* ---------- See examples at end of this file for typical usage -------- */\r\n\r\n/* AES Cipher header file"
  },
  {
    "path": "Crypt/uo_huffman.cpp",
    "chars": 13634,
    "preview": "////////////////////////////////////////////////////////////////////////////////\r\n//\r\n// uo_huffman.cpp\r\n//\r\n//\r\n// Deco"
  },
  {
    "path": "Crypt/uo_huffman.h",
    "chars": 346,
    "preview": "#pragma once\r\n\r\nclass Compression\r\n{\r\npublic:\r\n\tstatic int Compress( char *out, const char *in, int inlen );\r\n\tstatic in"
  },
  {
    "path": "FastColoredTextBox/AutocompleteItem.cs",
    "chars": 7709,
    "preview": "using System;\nusing System.Drawing;\nusing System.Drawing.Printing;\n\nnamespace FastColoredTextBoxNS\n{\n    /// <summary>\n"
  },
  {
    "path": "FastColoredTextBox/AutocompleteMenu.cs",
    "chars": 26791,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.Windows.Forms;\nusing System.Drawing;\nusing System.Component"
  },
  {
    "path": "FastColoredTextBox/Bookmarks.cs",
    "chars": 7557,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Text"
  },
  {
    "path": "FastColoredTextBox/Char.cs",
    "chars": 578,
    "preview": "using System;\n\nnamespace FastColoredTextBoxNS\n{\n    /// <summary>\n    /// Char and style\n    /// </summary>\n    public "
  },
  {
    "path": "FastColoredTextBox/CommandManager.cs",
    "chars": 6384,
    "preview": "using System.Collections.Generic;\nusing System;\n\nnamespace FastColoredTextBoxNS\n{\n    public class CommandManager\n    {"
  },
  {
    "path": "FastColoredTextBox/Commands.cs",
    "chars": 27751,
    "preview": "using System;\nusing System.Collections.Generic;\n\nnamespace FastColoredTextBoxNS\n{\n    /// <summary>\n    /// Insert sing"
  },
  {
    "path": "FastColoredTextBox/DocumentMap.cs",
    "chars": 7590,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Data;\nu"
  },
  {
    "path": "FastColoredTextBox/EncodingDetector.cs",
    "chars": 15573,
    "preview": "//          Copyright Tao Klerks, 2010-2012, tao@klerks.biz         \n//          Licensed under the modified BSD licens"
  },
  {
    "path": "FastColoredTextBox/ExportToHTML.cs",
    "chars": 7571,
    "preview": "using System.Text;\nusing System.Drawing;\nusing System.Collections.Generic;\n\nnamespace FastColoredTextBoxNS\n{\n    /// <s"
  },
  {
    "path": "FastColoredTextBox/ExportToRTF.cs",
    "chars": 7053,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Text;\n\nnamespace FastColoredTextBoxN"
  },
  {
    "path": "FastColoredTextBox/FastColoredTextBox.cs",
    "chars": 303371,
    "preview": "//\n//  THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF ANY\n//  KIND, EITHER EXPRESSED OR IMPLIED, INC"
  },
  {
    "path": "FastColoredTextBox/FastColoredTextBox.csproj",
    "chars": 6672,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"12.0\" DefaultTargets=\"Build\" xmlns=\"http://schemas.micros"
  },
  {
    "path": "FastColoredTextBox/FastColoredTextBox.resx",
    "chars": 5696,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The prim"
  },
  {
    "path": "FastColoredTextBox/FastColoredTextBox.xml",
    "chars": 128898,
    "preview": "<?xml version=\"1.0\"?>\n<doc>\n    <assembly>\n        <name>FastColoredTextBox</name>\n    </assembly>\n    <members>\n       "
  },
  {
    "path": "FastColoredTextBox/FileTextSource.cs",
    "chars": 14843,
    "preview": "//#define debug\n\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.IO;\n\nnamespace FastCol"
  },
  {
    "path": "FastColoredTextBox/FindForm.Designer.cs",
    "chars": 6498,
    "preview": "namespace FastColoredTextBoxNS\n{\n    partial class FindForm\n    {\n        /// <summary>\n        /// Required designer v"
  },
  {
    "path": "FastColoredTextBox/FindForm.cs",
    "chars": 3594,
    "preview": "using System;\nusing System.Windows.Forms;\nusing System.Text.RegularExpressions;\nusing System.Collections.Generic;\n\nname"
  },
  {
    "path": "FastColoredTextBox/FindForm.resx",
    "chars": 5696,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The prim"
  },
  {
    "path": "FastColoredTextBox/GoToForm.Designer.cs",
    "chars": 4670,
    "preview": "namespace FastColoredTextBoxNS\n{\n    partial class GoToForm\n    {\n        /// <summary>\n        /// Required designer v"
  },
  {
    "path": "FastColoredTextBox/GoToForm.cs",
    "chars": 1361,
    "preview": "using System;\nusing System.Windows.Forms;\n\nnamespace FastColoredTextBoxNS\n{\n    public partial class GoToForm : Form\n  "
  },
  {
    "path": "FastColoredTextBox/GoToForm.resx",
    "chars": 5695,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The prima"
  },
  {
    "path": "FastColoredTextBox/Hints.cs",
    "chars": 13575,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Text"
  },
  {
    "path": "FastColoredTextBox/Hotkeys.cs",
    "chars": 9726,
    "preview": "using System;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Com"
  },
  {
    "path": "FastColoredTextBox/HotkeysEditorForm.Designer.cs",
    "chars": 11088,
    "preview": "namespace FastColoredTextBoxNS\n{\n    partial class HotkeysEditorForm\n    {\n        /// <summary>\n        /// Required d"
  },
  {
    "path": "FastColoredTextBox/HotkeysEditorForm.cs",
    "chars": 5706,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Data;\nusing System.Drawing;\nu"
  },
  {
    "path": "FastColoredTextBox/HotkeysEditorForm.resx",
    "chars": 6242,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The prim"
  },
  {
    "path": "FastColoredTextBox/LimitedStack.cs",
    "chars": 2212,
    "preview": "using System;\n\nnamespace FastColoredTextBoxNS\n{\n    /// <summary>\n    /// Limited stack\n    /// </summary>\n    public c"
  },
  {
    "path": "FastColoredTextBox/Line.cs",
    "chars": 7345,
    "preview": "using System.Collections.Generic;\nusing System;\nusing System.Text;\nusing System.Drawing;\n\nnamespace FastColoredTextBoxN"
  },
  {
    "path": "FastColoredTextBox/LinesAccessor.cs",
    "chars": 2045,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace FastColoredTextBoxNS\n{\n    public class L"
  },
  {
    "path": "FastColoredTextBox/MacrosManager.cs",
    "chars": 5793,
    "preview": "using System.Collections.Generic;\nusing System.Globalization;\nusing System.IO;\nusing System.Text;\nusing System.Threadin"
  },
  {
    "path": "FastColoredTextBox/NativeMethods.cs",
    "chars": 4276,
    "preview": "using System;\nusing System.Runtime.InteropServices;\n\nnamespace FastColoredTextBoxNS\n{\n    public static class NativeMeth"
  },
  {
    "path": "FastColoredTextBox/Place.cs",
    "chars": 2554,
    "preview": "using System;\n\nnamespace FastColoredTextBoxNS\n{\n    /// <summary>\n    /// Line index and char index\n    /// </summary>\n"
  },
  {
    "path": "FastColoredTextBox/PlatformType.cs",
    "chars": 1660,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Runtime.InteropServices;\n\nnamespace Fas"
  },
  {
    "path": "FastColoredTextBox/Properties/AssemblyInfo.cs",
    "chars": 1492,
    "preview": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Infor"
  },
  {
    "path": "FastColoredTextBox/Range.cs",
    "chars": 56287,
    "preview": "using System;\nusing System.Text;\nusing System.Drawing;\nusing System.Text.RegularExpressions;\nusing System.Collections.G"
  },
  {
    "path": "FastColoredTextBox/ReplaceForm.Designer.cs",
    "chars": 8863,
    "preview": "namespace FastColoredTextBoxNS\n{\n    partial class ReplaceForm\n    {\n        /// <summary>\n        /// Required designe"
  },
  {
    "path": "FastColoredTextBox/ReplaceForm.cs",
    "chars": 5530,
    "preview": "using System;\nusing System.Windows.Forms;\nusing System.Text.RegularExpressions;\nusing System.Collections.Generic;\n\nname"
  },
  {
    "path": "FastColoredTextBox/ReplaceForm.resx",
    "chars": 5696,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The prim"
  },
  {
    "path": "FastColoredTextBox/Ruler.Designer.cs",
    "chars": 1105,
    "preview": "namespace FastColoredTextBoxNS\n{\n    partial class Ruler\n    {\n        /// <summary> \n        /// Required designer var"
  },
  {
    "path": "FastColoredTextBox/Ruler.cs",
    "chars": 4729,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.ComponentModel;\nusing System.Drawing;\nusing System.Data;\nu"
  },
  {
    "path": "FastColoredTextBox/Style.cs",
    "chars": 15111,
    "preview": "using System.Drawing;\nusing System;\nusing System.Drawing.Drawing2D;\nusing System.Collections.Generic;\n\nnamespace FastCo"
  },
  {
    "path": "FastColoredTextBox/SyntaxDescriptor.cs",
    "chars": 1432,
    "preview": "using System.Collections.Generic;\nusing System.Text.RegularExpressions;\nusing System;\n\nnamespace FastColoredTextBoxNS\n{"
  },
  {
    "path": "FastColoredTextBox/SyntaxHighlighter.cs",
    "chars": 20629,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Globalization;\nusing System.IO;\nusin"
  },
  {
    "path": "FastColoredTextBox/TextSource.cs",
    "chars": 9392,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Collections;\nusing System.Drawing;\nusin"
  },
  {
    "path": "FastColoredTextBox/TypeDescriptor.cs",
    "chars": 2769,
    "preview": "using System;\nusing System.ComponentModel;\nusing System.Windows.Forms;\n\nnamespace FastColoredTextBoxNS\n{\n    ///\n    //"
  },
  {
    "path": "FastColoredTextBox/UnfocusablePanel.cs",
    "chars": 1623,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Drawing.Drawing2D;\nusing System.Text"
  },
  {
    "path": "FastColoredTextBox/VisualMarker.cs",
    "chars": 3061,
    "preview": "using System;\nusing System.Collections.Generic;\nusing System.Text;\nusing System.Drawing;\nusing System.Windows.Forms;\n\nn"
  },
  {
    "path": "INSTALL.md",
    "chars": 424,
    "preview": "# Installation\n\nThese steps assume that you already have obtained and installed the Ultima Online game asset files in th"
  },
  {
    "path": "LICENSE.md",
    "chars": 35149,
    "preview": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
  },
  {
    "path": "Loader/Loader.cpp",
    "chars": 6260,
    "preview": "\r\n#include \"stdafx.h\"\r\n\r\nBOOL APIENTRY DllMain( HANDLE hModule, DWORD dwReason, LPVOID lpReserved )\r\n{\r\n\tswitch ( dwReas"
  },
  {
    "path": "Loader/Loader.def",
    "chars": 34,
    "preview": "LIBRARY\tLoader\r\n\r\nEXPORTS\r\n\tLoad\r\n"
  },
  {
    "path": "Loader/Loader.h",
    "chars": 823,
    "preview": "// The following ifdef block is the standard way of creating macros which make exporting \r\n// from a DLL simpler. All fi"
  },
  {
    "path": "Loader/Loader.vcxproj",
    "chars": 5342,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"12.0\" xmlns=\"http://schemas.micro"
  },
  {
    "path": "Loader/Loader.vcxproj.filters",
    "chars": 1365,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbui"
  },
  {
    "path": "Loader/stdafx.cpp",
    "chars": 293,
    "preview": "// stdafx.cpp : source file that includes just the standard includes\r\n// Loader.pch will be the pre-compiled header\r\n// "
  },
  {
    "path": "Loader/stdafx.h",
    "chars": 511,
    "preview": "// stdafx.h : include file for standard system include files,\r\n// or project specific include files that are used freque"
  },
  {
    "path": "Notepad++UDL.xml",
    "chars": 6485,
    "preview": "<NotepadPlus>\n    <UserLang name=\"Razor\" ext=\"\" udlVersion=\"2.1\">\n        <Settings>\n            <Global caseIgnored=\"no"
  },
  {
    "path": "Platform/Platform.cpp",
    "chars": 2052,
    "preview": "#include \"Platform.h\"\n\nHINSTANCE hInstance = NULL;\nHICON hRazorIcon = NULL;\nHFONT hRazorFont = NULL;\n\nBOOL APIENTRY DllM"
  },
  {
    "path": "Platform/Platform.def",
    "chars": 54,
    "preview": "LIBRARY\tPlatform\n\nEXPORTS\n\tCaptureScreen\n\tBringToFront"
  },
  {
    "path": "Platform/Platform.h",
    "chars": 366,
    "preview": "#pragma once\n\n#define WIN32_LEAN_AND_MEAN\n#include <windows.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h"
  },
  {
    "path": "Platform/Platform.vcxproj",
    "chars": 7219,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" ToolsVersion=\"15.0\" xmlns=\"http://schemas.microso"
  },
  {
    "path": "Platform/Platform.vcxproj.filters",
    "chars": 1171,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
  },
  {
    "path": "README.md",
    "chars": 2599,
    "preview": "# Razor: An Ultima Online Assistant\n\n![Razor Logo](https://imgur.com/jTtHLVF.png)\n\nRazor is a free tool designed to help"
  },
  {
    "path": "Razor/Agents/Agents.cs",
    "chars": 4800,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https:"
  },
  {
    "path": "Razor/Agents/BuyAgent.cs",
    "chars": 21317,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Agents/IgnoreAgent.cs",
    "chars": 11134,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Agents/OrganizerAgent.cs",
    "chars": 13536,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Agents/RestockAgent.cs",
    "chars": 19211,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Agents/ScavengerAgent.cs",
    "chars": 13105,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Agents/SearchExemptionAgent.cs",
    "chars": 9211,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Agents/SellAgent.cs",
    "chars": 13983,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Agents/UseOnceAgent.cs",
    "chars": 13206,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Boat/BoatWindow.Designer.cs",
    "chars": 33874,
    "preview": "using System.Windows.Forms;\n\nnamespace Assistant.Boat\n{\n    partial class BoatWindow\n    {\n        /// <summary>\n      "
  },
  {
    "path": "Razor/Boat/BoatWindow.cs",
    "chars": 19720,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Boat/BoatWindow.resx",
    "chars": 76375,
    "preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n  <!-- \n    Microsoft ResX Schema \n    \n    Version 2.0\n    \n    The prim"
  },
  {
    "path": "Razor/Client/ClassicUO.cs",
    "chars": 23230,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Client/Client.cs",
    "chars": 11444,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https:"
  },
  {
    "path": "Razor/Client/OSI.cs",
    "chars": 32253,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Client/UOAssist.cs",
    "chars": 15269,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https:"
  },
  {
    "path": "Razor/Core/ActionQueue.cs",
    "chars": 23689,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/BandageTimer.cs",
    "chars": 7387,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/BodCapture.cs",
    "chars": 6286,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/BuffDebuffManager.cs",
    "chars": 18582,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/ClassicUOManager.cs",
    "chars": 7143,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/Commands.cs",
    "chars": 24088,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/ContainerLabels.cs",
    "chars": 5009,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/CooldownManager.cs",
    "chars": 4607,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https:"
  },
  {
    "path": "Razor/Core/Counters.cs",
    "chars": 24122,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/DamageTracker.cs",
    "chars": 7228,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https:"
  },
  {
    "path": "Razor/Core/Dress.cs",
    "chars": 4266,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/DressList.cs",
    "chars": 15133,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/EncodedSpeech.cs",
    "chars": 5352,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/FriendsManager.cs",
    "chars": 19019,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/GateTimer.cs",
    "chars": 2919,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https:"
  },
  {
    "path": "Razor/Core/Geometry.cs",
    "chars": 14093,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/GoldPerHourTimer.cs",
    "chars": 3735,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https:"
  },
  {
    "path": "Razor/Core/Item.cs",
    "chars": 26555,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/ItemID.cs",
    "chars": 3028,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/Main.cs",
    "chars": 15329,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/Map.cs",
    "chars": 5370,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/MemHelper.cs",
    "chars": 1705,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/MessageInBottleCapture.cs",
    "chars": 4441,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/MessageManager.cs",
    "chars": 5366,
    "preview": "#region license\n\n// Razor: An Ultima Online Assistant\n// Copyright (C) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/Mobile.cs",
    "chars": 17537,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https:"
  },
  {
    "path": "Razor/Core/MsgQueue.cs",
    "chars": 5335,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/ObjectPropertyList.cs",
    "chars": 13348,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/OverheadManager.cs",
    "chars": 8239,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/Overrides.cs",
    "chars": 2825,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/PasswordMemory.cs",
    "chars": 6223,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/Ping.cs",
    "chars": 2902,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/Player.cs",
    "chars": 29969,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https:"
  },
  {
    "path": "Razor/Core/ScreenCapture.cs",
    "chars": 10479,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/Serial.cs",
    "chars": 3859,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/SkillTimer.cs",
    "chars": 2083,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https:"
  },
  {
    "path": "Razor/Core/Spells.cs",
    "chars": 22496,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/StaffToolsManager.cs",
    "chars": 7570,
    "preview": "#region license\n\n// Razor: An Ultima Online Assistant\n// Copyright (C) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/StealthSteps.cs",
    "chars": 2294,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/SystemMessages.cs",
    "chars": 3445,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/Targeting.cs",
    "chars": 48538,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/TargetingClosest.cs",
    "chars": 14366,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/TargetingNextPrevious.cs",
    "chars": 33119,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/TargetingRandom.cs",
    "chars": 12685,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/TextFilterManager.cs",
    "chars": 4127,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/Timer.cs",
    "chars": 9436,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/UOEntity.cs",
    "chars": 3841,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/Utility.cs",
    "chars": 14386,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/WaypointManager.cs",
    "chars": 7275,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Core/World.cs",
    "chars": 5587,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Core/ZLib.cs",
    "chars": 13935,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Filters/Death.cs",
    "chars": 1453,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Filters/Filter.cs",
    "chars": 4728,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Filters/Light.cs",
    "chars": 2715,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Filters/MessageFilter.cs",
    "chars": 3789,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Filters/MobileFilter.cs",
    "chars": 3233,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Filters/SoundFilters.cs",
    "chars": 4002,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Filters/SoundMusicManager.cs",
    "chars": 21136,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Filters/StaffItems.cs",
    "chars": 3436,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Filters/TargetFilterManager.cs",
    "chars": 7123,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Filters/VetRewardGump.cs",
    "chars": 2811,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Filters/WallStaticFilter.cs",
    "chars": 4233,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Filters/Weather.cs",
    "chars": 1528,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/Gumps/Gump.cs",
    "chars": 27081,
    "preview": "#region license\n/* Copyright (C) 2009 Matthew Geyer\n * \n * This file is part of UO Machine.\n * \n * UO Machine is free s"
  },
  {
    "path": "Razor/Gumps/GumpButtonType.cs",
    "chars": 862,
    "preview": "#region license\n/* Copyright (C) 2009 Matthew Geyer\n * \n * This file is part of UO Machine.\n * \n * UO Machine is free s"
  },
  {
    "path": "Razor/Gumps/GumpCollection.cs",
    "chars": 2667,
    "preview": "#region license\n/* Copyright (C) 2009 Matthew Geyer\n * \n * This file is part of UO Machine.\n * \n * UO Machine is free s"
  },
  {
    "path": "Razor/Gumps/GumpElement.cs",
    "chars": 13650,
    "preview": "#region license\n/* Copyright (C) 2009 Matthew Geyer\n * \n * This file is part of UO Machine.\n * \n * UO Machine is free s"
  },
  {
    "path": "Razor/Gumps/GumpPage.cs",
    "chars": 5252,
    "preview": "#region license\n/* Copyright (C) 2009 Matthew Geyer\n * \n * This file is part of UO Machine.\n * \n * UO Machine is free s"
  },
  {
    "path": "Razor/Gumps/GumpType.cs",
    "chars": 1317,
    "preview": "#region license\n/* Copyright (C) 2009 Matthew Geyer\n * \n * This file is part of UO Machine.\n * \n * UO Machine is free s"
  },
  {
    "path": "Razor/Gumps/Internal/AgentsGump.cs",
    "chars": 13183,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Gumps/Internal/BoatControlGump.cs",
    "chars": 7421,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Gumps/Internal/BuffGump.cs",
    "chars": 6940,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Gumps/Internal/CooldownGump.cs",
    "chars": 4060,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Gumps/Internal/DamageTrackerGump.cs",
    "chars": 2318,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Gumps/Internal/DamageTrackerListGump.cs",
    "chars": 1283,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Gumps/Internal/HotKeyGump.cs",
    "chars": 4342,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Gumps/Internal/InputDialogGump.cs",
    "chars": 2904,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Gumps/Internal/ItemInfoGump.cs",
    "chars": 4397,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Gumps/Internal/MobileInfoGump.cs",
    "chars": 4655,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Gumps/Internal/SystemMessagesGump.cs",
    "chars": 3209,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/Gumps/Internal/TestMessageGump.cs",
    "chars": 1661,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https"
  },
  {
    "path": "Razor/HotKeys/Counters.cs",
    "chars": 1611,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/HotKeys/HotKeys.cs",
    "chars": 31031,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/HotKeys/Misc.cs",
    "chars": 19265,
    "preview": "#region license\n// Razor: An Ultima Online Assistant\n// Copyright (c) 2022 Razor Development Community on GitHub <https:"
  },
  {
    "path": "Razor/HotKeys/SkillHotKeys.cs",
    "chars": 1845,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/HotKeys/SpecialMoves.cs",
    "chars": 13674,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  },
  {
    "path": "Razor/HotKeys/Undress.cs",
    "chars": 3293,
    "preview": "#region license\r\n// Razor: An Ultima Online Assistant\r\n// Copyright (c) 2022 Razor Development Community on GitHub <http"
  }
]

// ... and 178 more files (download for full content)

About this extraction

This page contains the full source code of the markdwags/Razor GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 378 files (5.9 MB), approximately 1.6M tokens, and a symbol index with 5391 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!