0

I want to decompress data that is compressed by using LZMA SDK in MASM32 program.
I found some assembly files such as LzmaDecOpt.asm in the LZMA SDK.

https://github.com/kornelski/7z/blob/main/Asm/x86/LzmaDecOpt.asm

I think this is the decompressor of LZMA for Assembly program.
But I can't understand how to use this to decompress data.
Please explain how to use this to decompress in MASM32 program.

3
  • 1
    That directory of asm functions might just be internal helpers with hand-written asm instead of compiler-generated code from pure C. The comments at the top say "That code is tightly coupled with LzmaDec_TryDummy() and with another functions in LzmaDec.c file.". You should just link the library and call the normal API functions, same way you'd call any C function according to the standard calling convention. Commented Apr 27, 2023 at 3:47
  • I tried to call the SDK api, but I failed to include C header files. I have got syntax errors in *.h files. Someone said that I should convert C header files to Assembly file to include. Is it right? Commented Apr 27, 2023 at 3:49
  • 3
    .h files use C syntax, so of course you can't include them in an assembly source file. MASM syntax uses extern to declare functions from other files / libraries, as in Calling a standard-library-function in MASM like EXTERN printf :PROC. I think MASM even allows you to declare prototypes, at least in 32-bit code where it has an invoke directive, otherwise you're setting up the args yourself so MASM doesn't need to know about args or return values. Commented Apr 27, 2023 at 3:55

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.