Jump to content
Tuts 4 You

Any working Ace Extrator on C++ ???


CodeExplorer

Recommended Posts

CodeExplorer
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!
 

CodeExplorer
Posted
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.
 

Posted

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.

 

Posted
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)?

Posted

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.

Teddy Rogers
Posted

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

Ted.

Posted

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

 

Posted
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.

Posted
1 hour ago, Python said:

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

Nope, they dropped ACE support instead. :)

 

CodeExplorer
Posted (edited)

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
Posted
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

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...