Added Rabi-Ribi Module debugging info. Beginning memory digging for the

game to get information required.
dev
sigonasr2 7 years ago
parent 322d83dcd1
commit dc79351730
  1. BIN
      sigIRCv2.jar
  2. 6
      src/sig/modules/RabiRibi/MemoryOffset.java
  3. 17
      src/sig/modules/RabiRibi/MemoryType.java
  4. 62
      src/sig/modules/RabiRibiModule.java

Binary file not shown.

@ -14,6 +14,12 @@ public enum MemoryOffset {
REGENUP_END(0xD63828),
PACKUP_START(0xD6382C),
PACKUP_END(0xD63928),
ERINA(0x0096DA3C), //Erina Data Pointer.
ERINA_HP(0x4D8),
ERINA_MAXHP(0x4E8),
ERINA_XPOS(0xC),
ERINA_YPOS(0x10),
MAPID(0xA600AC),
;
long offset;

@ -0,0 +1,17 @@
package sig.modules.RabiRibi;
public enum MemoryType {
INTEGER(4),
FLOAT(4),
;
int bytes;
MemoryType(int bytes) {
this.bytes=bytes;
}
public int getSize() {
return bytes;
}
}

@ -3,6 +3,7 @@ package sig.modules;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.geom.Rectangle2D;
import java.util.Arrays;
import java.util.List;
import com.sun.jna.Memory;
@ -14,6 +15,7 @@ import com.sun.jna.platform.win32.WinNT.HANDLE;
import sig.Module;
import sig.sigIRC;
import sig.modules.RabiRibi.MemoryOffset;
import sig.modules.RabiRibi.MemoryType;
import sig.modules.utils.PsapiTools;
import sig.utils.DrawUtils;
@ -81,12 +83,32 @@ public class RabiRibiModule extends Module{
public void draw(Graphics g) {
super.draw(g);
int i=32;
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "Money: "+readIntFromMemory(MemoryOffset.MONEY));
/*DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "Money: "+readIntFromMemory(MemoryOffset.MONEY));
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "H-Ups: "+readItemCountFromMemory(MemoryOffset.HEALTHUP_START,MemoryOffset.HEALTHUP_END));
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "A-Ups: "+readItemCountFromMemory(MemoryOffset.ATTACKUP_START,MemoryOffset.ATTACKUP_END));
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "M-Ups: "+readItemCountFromMemory(MemoryOffset.MANAUP_START,MemoryOffset.MANAUP_END));
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "R-Ups: "+readItemCountFromMemory(MemoryOffset.REGENUP_START,MemoryOffset.REGENUP_END));
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "P-Ups: "+readItemCountFromMemory(MemoryOffset.PACKUP_START,MemoryOffset.PACKUP_END));
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "HP: "+readIntFromErinaData(MemoryOffset.ERINA_HP)+"/"+readIntFromErinaData(MemoryOffset.ERINA_MAXHP));
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "POS ("+(int)readFloatFromErinaData(MemoryOffset.ERINA_XPOS)/1280+","+(int)readFloatFromErinaData(MemoryOffset.ERINA_YPOS)/720+")");
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE, "MAP: "+readIntFromMemory(MemoryOffset.MAPID));*/
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE,
"Sunny Beam: "+Arrays.toString(
new int[]{
readIntFromMemory(0xD63304),
readIntFromMemory(0xD63D0C),
}));
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, position.getX(), position.getY()+(i+=24), 3, Color.BLACK, Color.WHITE,
"Rainbow Eggs: "+readIntFromMemory(0xD65FD4));
}
int readIntFromErinaData(MemoryOffset val) {
return readIntFromPointer(val,MemoryOffset.ERINA);
}
float readFloatFromErinaData(MemoryOffset val) {
return readFloatFromPointer(val,MemoryOffset.ERINA);
}
int readIntFromMemory(long offset) {
@ -95,12 +117,46 @@ public class RabiRibiModule extends Module{
return mem.getInt(0);
}
int readIntFromMemory(MemoryOffset val) {
float readFloatFromMemory(long offset) {
Memory mem = new Memory(4);
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(rabiRibiMemOffset+val.getOffset()), mem, 4, null);
Kernel32.INSTANCE.ReadProcessMemory(rabiribiProcess, new Pointer(rabiRibiMemOffset+offset), mem, 4, null);
return mem.getFloat(0);
}
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);
}
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);
}
int readIntFromMemory(MemoryOffset val) {
return (int)readFromMemory(val,MemoryType.INTEGER);
}
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;

Loading…
Cancel
Save