Author Topic: Opening/Decompliling .pyc files  (Read 6089 times)

Offline JerichoKru

  • Posts: 75
  • Cookies: 2
Opening/Decompliling .pyc files
« on: February 15, 2008, 11:11:26 PM »
I was wondering is there is a program or something out there that i can use to open .pyc files.

I'm doing a bit of modding...and requires access to .pyc files since there are no .py's
~ [UFP]JerichoKru

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Opening/Decompliling .pyc files
« Reply #1 on: February 15, 2008, 11:30:36 PM »
I believe, if you search the forums, this question has been asked and answered. :wink: From what I can remember, the process that decompiles the pyc is unreliable. #Please Note: If my reply seems scathing or rude, it was never intended to be. It's late and I am only offering friendly advice. Also, any spelling or grammatical errors are also a result of lack of sleep.#

Edit: I just searched the forums myself, and was unable to find the thread, however, I know it exists.

Picard_1

  • Guest
Re: Opening/Decompliling .pyc files
« Reply #2 on: February 15, 2008, 11:44:49 PM »
Defiant used to have a decompiler at http://defiant.homedns.org/%7Est/dec.../decompyle.php

However, the link is currently forbidden.

Offline JerichoKru

  • Posts: 75
  • Cookies: 2
Re: Opening/Decompliling .pyc files
« Reply #3 on: February 16, 2008, 12:49:35 AM »
i wonder if i can contact Defiant...
~ [UFP]JerichoKru

Picard_1

  • Guest
Re: Opening/Decompliling .pyc files
« Reply #4 on: February 16, 2008, 02:40:11 AM »
Look under members

Offline FekLeyr Targ

  • DS9FX Team
  • Posts: 490
  • Cookies: 537
Re: Opening/Decompliling .pyc files
« Reply #5 on: February 16, 2008, 07:12:16 AM »
TaH pagh, Tah be.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Opening/Decompliling .pyc files
« Reply #6 on: February 16, 2008, 02:57:47 PM »
The link posted is broken because it's incomplete.

But what pyc files are you trying to look into?
Any stock pyc file can be found as py file (with comments, which decompiling can't retrieve) in the SDK.
Any pyc file included in KM without a py file can be found in the src directory (found with KM, but it already includes a lot of py files).
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline JerichoKru

  • Posts: 75
  • Cookies: 2
Re: Opening/Decompliling .pyc files
« Reply #7 on: February 16, 2008, 05:11:56 PM »
thanks MLeo, i shall check the SDK to see what i need is in there

EDIT: hmm..it kinda has what i want...you see, a friend and I were going to make a custom install of BC.  Since we are kind of bored with what is there, so, we gathered a bunch of ships and put them in.  Since they aren't in the multiplayer ship menu, we simply spawned them with the "Add Ships" button...i ran into 2 problems: 1) only the host can properly see the ship (to the other, the are marauders...) and 2) the game goes crazy when the non-host transports over to one, randomly crashing and/or booting me from the game completely.

I was hoping that if i add them to the multiplayer menu the problem will dissapear...but...since we are using KM 0.9.1 as a base...i cant excatly edit the files nessisary

any help will be appreciated  :D
~ [UFP]JerichoKru

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Opening/Decompliling .pyc files
« Reply #8 on: February 16, 2008, 05:51:54 PM »
KM1.0 contains the source of it.
The file to edit is SpeciesToShip.py and then every ship and projectile (the species number).
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline JerichoKru

  • Posts: 75
  • Cookies: 2
Re: Opening/Decompliling .pyc files
« Reply #9 on: February 16, 2008, 06:06:35 PM »
the...KM 1 source file is compatible with 0.9.1?  hmm...i shall try
~ [UFP]JerichoKru

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Opening/Decompliling .pyc files
« Reply #10 on: February 16, 2008, 06:25:26 PM »
No, KM1.0 is simply newer/better. And it includes the source.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline JerichoKru

  • Posts: 75
  • Cookies: 2
Re: Opening/Decompliling .pyc files
« Reply #11 on: February 16, 2008, 07:09:05 PM »
eh...editing the KM 1.0 file to fit 0.9.1 shouldn't be too hard
~ [UFP]JerichoKru

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Opening/Decompliling .pyc files
« Reply #12 on: February 17, 2008, 12:21:56 PM »
Why would you want that? Since it KM1.0 also fixes bugs in KM0.9...
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline JerichoKru

  • Posts: 75
  • Cookies: 2
Re: Opening/Decompliling .pyc files
« Reply #13 on: February 21, 2008, 10:19:01 PM »
Well...I obviously did something wrong (probably everything)

I'm still a bit of a newb when it comes to python...I'm almost afraid to attach the file in question...you might laugh at my horrid programming skills...  Hopefully an expert can point out all of the bad code I made... :(

btw...i attempted to make this ...KM 0.9.1 compatible...which may be part of the problem.
No, i didn't change our whole custom install to KM 1...1) too lazy and 2.) my bud wanted KM 0.9.1
~ [UFP]JerichoKru

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Opening/Decompliling .pyc files
« Reply #14 on: February 22, 2008, 07:33:51 AM »
You only have to change the constants and the list, nothing else.

So what's the problem?

And making it KM0.9.1 compatible isn't possible, only KM0.9.1 is compatible with KM0.9.1, same as KM1.0 is only compatible with KM1.0. If you change anything from it, it isn't KMX anymore, and therefor won't be compatible with something else.

BC is picky about this, every player has to have the same set of scripts for it to work.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline JerichoKru

  • Posts: 75
  • Cookies: 2
Re: Opening/Decompliling .pyc files
« Reply #15 on: February 23, 2008, 02:19:51 AM »
constants?  is that the number in the middle of the

Code: [Select]
("MPneghvar", 403, "Klingon", 1),
?

i wasn't sure what that meant...(i was thinking of ship classification or something...)
~ [UFP]JerichoKru

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Opening/Decompliling .pyc files
« Reply #16 on: February 23, 2008, 11:46:00 AM »
That's a constant, but I was refering to lines like this:
Code: [Select]
UNKNOWN = 0
AKIRA = 1
AMBASSADOR = 2
GALAXY = 3
NEBULA = 4
SOVEREIGN = 5
BIRDOFPREY = 6
VORCHA = 7
WARBIRD = 8
MARAUDER = 9
GALOR = 10
KELDON = 11
CARDHYBRID = 12
KESSOKHEAVY = 13

So what is the problem you were having?
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline JerichoKru

  • Posts: 75
  • Cookies: 2
Re: Opening/Decompliling .pyc files
« Reply #17 on: February 23, 2008, 02:39:29 PM »
As above, i tried to add the ships in...but...I get a black screen after i attempt to host.  In other words, No ship selection screen.

I did something wrong, just not sure what... :(
~ [UFP]JerichoKru

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Opening/Decompliling .pyc files
« Reply #18 on: February 23, 2008, 05:17:57 PM »
It would be rather helpfull if you told us what is wrong, not the effect (the effect is a black screen, the cause of it is a scripting error, the console shows you the "what" or reaso and where).

If you don't know about the console, it's immensly helpfull in trying stuff out (scripting wise), since it's an interactive Python interpretter, allowing you to interact with BC as if you were writing a script in a file. Therefor it also shows you if you wrote something wrong.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline JerichoKru

  • Posts: 75
  • Cookies: 2
Re: Opening/Decompliling .pyc files
« Reply #19 on: February 24, 2008, 12:52:02 AM »
the problem is...it wont show the console...and yes, i do have it enabled, as i used it before

i will try to see if i can get it to show
~ [UFP]JerichoKru