Skip to content

Commit 2cfbd41

Browse files
committed
fix char math
1 parent 593a16d commit 2cfbd41

4 files changed

Lines changed: 17 additions & 3 deletions

File tree

deobfuscator-api/src/main/java/uwu/narumi/deobfuscator/api/helper/AsmMathHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public final class AsmMathHelper {
9696
// Integer
9797
Map.entry(INEG, number -> -number.intValue()),
9898
Map.entry(I2B, Number::byteValue),
99-
Map.entry(I2C, Number::shortValue),
99+
Map.entry(I2C, (number) -> (int) (char) number.intValue()),
100100
Map.entry(I2D, Number::doubleValue),
101101
Map.entry(I2F, Number::floatValue),
102102
Map.entry(I2L, Number::longValue),

testData/results/custom-jars/SnakeGame-obf-zkm/d.dec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public class d extends Thread {
194194
return;
195195
}
196196

197-
System.out.println(a(879106065, -879064062, (int)var1));
197+
System.out.println(a(879106065, -879129598, (int)var1));
198198
this.c++;
199199
this.g = this.a(new Object[]{var4});
200200
}
@@ -203,7 +203,7 @@ public class d extends Thread {
203203
}
204204

205205
private void c(long var1) {
206-
System.out.println(a(672771037, -672779940, (int)var1));
206+
System.out.println(a(672836573, -672845476, (int)var1));
207207

208208
while (true) {
209209
this.a(new Object[0]);

testData/results/java/TestUniversalNumberTransformer.dec

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ public class TestUniversalNumberTransformer {
1212
}
1313
}
1414

15+
public void charMath() {
16+
int a = 49152;
17+
int b = 14828;
18+
int c = 12;
19+
System.out.println(c);
20+
}
21+
1522
public void illegalOperations() {
1623
int a = 2;
1724
if (a == 0) {

testData/src/java/src/main/java/TestUniversalNumberTransformer.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ public void testNumbers1() {
1313
}
1414
}
1515

16+
public void charMath() {
17+
int a = 49152;
18+
int b = 14828;
19+
int c = (char) a >>> b;
20+
System.out.println(c);
21+
}
22+
1623
public void illegalOperations() {
1724
int a = 2;
1825
if (a == 0) {

0 commit comments

Comments
 (0)