Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Any working Ace Extrator on C++ ???

Featured Replies

Posted

Any working Ace Extrator on C++ ???

https://github.com/ipr/qXpkLib https://github.com/ipr/qXpkLib/tree/master/xadACE missing the Extract Entry method!

Quote

bool CUnACE::extractEntry(CAnsiFile &archive, AceEntry *pEntry)
{
}

ftp://madmike.ml/Downloads/Software/Archivators/Ace32/UNACESRC/UNACE.C this is in C - DOS and I don't know how to open/compile it

https://github.com/droe/acefile/blob/master/acefile.py python

Generic tut https://www.roe.ch/acefile

Already tried:
 

Quote

 

bool CUnACE::extractEntry(CAnsiFile &archive, AceEntry *pEntry)
{
    // For decompressing comments:

    size_t len = pEntry->m_header.PSIZE;
    archive.Seek(pEntry->m_header.dataoffset, SEEK_SET);

    int8_t *buf = new int8_t[len];
    if (archive.Read(buf, len) == false)
    {
        throw std::exception("Failed reading data!");
    }

    m_Decompress.init_unace();
    //m_Decompress.comm = (char *)pEntry->m_header.COMM;
    //m_Decompress.comm_cpr_size = pEntry->m_header.COMM_SIZE;
    //m_Decompress.dcpr_comm(pEntry->m_header.COMM_SIZE);

    m_Decompress.fhead = pEntry->m_header;

    memcpy(m_Decompress.aname, "D:\\Winace.ace", sizeof("D:\\Winace.ace"));
    m_Decompress.open_archive(false);
    m_Decompress.dcpr_init_file();

    

    int rd = 0;
    //m_Decompress.dcpr_adds_blk(m_Decompress.buf_wr, len);
    int8_t *bufwrite = new int8_t[2048];

    int archan, wrhan;

    //wrhan = create_dest_file("D:\\file.exe", (int) m_Decompress.fhead.ATTR))<0;
 
    while (rd = m_Decompress.dcpr_adds_blk(buf, 2048))
   {
    char test = bufwrite[0];
    printf("%c", test);
/*

      if (write(wrhan, bufwrite, rd) != rd)       // write block
      {                         
         printf("\nWrite error\n");
         f_err = ERR_WRITE;
      }
*/      
   }

    close(wrhan);

return false;
}

 

Anyway: it doesn't work!
 

Don't remember from where I got it but it has C example. Maybe it will be usefull.

unacedll v2.6.zip

  • Author
4 hours ago, ToMKoL said:

Don't remember from where I got it but it has C example. Maybe it will be usefull.

Thanks for trying to help me. I don't wanna use Third Party Libraries.
Plus is using same UNACEV2.DLL which has security problems.
 

You don't have much choice there. ACE was a proprietary algorithm and therefore there are very few implementations available. You already found most of them.

 

On 8/27/2019 at 6:24 PM, CodeExplorer said:

Thanks for trying to help me. I don't wanna use Third Party Libraries

If you don't wanna use 3rd party libraries then your options would be very limited. Maybe you should consider third party tools/libs where the code is not obfuscated (thereby allowing you to examine it if needed)?

UNACE.c looks easily compilable and usable from C++, could call main, or better yet the functions main uses.  Probably you comment out all of the printf statements.

What is the intention for wanting a WinACE extractor in C++?

Ted.

you can do what malware kids do when Microsoft for example pushes a new update, they diff before and after the patch to see where changes happened

It's boring but the only way when no other way is available

 

@Kura: There's no need to diff anything, everything is described in a very detailed fashion: https://research.checkpoint.com/extracting-code-execution-from-winrar/

Fix could be a simple in-place patch of unacev2.dll or maybe a small amount of code added to some codecave.

 

16 hours ago, CodeExplorer said:

Winrar guys already released a fix, didn't they? As Kao mentioned, several articles (and FUD stories also) came out on that topic at that time 😄 Personally I would not waste too much of time on WinACE but it's just me.

1 hour ago, Python said:

Winrar guys already released a fix, didn't they?

Nope, they dropped ACE support instead. :)

 

  • Author

I would waste but only some small time on this.
By the way the problems comes when I try to decompress files:
files information seems to be ok.
Another problem is that HEAD_CRC seems to be corrupt or I am doing something wrong:

    int rd = (m_archiveHeader.header.HEAD_SIZE > size_headrdb) ? size_headrdb : m_archiveHeader.header.HEAD_SIZE;

    // count header CRC upto current position
    m_Crc.updatecrc((uint8_t *)m_ReadBuffer.GetAtCurrent(),
        (size_t)m_archiveHeader.header.HEAD_SIZE);

    uint32_t f1 = m_archiveHeader.header.HEAD_CRC;
    uint32_t f2 = m_Crc.crc();

    if (!(m_archiveHeader.header.HEAD_CRC == (m_Crc.crc() & 0xffff)))
      printf("\nError: archive is broken\n");

 

Edited by CodeExplorer

On 8/30/2019 at 7:33 AM, kao said:

Nope, they dropped ACE support instead

Oops.. My mistake. You are right. I rarely if ever needed to extract ACE files for the past several years...

Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.