Exetools  

Go Back   Exetools > General > Developer Section

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2015, 14:25
mudlord's Avatar
mudlord mudlord is offline
Family
 
Join Date: Aug 2015
Posts: 83
Rept. Given: 11
Rept. Rcvd 69 Times in 25 Posts
Thanks Given: 37
Thanks Rcvd at 190 Times in 50 Posts
mudlord Reputation: 69
LZMA1 encoder/decoder (ASM+C)

Ask no questions:
This is the core LZMA depacker and compressor code from the private build of my EXE/DLL packer. Figured it might be useful to some people. Decided not to use LZMA2 since that seems to be just focused on format changes and not actual algorithm changes.

The depacker code is modified from the original to save size and the main compression function focuses on compression ratio.

Example (using lzma.cpp to pack and LzmaDecodeSize.c to depack):
Prototype of decoder is:
Code:
extern "C" { void LzmaDecode(UInt16* workmem,
	const unsigned char *inStream, SizeT inSize,
	unsigned char *outStream, SizeT outSize);
}
Example:
Code:
DWORD compressed;
DWORD original_sz;
BYTE *Original = Load_Input_File("unpacker.bin", &original_sz);
BYTE* compressed_data = compress_lzma(Original, original_sz, &compressed);
PVOID testmem = (unsigned char*)malloc(original_sz);
unsigned char* workmem = (unsigned char*)malloc(0xC4000);
LzmaDecode((UInt16*)workmem, compressed_data + LZMA_PROPS_SIZE, (SizeT)compressed - LZMA_PROPS_SIZE, (unsigned char*)testmem, (SizeT)original_sz);
free(Original);
free(compressed_data);
free(workmem);
free(testmem);
There is a ASM version as well of the C function which is slightly modified for more space savings, which was decompiled from the original MSVC2015 compiled code.
Attached Files
File Type: rar lzma_decenc.rar (34.2 KB, 83 views)

Last edited by mudlord; 12-10-2015 at 14:34.
Reply With Quote
The Following 3 Users Gave Reputation+1 to mudlord For This Useful Post:
dj-siba (12-10-2015), Storm Shadow (12-11-2015), tonyweb (12-12-2015)
The Following 7 Users Say Thank You to mudlord For This Useful Post:
0xall0c (04-06-2018), alephz (12-26-2015), Git (05-05-2016), Indigo (07-19-2019), niculaita (12-12-2015), Spiderz_Soft (12-20-2015), vic4key (06-12-2022)
  #2  
Old 04-19-2016, 04:41
.:hack3r2k:.'s Avatar
.:hack3r2k:. .:hack3r2k:. is offline
Friend
 
Join Date: Mar 2002
Location: Inside the c0de ...
Posts: 66
Rept. Given: 1
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 3 Times in 3 Posts
.:hack3r2k:. Reputation: 0
Cool

For some reason i cannot download the attachment. maybe some admin could help ?!

Br
Reply With Quote
The Following User Says Thank You to .:hack3r2k:. For This Useful Post:
Indigo (07-19-2019)
  #3  
Old 04-21-2016, 03:32
CryptXor CryptXor is offline
Friend
 
Join Date: Oct 2015
Posts: 68
Rept. Given: 0
Rept. Rcvd 24 Times in 12 Posts
Thanks Given: 34
Thanks Rcvd at 131 Times in 39 Posts
CryptXor Reputation: 24
Quote:
Originally Posted by .:hack3r2k:. View Post
For some reason i cannot download the attachment. maybe some admin could help ?!

Br
You know, if exetools received $0.001 for every time someone asked that question, ZeNiX would be using $100 bills to wipe his ass...

Answer: Search or Read the %^%&*$^ rules: http://forum.exetools.com/showthread.php?t=16581
Reply With Quote
The Following User Gave Reputation+1 to CryptXor For This Useful Post:
mr.exodia (04-22-2016)
The Following 9 Users Say Thank You to CryptXor For This Useful Post:
aldente (04-21-2016), an0rma1 (04-26-2016), b30wulf (11-06-2018), chessgod101 (05-05-2016), Indigo (07-19-2019), LuckyPatcher (01-15-2019), uranus64 (04-21-2016), zeffy (12-31-2017), ZeNiX (04-27-2016)
  #4  
Old 05-03-2016, 07:37
virus virus is offline
Friend
 
Join Date: Apr 2002
Posts: 55
Rept. Given: 3
Rept. Rcvd 2 Times in 2 Posts
Thanks Given: 17
Thanks Rcvd at 17 Times in 11 Posts
virus Reputation: 2
Quote:
Originally Posted by .:hack3r2k:. View Post
For some reason i cannot download the attachment. maybe some admin could help ?!

Br
Grab it from here.
Reply With Quote
The Following User Says Thank You to virus For This Useful Post:
Indigo (07-19-2019)
  #5  
Old 05-04-2016, 16:53
mudlord's Avatar
mudlord mudlord is offline
Family
 
Join Date: Aug 2015
Posts: 83
Rept. Given: 11
Rept. Rcvd 69 Times in 25 Posts
Thanks Given: 37
Thanks Rcvd at 190 Times in 50 Posts
mudlord Reputation: 69
http://mudlord.info/crap/lzma_decenc.rar
Reply With Quote
The Following 2 Users Say Thank You to mudlord For This Useful Post:
Indigo (07-19-2019), Lite (02-06-2018)
  #6  
Old 11-05-2018, 01:11
Elesty Elesty is offline
Friend
 
Join Date: Feb 2017
Posts: 9
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 9
Thanks Rcvd at 14 Times in 5 Posts
Elesty Reputation: 0
Hi, the links above are not working anymore. Any chance to share it again on alternative URLs ?
Reply With Quote
The Following User Says Thank You to Elesty For This Useful Post:
Indigo (07-19-2019)
  #7  
Old 11-05-2018, 01:40
MarcElBichon MarcElBichon is offline
VIP
 
Join Date: Jan 2002
Posts: 274
Rept. Given: 381
Rept. Rcvd 151 Times in 57 Posts
Thanks Given: 319
Thanks Rcvd at 281 Times in 92 Posts
MarcElBichon Reputation: 100-199 MarcElBichon Reputation: 100-199
Quote:
Originally Posted by Elesty View Post
Hi, the links above are not working anymore. Any chance to share it again on alternative URLs ?
http://rgho.st/7Zrs4yNZB
or better
https://github.com/mudlord/compression_testbed
Reply With Quote
The Following 3 Users Say Thank You to MarcElBichon For This Useful Post:
foosaa (11-05-2018), Indigo (07-19-2019), niculaita (11-05-2018)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
XED2 (x86 encoder decoder) c++ library ferrit.rce General Discussion 7 01-05-2014 07:19


All times are GMT +8. The time now is 22:20.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )