Пример #1
0
// Read 4 bytes from given native address
int DOS4GWBinaryFile::readNative4(ADDRESS nat) {
    PSectionInfo si = GetSectionInfoByAddr(nat);
    if (si == 0) return 0;
    ADDRESS host = si->uHostAddr - si->uNativeAddr + nat;
    int n = dos4gwRead4((int*)host.m_value);
    return n;
}
Пример #2
0
// Read 1 byte from given native address
char DOS4GWBinaryFile::readNative1(ADDRESS nat) {
    PSectionInfo si = GetSectionInfoByAddr(nat);
    if (si == 0)
        si = GetSectionInfo(0);
    char* host = (char*)(si->uHostAddr - si->uNativeAddr + nat).m_value;
    return *host;
}
// Read 2 bytes from given native address
int MachOBinaryFile::readNative1(ADDRESS nat) {
	PSectionInfo si = GetSectionInfoByAddr(nat);
	if (si == 0) 
		si = GetSectionInfo(0);
	ADDRESS host = si->uHostAddr - si->uNativeAddr + nat;
	return *(char*)host;
}
// Read 4 bytes from given native address
int MachOBinaryFile::readNative4(ADDRESS nat) {
	PSectionInfo si = GetSectionInfoByAddr(nat);
	if (si == 0) return 0;
	ADDRESS host = si->uHostAddr - si->uNativeAddr + nat;
	int n = machORead4((int*)host);
	return n;
}
Пример #5
0
// Read 2 bytes from given native address
int DOS4GWBinaryFile::readNative2(ADDRESS nat)
{
	SectionInfo *si = GetSectionInfoByAddr(nat);
	if (si == 0) return 0;
	ADDRESS host = si->uHostAddr - si->uNativeAddr + nat;
	int n = dos4gwRead2((short *)host);
	return n;
}