Skip to content

Commit

Permalink
Add support for 2.10.12 build 201849 client
Browse files Browse the repository at this point in the history
Bump python version to 3.12
Bump PyMeow to 1.53.36
Restore V2.x scanning code
  • Loading branch information
aliencaocao committed Oct 26, 2023
1 parent baeb62a commit 5ab5203
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pyinstaller-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.12'
- run: pip install pyinstaller-versionfile
- name: Create version.txt for PyInstaller
working-directory: ./src
run: create-version-file version.yml --outfile version.txt
- name: PyInstaller Windows
uses: aliencaocao/pyinstaller_action@main
with:
python_ver: '3.11'
python_ver: '3.12'
spec: 'src/main.spec'
requirements: 'src/requirements.txt'
upload_exe_with_name: 'Netease Cloudmusic Discord RPC.exe'
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ Written in pure Python, supports latest versions of NetEase Cloud Music. Current
* 2.10.10 build 201117
* 2.10.10 build 201297
* 2.10.11 build 201538
* 3.0.0.Beta x64 build 201714
* 2.10.12 build 201849
* 3.0.0 WIP/正在开发中

还会继续支持未来的新版本。/Support for future versions will be added.

Expand All @@ -48,7 +49,7 @@ The program must be opened in UAC mode (Administrator permission) to work proper

# 构建 Building
你需要 / You need:
- Python 3.8 - 3.11
- Python 3.8 - 3.12
- `pip install -r requirements.txt`

运行build.txt里面的命令即可。
Expand Down
80 changes: 71 additions & 9 deletions scanning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 1,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"found version: 3.0.1.5106\n"
"found version: 2.10.12.5241\n"
]
}
],
Expand Down Expand Up @@ -37,21 +37,21 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-04T04:07:49.115708700Z",
"start_time": "2023-08-04T04:07:48.705069400Z"
"end_time": "2023-10-26T15:08:30.596087Z",
"start_time": "2023-10-26T15:08:30.372213Z"
}
}
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 2,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"base_exe_address: 0x7FF6A16E0000\n",
"base_dll_address: 0x7FFFC4910000\n"
"base_exe_address: 0x4A0000\n",
"base_dll_address: 0x797E0000\n"
]
}
],
Expand All @@ -67,8 +67,69 @@
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-08-04T04:07:50.620680500Z",
"start_time": "2023-08-04T04:07:50.578430100Z"
"end_time": "2023-10-26T15:08:37.657213400Z",
"start_time": "2023-10-26T15:08:37.614563400Z"
}
}
},
{
"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"
]
}
],
"source": [
"# Scanning for V2.x clients\n",
"import math\n",
"\n",
"found_songarray = False\n",
"found_length = False\n",
"found_current = False\n",
"for offset in range(0xA7A580, 0xC20000): # Change to estimated memory range\n",
" if found_songarray and found_length and found_current:\n",
" break\n",
" 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",
" 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",
" found_songarray = True\n",
" except Exception as e:\n",
" pass\n",
"\n",
" 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",
" print('found length at 0x%X: %f' % (offset, length))\n",
" found_length = True\n",
" except Exception as e:\n",
" pass\n",
"\n",
" 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",
" print('found current at 0x%X: %f' % (offset, current))\n",
" found_current = True\n",
" except Exception as e:\n",
" pass"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-10-26T15:13:15.516077600Z",
"start_time": "2023-10-26T15:13:04.607708300Z"
}
}
},
Expand Down Expand Up @@ -106,6 +167,7 @@
}
],
"source": [
"# Scanning for V3.0 clients (not working fully)\n",
"import math\n",
"from tqdm.auto import tqdm\n",
"\n",
Expand Down
7 changes: 4 additions & 3 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from pypresence import DiscordNotFound, PipeClosed, Presence
from win32api import GetFileVersionInfo, HIWORD, LOWORD

__version__ = '0.3.0'
__version__ = '0.3.1'

logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
Expand All @@ -37,8 +37,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},
'3.0.1.5106': {'current': 0x18ED7C8, 'song_array': 0x192D6A0, 'song_array_offsets': [0x48, 0x30, 0x70, 0x0]},
}
'2.10.12.5241': {'current': 0xA7A580, 'song_array': 0xB2BCB0},}
# '3.0.1.5106': {'current': 0x18ED7C8, 'song_array': 0x192D6A0, 'song_array_offsets': [0x48, 0x30, 0x70, 0x0]}, # does not work reliably

interval = 1

# regexes
Expand Down
2 changes: 1 addition & 1 deletion src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
pyMeow @ https://github.com/qb-0/pyMeow/releases/download/1.43.25/pyMeow-1.43.25.zip
pyMeow @ https://github.com/qb-0/pyMeow/releases/download/1.53.36/pyMeow-1.53.36.zip
WMI
pypresence >= 4.3.0
pyncm
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.0.0
Version: 0.3.1.0
CompanyName: aliencaocao
FileDescription: Netease Cloudmusic Discord RPC
InternalName: Netease Cloudmusic Discord RPC
Expand Down

0 comments on commit 5ab5203

Please sign in to comment.