CodeExplorer Posted August 27, 2019 Posted August 27, 2019 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!
ToMKoL Posted August 27, 2019 Posted August 27, 2019 Don't remember from where I got it but it has C example. Maybe it will be usefull. unacedll v2.6.zip
CodeExplorer Posted August 27, 2019 Author Posted August 27, 2019 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.
kao Posted August 27, 2019 Posted August 27, 2019 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.
Benjamin Posted August 29, 2019 Posted August 29, 2019 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)?
Progman Posted August 29, 2019 Posted August 29, 2019 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 August 29, 2019 Posted August 29, 2019 What is the intention for wanting a WinACE extractor in C++? Ted.
CodeExplorer Posted August 29, 2019 Author Posted August 29, 2019 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
Kurapica Posted August 29, 2019 Posted August 29, 2019 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
kao Posted August 29, 2019 Posted August 29, 2019 @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. 1
Python Posted August 30, 2019 Posted August 30, 2019 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.
kao Posted August 30, 2019 Posted August 30, 2019 1 hour ago, Python said: Winrar guys already released a fix, didn't they? Nope, they dropped ACE support instead.
CodeExplorer Posted August 30, 2019 Author Posted August 30, 2019 (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 August 30, 2019 by CodeExplorer
Python Posted September 1, 2019 Posted September 1, 2019 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...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now