Include basic Rabi Race Module functionality / Memory Reading

dev
sigonasr2 7 years ago
parent 0ad5cb7972
commit faea730e37
  1. BIN
      sigIRCv2.jar
  2. 4
      src/sig/ConfigFile.java
  3. 4
      src/sig/Module.java
  4. 71
      src/sig/modules/RabiRace/ColorCycler.java
  5. 98
      src/sig/modules/RabiRace/MemoryData.java
  6. 47
      src/sig/modules/RabiRace/Profile.java
  7. 293
      src/sig/modules/RabiRaceModule.java
  8. 1
      src/sig/modules/RabiRibi/Entity.java
  9. 155
      src/sig/modules/RabiRibi/MemoryOffset.java
  10. 5
      src/sig/modules/RabiRibiModule.java
  11. 20
      src/sig/sigIRC.java
  12. 15
      src/sig/utils/DrawUtils.java

Binary file not shown.

@ -10,6 +10,7 @@ import java.util.Arrays;
import java.util.HashMap;
import java.util.Properties;
import sig.modules.RabiRibi.EntityLookupData;
import sig.utils.FileUtils;
public class ConfigFile {
@ -94,6 +95,9 @@ public class ConfigFile {
try {
properties.store(GetFileWriter(basepath), "Properties file for sigIRCv2\n");
SortConfigProperties();
for (Module m : sigIRC.modules) {
m.SaveConfig();
}
System.out.println("Properties successfully saved.");
} catch (IOException e) {
e.printStackTrace();

@ -71,6 +71,10 @@ public class Module {
public void ApplyConfigWindowProperties() {
}
public void SaveConfig() {
}
public void mouseReleased(MouseEvent ev) {
if (dragging) {

@ -0,0 +1,71 @@
package sig.modules.RabiRace;
import java.awt.Color;
public class ColorCycler {
int r = 0;
int g = 0;
int b = 0;
int a = 255;
int cyclespd = 0;
int stage = 1; //1 = Green+, 2 = Red-, 3 = Blue+, 4 = Green-, 5 = Red+, 6 = Blue-
public ColorCycler(Color startingColor, int cyclespd) {
this.r = startingColor.getRed();
this.g = startingColor.getGreen();
this.b = startingColor.getBlue();
this.a = startingColor.getAlpha();
this.cyclespd=cyclespd;
}
public void run() {
switch (stage) {
case 1:{
if (g<255) {
g=Math.min(255, g+cyclespd);
} else {
stage++;
}
}break;
case 2:{
if (r>0) {
r=Math.max(0, r-cyclespd);
} else {
stage++;
}
}break;
case 3:{
if (b<255) {
b=Math.min(255, b+cyclespd);
} else {
stage++;
}
}break;
case 4:{
if (g>0) {
g=Math.max(0, g-cyclespd);
} else {
stage++;
}
}break;
case 5:{
if (r<255) {
r=Math.min(255, r+cyclespd);
} else {
stage++;
}
}break;
case 6:{
if (b>0) {
b=Math.max(0, b-cyclespd);
} else {
stage=1;
}
}break;
}
}
public Color getCycleColor() {
return new Color(r,g,b,a);
}
}

@ -0,0 +1,98 @@
package sig.modules.RabiRace;
import java.awt.Image;
import sig.modules.RabiRaceModule;
import sig.modules.RabiRibi.MemoryOffset;
public enum MemoryData {
HAMMER(MemoryOffset.HAMMER,"Hammer","piko_hammer.png",true),
AIR_JUMP(MemoryOffset.AIR_JUMP,"Air Jump","air_jump.png",true),
SLIDING_POWDER(MemoryOffset.SLIDING_POWDER,"Sliding Powder","sliding_powder.png",true),
CARROT_BOMB(MemoryOffset.CARROT_BOMB,"Carrot Bomb","carrot_bomb.png",true),
HOURGLASS(MemoryOffset.HOURGLASS,"Hourglass","hourglass.png",true),
SPEED_BOOST(MemoryOffset.SPEED_BOOST,"Speed Boost","speed_boost.png",true),
AUTO_EARRINGS(MemoryOffset.AUTO_EARRINGS,"Auto Earrings","auto_earrings.png",true),
RIBBON(MemoryOffset.RIBBON,"Ribbon","ribbon.png",true),
SOUL_HEART(MemoryOffset.SOUL_HEART,"Soul Heart","soul_heart.png",true),
RABI_SLIPPERS(MemoryOffset.RABI_SLIPPERS,"Rabi Slippers","rabi_slippers.png",true),
BUNNY_WHIRL(MemoryOffset.BUNNY_WHIRL,"Bunny Whirl","bunny_whirl.png",true),
QUICK_BARRETTE(MemoryOffset.QUICK_BARETTE,"Quick Barrette","quick_barrette.png",true),
BOOK_OF_CARROT(MemoryOffset.BOOK_OF_CARROT,"Book of Carrot","book_of_carrot.png",true),
CHAOS_ROD(MemoryOffset.CHAOS_ROD,"Chaos Rod","chaos_rod.png",true),
HAMMER_WAVE(MemoryOffset.HAMMER_WAVE,"Hammer Wave","hammer_wave.png",true),
HAMMER_ROLL(MemoryOffset.HAMMER_ROLL,"Hammer Roll","hammer_roll.png",true),
LIGHT_ORB(MemoryOffset.LIGHT_ORB,"Light Orb","light_orb.png",true),
WATER_ORB(MemoryOffset.WATER_ORB,"Water Orb","water_orb.png",true),
FIRE_ORB(MemoryOffset.FIRE_ORB,"Fire Orb","fire_orb.png",true),
NATURE_ORB(MemoryOffset.NATURE_ORB,"Nature Orb","nature_orb.png",true),
P_HAIRPIN(MemoryOffset.P_HAIRPIN,"P. Hairpin","p_hairpin.png",true),
SUNNY_BEAM(MemoryOffset.SUNNY_BEAM,"Sunny Beam","sunny_beam.png",true),
PLUS_NECKLACE(MemoryOffset.PLUS_NECKLACE,"Plus Necklace","plus_necklace.png",true),
CYBER_FLOWER(MemoryOffset.CYBER_FLOWER,"Cyber Flower","cyber_flower.png",true),
HEALING_STAFF(MemoryOffset.HEALING_STAFF,"Healing Staff","healing_staff.png",true),
MAX_BRACELET(MemoryOffset.MAX_BRACELET,"Max Bracelet","max_bracelet.png",true),
EXPLODE_SHOT(MemoryOffset.EXPLODE_SHOT,"Explode Shot","explode_shot.png",true),
AIR_DASH(MemoryOffset.AIR_DASH,"Air Dash","air_dash.png",true),
BUNNY_STRIKE(MemoryOffset.BUNNY_STRIKE,"Bunny Strike","bunny_strike.png",true),
STRANGE_BOX(MemoryOffset.STRANGE_BOX,"Strage Box","strange_box.png",true),
WALL_JUMP(MemoryOffset.WALL_JUMP,"Wall Jump","wall_jump.png",true),
SPIKE_BARRIER(MemoryOffset.SPIKE_BARRIER,"Spike Barrier","spike_barrier.png",true),
BUNNY_AMULET(MemoryOffset.BUNNY_AMULET,"Bunny Amulet","bunny_amulet.png",true),
CHARGE_RING(MemoryOffset.CHARGE_RING,"Charge Ring","charge_ring.png",true),
CARROT_SHOOTER(MemoryOffset.CARROT_SHOOTER,"Carrot Shooter","carrot_shooter.png",true),
SUPER_CARROT(MemoryOffset.SUPER_CARROT,"Super Carrot","super_carrot.png",true),
/*DLC_ITEM1(MemoryOffset.DLC_ITEM1,"","",true),
DLC_ITEM2(MemoryOffset.DLC_ITEM2,"","",true),
DLC_ITEM3(MemoryOffset.DLC_ITEM3,"","",true),
DLC_ITEM4(MemoryOffset.DLC_ITEM4,"","",true),*/
BADGE_HEALTH_PLUS(MemoryOffset.BADGE_HEALTH_PLUS,"Health Plus","health_plus.png",false),
BADGE_HEALTH_SURGE(MemoryOffset.BADGE_HEALTH_SURGE,"Health Surge","health_surge.png",false),
BADGE_MANA_PLUS(MemoryOffset.BADGE_MANA_PLUS,"Mana Plus","mana_plus.png",false),
BADGE_MANA_SURGE(MemoryOffset.BADGE_MANA_SURGE,"Mana Surge","mana_surge.png",false),
BADGE_CRISIS_BOOST(MemoryOffset.BADGE_CRISIS_BOOST,"Crisis Boost","crisis_boost.png",false),
BADGE_ATK_GROW(MemoryOffset.BADGE_ATK_GROW,"ATK Grow","atk_grow.png",false),
BADGE_DEF_GROW(MemoryOffset.BADGE_DEF_GROW,"DEF Grow","def_grow.png",false),
BADGE_ATK_TRADE(MemoryOffset.BADGE_ATK_TRADE,"ATK Trade","atk_trade.png",false),
BADGE_DEF_TRADE(MemoryOffset.BADGE_DEF_TRADE,"DEF Trade","def_trade.png",false),
BADGE_ARM_STRENGTH(MemoryOffset.BADGE_ARM_STRENGTH,"Arm Strength","arm_strength.png",false),
BADGE_CARROT_BOOST(MemoryOffset.BADGE_CARROT_BOOST,"Carrot Boost","carrot_boost.png",false),
BADGE_WEAKEN(MemoryOffset.BADGE_WEAKEN,"Weaken","weaken.png",false),
BADGE_SELF_DEFENSE(MemoryOffset.BADGE_SELF_DEFENSE,"Self Defense","self_defense.png",false),
BADGE_ARMORED(MemoryOffset.BADGE_ARMORED,"Armored","armored.png",false),
BADGE_LUCKY_SEVEN(MemoryOffset.BADGE_LUCKY_SEVEN,"Lucky Seven","lucky_seven.png",false),
BADGE_HEX_CANCEL(MemoryOffset.BADGE_HEX_CANCEL,"Hex Cancel","hex_cancel.png",false),
BADGE_PURE_LOVE(MemoryOffset.BADGE_PURE_LOVE,"Pure Love","pure_love.png",false),
BADGE_TOXIC_STRIKE(MemoryOffset.BADGE_TOXIC_STRIKE,"Toxic Strike","toxic_strike.png",false),
BADGE_FRAME_CANCEL(MemoryOffset.BADGE_FRAME_CANCEL,"Frame Cancel","frame_cancel.png",false),
BADGE_HEALTH_WAGER(MemoryOffset.BADGE_HEALTH_WAGER,"Health Wager","health_wager.png",false),
BADGE_MANA_WAGER(MemoryOffset.BADGE_MANA_WAGER,"Mana Wager","mana_wager.png",false),
BADGE_STAMINA_PLUS(MemoryOffset.BADGE_STAMINA_PLUS,"Stamina Plus","stamina_plus.png",false),
BADGE_BLESSED(MemoryOffset.BADGE_BLESSED,"Blessed","blessed.png",false),
BADGE_HITBOX_DOWN(MemoryOffset.BADGE_HITBOX_DOWN,"Hitbox Down","hitbox_down.png",false),
BADGE_CASHBACK(MemoryOffset.BADGE_CASHBACK,"Cashback","cashback.png",false),
BADGE_SURVIVAL(MemoryOffset.BADGE_SURVIVAL,"Survival","survival.png",false),
BADGE_TOP_FORM(MemoryOffset.BADGE_TOP_FORM,"Top Form","top_form.png",false),
BADGE_TOUGH_SKIN(MemoryOffset.BADGE_TOUGH_SKIN,"Tough Skin","tough_skin.png",false),
BADGE_ERINA_BADGE(MemoryOffset.BADGE_ERINA_BADGE,"Erina","erina_badge.png",false),
BADGE_RIBBON_BADGE(MemoryOffset.BADGE_RIBBON_BADGE,"Ribbon","ribbon_badge.png",false),
BADGE_AUTO_TRIGGER(MemoryOffset.BADGE_AUTO_TRIGGER,"Auto Trigger","auto_trigger.png",false),
BADGE_LILITHS_GIFT(MemoryOffset.BADGE_LILITHS_GIFT,"Lilith's Gift","lilith_s_gift.png",false),
;
public MemoryOffset mem;
public String name;
public Image img;
public boolean key_item; //Set to true if it's a key item. False if it's a badge.
MemoryData(MemoryOffset mem, String name, String icon_name, boolean isKeyItem) {
this.mem = mem;
this.name = name;
this.img = RabiRaceModule.image_map.get(icon_name);
this.key_item = isKeyItem;
}
public String getDisplayName() {
return (key_item)?name:name+" Badge";
}
}

@ -0,0 +1,47 @@
package sig.modules.RabiRace;
import java.util.HashMap;
import sig.modules.RabiRaceModule;
public class Profile {
public int playtime = 0;
public int healthUps = 0;
public int attackUps = 0;
public int manaUps = 0;
public int regenUps = 0;
public int packUps = 0;
public int rainbowEggCount = 0;
public boolean isPaused = false;
public int difficulty = 0;
public int loop = 0;
public float itempct = 0;
public float mappct = 0;
public HashMap<String,MemoryData> key_items = new HashMap<String,MemoryData>();
public HashMap<String,MemoryData> badges = new HashMap<String,MemoryData>();
RabiRaceModule parent;
public Profile(RabiRaceModule module) {
this.parent = module;
}
public void updateClientValues() {
for (MemoryData md : RabiRaceModule.key_items_list) {
//System.out.println("Checking "+md.getDisplayName());
if (parent.readIntFromMemory(md.mem)!=0) {
key_items.put(md.name, md);
//System.out.println("Obtained "+md.getDisplayName());
} else {
key_items.remove(md.name);
}
}
for (MemoryData md : RabiRaceModule.badges_list) {
if (parent.readIntFromMemory(md.mem)!=0) {
badges.put(md.name, md);
//System.out.println("Obtained "+md.getDisplayName());
} else {
key_items.remove(md.name);
}
}
}
}

@ -0,0 +1,293 @@
package sig.modules;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Image;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import java.util.HashMap;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
import javax.imageio.ImageIO;
import com.sun.jna.Memory;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.Kernel32;
import com.sun.jna.platform.win32.WinNT;
import com.sun.jna.platform.win32.WinNT.HANDLE;
import sig.Module;
import sig.sigIRC;
import sig.modules.RabiRace.ColorCycler;
import sig.modules.RabiRace.MemoryData;
import sig.modules.RabiRace.Profile;
import sig.modules.RabiRibi.MemoryOffset;
import sig.modules.RabiRibi.MemoryType;
import sig.modules.utils.PsapiTools;
import sig.utils.DrawUtils;
public class RabiRaceModule extends Module{
final static String ITEMS_DIRECTORY = sigIRC.BASEDIR+"sigIRC/rabi-ribi/items/";
final int PROCESS_PERMISSIONS = WinNT.PROCESS_QUERY_INFORMATION | WinNT.PROCESS_VM_READ;
boolean foundRabiRibi = false;
int rabiRibiPID = -1;
long rabiRibiMemOffset = 0;
public HANDLE rabiribiProcess = null;
public static HashMap<String,Image> image_map = new HashMap<String,Image>();
ColorCycler rainbowcycler = new ColorCycler(new Color(255,0,0,96),8);
Profile myProfile = new Profile(this);
public static List<MemoryData> key_items_list = new ArrayList<MemoryData>();
public static List<MemoryData> badges_list = new ArrayList<MemoryData>();
public RabiRaceModule(Rectangle2D bounds, String moduleName) {
super(bounds, moduleName);
//Initialize();
Initialize();
//System.out.println("Money value is: "+readIntFromMemory(MemoryOffset.MONEY));
}
private void Initialize() {
CheckRabiRibiClient();
ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
scheduler.scheduleWithFixedDelay(()->{
CheckRabiRibiClient();
UpdateMyProfile();
}, 5000, 5000, TimeUnit.MILLISECONDS);
File dir = new File(ITEMS_DIRECTORY);
String[] images = dir.list();
List<String> filtered_images = new ArrayList<String>();
for (String file : images) {
File f = new File(ITEMS_DIRECTORY+file);
if (!f.isDirectory()) {
filtered_images.add(file);
}
}
images = filtered_images.toArray(new String[filtered_images.size()]);
for (String image : images) {
try {
image_map.put(image, ImageIO.read(new File(ITEMS_DIRECTORY+image)));
} catch (IOException e) {
e.printStackTrace();
}
}
for (MemoryData md : MemoryData.values()) {
if (md.key_item) {
key_items_list.add(md);
} else {
badges_list.add(md);
}
}
}
private void CheckRabiRibiClient() {
List<Integer> pids;
try {
pids = PsapiTools.getInstance().enumProcesses();
boolean found=false;
for (Integer pid : pids) {
HANDLE process = Kernel32.INSTANCE.OpenProcess(PROCESS_PERMISSIONS, true, pid);
List<sig.modules.utils.Module> hModules;
try {
hModules = PsapiTools.getInstance().EnumProcessModules(process);
for(sig.modules.utils.Module m: hModules){
//System.out.println(m.getFileName()+":"+m.getEntryPoint());
if (m.getFileName().contains("rabiribi")) {
found=true;
if (!foundRabiRibi) {
rabiRibiMemOffset = Pointer.nativeValue(m.getLpBaseOfDll().getPointer());
System.out.println("Found an instance of Rabi-Ribi at 0x"+Long.toHexString(rabiRibiMemOffset)+" | File:"+m.getFileName()+","+m.getBaseName());
rabiRibiPID=pid;
foundRabiRibi=true;
rabiribiProcess=process;
break;
}
break;
}
}
if (found) {
break;
}
} catch (Exception e) {
e.printStackTrace();
}
if (process!=null) {
Kernel32.INSTANCE.CloseHandle(process);
}
}
if (!found && foundRabiRibi) {
foundRabiRibi=false;
System.out.println("Rabi-Ribi process lost.");
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void run() {
if (foundRabiRibi) {
rainbowcycler.run();
}
}
private void UpdateMyProfile() {
if (foundRabiRibi) {
//System.out.println("Called.");
myProfile.rainbowEggCount = readIntFromMemory(MemoryOffset.RAINBOW_EGG_COUNT);
myProfile.attackUps = readItemCountFromMemory(MemoryOffset.ATTACKUP_START,MemoryOffset.ATTACKUP_END);
myProfile.healthUps = readItemCountFromMemory(MemoryOffset.HEALTHUP_START,MemoryOffset.HEALTHUP_END);
myProfile.manaUps = readItemCountFromMemory(MemoryOffset.MANAUP_START,MemoryOffset.MANAUP_END);
myProfile.regenUps = readItemCountFromMemory(MemoryOffset.REGENUP_START,MemoryOffset.REGENUP_END);
myProfile.packUps = readItemCountFromMemory(MemoryOffset.PACKUP_START,MemoryOffset.PACKUP_END);
myProfile.isPaused = readIntFromMemory(MemoryOffset.WARP_TRANSITION_COUNTER)==141;
myProfile.itempct = readFloatFromMemory(MemoryOffset.ITEM_PERCENT);
myProfile.mappct = readFloatFromMemory(MemoryOffset.MAP_PERCENT);
myProfile.playtime = readIntFromMemory(MemoryOffset.PLAYTIME);
myProfile.updateClientValues();
}
}
/*public int readIntFromErinaData(MemoryOffset val) {
return readIntFromPointer(val,MemoryOffset.ENTITY_ARRAY);
}
public float readFloatFromErinaData(MemoryOffset val) {
return readFloatFromPointer(val,MemoryOffset.ENTITY_ARRAY);
}*/
public int readIntFromMemory(long offset) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(rabiRibiMemOffset+offset), mem, 4, null);
return mem.getInt(0);
}
public float readFloatFromMemory(long offset) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(rabiRibiMemOffset+offset), mem, 4, null);
return mem.getFloat(0);
}
public float readFloatFromMemoryOffset(MemoryOffset val, long pointer) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(pointer+val.getOffset()), mem, 4, null);
return mem.getFloat(0);
}
public int readIntFromMemoryOffset(MemoryOffset val, long pointer) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(pointer+val.getOffset()), mem, 4, null);
return mem.getInt(0);
}
public float readDirectFloatFromMemoryLocation(long pointer) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(pointer), mem, 4, null);
return mem.getFloat(0);
}
public int readDirectIntFromMemoryLocation(long pointer) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(pointer), mem, 4, null);
return mem.getInt(0);
}
public int readIntFromPointer(MemoryOffset val, MemoryOffset pointer) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(readIntFromMemory(pointer.getOffset())+val.getOffset()), mem, 4, null);
return mem.getInt(0);
}
public float readFloatFromPointer(MemoryOffset val, MemoryOffset pointer) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(readIntFromMemory(pointer.getOffset())+val.getOffset()), mem, 4, null);
return mem.getFloat(0);
}
public int readIntFromMemory(MemoryOffset val) {
return (int)readFromMemory(val,MemoryType.INTEGER);
}
public float readFloatFromMemory(MemoryOffset val) {
return (float)readFromMemory(val,MemoryType.FLOAT);
}
Object readFromMemory(MemoryOffset val, MemoryType type) {
Memory mem = new Memory(type.getSize());
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(rabiRibiMemOffset+val.getOffset()), mem, type.getSize(), null);
switch (type) {
case FLOAT:
return mem.getFloat(0);
case INTEGER:
return mem.getInt(0);
default:
System.out.println("WARNING! Type "+type+" does not have a defined value.");
return -1;
}
}
int readItemCountFromMemory(MemoryOffset start_range,
MemoryOffset end_range) {
int count=0;
for (long i=start_range.getOffset();i<=end_range.getOffset();i++) {
if (readIntFromMemory(i)==1) {
count++;
}
}
return count;
}
public void draw(Graphics g) {
super.draw(g);
if (!foundRabiRibi) {
DrawUtils.drawTextFont(g, sigIRC.panel.userFont, position.getX(), position.getY()+26, Color.BLACK, "Rabi-Ribi not found! Please start it.");
} else {
DrawUtils.drawTextFont(g, sigIRC.panel.userFont, position.getX(), position.getY()+26, Color.BLACK, "Values: "+readIntFromMemory(MemoryOffset.DLC_ITEM1)+","+readIntFromMemory(MemoryOffset.DLC_ITEM2)+","+readIntFromMemory(MemoryOffset.DLC_ITEM3)+","+readIntFromMemory(MemoryOffset.DLC_ITEM4));
final int border=20;
final int width=(int)(position.getWidth()-border*2);
final int spacing=width/5;
for (int i=0;i<5;i++) {
Image img = image_map.get("easter_egg.png");
Color col = (myProfile.rainbowEggCount>i)?rainbowcycler.getCycleColor():new Color(0,0,0,192);
DrawUtils.drawImage(g, img, (int)(position.getX()+border+i*spacing-img.getWidth(sigIRC.panel)/4),(int)(position.getY()+36),col,sigIRC.panel);
}
int size = myProfile.key_items.size();
final int icon_size = 24;
int count = 0;
try {
for (String key : myProfile.key_items.keySet()) {
MemoryData data = myProfile.key_items.get(key);
if (size*icon_size<width) {
g.drawImage(data.img, (int)(position.getX()+border+((count++)*icon_size)), (int)(position.getY()+96+8), (int)icon_size, (int)icon_size, sigIRC.panel);
} else {
g.drawImage(data.img, (int)(position.getX()+border+((width/size)*(count++))), (int)(position.getY()+96+8), (int)icon_size, (int)icon_size, sigIRC.panel);
}
}
count=0;
size = myProfile.badges.size();
for (String key : myProfile.badges.keySet()) {
MemoryData data = myProfile.badges.get(key);
if (size*icon_size<width) {
g.drawImage(data.img, (int)(position.getX()+border+((count++)*icon_size)), (int)(position.getY()+96+32), (int)icon_size, (int)icon_size, sigIRC.panel);
} else {
g.drawImage(data.img, (int)(position.getX()+border+((width/size)*(count++))), (int)(position.getY()+96+32), (int)icon_size, (int)icon_size, sigIRC.panel);
}
}
} catch (ConcurrentModificationException e) {
}
}
}
}

@ -206,7 +206,6 @@ public class Entity {
parent.lookup_table.put(hashcode,lookup_data);
parent.setStatusMessage("Adding "+(current_money-starting_money_val)+" to hash ID "+id+","+color);
}
EntityLookupData.saveEntityLookupData(parent.lookup_table);
Entity.taskDone=1;
scheduler.shutdownNow();
} else {

@ -1,20 +1,20 @@
package sig.modules.RabiRibi;
public enum MemoryOffset {
MONEY(0xD654CC),
PLAYTIME(0xD642D8), //In frames (Rabi-Ribi runs at 60FPS).
UNKNOWN1(0xD65BDC), //???? Originally assumed to be "Health Ups".
HEALTHUP_START(0xD6342C),
HEALTHUP_END(0xD63528),
ATTACKUP_START(0xD6352C),
ATTACKUP_END(0xD63628),
MANAUP_START(0xD6362C),
MANAUP_END(0xD63728),
REGENUP_START(0xD6372C),
REGENUP_END(0xD63828),
PACKUP_START(0xD6382C),
PACKUP_END(0xD63928),
ENTITY_ARRAY(0x0096DA3C), //Erina Data Pointer.
MONEY(0xD654CC,0x12DA99C),
PLAYTIME(0xD642D8,0x12D97A8), //In frames (Rabi-Ribi runs at 60FPS).
//UNKNOWN1(0xD65BDC), //???? Originally assumed to be "Health Ups".
HEALTHUP_START(0xD6342C,0xD6342C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
HEALTHUP_END(0xD63528,0xD63528+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
ATTACKUP_START(0xD6352C,0xD6352C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
ATTACKUP_END(0xD63628,0xD63628+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
MANAUP_START(0xD6362C,0xD6362C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
MANAUP_END(0xD63728,0xD63728+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
REGENUP_START(0xD6372C,0xD6372C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
REGENUP_END(0xD63828,0xD63828+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
PACKUP_START(0xD6382C,0xD6382C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
PACKUP_END(0xD63928,0xD63928+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
/*ENTITY_ARRAY(0x0096DA3C), //Erina Data Pointer.
ERINA_HP(0x4D8),
ERINA_MAXHP(0x4E8),
ERINA_XPOS(0xC),
@ -33,19 +33,138 @@ public enum MemoryOffset {
ENTITY_XPOS(0xC),
ENTITY_YPOS(0x10),
ENTITY_COLOR(0x1C),
TRANSITION_COUNTER(0xA7661C),
TRANSITION_COUNTER(0xA7661C),*/
WARP_TRANSITION_COUNTER(0,0x582CE0), //Detects pausing
GAME_DIFFICULTY(0xD64338),
GAME_LOOP(0xD6D05C),
GAME_DIFFICULTY(0xD64338,0xD64338+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
GAME_LOOP(0xD6D05C,0xD6D05C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
HAMMER(0xD632B0,0xD632B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
AIR_JUMP(0xD632B4,0xD632B4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
SLIDING_POWDER(0xD632B8,0xD632B8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
CARROT_BOMB(0xD632BC,0xD632BC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
HOURGLASS(0xD632C0,0xD632C0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
SPEED_BOOST(0xD632C4,0xD632C4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
AUTO_EARRINGS(0xD632C8,0xD632C8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
RIBBON(0xD632CC,0xD632CC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
SOUL_HEART(0xD632D0,0xD632D0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
RABI_SLIPPERS(0xD632D4,0xD632D4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BUNNY_WHIRL(0xD632D8,0xD632D8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
QUICK_BARETTE(0xD632DC,0xD632DC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BOOK_OF_CARROT(0xD632E0,0xD632E0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
CHAOS_ROD(0xD632E4,0xD632E4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
HAMMER_WAVE(0xD632E8,0xD632E8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
HAMMER_ROLL(0xD632EC,0xD632EC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
LIGHT_ORB(0xD632F0,0xD632F0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
WATER_ORB(0xD632F4,0xD632F4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
FIRE_ORB(0xD632F8,0xD632F8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
NATURE_ORB(0xD632FC,0xD632FC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
P_HAIRPIN(0xD63300,0xD632B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
SUNNY_BEAM(0xD63304,0xD63304+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
PLUS_NECKLACE(0xD63308,0xD63308+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
CYBER_FLOWER(0xD6330C,0xD6330C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
HEALING_STAFF(0xD63310,0xD63310+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
MAX_BRACELET(0xD63314,0xD63314+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
EXPLODE_SHOT(0xD63318,0xD63318+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
AIR_DASH(0xD6331C,0xD6331C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BUNNY_STRIKE(0xD63320,0xD63320+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
STRANGE_BOX(0xD63324,0xD63324+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
WALL_JUMP(0xD63328,0xD63328+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
SPIKE_BARRIER(0xD6332C,0xD6332C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BUNNY_AMULET(0xD63330,0xD63330+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
CHARGE_RING(0xD63334,0xD63334+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
CARROT_SHOOTER(0xD63338,0xD63338+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
SUPER_CARROT(0xD6333C,0xD6333C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
RUMI_DONUT(0xD63340,0xD63340+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
RUMI_CAKE(0xD63344,0xD63344+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
GOLD_CARROT(0xD63348,0xD63348+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
COCOA_BOMB(0xD6334C,0xD6334C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM1(0xD63350,0xD63350+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
TROPHY(0xD63354,0xD63354+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
EXCLAMATION_POINT(0xD63358,0xD63358+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM2(0xD6335C,0xD6335C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM3(0xD63360,0xD63360+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM4(0xD63364,0xD63364+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
RAINBOW_MAGIC(0xD63368,0xD63368+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM5(0xD6336C,0xD6336C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM6(0xD63370,0xD63370+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM7(0xD63374,0xD63374+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM8(0xD63378,0xD63378+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM9(0xD6337C,0xD6337C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM10(0xD63380,0xD63380+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM11(0xD63384,0xD63384+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM12(0xD63388,0xD63388+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM13(0xD6338C,0xD6338C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
UNKNOWN_ITEM14(0xD63390,0xD63390+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
DLC_ITEM1(0xD63394,0xD63394+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
DLC_ITEM2(0xD63398,0xD63398+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
DLC_ITEM3(0xD6339C,0xD6339C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
DLC_ITEM4(0xD633A0,0xD633A0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_HEALTH_PLUS(0xD633AC,0xD633AC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_HEALTH_SURGE(0xD633B0,0xD633B0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_MANA_PLUS(0xD633B4,0xD633B4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_MANA_SURGE(0xD633B8,0xD633B8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_CRISIS_BOOST(0xD633BC,0xD633BC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_ATK_GROW(0xD633C0,0xD633C0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_DEF_GROW(0xD633C4,0xD633C4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_ATK_TRADE(0xD633C8,0xD633C8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_DEF_TRADE(0xD633CC,0xD633CC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_ARM_STRENGTH(0xD633D0,0xD633D0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_CARROT_BOOST(0xD633D4,0xD633D4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_WEAKEN(0xD633D8,0xD633D8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_SELF_DEFENSE(0xD633DC,0xD633DC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_ARMORED(0xD633E0,0xD633E0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_LUCKY_SEVEN(0xD633E4,0xD633E4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_HEX_CANCEL(0xD633E8,0xD633E8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_PURE_LOVE(0xD633EC,0xD633EC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_TOXIC_STRIKE(0xD633F0,0xD633F0+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_FRAME_CANCEL(0xD633F4,0xD633F4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_HEALTH_WAGER(0xD633F8,0xD633F8+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_MANA_WAGER(0xD633FC,0xD633FC+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_STAMINA_PLUS(0xD63400,0xD63400+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_BLESSED(0xD63404,0xD63404+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_HITBOX_DOWN(0xD63408,0xD63408+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_CASHBACK(0xD6340C,0xD6340C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_SURVIVAL(0xD63410,0xD63410+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_TOP_FORM(0xD63414,0xD63414+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_TOUGH_SKIN(0xD63418,0xD63418+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_ERINA_BADGE(0xD6341C,0xD6341C+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_RIBBON_BADGE(0xD63420,0xD63420+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_AUTO_TRIGGER(0xD63424,0xD63424+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
BADGE_LILITHS_GIFT(0xD63428,0xD63428+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
ITEM_PERCENT(0,0x13423F0),
MAP_PERCENT(0,0x13423EC),
RAINBOW_EGG_COUNT(0xD65FD4,0xD65FD4+OffsetHelper.KEY_ITEM_OFFSET_V175_TO_V185),
;
long offset;
long offset_v185;
long latest_offset;
MemoryOffset(long offset) {
MemoryOffset(long offset,long offset_v185) {
this.offset=offset;
this.offset_v185=offset_v185;
//TODO CHANGE THIS IF PUBLIC VERSION CHANGES!
this.latest_offset = offset_v185;
}
public long getOffset() {
return latest_offset;
}
public long getOffsetV175() {
return offset;
}
public long getOffsetV185() {
return offset_v185;
}
}
class OffsetHelper{
final static long KEY_ITEM_OFFSET_V175_TO_V185 = 0x5754D0;
}

@ -74,6 +74,11 @@ public class RabiRibiModule extends Module{
//System.out.println("Money value is: "+readIntFromMemory(MemoryOffset.MONEY));
}
public void SaveConfig() {
super.SaveConfig();
EntityLookupData.saveEntityLookupData(lookup_table);
}
private void Initialize() {

@ -24,6 +24,7 @@ import com.sun.jna.platform.win32.WinNT.HANDLEByReference;
import sig.modules.ChatLogModule;
import sig.modules.ControllerModule;
import sig.modules.RabiRaceModule;
import sig.modules.RabiRibiModule;
import sig.modules.TouhouMotherModule;
import sig.modules.TwitchModule;
@ -133,7 +134,12 @@ public class sigIRC{
public static int rabiribimodule_height=312;
public static int rabiribimodule_X=0;
public static int rabiribimodule_Y=312;
public static boolean rabiribimodule_enabled=true;
public static boolean rabiribimodule_enabled=false;
public static int rabiracemodule_width=320;
public static int rabiracemodule_height=312;
public static int rabiracemodule_X=0;
public static int rabiracemodule_Y=312;
public static boolean rabiracemodule_enabled=false;
public static int chatlogMessageHistory=50;
public static boolean controllermodule_enabled=true;
public static int controllermodule_width=320;
@ -209,6 +215,11 @@ public class sigIRC{
rabiribimodule_width = config.getInteger("RABIRIBI_module_width",320);
rabiribimodule_height = config.getInteger("RABIRIBI_module_height",312);
rabiribimodule_enabled = config.getBoolean("Module_rabiribi_Enabled", false);
rabiracemodule_X = config.getInteger("RABIRACE_module_X",0);
rabiracemodule_Y = config.getInteger("RABIRACE_module_Y",312);
rabiracemodule_width = config.getInteger("RABIRACE_module_width",320);
rabiracemodule_height = config.getInteger("RABIRACE_module_height",312);
rabiracemodule_enabled = config.getBoolean("Module_rabirace_Enabled", false);
chatlogmodule_X = config.getInteger("CHATLOG_module_X",0);
chatlogmodule_Y = config.getInteger("CHATLOG_module_Y",312);
chatlogmodule_width = config.getInteger("CHATLOG_module_width",320);
@ -355,13 +366,18 @@ public class sigIRC{
"Controller"
));
}
if (rabiribimodule_enabled) {
modules.add(new RabiRibiModule(
new Rectangle(rabiribimodule_X,rabiribimodule_Y,rabiribimodule_width,rabiribimodule_height),
"Rabi-Ribi"
));
}
if (rabiracemodule_enabled) {
modules.add(new RabiRaceModule(
new Rectangle(rabiracemodule_X,rabiracemodule_Y,rabiracemodule_width,rabiracemodule_height),
"Rabi-Race"
));
}
}
private static void InitializeCustomSounds() {

@ -1,9 +1,11 @@
package sig.utils;
import java.awt.AlphaComposite;
import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.Rectangle;
import java.awt.RenderingHints;
import java.awt.Shape;
@ -11,6 +13,8 @@ import java.awt.font.FontRenderContext;
import java.awt.font.GlyphVector;
import java.awt.font.TextAttribute;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.awt.image.ImageObserver;
import java.text.AttributedString;
import sig.MyPanel;
@ -102,6 +106,17 @@ public class DrawUtils {
}
}
public static void drawImage(Graphics g, Image img, double x, double y, Color blend_col, ImageObserver source) {
BufferedImage tmp = new BufferedImage(img.getWidth(source),img.getHeight(source),BufferedImage.TYPE_INT_ARGB);
Graphics2D g2 = tmp.createGraphics();
g2.drawImage(img, 0, 0, null);
g2.setComposite(AlphaComposite.SrcAtop);
g2.setColor(blend_col);
g2.fillRect(0, 0, img.getWidth(source), img.getHeight(source));
g2.dispose();
g.drawImage(tmp,(int)x,(int)y,source);
}
public static Color invertColor(Color c) {
return new Color(255-c.getRed(),255-c.getGreen(),255-c.getBlue(),255);
}

Loading…
Cancel
Save