Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


programming a decompiler

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Thu Mar 27, 2008 6:15 pm    Post subject: programming a decompiler Reply with quote

I havn't programmed anything in forever. And I finally figured out what I want to do. I want to program a universal decompiler, or something along those lines. I just have no idea where to start. Anybody have any links to APIs I should know, or anything like that would be appreciated. Becuase I honestly, have no idea where to start.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Thu Mar 27, 2008 10:25 pm    Post subject: Reply with quote

For all API as you will land up needing to deal with all of them if you want to decompile back to real code, or at least attempt it:
http://msdn2.microsoft.com/

Universal is not something I see you getting anywhere close to doing. As each language has it's own compiler, own methods, etc. Everything is different for the most part in each language.

Different languages use different runtimes, different environment setups, etc.

You should probably just stick to one language, master that, then move on to another. Then as time progresses combine the two into one program, move into another, and so on.

But you wont make a single code base for every language that will follow the same decompile instructions.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Fri Mar 28, 2008 10:34 pm    Post subject: Reply with quote

I know. when I said universal, I didn't literally mean for everything, just for the comman languages, C/C++, delphi, vb, asm, stuff like that. And I know to go to msdn.com but, I don't know what APIs to look up.
_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
--Pillboi--
Grandmaster Cheater Supreme
Reputation: 0

Joined: 06 Mar 2007
Posts: 1383
Location: I don't understand the question. Is this a 1 to 10 thing?

PostPosted: Sat Mar 29, 2008 2:30 am    Post subject: Reply with quote

Wiccaan wrote:
You should probably just stick to one language.

_________________

Enter darkness, leave the light, Here be nightmare, here be fright...
Earth and Water, Fire and Air. Prepare to meet a creature rare.
Enter now if you dare, Enter now the dragon's lair.
Back to top
View user's profile Send private message
goldengold
Grandmaster Cheater Supreme
Reputation: -1

Joined: 11 Nov 2006
Posts: 1841
Location: -.-

PostPosted: Sat Mar 29, 2008 3:59 am    Post subject: Reply with quote

I dont think this is wise but google it
_________________
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Sat Mar 29, 2008 8:55 pm    Post subject: Reply with quote

oib111 wrote:
I know. when I said universal, I didn't literally mean for everything, just for the comman languages, C/C++, delphi, vb, asm, stuff like that. And I know to go to msdn.com but, I don't know what APIs to look up.


You will need quiet a few to create a full decompiler. For the most part, you need file input/output to read the contents of the file that you want to decompile. Other then that you will be doing a lot of hand work yourself comparing, stripping, and splitting up the code.

I can't give you a clear answer, I have never written a decompiler myself, and I really don't plan on ever making one either.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sat Mar 29, 2008 9:59 pm    Post subject: Reply with quote

Wiccaan wrote:
oib111 wrote:
I know. when I said universal, I didn't literally mean for everything, just for the comman languages, C/C++, delphi, vb, asm, stuff like that. And I know to go to msdn.com but, I don't know what APIs to look up.


You will need quiet a few to create a full decompiler. For the most part, you need file input/output to read the contents of the file that you want to decompile. Other then that you will be doing a lot of hand work yourself comparing, stripping, and splitting up the code.

I can't give you a clear answer, I have never written a decompiler myself, and I really don't plan on ever making one either.


any other APIs besides file in file out? I mean, I know, you can't write me down a list of every API i will need, just like list a few, that you think would be useful.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Hieroglyphics
I post too much
Reputation: 0

Joined: 06 Dec 2007
Posts: 2007
Location: Your bedroom

PostPosted: Sun Mar 30, 2008 12:08 am    Post subject: Reply with quote

Nice, that would be really nice since I am learning Delphi and C++ [kind of]
_________________

Back to top
View user's profile Send private message AIM Address MSN Messenger
Renkokuken
GO Moderator
Reputation: 4

Joined: 22 Oct 2006
Posts: 3249

PostPosted: Sun Mar 30, 2008 12:25 am    Post subject: Reply with quote

I really think you're underestimating the difficulty of this project.
Back to top
View user's profile Send private message
Trow
Grandmaster Cheater
Reputation: 2

Joined: 17 Aug 2006
Posts: 957

PostPosted: Sun Mar 30, 2008 9:15 am    Post subject: Reply with quote

you'll need to do a lot of research on what every "ASM function" (or whatever you call it) mean in every language you plan to reinterpret as readable code.

For example, you might need to know what you code in vb to get "nop" in ASM.
(You cannot do that directly via default VB6 IDE)

_________________
Get kidnapped often.
Back to top
View user's profile Send private message
DoomsDay
Grandmaster Cheater
Reputation: 0

Joined: 06 Jan 2007
Posts: 768
Location: %HomePath%

PostPosted: Sun Mar 30, 2008 1:38 pm    Post subject: Reply with quote

When you say API, are you talking about winAPI or the IA32/IA64 (or alternatively AMD**) opcode list? (WinAPI's are DLL exports, and the IA32 opcode list could be found searching through intell's manuals)

For better managment I suggest you to use some debugging functions in order to handle the executables better.
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Mon Mar 31, 2008 9:27 pm    Post subject: Reply with quote

Like I said, you will definitely need the file input/output, but you don't have to use API for that. You will come into contact with every API while decompiling something. It all depends on what the program itself uses. Basic steps for this would be:

- Open file and read contents into a buffer.
- Parse file header for needed information.
- Strip header from buffer.
- Convert ASM bytes to opcodes.
- Convert opcodes to 'attempted' translations.
- Output, in some fashion, the converted code.

Again, just basic overview of what I figure would be done. I've never written a decompiler, nor plan to so like I said, not much I can really say then my educated guess.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites