public void findAddress() { if (AddressFound) { return; } Pcsx2Memory.findProcess(); // Find by pointers long autoAddress = -1; if (fileType == FileType.KH2_00OBJENTRY) { autoAddress = Pcsx2Memory.getAddressOfSubBar(fileType, null); } else if (subBarName != null && subSubBarName != null) { autoAddress = Pcsx2Memory.getAddressOfSubSubBar(fileType, subBarName, subSubBarName); } else if (subBarName != null) { autoAddress = Pcsx2Memory.getAddressOfSubBar(fileType, subBarName); } // Find by string search if (autoAddress <= 0 && fileType != FileType.KH2_00OBJENTRY) { autoAddress = Pcsx2Memory.findBarFileAddress(stringToFind); } // If address was found if (autoAddress > 0) { AddressFound = true; MemOffset = FormatHandler.getHexString(autoAddress, ProcessType.PCSX2); if (Pcsx2Memory.process_current_Type == ProcessType.PCSX2 && autoAddress > 0x2FFFFFFF) { MemOffset = NOT_FOUND; } } else { MemOffset = NOT_FOUND; } }