Posted August 27, 20196 yr 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!
August 27, 20196 yr Don't remember from where I got it but it has C example. Maybe it will be usefull. unacedll v2.6.zip
August 27, 20196 yr 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.
August 27, 20196 yr 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.
August 29, 20196 yr 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)?
August 29, 20196 yr 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.
August 29, 20195 yr Author 1 hour ago, Teddy Rogers said: What is the intention for wanting a WinACE extractor in C++? Ted. I want to solve this security vulnerability https://forum.tuts4you.com/topic/41140-winrar-patches-19-year-old-security-vulnerability-that-put-millions-at-risk
August 29, 20195 yr 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
August 29, 20195 yr @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.
August 30, 20195 yr 16 hours ago, CodeExplorer said: I want to solve this security vulnerability https://forum.tuts4you.com/topic/41140-winrar-patches-19-year-old-security-vulnerability-that-put-millions-at-risk 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.
August 30, 20195 yr 1 hour ago, Python said: Winrar guys already released a fix, didn't they? Nope, they dropped ACE support instead.
August 30, 20195 yr 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 August 30, 20195 yr by CodeExplorer
September 1, 20195 yr 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