Yay! This needs to go in News.That it does.
Someone should package for Debian (.deb) and Arch Linux (PKGBUILD/AUR).
@adriweb:
Does the Mac build work?
When I run TILP though, not including the "./" in front is okay. Why is this?Because TILP is being installed to a folder that is listed in the PATH environment variable :)
And just to be clear, are all Linux programs supposed to be run with a "./" in the front?No :)
What on Earth was TI thinking, making their own closed source encryption scheme? As far as stupid decisions go, that's a pretty big one. Anyone who knows anything about encryption knows that you use a publicly available algorithm, or make your algorithm public.They didn't. They used triple-DES encryption, which is publicly available.
Would it be possible to use it in order to get text from a TNS file without TI-Nspire Computer software ?
k 10032AA0 +x
c
w dump1.xml r1 r2
c
w dump2.xml r1 r2
c
w dump3.xml r1 r2
c
w dump4.xml r1 r2
c
w dump5.xml r1 r2
c
w dump6.xml r1 r2
(...for as long as you expect the xml to be...)
then run: nspire_emu ... /D < commands.txt
Two bugs related to replacing & and < in lua source with character entities:
* escape_special_xml_chars stops processing when it reaches the offset equal to the size of the original input ("p < in_buf + header_size + in_size"), not taking into account that the size is changing during the loop, so characters near the end of the program may not get escaped
* xml_compress copies the footer without taking into account the change in size ("memcpy(in_buf + header_size + in_size, lua_footer, sizeof(lua_footer));"), resulting in a truncated program and garbage at the end of the xml
Levak: You could create a file containing all the debugger commands to enter:
then run: nspire_emu ... /D < commands.txt
function dump {
local winePath="$HOME/.wine/dosdevices/c:"
local rom=$(zenity --file-selection --title="Sélectionnez un fichier *.rom" --filename="$RELPAT/");
if [ "$rom" ]; then
if [ "${rom##*.}" = "rom" ]; then
local size=$(zenity --entry --title="Taille du classeur à dumper (octets)" --entry-text="0");
let num=$size/170
echo "k 10032AA0 +x" > "$RELPAT/commands.txt"
echo "c" >> "$RELPAT/commands.txt"
local i=0
while [ $i -le $num ]; do
# Complete tempory file names with zeros so that it's listed correclty
let local dif=${#num}-${#i}
local spaces=$(printf "%"$dif"s")
local zeros=${spaces// /0}
# Fill command list
echo "w C:\dump$zeros$i.xml r1 r2" >> "$RELPAT/commands.txt"
echo "c" >> "$RELPAT/commands.txt"
let i=$i+1
done
# Launch emulator with debug command list
"$RELPAT"/nspire_emu.exe /F="$rom" /B=boot2.img.raw /D < "$RELPAT/commands.txt"
# Concatenate final XML file using tempory files
echo -n "" > "$RELPAT/dump.xml"
for f in "$winePath/dump*"; do
cat $f >> "$RELPAT/dump.xml"
done
rm "$winePath/dump*"
rm "$RELPAT/commands.txt"
else
zenity --error --title="Erreur" --text="Veuillez sélectionner un fichier *.rom et pas autre chose ! \n Opération annulée"
fi
fi
}
> bash 4 linuxecho $(perl -0777 -pe 's/(.*<r2dtotree>|<\/r2dtotree>.*)//gsm' dump.xml | sed "s/<node name="1para">/\x0D/g;s/<\/*node[^g]*>//g;s/<\/*leaf[^g]*>//g;s/<cursor[^g]*>//g;s/&quot;/\"/g;s/&apos;/'/g;s/&lt;/</g;s/&gt;/>/g" | sed 's/&/\&/g' ) > dump.lua
Luna v0.2a is now available with several bug fixes. Sorry for this unable v0.2.
http://ndlessly.wordpress.com/2011/09/27/luna-bug-fixes/
Luna v0.2a is now available with several bug fixes. Sorry for this unable v0.2.
http://ndlessly.wordpress.com/2011/09/27/luna-bug-fixes/
Do you plan to include a Linux and a Mac build the next time (or does this one already feature it)? For people who can't build one themselves, it'd be neat.
@Levak:
Nope, the x86-Version should work on any Mac with an Intel processor (built since 2005/2006, should run on Mac OS X >= 10.4), I only provide a x86_64 version for those who really want to use 64-Bit (which should have no effect on Luna^^)
@ExtendeD:
Please try if my Makefile also works on Windows, if it does, please use it instead of your Makefile. It's the only thing that needs to be changed to compile Luna on Mac OS X.
Do you plan to include a Linux and a Mac build the next time (or does this one already feature it)? For people who can't build one themselves, it'd be neat.
OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
EXEEXT = .exe
else
CFLAGS=$(CFLAGS) -Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello
LDFLAGS=$(LDFLAGS) -lcrypto
endif
OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
EXEEXT = .exe
else
CFLAGS = -W -Wall -m32 -Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello
LDFLAGS = -lssl -lz -m32 -lcrypto
endif
Mac:src username$ make dist
rm -rf *.o luna dist
Makefile:10: *** Recursive variable `CFLAGS' references itself (eventually). Stop.
Don't know why.. ???
CFLAGS += -Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello
LDFLAGS += -lcrypto
OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
EXEEXT = .exe
else
CFLAGS += -Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello
LDFLAGS += -lcrypto
endif
-D_FILE_OFFSET_BITS=64 -D_LARGEFILE
instead of-Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello
?rm -rf *.o luna dist
gcc -W -Wall -m32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE -c -o luna.o luna.c
gcc -W -Wall -m32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE -c -o zip.o minizip-1.1/zip.c
In file included from minizip-1.1/zip.c:196:
minizip-1.1/crypt.h:35: warning: unused parameter ‘pcrc_32_tab’
gcc -W -Wall -m32 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE -c -o ioapi.o minizip-1.1/ioapi.c
minizip-1.1/ioapi.c:83: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c: In function ‘fopen64_file_func’:
minizip-1.1/ioapi.c:115: warning: implicit declaration of function ‘fopen64’
minizip-1.1/ioapi.c:115: warning: assignment makes pointer from integer without a cast
minizip-1.1/ioapi.c: At top level:
minizip-1.1/ioapi.c:101: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:120: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:127: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:134: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c: In function ‘ftell64_file_func’:
minizip-1.1/ioapi.c:145: warning: implicit declaration of function ‘ftello64’
minizip-1.1/ioapi.c: At top level:
minizip-1.1/ioapi.c:142: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:149: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c: In function ‘fseek64_file_func’:
minizip-1.1/ioapi.c:191: warning: implicit declaration of function ‘fseeko64’
minizip-1.1/ioapi.c: At top level:
minizip-1.1/ioapi.c:172: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:198: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:205: warning: unused parameter ‘opaque’
gcc -o luna luna.o zip.o ioapi.o -lssl -lz -m32 -lcrypto
Undefined symbols:
"_fopen64", referenced from:
_fopen64_file_func in ioapi.o
(maybe you meant: _fill_fopen64_filefunc)
"_fseeko64", referenced from:
_fseek64_file_func in ioapi.o
"_ftello64", referenced from:
_ftell64_file_func in ioapi.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [luna] Error 1
-Dfopen64=fopen -Dfseeko64=fseeko -Dftello64=ftello
is necessary.
-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
?
gcc -W -Wall -m32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o luna.o luna.c
gcc -W -Wall -m32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o zip.o minizip-1.1/zip.c
In file included from minizip-1.1/zip.c:196:
minizip-1.1/crypt.h:35: warning: unused parameter ‘pcrc_32_tab’
gcc -W -Wall -m32 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o ioapi.o minizip-1.1/ioapi.c
minizip-1.1/ioapi.c:83: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c: In function ‘fopen64_file_func’:
minizip-1.1/ioapi.c:115: warning: implicit declaration of function ‘fopen64’
minizip-1.1/ioapi.c:115: warning: assignment makes pointer from integer without a cast
minizip-1.1/ioapi.c: At top level:
minizip-1.1/ioapi.c:101: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:120: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:127: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:134: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c: In function ‘ftell64_file_func’:
minizip-1.1/ioapi.c:145: warning: implicit declaration of function ‘ftello64’
minizip-1.1/ioapi.c: At top level:
minizip-1.1/ioapi.c:142: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:149: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c: In function ‘fseek64_file_func’:
minizip-1.1/ioapi.c:191: warning: implicit declaration of function ‘fseeko64’
minizip-1.1/ioapi.c: At top level:
minizip-1.1/ioapi.c:172: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:198: warning: unused parameter ‘opaque’
minizip-1.1/ioapi.c:205: warning: unused parameter ‘opaque’
gcc -o luna luna.o zip.o ioapi.o -lssl -lz -m32 -lcrypto
Undefined symbols:
"_fopen64", referenced from:
_fopen64_file_func in ioapi.o
(maybe you meant: _fill_fopen64_filefunc)
"_fseeko64", referenced from:
_fseek64_file_func in ioapi.o
"_ftello64", referenced from:
_ftell64_file_func in ioapi.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [luna] Error 1
Welcome to the world of software porting, where every operating system is different and often in ways that the author of the software you want didn't know were important. There's no fopen64 function on OS X because the standard fopen function includes the added 64-bit functionality that is only present in the *64 symbols on other machines. Try passing -Dfopen64=fopen in CPPFLAGS.
it's very important because I'd like create a lua game
i'v 3.02 on computer softwar but 3.1 on calcso luna is your only way to go
Here it is: http://bytecode.fr/luna/page.php5?id=1163613
The id is the one of your code snippet on Gist (https://gist.github.com/1163613). An old version of Luna is being used, I'm not sure which one, I have to update it.
This was not really built for for development use, but rather for sharing Lua binary files. An HTML form would be more suited. And don't expect this service to be always available, I have limited resources on the server.
I have released Luna v0.3 (http://www.unsads.com/projects/nsptools/downloader/download/release/3) with OS v3.2 compatibility and full support of special characters: http://ndlessly.wordpress.com/2012/06/24/luna-updated-compatibility-with-os-v3-2-and-special-characters/yay! thank you ExtendeD!
cd C:\Graphing Calculator\Nspire\Lua Programming\luna-v0.2b
luna.exe jumper.lua jumper.tns
I usually work on one project at a time, so it's faster just clicking on an icon.
CC:=/opt/local/bin/gcc-mp-4.7
CFLAGS:=-W -Wall -m32
LDFLAGS:= -lssl -lz -m32
VPATH := minizip-1.1
OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
EXEEXT = .exe
else
CFLAGS := $(CFLAGS) -DUSE_FILE32API
LDFLAGS:= $(LDFLAGS) -lcrypto
endif
all: luna$(EXEEXT)
luna$(EXEEXT): luna.o zip.o ioapi.o
/opt/local/bin/gcc-mp-4.7 -o $@ $^ $(LDFLAGS)
dist: clean all
mkdir -p dist/src
rm -f *.o
find . -maxdepth 1 ! -name 'luna$(EXEEXT)' -a ! -name dist -a ! -name . -exec cp -r {} dist/src \;
cp luna$(EXEEXT) *.dll *.txt dist
clean:
rm -rf *.o luna$(EXEEXT) dist
For those of you who are on OS X and are having trouble building Luna, I found out why it won't build. In the Luna's readme, it states you need gcc >=4.5, but apple's gcc is gcc 4.2. Using MacPorts (or Homebrew, Fink), install gcc 4.7 (run "sudo port install gcc47"). Then open up Luna's Makefile with a text editor and change any instances of "gcc" to "/opt/local/bin/gcc-mp-4.7". Cd to the Luna directory in Terminal, and do make "dist luna", and it builds!Code: [Select]CC:=/opt/local/bin/gcc-mp-4.7
CFLAGS:=-W -Wall -m32
LDFLAGS:= -lssl -lz -m32
VPATH := minizip-1.1
OS ?= `uname -s`
ifeq ($(OS),Windows_NT)
EXEEXT = .exe
else
CFLAGS := $(CFLAGS) -DUSE_FILE32API
LDFLAGS:= $(LDFLAGS) -lcrypto
endif
all: luna$(EXEEXT)
luna$(EXEEXT): luna.o zip.o ioapi.o
/opt/local/bin/gcc-mp-4.7 -o $@ $^ $(LDFLAGS)
dist: clean all
mkdir -p dist/src
rm -f *.o
find . -maxdepth 1 ! -name 'luna$(EXEEXT)' -a ! -name dist -a ! -name . -exec cp -r {} dist/src \;
cp luna$(EXEEXT) *.dll *.txt dist
clean:
rm -rf *.o luna$(EXEEXT) dist
Also, link for those who don't want to build themselves:
https://dl.dropbox.com/u/4657389/luna-v3.0a-osx-intel.zip (https://dl.dropbox.com/u/4657389/luna-v3.0a-osx-intel.zip)
Alternatively, using clang, if you have that installed, should work. Works for me under Linux.
(I tried to post this yesterday evening, but my session timed out and I didn't notice)