Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Get Code From Executable

Author
Message
Michael F Trombley Sr
14
Years of Service
User Offline
Joined: 28th Feb 2012
Location: Ware, MA US
Posted: 28th Feb 2012 19:48
Hello Everyone.
Is there a way to convert an executeable that was created with DarkBASIC Pro to source code? Are there any utilities that can do this?

Mike
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Feb 2012 19:52
No there's nothing that does that, although it is technically possible to do a level of source-code recovery from the compiled code.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 28th Feb 2012 20:28
@ IanM

I have a question somewhat related to this whole "reverse code" thing. You know when you run the program in debug mode and move through it step by step while monitoring all of the variables? How does the communication between application and debug console work? How is it able to know what line you're on, what the commands are called, and what the variables are called? Is it emulated in some way, or is the executable actually able to provide that information?

Can this potentially be a security threat?

TheComet

Diggsey
20
Years of Service
User Offline
Joined: 24th Apr 2006
Location: On this web page.
Posted: 29th Feb 2012 03:07 Edited at: 29th Feb 2012 03:11
@TheComet
I'm not sure how the debug console works, but here's how debugging works in most languages (and how I did it when I was writing a debugger for DBPro):

When the program is compiled, the compiler knows which lines of code were translated into which assembly instructions, and it saves this information to a file. The debugger can see which instruction is executing at runtime, and do a reverse lookup using the debug information generated by the compiler to find out which line that assembly instruction belongs to.

The names and addresses of program level variables are saved as part of the debug info, so the debugger can convert a variable name to the correct address and then read the memory at that address.

For function level variables, the debug info stores the variables for each function, and an address relative to the stack frame of that function. At runtime, the debugger can look at which function the current assembly instruction belongs to because it knows the addresses of all the functions, and it knows the stack frame address because that is stored in a register. All it has to do is add on the relative address from the debug info for a particular local variable and read the value at that memory location.

All of this requires no cooperation from the program being debugged, as the facilities to pause and access another process's registers and memory are built into windows as a debugging api.

However, I'm fairly sure the debug console works in a much more cooperative way. I know for a fact that the line number is stored in a hidden global variable at all times, so it may use that. To access variables it would have to do something similar to a normal debugger though.

[b]
MrValentine
AGK Backer
15
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 29th Feb 2012 04:12
And yet things like the NVidia PHYSX debug tools from their developer site can manipulate your app externally...

This question was asked last year and met with fierce NO remarks...

But it is still a question unexplored... but eitherway isnt that what the encrypt function in DBPro is for¿

Also umm I am intending well I have it to use Smart Packer Pro... so how does that work¿ I mean it runs in a virtual world and not in standard world on your system yet it all sits in your memory eitherway... butam I correct to say the actual code bypasses the RAM and shoots directly via the RAM into the CPU erm if that makss sense...

What security vulnerability would this encase aside from a select few people trying to manipulate your source code¿

Login to post a reply

Server time is: 2026-07-10 12:22:22
Your offset time is: 2026-07-10 12:22:22