Skip to content

ams::mitm::ldn::LdnMitMService

LDN MITM Service implementation.

This class implements the ldn:u MITM service. When a game opens ldn:u, this service intercepts the calls and creates our custominstead of the original Nintendo service.

Type: ncm::ProgramId

Program ID of the client process.

Type: u64

Process ID of the client (for BSD MITM tracking)

void LdnMitMService(std::shared_ptr<::Service > && s, const sm::MitmProcessInfo & c)

Constructor.

sShared pointer to the original servicecMITM process info for the clientparam

Parameters:

  • s (std::shared_ptr&lt;::Service &gt; &&)
  • c (const sm::MitmProcessInfo &)
void ~LdnMitMService()

Destructor.

Result CreateUserLocalCommunicationService(sf::Out< sf::SharedPointer< ICommunicationInterface > > out)

Create the communication service.

This is the main entry point for games. When they call CreateUserLocalCommunicationService, we create our customthat communicates with the RyuLdn server.outOutput pointer for the created serviceparamResult codereturn

Parameters:

  • out (sf::Out&lt; sf::SharedPointer&lt; ICommunicationInterface &gt; &gt;)

Returns: Result

Result CreateClientProcessMonitor(sf::Out< sf::SharedPointer< IClientProcessMonitorInterface > > out)

Create the client process monitor.

Required for firmware 18.0.0+ compatibility. This is a stub implementation - games require it but don’t use it.outOutput pointer for the created monitorparamResult codereturn

Parameters:

  • out (sf::Out&lt; sf::SharedPointer&lt; IClientProcessMonitorInterface &gt; &gt;)

Returns: Result

bool ShouldMitm(const sm::MitmProcessInfo & client_info)

Determine if we should MITM this process.

This is called by Atmosphere to determine if we should intercept calls from a specific process. We always return true to intercept all LDN calls.client_infoProcess information for the clientparamtrue Always interceptreturn

Parameters:

  • client_info (const sm::MitmProcessInfo &)

Returns: bool