Home Risen Risen2 Risen3 Forum English Russian

Register FAQ Calendar Today's Posts
Page 1 of 11 123458 ... Last »
Results 1 to 20 of 207
  1. #1 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    This is my gift/bonus for Risen’s first-year anniversary.

    Before becoming over-excited, this is not the holy grail.
    Please read the complete text before asking questions.

    Code:
    
                              An inchoate, community-based
                           Software Development Kit for Risen
                            Version 1.0.96124.0 (Patch 1.10)
    
    1. License
    ~~~~~~~~~~
    
      The whole RisenSDK is licensed under a Creative Commons BY-NC-SA 3.0 License
      (please visit http://creativecommons.org/licenses/by-nc-sa/3.0/ for details).
      All other names used in the SDK may be trademarks of their respective owners.
    
      The RisenSDK is completely independent and has (besides the game) absolutely
      no relationship to the developer Piranha Bytes and the publisher Deep Silver.
      Do not annoy them with support requests. They have contributed nothing (yet).
    
    2. Preface
    ~~~~~~~~~~
    
        Player: How do I get into the castle?
        Guards: You don't. Only Gomez' people get to go in there.
        Player: I see.
    
      This SDK is intended for software developers with a strong background in C++
      and reverse engineering (Microsoft Visual C++ binary programs in particular).
      Without this expertise you are expected to get lost in space sooner or later.
    
      The idea of this project is to use the exported classes, functions, and data
      of the Genome libraries to extend Risen and develop custom tools or plug-ins.
      For several reasons (name mangling, memory layout, etc.) we are bound to the
      compiler that was used by Piranha Bytes to build Risen (Visual C++ 2005 SP1).
      Fortunately the Visual C++ 2005 Express Edition ISO image is still available
      on Microsoft's download server (google 0434C5AF-8FB5-4D64-B8D8-E9BDF3C83152).
      Combined with the "Windows Server 2003 R2 Platform SDK" (has been superceded
      by the Windows SDK, but the new SDKs do not include ATL/MFC headers) it adds
      up to a development environment for free, that can be used with the RisenSDK.
    
      To correctly handle exported data and functions with C linkage, I was forced
      to develop a custom tool for creating the import libraries that can be found
      in the /lib directory of the SDK. This tool is not part of this project (but
      I think this is not a problem, it seems to work and no changes are expected).
    
      For your own research, you might remove the protection wrapper (Solidshield)
      from the application (bin/Risen.exe) and protected libraries (bin/Engine.dll,
      bin/Game.dll, and bin/scripts/Script_Game.dll) to allow static code analysis.
      Do not waste our time, such binaries will not be published for legal reasons.
    
    3. Loading
    ~~~~~~~~~~
    
        Player: I need to get into the castle!
                I have a letter here for the High Fire Mage.
        Thorus: And you expect me to let you stroll inside the castle
                to hand it over and collect your reward?
        Player: Yeah.
    
      Checkout the "trunk" (main line of development) of the Subversion repository
      at svn://nicode.net/risensdk/trunk/ into Risen's program installation folder.
      For commits (write access) you need an account + password (send me an email).
    
      Go to http://svn.nicode.net/risensdk/trunk/ to browse through the repository.
    
    4. Playing
    ~~~~~~~~~~
    
        Xardas: WHO DARES TO DISTURB ME IN MY STUDIES?
        Player: My name is...
        Xardas: I don't wish to know your name. It is insignificant.
                All that matters is that you are the first person in years to have
                solved my Golem's riddles.
    
      As you will notice, the RisenSDK is in a very rudimentary state. All exports
      of the SharedBase.dll are covered, but the source is full of FIXMEs 'n TODOs.
      Expect to find problems and bugs in the template classes (has been developed
      from scratch, and some should have been rewritten) and nearly all parameters
      are unnamed. The reason is quite simple - lack of time. Most of the code has
      been written in about two weeks. The SharedBase.dll was the easiest part. It
      will require even more research and work to add support for the "foundation"
      (FF) and "framework" (FX) modules. Virtual inheritance is a nice feature for
      interfaces that might have been changed during the life cycle of the product.
      But it is no fun to analyze the thunks and data access with negative offsets.
    
      To get your code loaded by the engine, you can develop a script library that
      follows the naming convention /bin/scripts/Script_*.dll - have a look at the
      project in /source/Scripts/Script_Library (implements a new console command).
    
    5. Closing
    ~~~~~~~~~~
    
        Jackal: Hey, watch who you're trying to fool!
                Come back when you have the ore!
    
      This project is just a little too sparse and too late to be useful for Risen.
      But if Piranha Bytes re-uses parts of the Genome engine for the next project,
      it might speed up the development of community tools or plug-ins for Risen 2.
    
      So Long, and Thanks for All the Fish
      Nico Bendlin <nicode@gmx.net>
    NicoDE is offline Last edited by NicoDE; 01.10.2010 at 23:52.

  2. #2 Reply With Quote
    NicoDE is offline

  3. #3 Reply With Quote
    Ehrengarde Baltram's Avatar
    Join Date
    Jun 2006
    Posts
    2,234
    That's a VERY nice gift. And I'd really like to help expanding it... do you know any good book or online tutorial dealing with RE? Maybe I'll get experienced enough until Risen II is released.

    Thanks a lot for all the hours you spent on this project!



    EDIT:
    Danke, mal sehen ob ich mit IDA Pro 4.9 was anfangen kann... ich muss aber zunächst noch Assembler lernen.
    Baltram is offline Last edited by Baltram; 02.10.2010 at 18:50.

  4. #4 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    Here are same "pointers" for reverse engineering:

    IDA Pro + Hex-Rays Decompiler are professional tools, but a free version of IDA is available. Go to Ilfak’s Blog to have some interesting reads. Now a bit dated (due to the Blochs debugger in the current version), but still the best Book about IDA and analysis in general.

    OllyDbg is a good debugger.

    Please read the excellent articles from Igor Skochinsky at OpenRCE, especially the one about MSVC’s class layout, virtual functions, and RTTI.
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE is offline Last edited by NicoDE; 02.10.2010 at 22:12.

  5. #5 Reply With Quote
    Veteran White-Rabbit's Avatar
    Join Date
    Jul 2007
    Location
    Solingen
    Posts
    596
    Obwohl ich bisher kaum Erfahrung mit modden habe und auch nicht viel mit deiner bisherigen Arbeit anfangen könnte hab ich zumindest eine kleine Vorstellung davon wieviel Arbeit und vorallem Gehirnschmalz du hier investiert hast.

    Vielen herzlichen dank für dein Engagement!




    Schöne Grüsse mit der Hoffnung das jemand deine Arbeit aufnimmt und ausbaut,
    Whity
    Es gibt nur zwei Dinge die unendlich sind:
    Das Universum. Und die menschliche Dummheit.
    Beim ersten bin ich mir aber noch nicht ganz sicher.
    - Albert Einstein

    Meine Posts spiegeln immer nur meine Meinung dar. Ich nehme mir nicht das recht fuer die Allgemeinheit zu sprechen.
    White-Rabbit is offline

  6. #6 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    You’re welcome
    Please stick to posting in English, thank you.
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE is offline

  7. #7 Reply With Quote
    Rookie
    Join Date
    Oct 2010
    Posts
    2
    thanks for you work.

    Does sdk work with protectioned .exe file?

    Can you write a tutorial on how to remove wrapper?
    titanic98 is offline

  8. #8 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    Quote Originally Posted by titanic98 View Post
    Does sdk work with protectioned .exe file?
    Yes. It was/is intended for the official release/patch - else it would not make sense at all

    Quote Originally Posted by titanic98 View Post
    Can you write a tutorial on how to remove wrapper?
    No. Circumventing copy protections is not allowed in Germany.
    As long as you do not want to restore one of the 18 virtualized functions, there is nothing special to do: find the OEP, wait for decoding, write endless loop at OEP, wait for hang, dump sections, find original IAT/import table, and rebuild image without the Solidshield section. You will not get working images, but it is sufficient to analyze 99% of the binary.
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE is offline

  9. #9 Reply With Quote
    Warrior André Feroi's Avatar
    Join Date
    Feb 2009
    Location
    Belgium
    Posts
    438
    Well done !

    Quote Originally Posted by NicoDE View Post
    But if Piranha Bytes re-uses parts of the Genome engine for the next project, it might speed up the development of community tools or plug-ins for Risen 2
    Just curious to know: was Genome the graphic engine used for Risen ? Wiki has some information about it (here) but does not name it.
    André Feroi is offline

  10. #10 Reply With Quote
    Ehrengarde Baltram's Avatar
    Join Date
    Jun 2006
    Posts
    2,234
    Quote Originally Posted by André Feroi View Post
    Just curious to know: was Genome the graphic engine used for Risen ? Wiki has some information about it (here) but does not name it.
    Yeah, but there have been major changes/modifications since Gothic 3.
    Baltram is offline

  11. #11 Reply With Quote
    Knight Shadow Mabori's Avatar
    Join Date
    May 2008
    Location
    Wo das Sumpfkraut ...... 8D ...... am längsten blüht
    Posts
    1,221
    Quote Originally Posted by Baltram View Post
    Yeah, but there have been major changes/modifications since Gothic 3.
    I hope that they will use the Engine of Gothic 2 again!!!
    But than with really advanced technoligy and inprovemens!
    And European Style!!
    -------------------
    So know everyone can make mods??

    Real mods, like Quest, new Items.. ect?

    greetings,
    Mogi
    --->ELEX<--- Der Schläfer war damals auch mal ein Sektenspinner
    [Bild: sigpic90446_34.gif] [Bild: 492.gif]
    Spoiler:(zum lesen bitte Text markieren)
    • GA-990FXA-UD3
    • AMD Athlon II X4 640 (OC: 3,48 GHz)
    • 8GB RAM 1600mhz
    • AMD Radeon HD 7800 (OC: 1025/1250)
    • WIN 7 ULTIMATE (64bit)
    • Manjaro Linux Distro
    Shadow Mabori is offline Last edited by Shadow Mabori; 08.10.2010 at 20:24.

  12. #12 Reply With Quote
    Ehrengarde Baltram's Avatar
    Join Date
    Jun 2006
    Posts
    2,234
    New mods (including quests, dialogs, items, new weapons, ...) have become feasible quite some time ago, there is only a lack of modders.

    The main object of the SDK is, as far as I understood, the ability of adding new scripted functions, which results in additional "script_XYZ.dll" (example of adding new console commands). This would for example be critical for realizing complex quests / events. But at the moment it's not really doable since the SDK is too "young" yet.
    Baltram is offline

  13. #13 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    Quote Originally Posted by Baltram View Post
    The main object of the SDK is, [...]
    [...] to use the engine classes to load/modify/write the content files. Why should we analyze a file format and develop tools from scratch, if we can use the engine class to load the content.
    At least in my option

    I just used the Script interface to get into the engine and to interact with the user in a way that reduces the effort on both sides.

    The SPU analysis is far from ready. Nobody (that I know) took the time to analyze the requirements, conditions and interrelation of "scripted" functions.
    However, the Script wrapper classes (Script.dll) are very interesting, because they allow easy access to the frequently used functions/actions of the engine classes.

    Note: Next I’ll work on the property classes/templates. This would allow us to read/change the properties of every bCObjectBase-based class in a generic way.

    ps@Baltram: Many thanks for answering the questions
    NicoDE is offline Last edited by NicoDE; 08.10.2010 at 21:42.

  14. #14 Reply With Quote
    Ehrengarde Baltram's Avatar
    Join Date
    Jun 2006
    Posts
    2,234
    Quote Originally Posted by NicoDE View Post
    Why should we analyze a file format and develop tools from scratch
    Because it can be fun

    ... no, you're right of course. Could this also help to understand the ._xmot Format? I'm not sure here because it's kind of "external" file format.
    Quote Originally Posted by NicoDE View Post
    I just used the Script interface to get into the engine and to interact with the user in a way that reduces the effort on both sides.
    I hoped we could implement functions to be called in infos that way...
    Quote Originally Posted by NicoDE View Post
    Next I’ll work on the property classes/templates. This would allow us to read/change the properties of every bCObjectBase-based class in a generic way.
    Sounds cool! But I've no idea what bCObjectBase-based classes are (didn't find that expressen in your source files).
    Baltram is offline

  15. #15 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    Quote Originally Posted by Baltram View Post
    Because it can be fun
    "Verstehe."
    Sorry, in the English release it was translated with "I see." - but this translation does not work here
    Quote Originally Posted by Baltram View Post
    Could this also help to understand the ._xmot Format?
    Maybe, but I never had a deeper look at the animation resources/classes (other things to do, sorry).
    Quote Originally Posted by Baltram View Post
    I hoped we could implement functions to be called in infos that way...
    We can, the prolog (getting "self" and "other" by the parameters or from the SPU is _always_ the same and quite simple to implement).
    You just have to code what should happen in your function

    Even if no Script.dll header is included, I created the import libraries for all Genome modules. So you can have a look at the existing script functions and use
    @for /R "D:\Games\Risen\bin" %i in (*.dll) do @dumpbin /exports /out:"%~dpni.exports.txt" "%i" && undname 0x8000 "%~dpni.exports.txt" > "%~dpni.undname.txt"
    in a Visual Studio command prompt, to get started with the exports.

    For the class hierarchy you might read the RTTI data. I attached files that have been generated with an IDA plug-in. It is not fail-safe (specifically with multiple virtual inheritance), but it gets it right most of the time.

    Quote Originally Posted by Baltram View Post
    But I've no idea what bCObjectBase-based classes are (didn't find that expressen in your source files).
    bCObjectBase is the base class that introduces the generic property system.
    Attached Files
    NicoDE is offline Last edited by NicoDE; 30.03.2011 at 01:41.

  16. #16 Reply With Quote
    Ehrengarde Baltram's Avatar
    Join Date
    Jun 2006
    Posts
    2,234
    Quote Originally Posted by NicoDE View Post
    So you can have a look at the existing script functions and use [...] to get started with the exports.
    Wow, it worked .

    I guess if I wanted to use such exported methods (?) I'd have to "rewrite the header" (don't now how to express ) of the corresponding class and base classes, like you did in the SDK, right?
    And I further guess this would be the point where I'd need experience with IDA and assembly code...
    Quote Originally Posted by NicoDE View Post
    For the class hierarchy you might read the RTTI data. I attached files that have been generated with an IDA plug-in.
    Thanks!

    Unfortunately, as I haven't been concerned at all (yet) with anything having to do with RE, I don't quite understand it. For example:
    20D48B8C 0088 gCInventory_PS: eCEntityPropertySet, bCObjectRefBase, bCObjectBase, gCInventoryListener; [MI]
    20D48B6C 0005 gCInventory_PS; [MI]
    Why is gCInventory_PS stated twice?
    Are the classes stated in the first line the base classes of gCInventory_PS?
    Do I have to know about "[MI]"?
    Quote Originally Posted by NicoDE View Post
    We can, the prolog (getting "self" and "other" by the parameters or from the SPU is _always_ the same and quite simple to implement).
    You just have to code what should happen in your function
    So I could call lets say your library script out of an info?
    ___________________

    Sorry for bothering you with all these questions
    Baltram is offline

  17. #17 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    Quote Originally Posted by Baltram View Post
    I guess if I wanted to use such exported methods (?) I'd have to "rewrite the header" (don't now how to express ) of the corresponding class and base classes, like you did in the SDK, right?
    Yes.
    In the first step you just have to figure out, how big the class is (sizeof). For classes with virtual destructors (vector deleting destructor) this is quite easy, because the this-pointer is incremented by sizeof(*this). Therefore you can declare a dummy array as member block to start using a class (you should not include the pointer to the virtual function table(s) in the members).

    Quote Originally Posted by Baltram View Post
    And I further guess this would be the point where I'd need experience with IDA and assembly code...
    Yes, it helps debugging if you reverse engineer the complete class with all members. But you don’t have to, if you only use exported functions/methods. Sometimes, when you only use pointers to objects (e.g. global singletons), you don’t even have to know the size of the class.

    Quote Originally Posted by Baltram View Post
    For example:Why is gCInventory_PS stated twice?
    Don’t care, you’ll stumble upon it later.

    Quote Originally Posted by Baltram View Post
    Are the classes stated in the first line the base classes of gCInventory_PS?
    Yes, they are the base classes.

    Code:
    class bCObjectBase{};
    class bCObjectRefBase: public bCObjectBase{};
    class eCEntityPropertySet: public bCObjectRefBase{};
    
    class gCInventoryListener{};
    
    class gCInventory_PS: public eCEntityPropertySet, public gCInventoryListener{};
    Quote Originally Posted by Baltram View Post
    Do I have to know about "[MI]"?
    SI = Single Inheritance
    MI = Multiple Inheritance
    VI = Virtual Inheritance

    Because gCInventoryListener is not derived from bCObjectBase/bCObjectRefBase/eCEntityPropertySet, gCInventory_PS needs more than one virtual function table and separate blocks for the members -> MI.

    Quote Originally Posted by Baltram View Post
    So I could call lets say your library script out of an info?
    Do you have an idea for an example?
    I might take the time to create one. I’m sure it would help some people to get in touch with the SDK.
    NicoDE is offline Last edited by NicoDE; 10.10.2010 at 21:53.

  18. #18 Reply With Quote
    Ehrengarde Baltram's Avatar
    Join Date
    Jun 2006
    Posts
    2,234
    Quote Originally Posted by NicoDE View Post
    In the first step you just have to figure out, how big the class is (sizeof). For classes with virtual destructors (vector deleting destructor) this is quite easy, because the this-pointer is incremented by sizeof(*this).
    Okay...

    Sorry. It sounds pretty easy but I still have't got any idea what do to (in a concrete, practical sense) - am I supposed to use OllyDbg now?

    I'd be happy if you could give me some words I can google, or so, I really have to learn EVERYTHING from zero (but I usually learn fast ).
    Quote Originally Posted by NicoDE View Post
    Do you have an idea for an example?
    You mean an example of a useful additional script for the use in infos? Well, my intention was to write one to void trader inventories (in order to create own traders without pre-existing trade items) but today I recognized this isn't necessary at all .

    But I think it would be convenient to have a script for playing a specific animation / sound. For spawning NPCs, Objects, Items. For influencing ingame time. (Might be that such already exists.)
    Quote Originally Posted by NicoDE View Post
    I might take the time to create one. I’m sure it would help some people to get in touch with the SDK.
    At least it would help ME
    Baltram is offline

  19. #19 Reply With Quote
    research NicoDE's Avatar
    Join Date
    Dec 2004
    Posts
    7,404
    Quote Originally Posted by Baltram View Post
    But I think it would be convenient to have a script for playing a specific animation / sound. For spawning NPCs, Objects, Items. For influencing ingame time. (Might be that such already exists.)
    OK, that’s a lot
    After the current research (property converter), I’ll think and care about an example. But don’t expect it to be ready tomorrow. A lot of things have to be done to create a basic framework for this features.
    "Unter diesen schwierigen Umständen bin ich mir sicher, daß diese guten Menschen meinen augenblicklichen Bedarf an deren Gold verstehen werden." -- Connor
    NicoDE is offline

  20. #20 Reply With Quote
    Ehrengarde Baltram's Avatar
    Join Date
    Jun 2006
    Posts
    2,234
    Quote Originally Posted by NicoDE View Post
    OK, that’s a lot
    After the current research (property converter), I’ll think and care about an example. But don’t expect it to be ready tomorrow. A lot of things have to be done to create a basic framework for this features.
    Hey, these were only the first rash ideas I had when thinking of what I'd like to have if I was an "info-scripter" (and I'm far away from being one). Of course nobody wants you to waste your time by building up luxury features. But I'm really looking forward to an example.
    Baltram is offline

Page 1 of 11 123458 ... Last »

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •