Skip to content

Commit

Permalink
Add support for 2.10.8 build 200945
Browse files Browse the repository at this point in the history
bump version to 0.2.5
Fix README.md lines
  • Loading branch information
aliencaocao committed Apr 22, 2023
1 parent b2a059b commit 995746d
Show file tree
Hide file tree
Showing 6 changed files with 160 additions and 199 deletions.
34 changes: 27 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 网易云音乐 Discord Rich Presence (RPC)

## 介绍 About
支持同步歌曲,歌手,专辑,专辑封面和目前歌曲的播放时长和状态。歌曲的总时长暂不支持显示。
支持同步歌曲,歌手,专辑,专辑封面和目前歌曲的播放时长和状态。歌曲的总时长暂不支持显示(https://github.com/aliencaocao/netease_cloudmusic_discord_rpc/discussions/16)

Supports
synchronizing
Expand All @@ -25,7 +25,7 @@ song
is
not
supported
yet.
yet (https://github.com/aliencaocao/netease_cloudmusic_discord_rpc/discussions/16).

纯Python写成,支持最新版网易云音乐,目前只支持Windows客户端。

Expand All @@ -48,18 +48,38 @@ Windows
client.

目前支持版本:
2.7.1 build 198277(微软商店版本)
2.10.5 build 200537(微软商店版本)
2.10.6 build 200601
2.10.7 build 200847
2.7.1
build
198277(微软商店版本)
2.10.5
build
200537(微软商店版本)
2.10.6
build
200601
2.10.7
build
200847
2.10.8
build
200945
还会继续支持未来的新版本。

Currently supported versions:
2.7.1 build 198277 (Microsoft Store version)
2.10.5 build 200537 (Microsoft Store version)
2.10.6 build 200601
2.10.7 build 200847
Support for future versions will be added.
2.10.8
build
200945
Support
for
future
versions
will
be
added.

旧版本(2.10.3及以下)可以使用这个项目:https://github.com/Kxnrl/NetEase-Cloud-Music-DiscordRPC

Expand Down
128 changes: 128 additions & 0 deletions scanning.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true,
"ExecuteTime": {
"start_time": "2023-04-22T10:04:13.452175Z",
"end_time": "2023-04-22T10:04:13.647320Z"
}
},
"outputs": [],
"source": [
"import wmi\n",
"import gc\n",
"wmic = wmi.WMI()\n",
"process = wmic.Win32_Process(name=\"cloudmusic.exe\")\n",
"process = [p for p in process if '--type=' not in p.ole_object.CommandLine]\n",
"if not process:\n",
" raise RuntimeError('No candidate process found')\n",
"elif len(process) != 1:\n",
" raise RuntimeError('Multiple candidate processes found!')\n",
"else:\n",
" process = process[0]\n",
" pid = process.ole_object.ProcessId\n",
" del process\n",
" del wmic\n",
" gc.collect()"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false,
"ExecuteTime": {
"start_time": "2023-04-22T10:04:13.646295Z",
"end_time": "2023-04-22T10:04:13.692753Z"
}
},
"outputs": [],
"source": [
"from pyMeow import open_process, get_module, r_float64, close_process, get_module, r_bytes, r_uint\n",
"import psutil\n",
"\n",
"process = open_process(pid)\n",
"ps_util_process = psutil.Process(pid)\n",
"base_address = get_module(process, 'cloudmusic.dll')['base']"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {
"collapsed": false,
"ExecuteTime": {
"start_time": "2023-04-22T10:08:53.381381Z",
"end_time": "2023-04-22T10:09:29.931530Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"found current at 0xa74570: 55.765\n",
"found song array offset at 0xb24f28: 1458767558\n",
"found length at 0xb25d18: 255.24\n"
]
}
],
"source": [
"for offset in range(0xA70000, 0xC20000): # Change to estimated memory range\n",
" found_songarray = False\n",
" found_length = False\n",
" found_current = False\n",
" try:\n",
" songid_array = r_uint(process, base_address + offset)\n",
" song_id = r_bytes(process, songid_array, 0x14).decode('utf-16')\n",
" if song_id == '1458767558': # Change to current song ID\n",
" print(f'found song array offset at {hex(offset)}: {song_id}')\n",
" found_songarray = True\n",
" except Exception as e:\n",
" pass\n",
"\n",
" try:\n",
" length = r_float64(process, base_address + offset)\n",
" if length > 255 and length < 256: # Change to song length, in seconds\n",
" print(f'found length at {hex(offset)}: {length}')\n",
" found_length = True\n",
" except Exception as e:\n",
" pass\n",
"\n",
" try:\n",
" current = r_float64(process, base_address + offset)\n",
" if current > 55 and current < 56: # Change to current progress, in seconds\n",
" print(f'found current at {hex(offset)}: {current}')\n",
" found_current = True\n",
" except Exception as e:\n",
" pass\n",
" if found_songarray and found_length and found_current:\n",
" break"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.2"
}
},
"nbformat": 4,
"nbformat_minor": 0
}
2 changes: 1 addition & 1 deletion scanning.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
play 爱你没错 by 雷小宝 and run the brute force scirpt in test.ipynb
play 爱你没错 by 雷小宝 and run the brute force scirpt in scanning.ipynb
5 changes: 3 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
from pypresence import Presence
from win32api import GetFileVersionInfo, HIWORD, LOWORD

__version__ = '0.2.4'
__version__ = '0.2.5'
offsets = {'2.7.1.1669': {'current': 0x8C8AF8, 'song_array': 0x8E9044},
'2.10.5.3929': {'current': 0xA47548, 'song_array': 0xAF6FC8},
'2.10.6.3993': {'current': 0xA65568, 'song_array': 0xB15654},
'2.10.7.4239': {'current': 0xA66568, 'song_array': 0xB16974}}
'2.10.7.4239': {'current': 0xA66568, 'song_array': 0xB16974},
'2.10.8.4337': {'current': 0xA74570, 'song_array': 0xB24f28}}
interval = 1

# regexes
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.2.4.0
Version: 0.2.5.0
CompanyName: aliencaocao
FileDescription: Netease Cloudmusic Discord RPC
InternalName: Netease Cloudmusic Discord RPC
Expand Down
Loading

0 comments on commit 995746d

Please sign in to comment.