Skip to content

Instantly share code, notes, and snippets.

@Ouroboros
Last active April 14, 2025 13:45
Show Gist options
  • Save Ouroboros/1a1e0b9c8bcbac2a519516aa5a12a52b to your computer and use it in GitHub Desktop.
Save Ouroboros/1a1e0b9c8bcbac2a519516aa5a12a52b to your computer and use it in GitHub Desktop.
Make Cursor Work with cppvsdbg

1. Modify cpptools/package.json

Remove this condition "when": "workspacePlatform == windows"

%USERPROFILE%\.cursor\extensions\ms-vscode.cpptools-1.23.5-win32-x64\package.json

    "type": "cppvsdbg",
    "label": "C++ (Windows)",
    "when1": "workspacePlatform == windows",

2. Bypass the signature verification of vsdbg.dll

Keyword signature

%USERPROFILE%\.cursor\extensions\ms-vscode.cpptools-1.23.5-win32-x64\debugAdapters\vsdbg\bin\vsdbg.dll

  body = sub_18008D374(Delimiter, "body");
  *(_OWORD *)signature = 0i64;
  si128 = _mm_load_si128((const __m128i *)&xmmword_1800D7CF0);
  LOBYTE(signature[0]) = 0;
  sub_18003A624(body, "signature", signature);
  v7 = signature;
  if ( si128.m128i_i64[1] > 0xFui64 )
    v7 = (void **)signature[0];
  if ( sub_1800B08EC(v6, v7) )      // <----- check signature, force String + 0x154 = 4
  {
    if ( *((_DWORD *)String + 0x154) != 4 )
      *((_DWORD *)String + 0x154) = 4;
  }
  else
  {
    *((_DWORD *)String + 0x154) = 5;
  }
.text:000000018006C09F 48 8D 15 9E 4B 06 00                    lea     rdx, aBody      ; "body"
.text:000000018006C0A6 48 8B CF                                mov     rcx, rdi
.text:000000018006C0A9 E8 C6 12 02 00                          call    sub_18008D374
.text:000000018006C0AE 0F 57 C0                                xorps   xmm0, xmm0
.text:000000018006C0B1 0F 11 44 24 20                          movups  xmmword ptr [rsp+58h+signature], xmm0
.text:000000018006C0B6 66 0F 6F 0D 32 BC 06 00                 movdqa  xmm1, cs:xmmword_1800D7CF0
.text:000000018006C0BE F3 0F 7F 4C 24 30                       movdqu  [rsp+58h+var_28], xmm1
.text:000000018006C0C4 C6 44 24 20 00                          mov     byte ptr [rsp+58h+signature], 0
.text:000000018006C0C9 4C 8D 44 24 20                          lea     r8, [rsp+58h+signature]
.text:000000018006C0CE 48 8D 15 43 57 06 00                    lea     rdx, aSignature_0 ; "signature"
.text:000000018006C0D5 48 8B C8                                mov     rcx, rax
.text:000000018006C0D8 E8 47 E5 FC FF                          call    sub_18003A624
.text:000000018006C0DD 48 8D 54 24 20                          lea     rdx, [rsp+58h+signature]
.text:000000018006C0E2 48 83 7C 24 38 0F                       cmp     qword ptr [rsp+58h+var_28+8], 0Fh
.text:000000018006C0E8 48 0F 47 54 24 20                       cmova   rdx, [rsp+58h+signature] ; pMessage
.text:000000018006C0EE E8 F9 47 04 00                          call    VerifySignature
.text:000000018006C0F3 84 C0                                   test    al, al
.text:000000018006C0F5 74 15                                   jz      short loc_18006C10C ; <-------- patch here
.text:000000018006C0F7 83 BB 50 05 00 00 04                    cmp     dword ptr [rbx+550h], 4
.text:000000018006C0FE 74 16                                   jz      short loc_18006C116
.text:000000018006C100 C7 83 50 05 00 00 04 00+                mov     dword ptr [rbx+550h], 4

Now, simply use a hex editor to modify 74 15 to 74 00 at 18006C0F5

@bianoengpeng
Copy link

bianoengpeng commented Feb 8, 2025

Can you advise on how to change the signature of ms-vscode.cpptools-1.23.6-win32-x64(vsdbg.dll)?
It would be great if modified DLL files could be provided. Thanks~

@Ouroboros
Copy link
Author

Can you advise on how to change the signature of ms-vscode.cpptools-1.23.6-win32-x64(vsdbg.dll)? It would be great if modified DLL files could be provided. Thanks~

My instructions are already very clear. You just need to find yourself a hex editor, locate the patch offset, and modify a single byte according to the directions.

@veygax
Copy link

veygax commented Feb 16, 2025

now it just says:


You may only use the C/C++ Extension for Visual Studio Code with Visual Studio
Code, Visual Studio or Visual Studio for Mac software to help you develop and
test your applications.

@zhylmzr
Copy link

zhylmzr commented Feb 24, 2025

Thanks a lot, works perfectly on cpptools-1.23.6

@ScrX666
Copy link

ScrX666 commented Feb 25, 2025

牛逼 成功运行

@CitaTo
Copy link

CitaTo commented Feb 27, 2025

Which hexeditor you are using? I am try many hex editor but do not found the above patch offset.
Thank you a lot

@bianoengpeng
Copy link

Which hexeditor you are using? I am try many hex editor but do not found the above patch offset. Thank you a lot

I used IDA Pro v8.3 to successfully modify and patch DLL file.

@CitaTo
Copy link

CitaTo commented Feb 27, 2025

thank you @bianoengpeng . Could you please sent me the modifed dll to [email protected]? Because the price for IDA Pro is too much for me. I tried x64dbg and HxD but did not found the offset.
Thank you alot

@Mirasire
Copy link

thank you @bianoengpeng . Could you please sent me the modifed dll to [email protected]? Because the price for IDA Pro is too much for me. I tried x64dbg and HxD but did not found the offset. Thank you alot

vscode extension-hex editor can do the same thing, and it's free. (find 488D159E4B0600)

@ndraiman
Copy link

ndraiman commented Mar 7, 2025

Instructions to patch file:

  1. Install Microsoft "Hex Editor" extension - https://marketplace.cursorapi.com/items?itemName=ms-vscode.hexeditor
  2. Open debugAdapters\vsdbg\bin\vsdbg.dll
    1. Create a backup before modifying the file.
  3. Find 488D159E4B0600 in binary format
    1. Ctrl + F
    2. Toggle "Search in Binary Mode"
    3. Example:
      image
  4. find 74 15 a bit below it:
    image
  5. Enable Hex Editor Edit Mode
    1. Ctrl + Shift + P
    2. Search Hex Edit
    3. Choose "Hex Editor: Switch Edit Mode"
      image
  6. Mark the 15 box and change to it 00:
    image
  7. Save changes.

@stormsen
Copy link

thanks

@jiangfeizi
Copy link

good, it works

@KimYC1223
Copy link

thanks!!! It's works for me

@Tim-1e
Copy link

Tim-1e commented Mar 25, 2025

works well,thanks. Tips Don't forget to replace all "workspacePlatform == windows" to 1 whether it in a expression or not

@li-zhixin
Copy link

{F0B51547-71BC-476D-81CB-03272EBF0456}
For C# user, ms-dotnettools.csharp-2.63.32-win32-x64, patch like the picture. 60CC6 15 -> 00

@REMvisual
Copy link

This is by far the coolest thing i have ever done. and it worked.
fuck yeah and fuck Microsoft.

@ionabio
Copy link

ionabio commented Apr 8, 2025

Thanks a lot for this. I was trying it in an ARM (Snapdragon) PC and obviously it is different . Does it need to be disassembled to locate the "signature" keyword?

@Ouroboros
Copy link
Author

Thanks a lot for this. I was trying it in an ARM (Snapdragon) PC and obviously it is different . Does it need to be disassembled to locate the "signature" keyword?

You need to reverse engineer it yourself, but since they're all compiled from the same codebase, it shouldn't be too difficult.

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