Skip to content

Commit

Permalink
Merge pull request #23 from moeshin/master
Browse files Browse the repository at this point in the history
Support 2.10.11 build 201538
  • Loading branch information
aliencaocao authored Jul 5, 2023
2 parents 74b0264 + 25d7ad2 commit 19b999e
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 40 deletions.
113 changes: 74 additions & 39 deletions scanning.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,19 @@
{
"cell_type": "code",
"execution_count": 1,
"metadata": {
"collapsed": true,
"ExecuteTime": {
"end_time": "2023-06-01T13:17:14.371582Z",
"start_time": "2023-06-01T13:17:14.101582900Z"
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"found version: 2.10.11.4930\n"
]
}
},
"outputs": [],
],
"source": [
"import wmi\n",
"import gc\n",
"from win32api import GetFileVersionInfo, HIWORD, LOWORD\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",
Expand All @@ -24,85 +26,118 @@
"else:\n",
" process = process[0]\n",
" pid = process.ole_object.ProcessId\n",
" ver_info = GetFileVersionInfo(process.ole_object.ExecutablePath, '\\\\')\n",
" ver = f\"{HIWORD(ver_info['FileVersionMS'])}.{LOWORD(ver_info['FileVersionMS'])}.\" \\\n",
" f\"{HIWORD(ver_info['FileVersionLS'])}.{LOWORD(ver_info['FileVersionLS'])}\"\n",
" print(f'found version: {ver}')\n",
" del process\n",
" del wmic\n",
" gc.collect()"
]
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-05T03:34:54.602764900Z",
"start_time": "2023-07-05T03:34:54.384030300Z"
}
}
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-06-01T13:17:14.416582900Z",
"start_time": "2023-06-01T13:17:14.372583Z"
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"base_address: 0x78C30000\n"
]
}
},
"outputs": [],
],
"source": [
"from pyMeow import open_process, get_module, r_float64, close_process, get_module, r_bytes, r_uint\n",
"import psutil\n",
"from pyMeow import open_process, get_module, r_float64, r_bytes, r_uint\n",
"\n",
"process = open_process(pid)\n",
"ps_util_process = psutil.Process(pid)\n",
"base_address = get_module(process, 'cloudmusic.dll')['base']"
]
"base_address = get_module(process, 'cloudmusic.dll')['base']\n",
"print('base_address: 0x%X' % base_address)"
],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-05T03:34:54.628988200Z",
"start_time": "2023-07-05T03:34:54.605766600Z"
}
}
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-06-01T13:18:28.562982Z",
"start_time": "2023-06-01T13:18:03.295993500Z"
"end_time": "2023-07-05T03:35:14.273201900Z",
"start_time": "2023-07-05T03:34:54.678987400Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"found current at 0xa79580: 55.561\n",
"found song array offset at 0xb2ad10: 1458767558\n",
"found length at 0xb2baf8: 255.24\n",
"found length at 0xbdf8b8: 255.27533486943685\n"
"found current at 0xA7A580: 64.524000\n",
"found song array offset at 0xB2BCB0: 411349068\n",
"found length at 0xB2CA98: 277.995102\n"
]
}
],
"source": [
"import math\n",
"\n",
"found_songarray = False\n",
"found_length = False\n",
"found_current = False\n",
"for offset in range(0xA70000, 0xC20000): # Change to estimated memory range\n",
" found_songarray = False\n",
" found_length = False\n",
" found_current = False\n",
" if found_songarray and found_length and found_current:\n",
" break\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",
" string = '411349068' # 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",
" 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",
" if math.floor(length) == 277: # 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",
" 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",
" if math.floor(current) == 64: # 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\n",
" if found_songarray and found_length and found_current:\n",
" break"
" pass"
]
},
{
"cell_type": "code",
"execution_count": 3,
"outputs": [],
"source": [],
"metadata": {
"collapsed": false,
"ExecuteTime": {
"end_time": "2023-07-05T03:35:14.277359Z",
"start_time": "2023-07-05T03:35:14.275350500Z"
}
}
}
],
"metadata": {
Expand Down
4 changes: 3 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
'2.10.7.4239': {'current': 0xA66568, 'song_array': 0xB16974},
'2.10.8.4337': {'current': 0xA74570, 'song_array': 0xB24F28},
'2.10.10.4509': {'current': 0xA77580, 'song_array': 0xB282CC},
'2.10.10.4689': {'current': 0xA79580, 'song_array': 0xB2AD10}}
'2.10.10.4689': {'current': 0xA79580, 'song_array': 0xB2AD10},
'2.10.11.4930': {'current': 0xA7A580, 'song_array': 0xB2BCB0},
}
interval = 1

# regexes
Expand Down

0 comments on commit 19b999e

Please sign in to comment.