superblaubeere27 / obfuscator

A java obfuscator (GUI)
MIT License
845 stars 236 forks source link

Is not working with HTTPClient and JSON libraries #39

Open marcoVera opened 5 years ago

marcoVera commented 5 years ago

Bug Report

Is not working with HTTPClient and JSON libraries

Expected Behaviour

If HTTPClient library and JSON libraries are used shold work,

Actual Behaviour

If a POST action is send via HTTPClient or a JSON request is send is not responding.

How to reproduce the behaviour

HTTPClient:

 HttpClient client = HttpClientBuilder.create().build();
 HttpPost post = new HttpPost("https://www.test.com");

 // Create some NameValuePair for HttpPost parameters
 List < NameValuePair > arguments = new ArrayList < > (2);
 arguments.add(new BasicNameValuePair("record1", "test string1"); arguments.add(new BasicNameValuePair("record2", "test string2");

 try {
     post.setEntity(new UrlEncodedFormEntity(arguments));
     HttpResponse response = client.execute(post);
     String jsonResponse = EntityUtils.toString(response.getEntity());

     JSONArray jsonArray = new JSONArray(jsonResponse);

     for (int i = 0; i < jsonArray.length(); i++) {
         JSONObject jsonobject = jsonArray.getJSONObject(i);
         if (jsonobject.getString("valResponse").equals("1")) {
             system.out.print.ln("In");
         }
     }

 } catch (IOException e) {
     e.printStackTrace();

 } catch (JSONException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();

 }
superblaubeere27 commented 5 years ago

I'll try to reproduce this issue... Btw, I edited your comment (Just changed the code formatting)

superblaubeere27 commented 5 years ago

Uhm, can you please provide your configuration?

AuligPromotions commented 5 years ago

Same happening for me on 1.9.3 using default config. What feature could be causing this?

Keep getting errors like these:


Exception in thread "Thread-0" java.lang.VerifyError: Bad local variable type
Exception Details:
  Location:
    com/fasterxml/jackson/databind/deser/BeanDeserializerFactory.buildBeanDeserializer(Lcom/fasterxml/jackson/databind/DeserializationContext;Lcom/fasterxml/jackson/databind/JavaType;Lcom/fasterxml/jackson/databind/BeanDescription;)Lcom/fasterxml/jackson/databind/JsonDeserializer; @26: fload_1
  Reason:
    Type 'com/fasterxml/jackson/databind/DeserializationContext' (current frame, locals[1]) is not assignable to float
  Current Frame:
    bci: @26
    flags: { }
    locals: { 'com/fasterxml/jackson/databind/deser/BeanDeserializerFactory', 'com/fasterxml/jackson/databind/DeserializationContext', 'com/fasterxml/jackson/databind/JavaType', 'com/fasterxml/jackson/databind/BeanDescription', 'com/fasterxml/jackson/databind/deser/ValueInstantiator' }
    stack: { integer, integer }
  Bytecode:
    0000000: 2a2b 2db6 0040 3a04 1242 b600 4857 1071
    0000010: 1075 8213 0100 b600 4800 2321 01b0 3a05
    0000020: bb00 4c59 1905 b700 50b0 3a05 2bb6 0058
    0000030: 1905 b800 5e2d 01b8 0064 bf2a 2b2d b600
    0000040: 703a 0519 0519 04b6 0076 2a2b 2d19 05b6
    0000050: 007a 2a2b 2d19 05b6 007d 2a2b 2d19 05b6
    0000060: 0080 2a2b 2d19 05b6 0083 2bb6 006c 3a06
    0000070: 2ab4 00c2 b600 c7b8 00a6 0051 4f2a b400
    0000080: c2b6 00cb b900 d101 003a 0719 07b9 00d6
    0000090: 0100 b800 a600 3634 1907 b900 da01 00c0
    00000a0: 00dc 3a08 1908 1906 2d19 05b6 00e0 3a05
    00000b0: 1242 b600 4857 1100 f511 00c4 8210 0c10
    00000c0: 3d82 0282 7e99 ffc6 01b0 2cb6 0103 b800
    00000d0: a600 2c29 1904 b601 06b8 0109 0021 1e19
    00000e0: 05b6 010d 3a07 1242 b600 4857 1301 00b6
    00000f0: 0048 1291 b600 000e 000a 01b0 1905 b601
    0000100: 113a 072a b400 c2b6 00c7 b800 004e 004a
    0000110: 2ab4 00c2 b600 cbb9 00d1 0100 3a08 1908
    0000120: b900 d601 00b8 0000 3300 2f19 08b9 00da
    0000130: 0100 c000 dc3a 0919 0919 062d 1907 b600
    0000140: ea3a 0712 42b6 0048 5712 91b6 0048 124a
    0000150: b600 4874 a3ff ca01 b019 07b0          
  Exception Handler Table:
    bci [0, 8] => handler: 30
    bci [0, 8] => handler: 42
  Stackmap Table:
    full_frame(@30,{},{Object[#58]})
    full_frame(@42,{Top,Object[#82],Top,Object[#84]},{Object[#60]})
    full_frame(@59,{Object[#2],Object[#82],Object[#102],Object[#84],Object[#104]},{})
    full_frame(@139,{Object[#2],Top,Object[#102],Object[#84],Object[#104],Object[#114],Object[#147],Object[#211]},{})
    chop_frame(@202,1)
    full_frame(@252,{Object[#2],Top,Top,Object[#84],Top,Object[#114],Object[#147]},{})
    full_frame(@259,{Object[#2],Top,Top,Object[#84],Top,Top,Object[#147],Object[#230]},{})
    full_frame(@286,{Top,Top,Top,Object[#84],Top,Top,Object[#147],Object[#230],Object[#211]},{})
    full_frame(@345,{Top,Top,Top,Top,Top,Top,Top,Object[#230]},{})

    at com.fasterxml.jackson.databind.ObjectMapper.<init>(Unknown Source)
    at com.fasterxml.jackson.databind.ObjectMapper.<init>(Unknown Source)```

Or

Exception in thread "AWT-EventQueue-0" java.lang.VerifyError: Bad type on operand stack
Exception Details:
  Location:
    org/apache/http/impl/client/InternalHttpClient.doExecute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/methods/CloseableHttpResponse; @182: areturn
  Reason:
    Type integer (current frame, stack[1]) is not assignable to reference type
  Current Frame:
    bci: @182
    flags: { }
    locals: { 'org/apache/http/impl/client/InternalHttpClient', 'org/apache/http/HttpHost', 'org/apache/http/HttpRequest', top, 'org/apache/http/client/methods/HttpExecutionAware', 'org/apache/http/client/methods/HttpRequestWrapper', 'org/apache/http/client/protocol/HttpClientContext', 'org/apache/http/client/config/RequestConfig', 'org/apache/http/params/HttpParams' }
    stack: { integer, integer }
  Bytecode:
    0000000: 2cb2 00c4 b200 8610 122e 32b8 00ca 1254
    0000010: b600 5a58 013a 042c c100 ccb8 004a 9900
    0000020: 092c c000 cc3a 042c 2bb8 00d2 3a05 2db8
    0000030: 003a 9900 142d 1254 b600 5a57 125c b600
    0000040: 5a9c 000c 01b0 bb00 d859 b700 dab8 00e2
    0000050: 3a06 013a 072c c100 06b8 004a 9900 0e2c
    0000060: c000 06b9 00e4 0100 3a07 1907 b800 e999
    0000070: 0053 2cb9 00ed 0100 3a08 1908 c100 efb8
    0000080: 004a 9900 3519 08c0 00ef b900 f301 00b9
    0000090: 00f8 0100 b800 fb99 002b 1908 2ab4 002a
    00000a0: b801 013a 0712 54b6 005a 5713 0103 b600
    00000b0: 5a74 0011 0f01 b019 082a b400 2ab8 0101
    00000c0: 3a07 1907 b800 3a00 0b09 1906 1907 b601
    00000d0: 092a 1906 b701 0d2a 2b19 0519 06b7 0111
    00000e0: 3a08 2ab4 0113 1908 1905 1906 1904 b901
    00000f0: 1905 00b0 3a05 bb01 1b59 1905 b701 1ebf
    0000100:
  Exception Handler Table:
    bci [39, 243] => handler: 244
  Stackmap Table:
    append_frame(@39,Object[#204])
    full_frame(@70,{Object[#2],Object[#212],Object[#214],Top,Object[#204],Object[#206]},{})
    same_locals_1_stack_item_frame(@77,Object[#220])
    append_frame(@106,Object[#222],Object[#230])
    full_frame(@183,{Object[#2],Object[#212],Top,Top,Object[#204],Object[#206],Object[#222],Top,Object[#261]},{})
    full_frame(@194,{Object[#2],Object[#212],Top,Top,Object[#204],Object[#206],Object[#222],Object[#230]},{})
    chop_frame(@209,1)
    full_frame(@244,{},{Object[#194]})

        at org.apache.http.impl.client.HttpClientBuilder.build(Unknown Source)
AuligPromotions commented 5 years ago

I think I fixed it by disabling Bad Concat.

superblaubeere27 commented 5 years ago

@AuligPromotions Interesting...

marcoVera commented 5 years ago

"I think I fixed it by disabling Bad Concat" I removed all options and just leaved without anything and still was not working, something with http and json functionality is not working well

superblaubeere27 commented 5 years ago

@marcoVera java version?

marcoVera commented 5 years ago

Java 8

superblaubeere27 commented 5 years ago

@marcoVera I will introduce some new unit test to tests if the obfuscator has any bugs.

JH3Y50N commented 4 years ago

23.02 19:53:09 [Server] WARN java.security.InvalidKeyException: Illegal key size or default parameters 23.02 19:53:09 [Server] WARN at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1026) 23.02 19:53:09 [Server] WARN at javax.crypto.Cipher.implInit(Cipher.java:801) 23.02 19:53:09 [Server] WARN at javax.crypto.Cipher.chooseProvider(Cipher.java:864) 23.02 19:53:09 [Server] WARN at javax.crypto.Cipher.init(Cipher.java:1249) 23.02 19:53:09 [Server] WARN at javax.crypto.Cipher.init(Cipher.java:1186)

superblaubeere27 commented 4 years ago

@JH3Y50N Did you enable AES?

JH3Y50N commented 4 years ago

@JH3Y50N Did you enable AES?

yes

superblaubeere27 commented 4 years ago

@JH3Y50N AES is marked as Proceed with caution since it can easily break your code. Just turn it of and it will work ;D