Use DLL when no C source code

I have a special proprietary type files, lets say .KTV
There are several layers to the KTV file format:
1. XML
2.ZLib Deflate compresion
3.Rijndael AES encryption
well, I need to read the XML text. I know that Java already includes Deflate and AES algorithms so I could write an extractor.
but,
I was given a DLL file which is used in a CPP project just for the same purpose, and I assume i can use it to obtain XML output from KTV files. The big problem is that I have no idea of the methods, or their signatures the DLL files contains.
Has anyone any ideas there should I start my investigation using the DLL for this purpose?

I found this in a header file .h which is included in the .CPP file which has the method I want to tuse:
basically I need to use only the ReadFile routine.
Is is this a problem, that the method is inside a CPP class and is not standalone?
Once I have this header file how should I implement the Java class?
class KTV_API KTVFile
public:
     enum Modes
          modeRead          = 0x00,
          modeWrite          = 0x01,
          modeNoHeader     = 0x02,
          modeNoCompress     = 0x40,
          modeNoEncrypt     = 0x80,
     KTVFile();
     ~KTVFile();
     bool Open(const _TCHAR* filename, int openMode);
     bool Close();
     unsigned int Read(void* buffer, unsigned int len);
     unsigned int Write(const void* buffer, unsigned int len);
private:
     enum Masks
          maskCompressEncrypt     = 0xC0,
          maskVersion               = 0x3F,
     bool     IsWriting();
     bool     IsCompressionEnabled();
     bool     IsEncryptionEnabled();
     bool     IsHeaderEnabled();
     bool     WriteFile(const void* buffer, unsigned int len);
     int          ReadFile(void* buffer, unsigned int len);
     bool     Deflate(const unsigned char* buffer, unsigned int len, bool isFinal = false);
     int          Inflate(unsigned char* buffer, unsigned int len, bool isFinal = false);
     bool     Encrypt(const void* buffer, unsigned int len);
     int          Decrypt(void* buffer, unsigned int len);
     int                    m_openMode;
     FILE*               m_pFile;
     unsigned char*     m_inbuf;
     unsigned char*  m_inbuf_start;
     unsigned char*     m_inbuf_end;
     unsigned char*     m_zbuf;
     unsigned char*     m_cryptbuf;
     z_stream          m_Zstream;
     CRijndael*          m_pRijndael;
};

Similar Messages

  • Decompiling a .DLL file to view Source Code

    Hi guys,
    I have a DLL file which I would like to decompile in order to edit the source code... Does anyone have any idea of  how I come go about doing this?
    I don not have the original solution (The person who wrote it has left the company)
    Thanks
    Neefy

    Hello,
    I am in the same situation as Neefy was. I followed everyones advice and went to get .Net Reflector. Sadly you have to pay $35 for it now. I am  not sure if the company wants to buy this if it does not work how we want. I noticed they have a beta version
    out for free. I downloaded this and then FileGenerator plugin from the link provided. I started following Rukshan's steps. I get to step 4. After I click add and locate the plugin I get an error saying that it failed to to load the add-in.
    Does anyone know if this is because the plugin is not compatible with the beta? Or is it that the plugin does not even work with their newest version, version 7 because when this thread was created I believe they were not using version 7.
    I have tried downloading older versions off of .cnet, but when you run the reflector.exe a message pops up saying newer version available would you like to download it. If you choose no it removes the .exe if you choose yes it says you must visit the website
    to download (to pay) and then it deletes the .exe.
    Thanks for any help on this
    Rob
    *Edit*
    Something else I am wondering:
    I believe the .dll that I want to view the source code was in C or C++ with a slight chance of being C#. If I use .NET Reflector and it was written in C/C++ will it successfully create a C# file?
    *edit edit*
    Seems there is actual error output:
    Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. (ReflectionTypeLoadException)
    LoaderExceptions:
    Could not load file or assembly 'Reflector, Version=5.0.0.0, Culture=neutral, PublicKeyToken=18ca6bb8dd6a03c3' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
    (FileLoadException)
    That error message repeats 7 more times.
    *edit edit edit*
    couple of hours of searching I found free stable version 6.5
    Here:
    http://www.brothersoft.com/red-gate-.net-reflector-284053.html
    I downloaded it and tried to use the plugin. Seems to be working. I think the problem might be the fact that version 7 is in beta. Hopefully the problem doesn't exist in final production of version 7.
    Cheers! Hope this helps someone else
    *edit edit edit edit*
    So I think it worked. It generated 2000 files(mostly System.XXXXXX.XXXXX etc..). Does anyone know where I would be able to actually find the code written by programmer who wrote the .dll not the .NET files. Thanks!

  • LoadExternalModule throws error (-7 Unknown file extension) when working with source-code.

    Utility library function LoadExternalModule (admittedly marked as obsolete - but key to one of our older software)
    fails with error code (-7 Unknown file extension.)  in CVI 2012SP1 and 2013 Version 13.0.0(647) on Win7
    The suggested alternative Win32 API GetProcAddress doesn't work with source or obj files (so isn't an alternative at all)
    The Target-Settings to "Enable LoadExternalModule" are already checked.
    Any suggestions ?
    This code-snipped shows the behavior :
    // File "Main.c"
    #include <utility.h>
    int main(void)
    void (*funcPtr) (void);
    int moduleID;
    int status;
    // Library-Function-Error : -7 Unknown file extension.
    moduleID = LoadExternalModule ("Test.c");
    funcPtr = GetExternalModuleAddr (moduleID, "test_function", &status);
    (*funcPtr) ();
    return 0;
    // File "Test.c"
    void test_function(void)

    Hi,
    Thanks for teh inf regarding the LoadExternal Module,
    Using the LoadExternalmodule as you mentionned requires using a .obj file but this lead me to an issue getting a Control value from an .obj file called from a dll
    When using the LoadExternalModule function in CVI 2013, we can no longer use a .c file. Instead we have to use an .obj file.
    My issue is that' impossible for me to get a control value from an .iur managed by the .obj witchi is called by a dll. 
    Otherwise it's impossible for me to get the control vale when calling the .obj from a dll.
    Any suggestions Amigos
    Thanks

  • Can any solve this exception when compiling the source code

    when i compile the source code . i am getting the following exceptions
    1.java.lang.classnotfoundException and javax.jnlp.UnavailableServiceException
    BadFieldException[ The field <jnlp>codebase has an invalid value: $$context/adempiereHome,$$context/adempiereHome]
         at com.sun.javaws.jnl.XMLUtils.getAttributeURL(Unknown Source)
         at com.sun.javaws.jnl.XMLFormat.parse(Unknown Source)
         at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
         at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
         at com.sun.javaws.Main.launchApp(Unknown Source)
         at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
         at com.sun.javaws.Main$1.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

    looks like you're using java web start to run app. am i right? personally i don't have much expertise in this area but i've had to deal with it before, essentially what your problem looks to me is that the codebase in your jnlp file is set up wrong
    under my definition (vague) the codebase points to where java should look at to find your files and run them
    do a search and read more about running apps. through web start if that's your case

  • Can't use right click to view source code of photos

    In Windows I can right click my mouse to view the source code of a posted photo. However, I don't see this capability in the iMac. Am I wrong and, if so, how to do it?

    It actually works with Photoshop but not with Flash Pro.

  • ORA-22809 when executing sample source code for purchaseOrder.xsd

    Hello,
    i was trying to execute the sample code given in chapter 5 of Oracle XML DB User's Guide for version 10GR2 (on an Oracle XE db) and i got:
    Error starting at line 1 in command:
    CREATE TABLE purchaseorder_as_column (
    id NUMBER,
    xml_document XMLType,
    UNIQUE (xml_document."XMLDATA"."Reference"))
    XMLTYPE COLUMN xml_document
    XMLSCHEMA "http://xmlns.oracle.com/xdb/documentation/purchaseOrder.xsd"
    ELEMENT "PurchaseOrder"
    VARRAY xml_document."XMLDATA"."Actions"."Action"
    STORE AS TABLE action_table2
    ((PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$))
    ORGANIZATION INDEX OVERFLOW)
    VARRAY xml_document."XMLDATA"."LineItems"."LineItem"
    STORE AS TABLE lineitem_table2
    ((PRIMARY KEY (NESTED_TABLE_ID, SYS_NC_ARRAY_INDEX$))
    ORGANIZATION INDEX OVERFLOW)
    LOB (xml_document."XMLDATA"."Notes")
    STORE AS (TABLESPACE USERS ENABLE STORAGE IN ROW
    STORAGE(INITIAL 4K NEXT 32K))
    Error at Command Line:12 Column:32
    Error report:
    SQL Error: ORA-22809: nonexistent attribute
    22809. 00000 - "nonexistent attribute"
    *Cause:    An attempt was made to access a non-existent attribute of an
    object type.
    *Action:   Check the attribute reference to see if it is valid. Then retry
    the operation.
    The purchaseOrder.xsd schema document has been built by cutting and pasting the various fragments contained in the documentation and can be found at:
    http://www.yocoya.com/temp/purchaseOrder.xsd
    The schema was registered using the following command:
    BEGIN
    DBMS_XMLSCHEMA.registerSchema(
    SCHEMAURL => 'http://xmlns.oracle.com/xdb/documentation/purchaseOrder.xsd',
    SCHEMADOC => bfilename('XMLDIR','purchaseOrder.xsd'),
    CSID => nls_charset_id('AL32UTF8'),
    LOCAL => TRUE,
    GENTYPES => TRUE,
    GENTABLES => TRUE);
    END;
    Can someone explain what i am doing wrong or tell if the sample code is flawed?
    Thank you,
    Flavio
    http://www.oraclequirks.com

    Just to close this thread, in the sample xml schema document i linked in my original post, there were some xdb:SQLName annotations against elements LineItems, LineItem, Actions and Action. When such annotations are present, column names and object attributes that would otherwise carry the same name as the xml elements/attributes are completely replaced by the specified strings. This is necessary if, for some reason, the element name contain reserved oracle words (i also hit this problem 15 minutes after resolving my original issue...) or simply because we don't like having case sensitive names.
    In my original CREATE TABLE statement i was attempting to refer to nested elements using the original case sensitive names, but these names had been replaced by LINEITEMS, LINEITEM, ACTIONS and ACTION (in uppercase), hence ORA-22809.
    This was not the only problem afflicting my custom purchaseOrder.xsd, but it was the reason of ORA-22809.
    Eventually I managed to get the custom purchaseOrder schema to work.
    May be i'll come up with some tongue-in-cheek tutorial on my blog one day or another.
    Bye,
    Flavio
    http://www.oraclequirks.com

  • Do I have control over "USE flags" when compile from source

    I have  used Gentoo and like it's system specific customizations, but am looking for something a slight bit easier to maintain.  I noticed that Arch also compiles as part of the installation.  Do I have control over the system wide compile setting in order to customize the builds similar to what is done is Gentoo?  Or, is the pacman process a "one size fits all" installer without customizations, for such things as architecture, with or without certain extensions...
    Thanks for your info.  This looks like the distro for me, but am researching first.

    It's a one-size-fits-all approach for the official binary repos and many weird and wonderful things can be found in the AUR or unofficial user repos. You can also use ABS to alter the configuration yourself, but you would have to edit PKGBUILDs for every package you want to change (e.g. add '--enable-foo') as Arch doesn't use the USE flags.
    Official Arch packages support only i686 and generic 64-bit architectures, but e.g. linux -ck kernel https://bbs.archlinux.org/viewtopic.php?id=111715 is provided optimized for many specific processors.

  • Using wysiwyg text editor in drupal the latest firefox does not wrap text when viewing source code-chrome ie ok

    Using drupal ckeditor profile with wysiwyg . Firefox latest version is apparently not respecting the width of the i-frame text editor box and the text is not wrapping when viewing in source code mode. Chrome and IE are working as expected. Windows 7

    [https://support.mozilla.org/en-US/kb/where-go-developer-support Where to go for developer support]

  • Scrolling  messes source code on JDeveloper 10.1.3.5 Windows 7 (64 bit)

    Hello!
    One can only work around the problem as in vista, by using a new Sun jdk, other than that shipped with JDeveloper.
    However, this is not considered safe, as the newer jdk is neither tested nor certified to work with that version of JDeveloper.
    I have already searched My Oracle Support, only to find a patch about a memory leak for JDeveloper 10.1.3.5. +(I wonder why is it not offered to the public anyway?+)
    Could any one from Oracle please see to a more permanent and safer solution to the problem?
    I am looking forward for your prompt actions, and thank you very much in advance!

    Let me rephrase: when one scrolls using page up or down keys, or by using a mouse wheel, the source code lines ( and characters) appear partly only, either distorted or overlapping with each other, in such a way that one cannot make out what has been written. I hope the above clarifies the problem in question. In such a case a screen shot might actually serve us perfectly.
    I have already given your suggestion a try, without any success.
    Thanks anyway very much for your reply!
    Any other helping hand available?
    TIA!

  • ORA-06502 when searching region source

    The following is listed as a limitation of Apex 3.1, for both interactive reports and the application builder, although the specific context is not mentioned.
    The row length limit is 32k (just as with Classic Reports). You can include more columns but if too many are selected to be displayed, the user will get the following error - "ORA-06502: PL/SQL: numeric or value error: character string buffer too small". This should be considered when creating your report.You can find that here: http://www.oracle.com/technology/products/database/application_express/html/3.1_known_issues.html
    I'm getting this very error when trying to search region source for one of my application items. Presumably the region source is larger than the 32k limit where my particular page item is being used?
    Can anyone from Oracle verify that this is still a problem in Apex 3.2.0.00.27?
    Earl

    >
    The following is listed as a limitation of Apex 3.1, for both interactive reports and the application builder, although the specific context is not mentioned.
    The row length limit is 32k (just as with Classic Reports). You can include more columns but if too many are selected to be displayed, the user will get the following error - "ORA-06502: PL/SQL: numeric or value error: character string buffer too small". This should be considered when creating your report.
    You can find that here: http://www.oracle.com/technology/products/database/application_express/html/3.1_known_issues.html
    I'm getting this very error when trying to search region source for one of my application items. Presumably the region source is larger than the 32k limit where my particular page item is being used?
    Can anyone from Oracle verify that this is still a problem in Apex 3.2.0.00.27?
    EarlAnyone have any ideas about the above? I'm getting this error when searching region source code, here:
    Home>Application Builder>Application nnn>Application Reports>Page Components>Search Region Source
    Any help would be appreciated. Thanks.
    Earl

  • "Organize Imports" feature in Jdev10g will totally mess up my source code

    I set "Use Wide Imports". The source code became a piece of junk after running "Organize Imports" against following code:
    * @author
    package test;
    import java.io.*;
    import java.util.*;
    import javax.xml.parsers.*;
    import org.apache.xerces.util.XMLChar;
    import org.apache.xml.serialize.*;
    import org.apache.xml.utils.*;
    import org.w3c.dom.*;
    import org.xml.sax.*;
    public class Test {
    This bug exists in preview version. I'm suprised this bug still in production release.

    The javadoc comments is causing the behavior.
    Removing the java doc comments seems to work
    Bug 5006753

  • Is Source Code availble for all the iFS clases (i.e.: webui package)

    I am trying to build some custom pages to interact with iFS. Some of them are similar to the prebuilt pages (to do searches for example).
    I found the class files that the JSPs use but cannot find any source code for them. Are they available? I know there are several packages that the API is provided for but by looking at how the webui classes, etc. interact it would provide insight into how to use them.
    For example I want search pages that will take a list of folders and fillnames(via a Query string) and generate a list similar to what "container" does via the "advancedfind.jsp" page.
    Basically I am found the jar files such as
    ...\jsp\lib\ojsp.jar
    ...\ifs1.1\lib\webui.jar
    ...\ifs1.1\lib\utils.jar
    ...\ifs1.1\lib\email.jar
    I am looking for source and JavaDoc for these classes if it exists.
    Thanks,
    Simon

    the source code for the WebUI and other modules that make up 9iFS is not available to the public. there is example code for using the API in the 9iFS (version 9.0.1) installation. you can also consult the documentation and whitepapers here on OTN.

  • How to setup source code control with StarTeam

    Hi,
    Could anyone please tell me what should I do to set up the source code control?
    My company use StarTeam Borland as a source code control tool. I try to set this as a Source Control for Labview by go to SourceControl category ins the Options setup, but I cannot select anything form the list of provider name. Do I have to do any extra step to make it right?
    Best regards,
    Thang Nguyen
    Message Edited by THANG NGUYEN on 08-12-2009 05:23 PM
    Attachments:
    SourceCodeControl.JPG ‏64 KB

    Read this: Source Code Control Provider Does Not Appear In LabVIEW Options. (A simple search would have yielded this.)

  • When I am using firebug how do I enable editing of css source code? I can use the edit menu "find" option but cannot change the code. It won't allow that.

    I am not allowed to edit my css source code. I can open a css file
    and see all the code but when I try to change any of the text, it
    will not do it. I thought I could text edit to update css files. How do I do that?

    If your intention is to upload the changed file(s) to the server then you need to use an external editor.<br />
    Otherwise you can look at an extension like Web Developer.
    *Web Developer: https://addons.mozilla.org/firefox/addon/web-developer/

  • Why does debugger not find source code when compiler output has been directed to the root directory, but the source is in a sub-directory, using Forte for JAVA community edition V3.0

    I have configured Forte to put compiler output, i.e. my classes, in the root directory of the project. I now find that the debugger does not find the source code when it is in a sub-directory. However, if I temporarily copy a classes' source code to the root directory the debugger will display it.
    To direct compiler output to the root directory I selected Project >Settings>Compiler types, then External Compiler ( which is the default compiler in my case ) and set Target to be the root project directory. This is the only directory it will allow.

    This Forum is for Forte 4GL or UDS as its called today. I am not sure if anybody is going to be able to answer your question here. Sorry.
    ka

Maybe you are looking for

  • Why does my hard drive keep dismounting...help please I am going bonkers...

    Brand new AEBS ver7 firmware Works fine on the network and to the gateway for the internet. Plug in a Lacie320 drive tot he USB, it sees it, it appears to work (but slow) for a while. Leave it to backup and when I return the disk has dismounted? Gone

  • Lion starts in 'set up' mode after installing Parallelsn safe mode

    Big problem. I couldn't get on with VMWare Fusion as it was piling up huge files (106 Gb) and using up half of my hard drive. I had always had problems with it since installation so i decided to take up the transfer offer from Parallels and installed

  • Firefox takes 4 minutes to start since the recent upgrade. Can you help?

    Since Firefox was upgraded to the latest version about 5 days ago, it has become extremely slow to start. It is taking just about 4 minutes. As soon as I experienced this problem, I removed it completely from my computer. I subsequently reinstalled i

  • What's with these appended numbers in front or back of titles?

    What about those appended numbers (01 or 01-09 or whatever) in front of song titles or at the end so iTunes doesn't find these as duplicates? You can't even sort them because it reads those numbers as titles. I didn't put them there. If they are dupe

  • I need to Average multiple months.

    I am new to spreedsheets and I am makeing a sheet for my work and I need help. I am trying to average multiple cells as I enter new numbers in the cells per week. For example $100.00 in cell A1 200.00 in cell B1,C1:L1 are all blank until I enter new