* WalrusIRC

You need to have 5 posts and not be part of restricted usergroups in order to use the WalrusIRC embedded shoutbox. However, you can also access our IRC channel called #CodeWalrus via EFnet.

Author Topic: .exe to ASM?  (Read 1393 times)

0 Members and 1 Guest are viewing this topic.

Offline Streetwalrus

  • Professional slacker
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Israel
  • Posts: 2822
  • Post Rating Ratio: +20/-0
  • ƎW∀⅁ ƎH⊥
    • View Profile
  • Gender: Male
Re: .exe to ASM?
« Reply #30 on: January 01, 2017, 05:43:50 am »
The C language and standard library were created for developing Unix, and Windows has never provided a sane environment for it. The point was more to make development more efficient while remaining easily portable across CPU architectures than operating systems (though nothing really hinders that, with some effort you can port stuff over if you know your way around the windows API).
  • Calculators owned: TI-80, HP 40G, TI-84 Plus rev G (yay 128k RAM), TI-83 Plus Silver Edition (broken LCD), TI-82 Stats.fr (black), TI-Nspire CX rev C (yay Nlaunchy), TI-83+ SE ViewScreen



Offline Hayleia

  • Full User
  • Join Date: Nov 2014
  • Location:
  • Posts: 323
  • Post Rating Ratio: +12/-0
    • View Profile
Re: .exe to ASM?
« Reply #31 on: January 01, 2017, 08:33:01 am »
The C language and standard library were created for developing Unix, and Windows has never provided a sane environment for it.
Would the Ubuntu for Windows thing fulfill that purpose?
(True question here, I still use Win8.1 for games and Linux for dev so I have no idea what that thing does).

Offline Scipi

  • Full User
  • Domain Name Owner
  • CW 4x3 challenge - 3rd place
  • *
  • Join Date: Nov 2014
  • Location: Lost Town
  • Posts: 164
  • Post Rating Ratio: +1/-0
  • CodeKitten ^w^
    • s1ay3r44
    • Scipii
    • _Scipi
    • Scipi
    • View Profile
    • ScipiSoftware
  • Gender: Male
Re: .exe to ASM?
« Reply #32 on: January 01, 2017, 09:41:29 am »
There are quite a few hurdles you are going to run into if you want to port scratch programs in this manner. For one, your scratch exe will be in a different type of assembly (x86-64) than what the TI-83/84+ uses (Z80). You will have to end up learning both assembly languages and manually translating between the two, which is not an easy task. Additionally, a lot of the time tools like Scratch will link in their own runtimes into the exe. You will have to either port this stuff over as well, which would require deep knowledge of the calculator's hardware to do. You might as well make a scratch interpreter at that point. Moreover, if there's any optimization or obfuscation, it could become very difficult to understand the code you are trying to port (I speak from direct experience with this, this kind of stuff is my job ;)). It's much easier and much, much more worthwhile to learn Axe, Z80, or C and rewrite the programs with those. I cannot recommend this enough.

If you want to know of some tools to do this kind of stuff anyways to learn or play around with, there are a few really useful tools that I can point you to. Free ones that I know of are:
Ollydbg
x64dbg

These primarily debug a running program so you can reverse via dynamic analysis.

If you have funds, an excellent tool I use for work is IDA Pro. This also comes with the Hexrays decompiler.

There is also Medusa, which is like a free version of IDA. Not sure how good it is, however. These are static analysis tools, though. They don't require the binary to be executing.
  • Calculators owned: TI-83+, Nspire, Nspire CX, Casio Prizm




Offline Streetwalrus

  • Professional slacker
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Israel
  • Posts: 2822
  • Post Rating Ratio: +20/-0
  • ƎW∀⅁ ƎH⊥
    • View Profile
  • Gender: Male
Re: .exe to ASM?
« Reply #33 on: January 01, 2017, 09:52:25 am »
The C language and standard library were created for developing Unix, and Windows has never provided a sane environment for it.
Would the Ubuntu for Windows thing fulfill that purpose?
(True question here, I still use Win8.1 for games and Linux for dev so I have no idea what that thing does).
Technically it does the same thing as msys or cygwin, essentially wine in reverse, but it's probably tightly integrated into the kernel and it's binary-compatible with Linux so you can run any distro in it, while the former two require specific builds.
One big problem with all three is the lack of a decent X11 implementation so don't expect miracles when it comes to GUI applications.

As far as the reverse engineering part goes, I'll side with scipi here, I design and reverse engineer hardware and software so I deal with assembly a lot, I've also patched a steam game once to fix a crash and it was all but easy. It gets worse when your application is c++ because that ramps complexity up quite a bit.
« Last Edit: January 01, 2017, 09:56:16 am by Streetwalrus »
  • Calculators owned: TI-80, HP 40G, TI-84 Plus rev G (yay 128k RAM), TI-83 Plus Silver Edition (broken LCD), TI-82 Stats.fr (black), TI-Nspire CX rev C (yay Nlaunchy), TI-83+ SE ViewScreen



Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17822
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: .exe to ASM?
« Reply #34 on: January 02, 2017, 01:41:31 am »
The C language and standard library were created for developing Unix, and Windows has never provided a sane environment for it. The point was more to make development more efficient while remaining easily portable across CPU architectures than operating systems (though nothing really hinders that, with some effort you can port stuff over if you know your way around the windows API).
Well, it seems this Windows problem was solved by @MateoConLechuga then, as the tools he made to develop C programs seems quite easy to use for everyone who tried them overall. But yeah, if someone doesn't want to restrict himself only to TI-84+CE development then I assume they aren't that practical :P

As for assembly, one thing to keep in mind is that even between two platforms with the same CPU, ASM code can still be different. For example, on the TI-83, you used ROM Calls instead of BCalls and the syntax to call them was different compared to the TI-83+/84+. It often also depends of the hardware (eg the LCD)
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline Streetwalrus

  • Professional slacker
  • CodeWalrus Staff
  • Super User
  • Server Maintenance
  • Original 5
  • Join Date: Nov 2014
  • Location: Israel
  • Posts: 2822
  • Post Rating Ratio: +20/-0
  • ƎW∀⅁ ƎH⊥
    • View Profile
  • Gender: Male
Re: .exe to ASM?
« Reply #35 on: January 03, 2017, 09:02:42 am »
Well we were talking about programming *for* Windows, on Windows, not targeting other platforms. In the case of the CE, the target environment is completely non standard (custom stdlib, and not entirely compliant compiler), but it doesn't matter because it's an embedded system anyway. There are things I could be picky about but not today. :P
  • Calculators owned: TI-80, HP 40G, TI-84 Plus rev G (yay 128k RAM), TI-83 Plus Silver Edition (broken LCD), TI-82 Stats.fr (black), TI-Nspire CX rev C (yay Nlaunchy), TI-83+ SE ViewScreen



Offline mazhat

  • Full User
  • Join Date: Mar 2017
  • Location:
  • Posts: 46
  • Post Rating Ratio: +1/-0
    • View Profile
Re: .exe to ASM?
« Reply #36 on: March 16, 2017, 02:23:48 pm »
18kB for a shape is pretty big,
also aren't scratch programs dependent on a scratch environment?
  • Calculators owned: TI-83Plus, TI-84Plus
  • Consoles, mobile devices and vintage computers owned: Samsung TAB A (Cheap), DSI, Rasperry PI 3

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17822
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: .exe to ASM?
« Reply #37 on: March 16, 2017, 04:50:25 pm »
Mazhat they can be exported to Flash and tools can export SWF files to exe's but the latter tools look shady.
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

Offline mazhat

  • Full User
  • Join Date: Mar 2017
  • Location:
  • Posts: 46
  • Post Rating Ratio: +1/-0
    • View Profile
Re: .exe to ASM?
« Reply #38 on: March 16, 2017, 04:58:58 pm »
Ah, I see, I had no idea.
I would just stick to all of your recommendations, and just build programs in C or ASM :)

Or make a custom "compiler" for ASM if you know input/output streams, and the z80 opcode :D
  • Calculators owned: TI-83Plus, TI-84Plus
  • Consoles, mobile devices and vintage computers owned: Samsung TAB A (Cheap), DSI, Rasperry PI 3

Online c4ooo

  • ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
  • Super User
  • CW Contest II Winner
  • *
  • Join Date: Aug 2015
  • Location: 127.0.0.1
  • Posts: 873
  • Post Rating Ratio: +7/-2
  • ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
    • View Profile
  • Gender: Male
Re: .exe to ASM?
« Reply #39 on: March 16, 2017, 09:41:47 pm »
This is pointless - you won't understand the outputted x86 without a lot of practise, and without labels, understanding something of that size would be impossible for *anyone*. Plus, i would guess that the .exe file contains a Scratch interpreter along with the Scratch code save file - so the actual Scratch code most likely doesn't even run natively on the CPU. (Thats a guess but that's how i would implement something like that) ;)

Also, if you want to get started with C programming, you might want to use linux since it is much easier to set up, at least in my opinion.
MS only supports c++ in msvc, actual c support sucks. I'd recommend against using anything like cygwin/msys/bash for windows, just use Linux and it'll go smoothly.
The C toolchain for the CE calc isn't hard to set up and doesnt need msvc/cygwin/msys/bash, at least iirc.

I remember for the TI-83 Plus there was a BASIC to ASM converter and the ASM result was even larger in size actually.
Equivalent Asm code will commonly be bigger than equivalent TI-BASIC code; TI-BASIC uses tokens (1 or 2 bytes per token) while ASM is 1 byte per *instruction*. By "equivalent" i mean behaving 100% the same - using the a-z vars and all; but i don't know if the converter did this.
??? ??? ???
C'est une signature

Online DJ Omnimaga

  • Omni founder & CW co-founder
  • CodeWalrus Staff
  • Super User
  • Forum Maintenance
  • Original 5
  • CodeWalrus Supporter
  • *
  • Topic Management
  • Join Date: Nov 2014
  • Location: Quebec, Canada
  • Posts: 17822
  • Post Rating Ratio: +89/-4
    • dj_omnimaga
    • DJOmnimaga.music
    • @DJOmnimaga
    • dj_omnimaga
    • @DJOmnimaga
    • /u/DJ_Omnimaga
    • DJOmnimaga
    • 112/11286
    • @djomnimaga
    • @DJOmnimaga
    • View Profile
    • DJ Omnimaga music store
  • Gender: Male
Re: .exe to ASM?
« Reply #40 on: March 16, 2017, 10:46:20 pm »
I should check how large the exe version of Wal-Rush! Scratch Edition is. It had some bizzare behavior, though: When the game was running, if I minimized it or put it in the background to do other stuff on Windows, PrintScreen and the clipboard stopped working entirely. It was kinda scary that such SWF to EXE converter had so much control on my computer but it isn't JWinslow's fault, as I am sure that legit SWF to EXE converters cost a lot of money.
  • Calculators owned: TI-73, TI-80 (broken), TI-81, TI-82, TI-83, TI-83+ (broken), TI-83+ (broken), TI-83+SE (broken), TI-84+, TI-84+CSE, TI-84+CE, TI-85, TI-86, TI-89T, TI-92, TI-Nspire, TI-Nspire CX (semi-broken), HP 39gII, HP Prime, Casio fx-7000G, fx-7400G+, fx-7700GE, fx-9750G+, fx-9750GII, fx-9860G, cfx-9850G, FX-1.0+, fx-CG10, fx-CP400
  • Consoles, mobile devices and vintage computers owned: Samsung i5510, Nexus 5, Atari 2600, Lynx, SMS, Game Gear, Genesis, Dreamcast, NES, SNES, N64, GCN, Wii, Wii U, GBA, DS, 3DS, PS2, PS3, PS4, PSP, PSVita, XBox 360, XBOne

Bandcamp|Reverbnation|Facebook|Youtube|Twitter
Retired Omnimaga admin (2001-11) and editor (2012-14)
??? ??? ??? ???

 


You can also use the following HTML or bulletin board code to share it on your page or forum signature!


Also do not forget to check our affiliates below.
Planet Casio TI-Planet Calc.news BroniesQC BosaikNet Velocity Games