Compare commits

...

1 Commits
v1.1.0 ... main

Author SHA1 Message Date
es3n1n 506e1b7c87 v1.1.1 (#2)
- fixes for the new spotify version 🎉

Co-authored-by: Arsenii es3n1n <40367813+es3n1n@users.noreply.github.com>
Reviewed-on: #2
2023-03-30 21:05:19 +00:00
4 changed files with 23 additions and 14 deletions

View File

@ -2,22 +2,23 @@
#include <Windows.h>
#include <cstdint>
#include <functional>
#include <mutex>
#include <stdio.h>
#define L_ERROR(...) util::logger::error(__FUNCTION__ "(): " __VA_ARGS__);
#define TRACE_FN util::logger::debug("%s()", __FUNCTION__);
#define LOGGER_PARSE_FMT \
char buf[2048]; \
va_list va; \
va_start(va, fmt); \
_vsnprintf_s(buf, 1024, fmt, va); \
#define LOGGER_PARSE_FMT \
char buf[2048]; \
va_list va; \
va_start(va, fmt); \
_vsnprintf_s(buf, 1024, fmt, va); \
va_end(va);
#define CREATE_LOGGER_METHOD(n) \
inline void n(const char* fmt, ...) { \
LOGGER_PARSE_FMT; \
log(#n, e_level_color::level_color_##n, buf); \
#define CREATE_LOGGER_METHOD(n) \
inline void n(const char* fmt, ...) { \
LOGGER_PARSE_FMT; \
log(#n, e_level_color::level_color_##n, buf); \
}
namespace util {
@ -45,7 +46,9 @@ namespace util {
SetConsoleTextAttribute(m_console_handle, clr);
}
inline void reset() { apply(static_cast<uint32_t>(e_level_color::level_color_none)); }
inline void reset() {
apply(static_cast<uint32_t>(e_level_color::level_color_none));
}
inline void colorify(uint32_t clr, std::function<void()> cb) {
apply(clr);
@ -54,7 +57,13 @@ namespace util {
}
} // namespace _colors
namespace {
inline std::mutex _mtx;
}
inline void log(const char* prefix, e_level_color level, const char* message) {
std::lock_guard<std::mutex> _lock(_mtx);
_colors::colorify(static_cast<uint32_t>(level), [prefix]() -> void { printf("%s >> ", prefix); });
printf("%s\n", message);

View File

@ -2,8 +2,8 @@
// autoupdates
// @note: es3n1n: v1.1.0 = 110
#define UNSPOTIFY_VERSION 110
// @note: es3n1n: v1.1.1 = 111
#define UNSPOTIFY_VERSION 111
#define AUTOUPDATER_DOMAIN "es3n.in"
#define AUTOUPDATER_URL "unspotify.json"

View File

@ -45,7 +45,7 @@ namespace spotify {
ASSERT_PATTERN_STEP(sig);
do {
sig = sig.walk_back_until(0xC2 /* retn */);
} while (sig.offset(-5).read<uint8_t>() != 0xE8 && sig.offset(-8).read<uint8_t>() != 0xE8);
} while (sig.offset(-5).read<uint8_t>() != 0xE8 && sig.offset(-8).read<uint8_t>() != 0xE8 && sig.offset(-9).read<uint8_t>() != 0xE8);
addr::get_ad = sig.add(1).read<uint8_t>() == 0x68 /* push */ ? sig.add(1) : sig.walk_until(0x68 /* push 0D4h */);
util::logger::debug("addr::get_ad = 0x%p", addr::get_ad);
ASSERT_PATTERN(get_ad);

View File

@ -12,7 +12,7 @@ namespace spotify {
struct player_track_meta_t {
private:
char __pad[0x98];
char __pad[0xB0];
public:
const char* m_track_uri;
};