Skip to content

Commit

Permalink
Add support for 2.10.13 build 202675 client (last version for V2.x cl…
Browse files Browse the repository at this point in the history
…ients)
  • Loading branch information
aliencaocao committed Aug 17, 2024
1 parent e225097 commit b15d0a6
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 43 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Written in pure Python, supports latest versions of NetEase Cloud Music. Current
* 2.10.10 build 201297
* 2.10.11 build 201538
* 2.10.12 build 201849
* 2.10.13 build 202675 (last version of V2.x clients by NetEase)
* 3.0.0 WIP/正在开发中 (https://github.com/aliencaocao/netease_cloudmusic_discord_rpc/issues/26)

还会继续支持未来的新版本。/Support for future versions will be added.
Expand All @@ -43,15 +44,15 @@ Written in pure Python, supports latest versions of NetEase Cloud Music. Current

使用X关闭程序窗口后,程序会以托盘图标的形式在后台继续运行。右键托盘图标可以控制程序。

程序必须以UAC模式运行(管理员权限)才能正常工作。请右键exe文件,点击属性,在兼容性页面里勾选“以管理员身份运行”
程序必须以管理员运行才能正常工作。请右键exe文件,点击以管理员身份运行

与BetterDiscord等第三方Discord客户端不兼容。

Download the executable binary (exe) from the Release page, Keep the exe running.

If you close the program window with X, the program will continue to run in the background as a tray icon. Right-click the tray icon to control the program.

The program must be opened in UAC mode (Administrator permission) to work properly. Please right-click on the exe, click Properties, and check "Run as administrator" on the Compatibility page.
The program requires administrator permission to work properly. Please right-click on the exe, and click run as administrator.

Not compatible with third-party Discord clients such as BetterDiscord.

Expand Down
70 changes: 35 additions & 35 deletions scanning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@
"cells": [
{
"cell_type": "code",
"execution_count": 83,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"found version: 3.0.6.5811\n"
]
}
],
"source": [
"import wmi\n",
"import gc\n",
Expand All @@ -37,24 +27,23 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-01-21T08:51:49.781127800Z",
"start_time": "2024-01-21T08:51:49.559128600Z"
"end_time": "2024-08-17T03:46:44.856783Z",
"start_time": "2024-08-17T03:46:44.674785Z"
}
}
},
{
"cell_type": "code",
"execution_count": 84,
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"base_exe_address: 0x7FF6D7440000\n",
"base_dll_address: 0x7FFD3DCD0000\n"
"found version: 2.10.13.6067\n"
]
}
],
"execution_count": 1
},
{
"cell_type": "code",
"source": [
"from pyMeow import *\n",
"\n",
Expand All @@ -67,25 +56,24 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2024-01-21T08:51:49.952130400Z",
"start_time": "2024-01-21T08:51:49.920127200Z"
"end_time": "2024-08-17T03:46:54.004252Z",
"start_time": "2024-08-17T03:46:53.969252Z"
}
}
},
{
"cell_type": "code",
"execution_count": 6,
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"found current at 0xA7A580: 38.851000\n",
"found song array offset at 0xB2BCB0: 1458767558\n",
"found length at 0xB2CA98: 255.205306\n"
"base_exe_address: 0xB50000\n",
"base_dll_address: 0x78EC0000\n"
]
}
],
"execution_count": 2
},
{
"cell_type": "code",
"source": [
"# Scanning for V2.x clients\n",
"import math\n",
Expand All @@ -99,7 +87,7 @@
" if not found_songarray:\n",
" try:\n",
" songid_array = r_uint(process, base_dll_address + offset)\n",
" string = '1458767558' # Change to current song ID\n",
" string = '511460368' # Change to current song ID\n",
" song_id = r_bytes(process, songid_array, len(string) * 2).decode('utf-16')\n",
" if song_id == string:\n",
" print('found song array offset at 0x%X: %s' % (offset, song_id))\n",
Expand All @@ -110,7 +98,7 @@
" if not found_length:\n",
" try:\n",
" length = r_float64(process, base_dll_address + offset)\n",
" if math.floor(length) == 255: # Change to song length, in seconds\n",
" if math.floor(length) == 193: # Change to song length, in seconds\n",
" print('found length at 0x%X: %f' % (offset, length))\n",
" found_length = True\n",
" except Exception as e:\n",
Expand All @@ -119,7 +107,7 @@
" if not found_current:\n",
" try:\n",
" current = r_float64(process, base_dll_address + offset)\n",
" if math.floor(current) == 38: # Change to current progress, in seconds\n",
" if math.floor(current) == 11: # Change to current progress, in seconds\n",
" print('found current at 0x%X: %f' % (offset, current))\n",
" found_current = True\n",
" except Exception as e:\n",
Expand All @@ -128,10 +116,22 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-10-26T15:13:15.516077600Z",
"start_time": "2023-10-26T15:13:04.607708300Z"
"end_time": "2024-08-17T05:00:29.326330Z",
"start_time": "2024-08-17T05:00:18.541107Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"found current at 0xA7A590: 11.333000\n",
"found song array offset at 0xB2BCD0: 511460368\n",
"found length at 0xB2CAB8: 193.757583\n"
]
}
}
],
"execution_count": 5
},
{
"cell_type": "code",
Expand Down
2 changes: 1 addition & 1 deletion scanning.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
play 爱你没错 by 雷小宝 and run the brute force script in scanning.ipynb to get current and length offsets. Data type in cheat engine is double for current time, and string for searching song id.
play Shed a Light (Like Instrumental Mix) (https://music.163.com/#/song?id=511460368) and run the brute force script in scanning.ipynb to get current and length offsets. Data type in cheat engine is double for current time, and string for searching song id.
in cheat engine, scan for string of the song id in all memory space, find the memory address that holds the string, eliminate until one left, then use pointer scan for this address and find any offset of cloudmusic.dll with offsets 0 1 2 3 of some number and rest to be empty. Fill the offsets in notebook and scan to confirm the address (should agree with what cheat engine shows).
In cheat engine pointer scan page, need to switch around songs and pick the pointer that constantly points to the song id. Most pointers+offsets does not stay.
9 changes: 5 additions & 4 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from pystray import Icon as TrayIcon, Menu as TrayMenu, MenuItem as TrayItem
from win32api import GetFileVersionInfo, HIWORD, LOWORD

__version__ = '0.3.4'
__version__ = '0.3.5'

logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
Expand All @@ -46,7 +46,9 @@
'2.10.10.4509': {'current': 0xA77580, 'song_array': 0xB282CC},
'2.10.10.4689': {'current': 0xA79580, 'song_array': 0xB2AD10},
'2.10.11.4930': {'current': 0xA7A580, 'song_array': 0xB2BCB0},
'2.10.12.5241': {'current': 0xA7A580, 'song_array': 0xB2BCB0}, }
'2.10.12.5241': {'current': 0xA7A580, 'song_array': 0xB2BCB0},
'2.10.13.6067': {'current': 0xA7A590, 'song_array': 0xB2BCD0},
}
# '3.0.6.5811': {'current': 0x192B7F0, 'song_array': 0x0196DC38, 'song_array_offsets': [0x398, 0x0, 0x0, 0x8, 0x8, 0x50, 0xBA0]}, } # TODO: song array offsets are different for every session, current and song_array stays same

frozen = getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS')
Expand All @@ -56,9 +58,8 @@
user_startup_folder = os.path.join(os.path.expandvars('%APPDATA%'), r'Microsoft\Windows\Start Menu\Programs\Startup')
startup_file_path = os.path.join(user_startup_folder, 'Netease Cloud Music Discord RPC.bat')
start_minimized = '--min' in sys.argv

# regexes
re_song_id = re.compile(r'(\d+)')

logger.info(f"Netease Cloud Music Discord RPC v{__version__}\nRunning on Python {sys.version}\nSupporting NCM version: {', '.join(offsets.keys())}")


Expand Down
2 changes: 1 addition & 1 deletion src/version.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Version: 0.3.4.0
Version: 0.3.5.0
CompanyName: aliencaocao
FileDescription: Netease Cloudmusic Discord RPC
InternalName: Netease Cloudmusic Discord RPC
Expand Down

0 comments on commit b15d0a6

Please sign in to comment.