mirror of
https://github.com/LNH-team/pico-loader.git
synced 2026-06-02 09:16:49 +02:00
Initial commit
This commit is contained in:
31
arm9/source/patches/PatchContext.cpp
Normal file
31
arm9/source/patches/PatchContext.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "common.h"
|
||||
#include "fastSearch.h"
|
||||
#include "platform/LoaderPlatform.h"
|
||||
#include "PatchContext.h"
|
||||
|
||||
u32* PatchContext::FindPattern32(const u32* pattern, u32 byteLength) const
|
||||
{
|
||||
#ifdef LIBTWL_ARM9
|
||||
if (byteLength == 16)
|
||||
{
|
||||
return (u32*)fastSearch16((const u32*)_data, _dataSize, pattern);
|
||||
}
|
||||
#endif
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
u32* PatchContext::FindPattern32Twl(const u32* pattern, u32 byteLength) const
|
||||
{
|
||||
if (!_twlData || _twlDataSize == 0)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
#ifdef LIBTWL_ARM9
|
||||
if (byteLength == 16)
|
||||
{
|
||||
return (u32*)fastSearch16((const u32*)_twlData, _twlDataSize, pattern);
|
||||
}
|
||||
#endif
|
||||
return nullptr;
|
||||
}
|
||||
Reference in New Issue
Block a user