mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-25 14:20:14 +00:00
LDR fixup VerifyStringTableLength can be local
This commit is contained in:
parent
6fab9fe2f6
commit
e529d358cf
@ -266,14 +266,6 @@ ResultCode CROHelper::RebaseHeader(u32 cro_size) {
|
|||||||
return RESULT_SUCCESS;
|
return RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
ResultCode CROHelper::VerifyStringTableLength(VAddr address, u32 size) {
|
|
||||||
if (size != 0) {
|
|
||||||
if (Memory::Read8(address + size - 1) != 0)
|
|
||||||
return CROFormatError(0x0B);
|
|
||||||
}
|
|
||||||
return RESULT_SUCCESS;
|
|
||||||
}
|
|
||||||
|
|
||||||
ResultVal<VAddr> CROHelper::RebaseSegmentTable(u32 cro_size,
|
ResultVal<VAddr> CROHelper::RebaseSegmentTable(u32 cro_size,
|
||||||
VAddr data_segment_address, u32 data_segment_size,
|
VAddr data_segment_address, u32 data_segment_size,
|
||||||
VAddr bss_segment_address, u32 bss_segment_size) {
|
VAddr bss_segment_address, u32 bss_segment_size) {
|
||||||
@ -1061,6 +1053,23 @@ ResultCode CROHelper::ApplyExitRelocations(VAddr crs_address) {
|
|||||||
return RESULT_SUCCESS;
|
return RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Verifies a string or a string table matching a predicted size (i.e. terminated by 0)
|
||||||
|
* if it is not empty. There can be many other nulls in the string table because
|
||||||
|
* they are composed by many sub strings. This function is to check whether the
|
||||||
|
* whole string (table) is terminated properly, despite that it is not actually one string.
|
||||||
|
* @param address the virtual address of the string (table)
|
||||||
|
* @param size the size of the string (table), including the terminating 0
|
||||||
|
* @returns ResultCode RESULT_SUCCESS if the size matches, otherwise error code.
|
||||||
|
*/
|
||||||
|
static ResultCode VerifyStringTableLength(VAddr address, u32 size) {
|
||||||
|
if (size != 0) {
|
||||||
|
if (Memory::Read8(address + size - 1) != 0)
|
||||||
|
return CROFormatError(0x0B);
|
||||||
|
}
|
||||||
|
return RESULT_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
ResultCode CROHelper::Rebase(VAddr crs_address, u32 cro_size,
|
ResultCode CROHelper::Rebase(VAddr crs_address, u32 cro_size,
|
||||||
VAddr data_segment_addresss, u32 data_segment_size,
|
VAddr data_segment_addresss, u32 data_segment_size,
|
||||||
VAddr bss_segment_address, u32 bss_segment_size, bool is_crs) {
|
VAddr bss_segment_address, u32 bss_segment_size, bool is_crs) {
|
||||||
|
@ -511,17 +511,6 @@ private:
|
|||||||
*/
|
*/
|
||||||
ResultCode RebaseHeader(u32 cro_size);
|
ResultCode RebaseHeader(u32 cro_size);
|
||||||
|
|
||||||
/**
|
|
||||||
* Verifies a string or a string table matching a predicted size (i.e. terminated by 0)
|
|
||||||
* if it is not empty. There can be many other nulls in the string table because
|
|
||||||
* they are composed by many sub strings. This function is to check whether the
|
|
||||||
* whole string (table) is terminated properly, despite that it is not actually one string.
|
|
||||||
* @param address the virtual address of the string (table)
|
|
||||||
* @param size the size of the string (table), including the terminating 0
|
|
||||||
* @returns ResultCode RESULT_SUCCESS if the size matches, otherwise error code.
|
|
||||||
*/
|
|
||||||
static ResultCode VerifyStringTableLength(VAddr address, u32 size);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rebases offsets in segment table according to module address.
|
* Rebases offsets in segment table according to module address.
|
||||||
* @param cro_size the size of the CRO file
|
* @param cro_size the size of the CRO file
|
||||||
|
Loading…
Reference in New Issue
Block a user