2020-02-13 16:53:42

I want to be able to decompile an older program made by me.

Start of signature: I'm using a translation app.

If you like this post, please press the appropriate button.

2020-02-13 21:04:42

Unfortunately, you cannot. As others have said, we do not have a decompiler available for this language.

2020-02-14 05:59:35

Sure you may not be able to decmopile an entire program, but I have seen ways people were able to get strings and stuff that contains information.

2020-02-14 09:50:12

that is from  runtime errors.

2020-02-14 11:53:57

that's not that hard, just get a program like cheat engine and then bam, you've got all the variables you need if you can find them in memory -- although I do not believe this applies for strings. It can mess with practically every single bgt game out there, except for adventure at c: to my slight annoyance.
It must encrypt the values in strings and then decrypt and mess with them to do stuff, but otherwise leave them in a scrambled state.
Also can someone tell me what algorythm bgt uses for encrypting strings -- is it AES, and if so, what bits, or is it something else entirely?

2020-02-14 20:30:18

@30, its AES-256 in CBC mode if I'm not mistaken. Your not breaking that, just saying.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-02-14 23:16:57

yeah I didn't think I was, I just wanted to know it was up to modern standard

2020-02-15 06:50:15

@32, its still easily breakable due to the way BGT does things. Its up to par but the way BGT does it pretty much makes it useless, ufortunately.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-02-15 09:06:25

what method of encryption does it use for packing files?

2020-02-15 19:09:34

@34, custom format. The header it uses is not a header that any of my friends or myself know, so we've put it down toa custom packing method. Its not encryption though.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-02-15 20:03:43

About a year ago, I reverse engineered the pack_file algorithm and wrote up an explanation as well as fully-functional python version. You can find that here.

If OP (or anyone else) is dead set on getting *their* code back, I may be able to help in extracting information and/or re-creating the project. Contact me privately and we can discuss rates.
Note, if you send me something to which you have no rights with the expectation of source code, don't expect anything other than a loss in respect.

Can we also put an end to the baseless presumptions? You know who you are. They do little to further the conversation and in fact cast more doubt on OP, where there is already enough given the subject matter.
Nefilimul is a new member here. Nowhere in their post history do I detect anything near the magnitude some of you are proposing. There is a stark difference between what some are saying and

"No decompilers are available at this time. Just a heads up, but using one with malicious intent... Kinda dickish"

Innocent before proven guilty and all that. The shear act of requesting tools or information in and of itself is far from disreputable.

2020-02-15 20:48:54

@36, wow, very nice work. I knew it was a custom format but didn't know how it worked. I'll be checking that out.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2020-02-19 17:39:26

@36, Can this also decrypt sounds?

2020-02-19 19:48:50 (edited by Lucas1 2020-02-19 19:49:29)

No, because to my knowledge the specific BGT encryption procedure has not been publicized. It can only work with unencrypted packs, unless you encrypt them in your own way using Python. They then probably could not be decrypted with BGT.

2020-02-20 22:27:00

I don't normally approve of something like this, needless to speak about sharing it, but seeing that bgt is long dead and people are hiting a dead horse insisting for too long now, so, instead of replacing a failed project with another one, I found something that can be tweaked to replace a bgt decompiler.
It's not as if it would be illegal, mind you, abit gray is the use I intent to put it to.
It's intended to optimyse angelscript by converting it in c++. It's a python script that generates c++ code that compiles angelscript bytecode down to c++ based on the source tree of the angelscript lib, so we'll need to obtain the exact source dist of the version bgt uses in order for this to work properly.
After we obtained and compiled our generated compiler, we should create a tool to extract, decrypt and dump the bytecode from the provided bgt executable, then another who integrates our freshly generated code slightly modified to output bgt compliant syntax, thus we'd create for our selfes a bgt decompiler toolchain to decompile any bgt exe and, eventually give people the option to convert it into cpp, etc.
I'm going to say one more thing before I end this abnocciously long post, for the sake of everything that's good in the world, for the sake of liberating the bgt enslaved people, let's do this, now or never!
The link is:
https://github.com/quarnster/asaot
I really hope this will work properly and we'll finally have our own bgt decompiler, if nothing else, then let it be a warning to any bgt starters, never to drink the sweet poison for fear of code decompilation and cloning even if compiled with release mode enabled.

2020-02-20 22:50:36

hi,
didn't want to talk about it for a while
first, in BGT the Bytecode will be encrypted, and will be appended into a file called exec.bin (don't exactly remember it's name).
that exec.bin which is the core of your executable (which runs your bytecode), reads it from the end of your executable and run it
(a struct should be appended at the end to read the offset of your executable and seek to it's position and load and decrypt the Bytecode).
now, if you are a cloner, go clone a code.
don't waist your time trying to decompile someone else's code since you can't
last but not least, the Bytecode is in binary format not in text (good luck trying to read the instructions from there as well).

2020-02-21 08:36:48

Then, the first step is to reverse engineer the exec.bin file because, since it needs to decrypt the bytecode at some point before passing it to the load_bytecode from the as lib, the key is for sure somewhere in the file and our jov is to find an absolute position from the beginning of the file, not from memory and use it to dump that bytecode. Then, the tool I linked above can take care of the rest, no matter whether the bytecode is in binary since that it was made to do, transforming angelscript bytecode.
Btw, I am not a cloner, neither do I want to stoop that low, not in this lifetime at least. The only thing I want to achieve with this comunity driven project is to stop newbies thinking that, since there is no bgt decompiler, their newly released game is immune to reverse engineering and such an unconchurable bastion. I would say to those people, no, no, no... there truely is a bgt decompiler, catch!

2020-02-26 14:08:09

Sorry for necrothreading, but, even with the tool I linked, bgt is so tuff no one even has the courage to help do this? or is everyone too uninterested to do it? I just want to know.

2020-02-26 18:04:31 (edited by amerikranian 2020-02-26 18:04:49)

I doubt that it's too tough. I know that there are pretty bright people on here. However, if you know how to disassemble an EXE, chances are you will keep pretty quiet about it because of the following:
1. Such tool is incredibly dangerous in wrong hands.
2. You are uninterested in the content and are only doing for the sake of the experience.
Either of those reasons could serve as an explanation here.

2020-02-26 18:31:45

the thing is, people who have nothing to do and just clone can't disassemble that thing
and the worse, if you pack your executable with something like upx (upx easily will be unpacked by itself), your executable stops working. although upx won't delete the appended part unlike other packers do.

2020-02-26 20:16:45

@42
Even after you've done all that, you will have to reimplement all of the parts of BGT which are not implemented in bytecode in order to provide the APIs that are missing, and you're very unlikely to recover the source code sufficiently to allow modification.  Since BGT isn't going to just stop working, I'm not sure what the point is--you will spend as much effort as it would take to write BGT fro scratch in addition to the effort it will take to reverse engineer the bytecode.

Plus it may not be encrypted.  It might be something like the Python techniques of changing the bytecode of the Angelscript distribution itself.  most naively you can change the  numbers, but sometimes you'll also add merged bytecodes in where you have a bytecode that stands for 2 or 3 and will run a peephole optimizer to add yours in (this is easier than it sounds) at which point you can't recover the source code without translating those back.

And then, it's possible it doesn't just decrypt either.  It's not very hard to actually ahve the key be a secret encryption algorithm--one very simple technique is to use a random number generator to make the key at runtime, or use a random number generator to get a stream of bytes to xor with the bytecode.  And if you're sufficiently clever the code never exists fully decrypted at runtime either, and only gets decrypted on demand, which means not being able to just copy it out with a debugger.

And anyone who's serious about this stuff, they're going to do all of these.

My Blog
Twitter: @ajhicks1992