Skip to content

Instantly share code, notes, and snippets.

@JerryLokjianming
Last active February 23, 2025 00:44
Show Gist options
  • Save JerryLokjianming/71dac05f27f8c96ad1c8941b88030451 to your computer and use it in GitHub Desktop.
Save JerryLokjianming/71dac05f27f8c96ad1c8941b88030451 to your computer and use it in GitHub Desktop.
Crack Sublime Text 3.2.2 Build 3211 and Sublime Text 4 Alpha 4098 with Hex

How to Crack Sublime Text 3.2.2 Build 3211 with Hex Editor (Windows | Without License) ↓

  1. Download & Install Sublime Text 3.2.2 Build 3211
  2. Visit https://hexed.it/
  3. Open file select sublime_text.exe
  4. Offset 0x8545: Original 84 -> 85
  5. Offset 0x08FF19: Original 75 -> EB
  6. Offset 0x1932C7: Original 75 -> 74 (remove UNREGISTERED in title bar, so no need to use a license)
  7. Export File and save it to location you want
  8. Backup sublime_text.exe file (just rename)
  9. Copy sublime_text.exe modified to directory Sublime Text 3
  10. Happy Coding :)
Screenshot

Screenshot


How to Crack Sublime Text 4 Alpha 4098 with Hex Editor (Windows | Without License) ↓

  1. Download & Install Sublime Text 4 Alpha 4094
  2. Visit https://hexed.it/
  3. Open file select sublime_text.exe
  4. Go to Address: 0000A700 change 80 38 00 to FE 00 90
  5. Export File and save it to location you want
  6. Backup sublime_text.exe file (just rename)
  7. Copy sublime_text.exe modified to directory Sublime Text 4 (i.e C:\Program Files\Sublime Text)
  8. Use this License
----- BEGIN LICENSE ----- 
TwitterInc 
200 User License 
EA7E-890007 
1D77F72E 390CDD93 4DCBA022 FAF60790 
61AA12C0 A37081C5 D0316412 4584D136 
94D7F7D4 95BC8C1C 527DA828 560BB037 
D1EDDD8C AE7B379F 50C9D69D B35179EF 
2FE898C4 8E4277A8 555CE714 E1FB0E43 
D5D52613 C3D12E98 BC49967F 7652EED2 
9D2D2E61 67610860 6D338B72 5CF95C69 
E36B85CC 84991F19 7575D828 470A92AB 
------ END LICENSE ------
  1. Happy Coding :)
Screenshot

Screenshot


Blocked by Microsoft Defender SmartScreen -> More Info -> Run Anyway

Screenshot

Screenshot

Screenshot


How to Crack Sublime Text 3 & 4 Alpha 4094 with Hex Editor (Linux & MacOS | With License) ↓

  1. Download & Install Sublime Text 3 or 4
  2. Visit https://hexed.it/
  3. Open file select sublime_text
    • Linux Location: /opt/sublime_text/sublime_text
    • MacOS Location: /Application/Sublime Text [version].app (Correct Me If I'm Wrong)
  4. Search 97 94 0D and Change to 00 00 00
  5. Export File and save it to location you want
  6. Backup sublime_text file (just rename)
  7. Copy sublime_text modified to default directory Sublime Text
  8. Use this License
----- BEGIN LICENSE ----- 
TwitterInc 
200 User License 
EA7E-890007 
1D77F72E 390CDD93 4DCBA022 FAF60790 
61AA12C0 A37081C5 D0316412 4584D136 
94D7F7D4 95BC8C1C 527DA828 560BB037 
D1EDDD8C AE7B379F 50C9D69D B35179EF 
2FE898C4 8E4277A8 555CE714 E1FB0E43 
D5D52613 C3D12E98 BC49967F 7652EED2 
9D2D2E61 67610860 6D338B72 5CF95C69 
E36B85CC 84991F19 7575D828 470A92AB 
------ END LICENSE ------
  1. Happy Coding :)
Screenshot

Screenshot


@maboloshi
Copy link

I don't care what you think. Use it or not. You can ask @maboloshi whether he can access to its source codes or not. But yes you don't have to trust him.

Feel free to ask for access if you consider yourself be able to improve it. E.g., add patch patterns for macos or arm64.

Yeah, I'm using it. It's more worry-free.

@kodmanyagha
Copy link

kodmanyagha commented Jan 14, 2025

https://github.com/n6333373/sublime-self-patcher

NEVER DOWNLOAD SOMEBODY'S CLOSED SOURCE THINGS!!!

I don't trust any closed source too. If your intentions are not bad, why are you closing the source? There are lots of scæmmer around here. Everyday scæmmers posting malware links in here and I tired to report them. Look at the pictures down below:

Who the hell is n6333373? He has only one repo, this repo created 2 months ago and this is closed source. This is highly suspicious. I think everybody must report this.

image image

@n6333373
Copy link

Yeah. All closed source projects are suspicious. Do whatever you want and share, kid.

@kodmanyagha
Copy link

Yeah. All closed source projects are suspicious. Do whatever you want and share, kid.

Kid? If you saw me you would swallow your tongue. This gist is already explaining the fix. Why don't you share source codes little keyboard boy?

@n6333373
Copy link

n6333373 commented Jan 14, 2025

That's fine if you don't want to use it. I just won't open source it to every one. I don't care whether people want to use it or not.

This gist is already explaining the fix.

The value of the creation is automation without a dependency (well, not if you consider Sublime Text itself as a dependency) and most likely future-proof. You can always do it manually I know but I am lazy and I share my creation. I don't understand why I must open source it. If you don't trust it, you just don't use it. You are not forced to use it. And I actually provide a more active gist, where updates patterns much more often, in the readme.

@Destitute-Streetdwelling-Guttersnipe
Copy link

Destitute-Streetdwelling-Guttersnipe commented Jan 17, 2025 via email

@n6333373
Copy link

n6333373 commented Jan 17, 2025

@n6333373 no need to use a plugin, you can patch using ST console (Ctrl+`) Just write some Python code here: with open("sublime_text", "r+b") as f: (d:=f.read().replace(b'123',bytes.fromhex('33 32 31'))), f.seek(0), f.write(d)

Whatever works for people. That's only for stable build though. And still as I said, the value of the creation is automation without a dependency or the need of memorize/find something like patterns.

@CypherpunkSamurai
Copy link

CypherpunkSamurai commented Jan 19, 2025

Here's a patch tool in Python3

# Sublime Text Win x64 Build 4189 Patch
PATCH_BYTES = bytes([0x80, 0x79, 0x05, 0x00, 0x0F, 0x94, 0xC2])
PATCH_BYTES_UNLIMITED = bytes([0xC6, 0x41, 0x05, 0x01, 0xB2, 0x00, 0x90])

import os
import logging

# Set up logging
logging.basicConfig(
    filename='patch_log.txt',
    level=logging.INFO,
    format='%(asctime)s - %(message)s',
    datefmt='%Y-%m-%d %H:%M:%S'
)

def patch_binary(file_path: str, original: bytes, replacement: bytes) -> None:
    """
    Patch a binary file by replacing all occurrences of a byte pattern with another byte pattern.
    :param file_path: The path to the binary file to patch.
    :param original: The byte pattern to search for.
    :param replacement: The byte pattern to replace the original pattern with.
    """
    # Read the entire file
    with open(file_path, 'rb') as f:
        content = bytearray(f.read())

    # Find and replace all occurrences
    count = 0
    pos = 0
    while True:
        pos = content.find(original, pos)
        if pos == -1:  # No more matches
            break
        content[pos:pos + len(original)] = replacement
        pos += len(replacement)
        count += 1

    # Write the modified content back to file and log results
    if count > 0:
        with open(file_path, 'wb') as f:
            f.write(content)
        message = f"Successfully patched {count} occurrence(s) in {file_path}"
        print(message)
        logging.info(message)
    else:
        message = f"Pattern not found in the file: {file_path}"
        print(message)
        logging.warning(message)

if __name__ == "__main__":
    # Log the start of the patching process
    logging.info("Starting the patching process...")

    if not os.path.exists("sublime_text.exe"):
        error_message = "sublime_text.exe not found in the current directory. Please place this script in the same directory as sublime_text.exe and run it again."
        print(error_message)
        logging.error(error_message)
        exit()

    # Patch the Sublime Text binary
    binary_path = r"sublime_text.exe"
    try:
        patch_binary(binary_path, PATCH_BYTES, PATCH_BYTES_UNLIMITED )
    except Exception as e:
        error_message = f"Error patching file: {e}"
        print(error_message)
        logging.error(error_message)

Here's One in Powershell

# Elevate Powershell Execution Policy
Set-ExecutionPolicy RemoteSigned

# Define the byte patterns
$PATCH_BYTES = [byte[]](0x80,0x79,0x05,0x00,0x0F,0x94,0xC2)
$PATCH_BYTES_UNLIMITED = [byte[]](0xC6,0x41,0x05,0x01,0xB2,0x00,0x90)

# Path to sublime_text.exe (adjust this path as needed)
$exePath = "sublime_text.exe"

# Check if file exists and read the executable as a byte array
if (-not (Test-Path $exePath)) {
    Write-Host "Error: File not found at $exePath"
    exit 1
}
$fileBytes = [System.IO.File]::ReadAllBytes($exePath)

# Find the pattern
$patternPos = -1
for ($i = 0; $i -lt ($fileBytes.Length - $PATCH_BYTES.Length); $i++) {
    $match = $true
    for ($j = 0; $j -lt $PATCH_BYTES.Length; $j++) {
        if ($fileBytes[$i + $j] -ne $PATCH_BYTES[$j]) {
            $match = $false
            break
        }
    }
    if ($match) {
        $patternPos = $i
        break
    }
}

if ($patternPos -ne -1) {
    # Create backup
    Copy-Item $exePath "$exePath.free.exe"
    
    # Apply patch
    for ($i = 0; $i -lt $PATCH_BYTES_UNLIMITED.Length; $i++) {
        $fileBytes[$patternPos + $i] = $PATCH_BYTES_UNLIMITED[$i]
    }
    
    # Write patched file
    [System.IO.File]::WriteAllBytes($exePath, $fileBytes)
    Write-Host "Patch applied successfully!"
} else {
    Write-Host "Pattern not found. Unable to patch."
}

# Revert Execution Policy
Set-ExecutionPolicy Restricted

Here's one in bash:

#!/bin/bash

# Define the byte patterns (in hex)
PATCH_BYTES="\x80\x79\x05\x00\x0F\x94\xC2"
PATCH_BYTES_UNLIMITED="\xC6\x41\x05\x01\xB2\x00\x90"

# Path to sublime_text executable
exe_path="sublime_text"

# Check if file exists
if [ ! -f "$exe_path" ]; then
    echo "Error: File not found at $exe_path"
    exit 1
fi

# Create backup
cp "$exe_path" "$exe_path.free"

# Use perl to perform the binary pattern replacement
# -pi.bak creates a backup and modifies file in-place
# \Q...\E quotes the pattern literally
perl -pi.bak -e "s/\Q$PATCH_BYTES\E/$PATCH_BYTES_UNLIMITED/" "$exe_path"

if [ $? -eq 0 ]; then
    echo "Patch applied successfully!"
else
    echo "Pattern not found. Unable to patch."
    # Restore original if patch failed
    mv "$exe_path.bak" "$exe_path"
fi

# Clean up backup created by perl
rm -f "$exe_path.bak"

@CypherpunkSamurai
Copy link

Stop running random .exe files you find on github or random links

@Reelix
Copy link

Reelix commented Jan 19, 2025

CypherpunkSamurai's version is fully open source, has nothing malicious, and I can confirm it works.

Great work! :)

@Hazuki-san
Copy link

4192 hex (Windows x64/leogx9r's method):
48 8B 96 B0 02 00 00 48 8D 0D 4A 06 00 00 41 B8 88 13 00 00 E8 21 DC 1A 00 48 8B 96 B0 02 00 00 48 8D 0D BB 07 00 00 41 B8 98 3A 00 00 E8 08 DC 1A 00 -> 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 (Invalidation/Validation Functions)
28 5F 5E C3 41 57 41 56 41 54 56 57 53 48 81 EC E8 -> 28 5F 5E C3 C3 57 41 56 41 54 56 57 53 48 81 EC E8 (License Notify Thread, same as 4186)
20 C8 C3 41 57 41 56 -> 20 C8 C3 48 31 C0 C3 (License Validity Checking, same as 4186)
5F C3 56 57 53 48 83 EC 20 89 D6 -> 5F C3 48 31 C0 48 FF C0 C3 89 D6 (Server Validation Thread, same as 4186)

There was no crash reporter code found in this version.
After patch just enter anything to license and it should work.

Also available here

@Vitalicus
Copy link

CypherpunkSamurai Thanks !!!

@strotee
Copy link

strotee commented Jan 20, 2025

Thanks Hazuki-san

@Reelix
Copy link

Reelix commented Jan 20, 2025

CypherpunkSamurai's patch also works in Build 4192.

@CypherpunkSamurai
Copy link

CypherpunkSamurai commented Jan 20, 2025

Thanks guys, also thanks to the people who found the binary opcodes using Ghidra or IDA 👍🏻

When a new patch opcode is available just update the code with new hex opcodes.

@Vitalicus
Copy link

Vitalicus commented Jan 21, 2025

On Powershell script can be added
first line - "Set-ExecutionPolicy RemoteSigned" , for set the execution policy
......
last line - "Set-ExecutionPolicy Restricted", set back the default policy

@Bruskyer
Copy link

can you share for stable ST 4192 windows 64
Offset: xxxx Patch: xxxxx
Thanks

@alexkoj
Copy link

alexkoj commented Jan 22, 2025

can you share for stable ST 4192 windows 64 Offset: xxxx Patch: xxxxx Thanks

This patch working on my pc. i'm working without error
Use any text as License key


[=] Offset 0x4dfa  : invalidate1
         -  e8 21 dc 1a 00
         +  90 90 90 90 90
[=] Offset 0x4e13  : invalidate2
         -  e8 08 dc 1a 00
         +  90 90 90 90 90
[=] Offset 0x80023 : license_notification
         -  41 57 41 56
         +  48 31 c0 c3
[=] Offset 0x80355 : license_check.1
         -  41 57 41 56
         +  48 31 c0 c3
[=] Offset 0x81b12 : server_validate
         -  56 57 53 48 83 ec 20
         +  48 31 c0 48 ff c0 c3

@Bruskyer
Copy link

Bruskyer commented Jan 22, 2025

0x81b12

Thank you @alexkoj
its working on win11 x64

@bankhonggioi
Copy link

can you share for stable ST 4192 windows 64 Offset: xxxx Patch: xxxxx Thanks

This patch working on my pc. i'm working without error Use any text as License key


[=] Offset 0x4dfa  : invalidate1
         -  e8 21 dc 1a 00
         +  90 90 90 90 90
[=] Offset 0x4e13  : invalidate2
         -  e8 08 dc 1a 00
         +  90 90 90 90 90
[=] Offset 0x80023 : license_notification
         -  41 57 41 56
         +  48 31 c0 c3
[=] Offset 0x80355 : license_check.1
         -  41 57 41 56
         +  48 31 c0 c3
[=] Offset 0x81b12 : server_validate
         -  56 57 53 48 83 ec 20
         +  48 31 c0 48 ff c0 c3

it works fine with version 4192 (windows 10 22H2 64 bit)

@TheGridRepo
Copy link

anyone got it working for windows 11

@Reelix
Copy link

Reelix commented Jan 23, 2025

anyone got it working for windows 11

Working on the latest version (Build 4192) on Windows 11 using CypherpunkSamurai's version

@TheGridRepo
Copy link

TheGridRepo commented Jan 23, 2025 via email

@RakeshChowdhury
Copy link

@TheGridRepo

  1. paste the code into a .py file.
  2. Place it in the same folder as the binary.
  3. Change the binary path (ie. Remove the .exe if on Linux).
  4. Install python3.
  5. Open a terminal in the folder of sublime text (or copy over the binary to a new folder)
  6. run the code by "python3 script.py"

@TheGridRepo
Copy link

@Fadi002
Copy link

Fadi002 commented Feb 22, 2025

heres an updated version i made it and test it on the latest version
https://gist.github.com/Fadi002/b65cbbffb5eef7554a3c6856603ca4bb

@Destitute-Streetdwelling-Guttersnipe
Copy link

@Fadi002
Copy link

Fadi002 commented Feb 22, 2025

@Fadi002 you only changed some text in the About dialog, dear 0xmrpepe This is not an effective patch.

I fixed the problem i will update the new code tomorrow

@Fadi002
Copy link

Fadi002 commented Feb 22, 2025

@Fadi002 you only changed some text in the About dialog, dear 0xmrpepe This is not an effective patch.

fixed the code now i removed the free popup message completely and tested it on windows 10

@Destitute-Streetdwelling-Guttersnipe
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment