TrackIR emulation coming soon

Official forum for open source FreePIE discussion and development.
User avatar
djdevin
Two Eyed Hopeful
Posts: 55
Joined: Wed Oct 17, 2012 1:10 pm
Location: Philadelphia, USA

Re: TrackIR emulation coming soon

Post by djdevin »

Yep that was it! Add the NPClient.def and worked as expected. Going to fool around with the haiku now...
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: TrackIR emulation coming soon

Post by CyberVillain »

Nice work, djdevin hope you find that little poem in there :P
CyberRascal
Two Eyed Hopeful
Posts: 74
Joined: Fri Sep 21, 2012 4:46 am

Re: TrackIR emulation coming soon

Post by CyberRascal »

Yep, good job :)

To log the haiku you should probably use get_log_path, and open a stream in binary mode, and write the memory as a string to that file. You might find it useful to use another file though, so you only get the binary data.

Good luck, hope you find something useful! Since it is an encrypted version of trackir, the location of the poem is probably changed, hopefully it's still close to the input buffer though.
User avatar
djdevin
Two Eyed Hopeful
Posts: 55
Joined: Wed Oct 17, 2012 1:10 pm
Location: Philadelphia, USA

Re: TrackIR emulation coming soon

Post by djdevin »

So I managed to do some step debugging to attach to F1 2012 and poke around the memory when NPClient.dll was loaded, but I was unable to find the haikus near the buffer. I'll try broader searching later - my short term goal was to get F1 2012 actually working with FreePie/TrackIR. I *did* get it working by writing certain haikus and feeding them in - so that's confirmed, it does actually work. Mapped my hillcrest tracker and all is well.

While the search algorithm is a great idea, I don't think it can handle all cases. For example maybe the haikus aren't even loaded into memory at the time our DLL is called. Or like you said they could be in an entirely different or encrypted/protected area. So looked at some other solutions and linux-freetrack seems to already do what I have in mind.

https://code.google.com/p/linux-track/s ... main.c#280

Read the signature from a file and load that instead. I think we can combine all the techniques together so we have a signature function that searches memory and falls back to an optional NPClient.ini file.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: TrackIR emulation coming soon

Post by CyberVillain »

My plan from the beginning was to have it as a setting in FreePIE, but my brother (CyberRascal) liked this way better :)like you say maybe we can combine them
CyberRascal
Two Eyed Hopeful
Posts: 74
Joined: Fri Sep 21, 2012 4:46 am

Re: TrackIR emulation coming soon

Post by CyberRascal »

djdevin: Sorry for the late reply!

Anyway, good investigation :) I guess we'll have to go with either plain-text, supplied by the user, or storing it using a simple cipher (so it is hard to read, like in freetrack), supplied with the program.

I'm leaning towards the second option for usability, do you agree? If freetrack can get away with it, so should we. (both Villain and djdevin)
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: TrackIR emulation coming soon

Post by CyberVillain »

CyberRascal wrote:djdevin: Sorry for the late reply!

Anyway, good investigation :) I guess we'll have to go with either plain-text, supplied by the user, or storing it using a simple cipher (so it is hard to read, like in freetrack), supplied with the program.

I'm leaning towards the second option for usability, do you agree? If freetrack can get away with it, so should we. (both Villain and djdevin)
Yeah, maybe thats the best solution, and move the npclient code out of FreePIE like Freetrack did?
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: TrackIR emulation coming soon

Post by CyberVillain »

@djdevin

Can you try this branch and see if it works for you with trackir fixer etc?

https://github.com/maxmalmgren/FreePIE/ ... ir-feature
User avatar
djdevin
Two Eyed Hopeful
Posts: 55
Joined: Wed Oct 17, 2012 1:10 pm
Location: Philadelphia, USA

Re: TrackIR emulation coming soon

Post by djdevin »

Just grabbed the new NPClient.dll, and it works! Tested in Future Pinball and F1 2012.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: TrackIR emulation coming soon

Post by CyberVillain »

Cool!
CyberRascal
Two Eyed Hopeful
Posts: 74
Joined: Fri Sep 21, 2012 4:46 am

Re: TrackIR emulation coming soon

Post by CyberRascal »

Thanks djdevin, much appreciated. :)

For those interested, I decided NOT to make the implementation of getting the signature part of the available source code - I just provided a header file containing the interface for it. The currently existing NPClient.dll in the source repository has an implementation provided by me, statically linked.

Cheers
evilC
One Eyed Hopeful
Posts: 4
Joined: Wed Jun 04, 2014 12:16 pm

Re: TrackIR emulation coming soon

Post by evilC »

Hi, sorry to necro a thread, but is this project still alive?

I tried to download from http://naturalpointofview.blogspot.co.u ... fixer.html but the MediaFire download was blocked by Chrome as "malicious"
evilC
One Eyed Hopeful
Posts: 4
Joined: Wed Jun 04, 2014 12:16 pm

Re: TrackIR emulation coming soon

Post by evilC »

It does, however, seem like this was an erroneous warning, my AV software didn't grumble at all.

I now understand that this software only works for the listed games. Is there any way to add support for a game?
I wish to use MechWarrior Online with TrackIRFixer - the game is free to play so could anyone maybe add support for it?
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: TrackIR emulation coming soon

Post by CyberVillain »

evilC
One Eyed Hopeful
Posts: 4
Joined: Wed Jun 04, 2014 12:16 pm

Re: TrackIR emulation coming soon

Post by evilC »

I used the contact form, but the message never got approved :(
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: TrackIR emulation coming soon

Post by CyberVillain »

Maybe the project is dead. We should fix so that games work without the fixer at some point
evilC
One Eyed Hopeful
Posts: 4
Joined: Wed Jun 04, 2014 12:16 pm

Re: TrackIR emulation coming soon

Post by evilC »

CyberVillain wrote:Maybe the project is dead. We should fix so that games work without the fixer at some point
I take it nobody has contact info, or a copy of the source?
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: TrackIR emulation coming soon

Post by CyberVillain »

evilC wrote:
CyberVillain wrote:Maybe the project is dead. We should fix so that games work without the fixer at some point
I take it nobody has contact info, or a copy of the source?
If you are good at C and C++ you could take a look at integrating this into FreePIE,

https://github.com/AndersMalmgren/FreeP ... t-27280148

It replaces the need of TrackIrFixer
Cercata
One Eyed Hopeful
Posts: 21
Joined: Fri Oct 17, 2014 1:50 am

Re: TrackIR emulation coming soon

Post by Cercata »

CyberVillain wrote:If you are good at C and C++ you could take a look at integrating this into FreePIE,

https://github.com/AndersMalmgren/FreeP ... t-27280148

It replaces the need of TrackIrFixer
What's the status for this ?

The source code from that link is not available anymore ...
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: TrackIR emulation coming soon

Post by CyberVillain »

https://github.com/AndersMalmgren/FreePIE/issues/30

Please check the link in the last post
Cercata
One Eyed Hopeful
Posts: 21
Joined: Fri Oct 17, 2014 1:50 am

Re: TrackIR emulation coming soon

Post by Cercata »

I think the integration steps would be the following:
  • Get the GameId when the game calls NP_RegisterProgramProfileID().
    • For each game you will need later a 8 byte array("table"), you can setup it here.
    • For a first test you can hardcode it for a game.
    • Later you can load it from a CSV like they do in getGameData()
    • Or maybe you prefer load it from somewere else.
  • Calc the checksum in set_trackir_data() after setting the parameters.
    You can user their function cksum() for doing this. chsum must be 0 in the structure before calculation.
  • if the GameId is in the list of protected games:
    • Scramble the tir_data structure set_trackir_data()
    • You can use their enhance() function, with the "table" asociated to the gameId.
And then the buffer passed by NP_GetData() should contain the TrackIR information in the way the Game expects it.
I guess it required a lot of hard reverse engineeing to make the enhance function, and the program that unscrambles "sgl.dat" from the TrackIR inslalation.

For obtaining the "tables" you can use the suplied programs. It must be done each time a new game is added to trackIr:
  • You must compile the supplied main.c (requires http://mxml.sourceforge.net/)
  • Run it against "sgl.dat" from the TrackIR instalation
  • This gives you a list with gameId, gameName and gameKey(8 byte table in hexascii)
  • Then they run the perl script to merge it with other file, and generate a CSV with more info about each game, but I think that this is not needed.
What do you think ?
Since your code is C++, I guess you could reuse cksum() and enhance() without rewriting them, isn't it ?
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: TrackIR emulation coming soon

Post by CyberVillain »

The guy that wrote this is no longer active in the project, and I have very little time these day, I mostly have some time todo minor maintance work and such.
Yes our fake dll is C++
Post Reply

Return to “FreePIE”