#include "current_cfw.hpp" #include bool isServiceRunning(const char *serviceName) { Handle handle; SmServiceName service_name = smEncodeName(serviceName); bool running = R_FAILED(smRegisterService(&handle, service_name, false, 1)); svcCloseHandle(handle); if (!running) smUnregisterService(service_name); return running; }; Result smAtmosphereHasService(bool *out, SmServiceName name) { u8 tmp = 0; Result rc = serviceDispatchInOut(smGetServiceSession(), 65100, name, tmp); if (R_SUCCEEDED(rc) && out) *out = tmp; return rc; } CFW getCFW(){ bool res = false; smAtmosphereHasService(&res, (SmServiceName) {"rnx"}); if(res) return rnx; smAtmosphereHasService(&res, (SmServiceName) {"tx"}); if(res) return sxos; return ams; };