METIN-2 / METIN2 and other illegal software- don't ask for assistance on these forums.

Status
Not open for further replies.
a problem .h file

[ separate thread merged in - metin2 topics not allowed ]

I have a problem using this file. I'm sorry if this is the wrong section,

If anyone knows how to use this file please tell me.

Code:
#include "lzo/lzoconf.h"
#include "lzo/lzo1x.h"
 
 
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
 
 
#ifndef IN_LEN
#define IN_LEN      (128*1024L)
#endif
#define OUT_LEN     (IN_LEN + IN_LEN / 16 + 64 + 3)
 
int main(int argc, char *argv[])
{
       
        if(argc < 3)
        {
                printf("Usage: %s <extract/pack> <filename>\n", argv[0]);
                return 0;
        }
       
        char cmd[255];
        sprintf(cmd, "%s", argv[1]);
       
        if(strcasecmp(cmd, "extract") == 0) {
                printf("extract\n");
                return 0;
        } else if(strcasecmp(cmd, "pack") == 0) {
                char filename[255];
                sprintf(filename, "%s", argv[2]);
                FILE *fp;
                fp = fopen(filename, "r");
               
                printf("pack\n");
               
                lzo_voidp wrkmem;
               
                struct stat st;
                stat(filename, &st);
                const int fileSize = st.st_size;
               
                wrkmem = (lzo_voidp) xmalloc(LZO1X_1_MEM_COMPRESS);
 
                uint8_t* outputData = (lzo_bytep) xmalloc(OUT_LEN);
                *(uint32_t *)outputData = fileSize;
                uint32_t compressedSize;
                int lzo = lzo1x_999_compress(data, fileSize, outputData + 4, &compressedSize, workingMemory);
               
                return 0;
        } else {
                printf("CMD: %s \n", cmd);
                return 0;
                }
}

Hope that you know how.

Best Regards
 
Sorry my fault. I'll elaborate. I want to compress with encryption to .lz. This is programmed to do this function. The problem is in using it. I want to know how to use it. Where I am supposed to put it. And how to make it function.

Thanks very much.
 
The example looks pretty straight forward.

Do you have any experience with programming in C?
 
I'm afraid that I don't. I'm a beginner in the world of FreeBSD. What I want to know is how to compress with this file? I want to know the steps to do it.

thanks in advance :)
 
Knowing how to program in C has nothing to do with knowledge of FreeBSD. I suggest learning C first.
 
As far as I understand you want to compress files using lzo compression. There is a program in ports that does just that archivers/lzop. I also don't see any encryption taking place in your code, I only see compression.
 
Sorry I don't know. But the problem is it must be compressed with this code or it will not work. If you can help me to know how to compress with it, please do.
 
almobd3, install archivers/lzop and then try compile your stuff with
Code:
gcc -o <exec_filename> -llzo2 <source_filename>
Dig any other info in google or link, because this is absolutely not FreeBSD-related.
 
almobd3 wrote:
Code:
#include "lzo/lzoconf.h"
#include "lzo/lzo1x.h"

I assume that the compiler complains about not finding lzo/lzoconf.h and lzo/lzo1x.h. The double quotes usually have the meaning that the so referenced include files are to be searched in the "User Header Search Paths", which for sure is in your case the directory that contains the file that you want to compile.

Make sure that this directory contains another directory named lzo, and make sure of course that in there are the headers lzoconf.h and lzo1x.h.

Intentionally by the original author of your program file, this lzo directory was accompanied with it, at least at that point in time once the file was successfully compiled the last time - by whomever. So, I would like to suggest that you search for the directory lzo that you somehow lost, and once you found it, put it alongside to your main source file into the same directory. Then try compiling again.

Best regards

Rolf
 
@Alt, I tried it:

Code:
lzo.h: In function 'main':
lzo.h:60: error: 'data' undeclared (first use in this function)
lzo.h:60: error: (Each undeclared identifier is reported only once
lzo.h:60: error: for each function it appears in.)
lzo.h:60: error: 'workingMemory' undeclared (first use in this function)
lzo.h:60: warning: passing argument 4 of 'lzo1x_999_compress' from incompatible pointer type
lzo.h:67:2: warning: no newline at end of file

This what is shown to me in the VMC of FreeBSD.

@rolfheinrich,

I don't understand most of what you wrote -.-" You seemed to be trying to solve some errors, but the problem is I don't know how to use it.

lzo/lzoconf.h and lzo/lzo1x.h. << these two are existing in [file"]/usr/local/include[/file]. I want some one to use the code on these two files, https://rapidshare.com/files/460999874/compress.rar

Uncompress then compress the content of compress.rar.

Thanks in advance :)
 
Allow me to reiterate. archivers/lzop does exactly the same thing as the code you posted intends to do. Check the man page (lzop(1)) if you don't believe me. The compression stream generated by your code will be the same as the compression stream generated by lzop as they use the same library and algorithms. I also see several errors in your code that need to be addressed before it will correctly compile. Either fix your code or use the lzop program.
 
I'm sorry again

but the problem is that I have a patcher and this patcher doesn't work with any compressors

I used lzop but alas!

no use
the extension is .lz and I wanna test it if anyone can compress this file with it.

if it works I'll pay him to show me how to make this code works fine.

thanks alot.
 
I used it

the program stops when it wants to uncompress

if you want an example of compressing

CLICK_HERE

I hope that you help me to compress because my site depends on it ><

thank you all...
 
The file you linked to seems to be part of the video game Metin 2. I would suggest you contact them as they are the ones who will know how to decompress the file.
 
If you're trying to run an illegal copy of Metin2 on FreeBSD do note that this forum will not assist you with that.
 
[METIN 2 SUBJECT: CLOSED] Freebsd 7.2 with Broadcom Corporation

[ separate thread merged in - metin2 topics not allowed ]

Hi all. im newbie in freebsd. i want make a home server with freebsd 7.2. but later install freebsd him dont recognize my Broadcom gigabit card.

Code:
vendor     = 'Broadcom Corporation'
class      = network
subclass   = ethernet

Some can explain wat steps i need to do?

Thanks and best regards
 
InsaneQlimax said:
i want make a home server with freebsd 7.2. but later install freebsd him dont recognize my Broadcom gigabit card.
Is there any reason thay you don't want to use the newest production release (8.2, at the present time)?

Even if you can't use 8.2 for some reason, you may want to download and burn CDs with 8.2 and perhaps -CURRENT (which will eventually become FreeBSD 9.0) and try booting from them. If either of those correctly detect your Ethernet card, then it may be easier to pinpoint when support for it was added.

Note that FreeBSD 7.2 is EoL (end of life), so you won't get security fixes, etc.
 
Sorry for double post.


Terry_Kennedy said:
Is there any reason thay you don't want to use the newest production release (8.2, at the present time)?

Even if you can't use 8.2 for some reason, you may want to download and burn CDs with 8.2 and perhaps -CURRENT (which will eventually become FreeBSD 9.0) and try booting from them. If either of those correctly detect your Ethernet card, then it may be easier to pinpoint when support for it was added.

Note that FreeBSD 7.2 is EoL (end of life), so you won't get security fixes, etc.

I know friend. I like much of 8.x and 9.. but the software I try to run is not compatible with 8x because it gives me
Code:
PROT_EXEC|PROT_WRITE failed
and I try to use lib and more one 8.2 but not have sucess .. but in 7.2 it works perfect. But I can't install ethernet drivers. I'm so newbie ...
 
Status
Not open for further replies.
Back
Top