    if (RamInfo.Access == SEARCH_ACCESS_AUTO) {
		//if file compare, System PC??? or dump is over 100MB use file access
		if ((RamInfo.OldResultsInfo.DumpSize > 0x6400000) || (HookInfo.HookType == HOOK_FILE)) { RamInfo.Access = SEARCH_ACCESS_FILE; }
//		if ((HookInfo.SystemId == SYSTEM_PC) || (RamInfo.OldResultsInfo.DumpSize > 0x6400000)) { RamInfo.Access = SEARCH_ACCESS_FILE; }
		else { RamInfo.Access = SEARCH_ACCESS_ARRAY; }
	}

    if (RamInfo.Access == SEARCH_ACCESS_ARRAY) {
		if (!(LoadFile(&RamInfo.NewRAM, RamInfo.NewResultsInfo.dmpFileName, 0, NULL, FALSE))) { goto RUN_SEARCH_ERROR; }
    	if (SearchCompareTo) {
			if (!LoadFile(&RamInfo.OldRAM, RamInfo.OldResultsInfo.dmpFileName, 0, NULL, FALSE)) { goto RUN_SEARCH_ERROR; }
    	}

    } else {
		/***only loading file handles***/
        if (!(RamInfo.NewFile = fopen(RamInfo.NewResultsInfo.dmpFileName, "rb"))) {
            sprintf(ErrTxt, "Unable to open ram dump (CMD_CS_SEARCH,2) -- Error %u", GetLastError());
            MessageBox(NULL,ErrTxt,"Error",MB_OK); goto RUN_SEARCH_ERROR;
        }
        RamInfo.OldFile = fopen(RamInfo.OldResultsInfo.dmpFileName, "rb");
        if ((!RamInfo.OldFile) && SearchCompareTo) {
			sprintf(ErrTxt, "Unable to open previous ram dump (CMD_CS_SEARCH,3) -- Error %u", GetLastError());
            MessageBox(NULL,ErrTxt,"Error",MB_OK); goto RUN_SEARCH_ERROR;
        }
    }

    if ((HookInfo.HookType == HOOK_FILE) && (RamInfo.OldResultsInfo.DumpSize > 0) && (RamInfo.OldResultsInfo.DumpSize != RamInfo.NewResultsInfo.DumpSize)) {
        MessageBox(NULL, "RAM dumps don't match in size. Are you trying to compare files of differnet size?", "Error", MB_OK);
        goto RUN_SEARCH_ERROR;
    }


//	ShrinkResults(&RamInfo, Search.Size);
//Try remembering both base and new start instead
	//unsigned char *tmpResults;
	u32 NewResSize = (RamInfo.ResHigh - RamInfo.ResLow)/Search.Size/8;
    if (!(RamInfo.NewResultsInfo.MappedResults[CurSearchArea] = (unsigned char*)malloc(NewResSize))) {
        ShowError("Unable to allocate shrink results memory () -- Error %u", GetLastError());
        goto RUN_SEARCH_ERROR;
    }
    memcpy(tmpResults, &RamInfo.Results[(RamInfo.ResLow/Search.Size)>>3], NewResSize);
	free(RamInfo.Results); RamInfo.Results = NULL;
    if (!(RamInfo.Results = (unsigned char*)malloc(NewResSize))) {
		ShowError("Unable to allocate results memory (DO_SEARCH_CMD) -- Error %u", GetLastError());
        goto RUN_SEARCH_END;
    }
    memcpy(RamInfo.Results, tmpResults, NewResSize);
//    ShowError("Original: %X\nNew: %X\nResLow: %X", RamInfo.NewResultsInfo.DumpSize/Search.Size/8, NewResSize, (RamInfo.ResLow/Search.Size)>>3);
    free(tmpResults);
    RamInfo.NewResultsInfo.DumpSize = RamInfo.ResHigh - RamInfo.ResLow;
char tmpFile[MAX_PATH];
sprintf(tmpFile, "%stestres%u.bin", Settings.CS.DumpDir, SearchCompareTo);
SaveFile(RamInfo.Results, (RamInfo.NewResultsInfo.DumpSize/Search.Size/8), tmpFile, -1, NULL);
  	ShowError("MapDump: %X\nMapSysAddr: %X\nRes Low: %X\nRes High: %X\n", RamInfo.NewResultsInfo.MapDumpAddr[CurSearchArea], RamInfo.NewResultsInfo.MapSysAddr[CurSearchArea], RamInfo.ResLow, RamInfo.ResHigh);
