mirror of
https://github.com/ApacheThunder/nitrohaxTWL.git
synced 2025-06-19 03:55:45 -04:00

* DSi Enhanced games now have working cheats. * usrcheat.dat file system now used instead of old XML system. * Due to how the new cheat file stuff works nitrohaxTWL no longer supports being run on DS/DS LIte. Now requires DSI/3DS.
32 lines
1.4 KiB
C
32 lines
1.4 KiB
C
#ifndef FIND_H
|
|
#define FIND_H
|
|
|
|
#include <nds/ndstypes.h>
|
|
#include <nds/memory.h> // tNDSHeader
|
|
#include "module_params.h"
|
|
|
|
// COMMON
|
|
//u8* memsearch(const u8* start, u32 dataSize, const u8* find, u32 findSize);
|
|
u32* memsearch32(const u32* start, u32 dataSize, const u32* find, u32 findSize, bool forward);
|
|
u16* memsearch16(const u16* start, u32 dataSize, const u16* find, u32 findSize, bool forward);
|
|
|
|
inline u32* findOffset(const u32* start, u32 dataSize, const u32* find, u32 findLen) {
|
|
return memsearch32(start, dataSize, find, findLen*sizeof(u32), true);
|
|
}
|
|
inline u32* findOffsetBackwards(const u32* start, u32 dataSize, const u32* find, u32 findLen) {
|
|
return memsearch32(start, dataSize, find, findLen*sizeof(u32), false);
|
|
}
|
|
inline u16* findOffsetThumb(const u16* start, u32 dataSize, const u16* find, u32 findLen) {
|
|
return memsearch16(start, dataSize, find, findLen*sizeof(u16), true);
|
|
}
|
|
inline u16* findOffsetBackwardsThumb(const u16* start, u32 dataSize, const u16* find, u32 findLen) {
|
|
return memsearch16(start, dataSize, find, findLen*sizeof(u16), false);
|
|
}
|
|
|
|
const u32* getMpuInitRegionSignature(u32 patchMpuRegion);
|
|
u32* findMpuStartOffset(const tNDSHeader* ndsHeader, u32 patchMpuRegion);
|
|
u32* findMpuDataOffset(const module_params_t* moduleParams, u32 patchMpuRegion, const u32* mpuStartOffset);
|
|
u32* findMpuInitCacheOffset(const u32* mpuStartOffset);
|
|
|
|
#endif // FIND_H
|