yashsingh1/xdaforums huggingface dataset:
[Windows Mobile Development and Hacking General] sztupy:
I apologize. I should have made this release waaay earlier. But it's here:

LuaDec 2.0

What's new:

A new local declaration/releasing gesser heuristic built into luadec

This new guesser works real fine. It even works inside loops and other constructs. Only the following can kill it currently:

inline list assignments (like Something = {[0] = a, [1] = b, [2] = c})

table assignments involving two constants (in some of the cases)

while and repeat..until loops (but this is because of the old conditional handling engine)

So now luadec can actually output useful scripts in almost all of the time, and usually only the conditionals have to be fixed. Of course there are some exceptions, but who cares :)

The new heuristic is ON by default, because it seems it's stable enough for everyday use. It only crashed once for me, when it encountered a SETLIST assignment (very rare), but still then you could get the guessed LDS2 string, and modify it, so it won't crash.

To get the guessed string use:

luadec -pg filename.luac

To decompile simply use:

luadec filename.luac > filename.lua

This is it. No more fancy LDS strings (except when it crashes, but that should be very rare). Now only the conditional statements has to be fixed... but they're scheduled for luadec 3 :)

DL: http://winmo.sztupy.hu/luadec.html

And of course a large release means nothing if I wouldn't use it. So

All Rhodium2 manila scripts decompiled

They are all unicode and Q16.16 fixed! The only file that doesn't recompile to the original bytecode is stock.lua, but it only has a minor bug, and semantically both files are the same.

DL: http://winmo.sztupy.hu/manilakitchen.html

Manila kitchen is updated to reflect these changes too of course.
[Windows Mobile Development and Hacking General] smotrs:
Would anyone happen to know where this path is actually located at? I can't seem to find it on the mobile anywhere.

"Manila://settings/updatesanddata/updatesanddata.page"

it's being called by the LUA Weather file when you go in to the Settings menu.

elseif l_50_0.Result.UserValue == "Settings" then
_application.Navigation:Navigate(URL("Manila://settings/updatesanddata/updatesanddata.page"), true)

I'd like to add some additional options, or try to add options like Display time for each city, change max city list to customizable, and anything else I can think of.
[Windows Mobile Development and Hacking General] avimak:
letterpicker.lua contains the letters which shows in the slider bars of the TF3D (contacts, weather..).

I managed to change it to hebrew letters and it realy shows it great - but it still searching for contacts with only English letters and even when i'm mixing the ASCII file - it only mix it from the visual side and still searching "by the book" (A -> B -> C -> Etc...), where is the reference for those letters? I want to change it

thanks!
[Windows Mobile Development and Hacking General] sztupy:
I think these are either mode9 or dialog references, not real file references.
[Windows Mobile Development and Hacking General] smotrs:
Hmm, ok, I'll look into that. by the way. I was able to fix the Weather TAB so it now works on ALL VGA phones. Now I'm in the process of seeing about making bigger changes.
[Windows Mobile Development and Hacking General] sztupy:
I'm now working on a widgetized home interface (like on Omnia). It's not that hard actually.
[Windows Mobile Development and Hacking General] sztupy:
I found this:

HandleLetterSelected = function(l_10_0)
local l_10_1 = string.char(l_10_0 + 65)
trace("HandleLetterSelected=" .. l_10_1)
local l_10_2 = ContactObj.ContactList:GetLetterIndex(tostring(l_10_1)) + ContactObj.offset
trace("HandleLetterSelected indexJump=" .. l_10_2)
ContactObj.listview:GetLayout():JumpToIndex(l_10_2, ListAlignment_Top, ListAlignmentOptions_Snap)
ContactObj.listview:GetGenerator().SelectedIndex = -1
end

This might be what you're looking for, but might be something else. Here you can see, that the character is actually get from the letter index + 65 (where 65 is the character code of "A" of course)

Try changing the first line to:

local l_10_1 = LetterArray[l_10_0]

Where LetterArray is the array you modified in letterpicker.lua. This might work. There might be other instances of this stuff, try searching for the string "+65" or "+ 65" or simply "65" inside of the files, they might refer to this problem.
[Windows Mobile Development and Hacking General] smotrs:
Nice, can't wait to see it. :)
[Windows Mobile Development and Hacking General] avimak:
Doesn't work, it shows me the letter and stack on it (the letter doesn't disappear after finger released...). i tried to add the first Character of the Hebrew ABC by adding "א" instead 65 - doesn't work either.
[Windows Mobile Development and Hacking General] showaco:
Isn't 65 the ascii code for letter A or something? Maybe find the code for hebrew starting letter? Maybe I'm completely crazy....:rolleyes:
[Windows Mobile Development and Hacking General] avimak:
I think you right, but the problem is that there is no Hebrew in ASCII - only in Unicode - and i'm not sure how to write the Hebrew Unicode for "א" (The Hebrew "A") because I don't know Lua at all...
[Windows Mobile Development and Hacking General] sztupy:
string.char won't work with unicode ordinals unfortunately :( I hoped simply using the LetterArray as a map will do the job, but it seems no. I'll try it someday
[Windows Mobile Development and Hacking General] sztupy:
could you send me the files you modified? I'll try setting them up. The fact that the letter doesn't dissapear means it crashed.
[Windows Mobile Development and Hacking General] avimak:
Here is the scores results so far...

the files with "65" ("A") inside them are:

contactpickerallscript.lua

contactpickerscript.lua

peopleallscript.lua

peoplefavoriteglobal.lua

peopleselectcontactscript.lua

failed tests:

1) local l_10_1 = LetterArray[l_10_0]

result - slider showing but doesn't work, pressing the slider only shows the Letters from that LetterArray from letterpicker.lua, the letter doesn't disappear after finger released but I can change the letters that shows in the screen (without any effect on the contact list of course)...

2) local l_10_1 = string.char(l_10_0 + "א")

result - the same as test 1.

3) local l_10_1 = string.char(l_10_0 + LetterArray[l_10_0])

result - - doesn't compiled...

4) local l_10_1 = string.char(l_10_0 + 'א')

result - TF3D crashed when "all contact" starts...
[Windows Mobile Development and Hacking General] avimak:
here is the files which modified as test 2 (it's UTF-8 without BOM)

change it to rar ;)

thanks!
[Windows Mobile Development and Hacking General] mun_rus:
Did u initialise letterArray in other scripts7
[Windows Mobile Development and Hacking General] avimak:
I didn't find any other letterArray in the scripts! did you find any? I found only in letterPicker.lua
[Windows Mobile Development and Hacking General] mun_rus:
Other scripts are using string.char() to get letters. but probably they can't see LetterPicker array from 1st script
[Windows Mobile Development and Hacking General] avimak:
oh sure, I changed those scripts:

contactpickerallscript.lua

contactpickerscript.lua

peopleallscript.lua

peoplefavoriteglobal.lua

peopleselectcontactscript.lua

they all have string.char() method that looking for "65" ("A"), and I posted a couple of posts ago the tests I did to try changing this to Hebrew, and failed.

are Lua an Object oriented lang? can I "import" this Array to those scripts for they recognize it?

I don't know Lua syntax, but maybe I can create an Array of letters like the one in letterPicker in each of this scripts, and point the string.char() in each script to this Array?
[Windows Mobile Development and Hacking General] sztupy:
letterpicker array is included in these files. It is contained in letterpicker.lua. It might wort trying to duplicate that assignment in these files too, but that shouldn't cause any problem
[Windows Mobile Development and Hacking General] avimak:
Since I don't know Lua, can you write this duplicate code and the assignment code and I'll give it a shot? please? :o:o:o
[Windows Mobile Development and Hacking General] sztupy:
Simply copy the LetterPicker = { ... } stuff from letterpicker.lua you modified and insert it after the require('letterpicker') line in the people*.lua files
[Windows Mobile Development and Hacking General] avimak:
are you talking about LetterArray (LetterPicker is the class..)?

I need to copy the:

LetterArray = {[0] = "׳",
[1] = "׳‘",
[2] = "׳’",
[3] = "׳“",
[4] = "׳”",
[5] = "׳•",
[6] = "׳–",
[7] = "׳—",
[8] = "׳˜",
[9] = "׳™",
[10] = "׳›",
[11] = "׳œ",
[12] = "׳ž",
[13] = "׳*",
[14] = "׳¡",
[15] = "׳¢",
[16] = "׳₪",
[17] = "׳¦",
[18] = "׳§",
[19] = "׳¨",
[20] = "׳©",
[21] = "׳×",
[22] = "A",
[23] = "H",
[24] = "S",
[25] = "Z"}

(ignore the strange signs) stuff to people*.lua? where exactly? and how i'm making this:

local l_10_1 = string.char(l_10_0 + 65)

to point for this Array?

thank you for your kindness and your patience... :)
[Windows Mobile Development and Hacking General] sztupy:
Sorry I mixed the two up, it's LetterArray of course...

And use this one:

(added some error checking)

local l_10_1 = LetterArray[l_10_0]
if l_10_1 == nil then
l_10_1 = "A"
end
[Windows Mobile Development and Hacking General] avimak:
Not working...

in the next files:

contactpickerallscript.lua
contactpickerscript.lua
peopleallscript.lua
peoplefavoriteglobal.lua
peopleselectcontactscript.lua

I changed the:

local l_10_1 = string.char(l_10_0 + 65)

to:

LetterArray = {[0] = "׳�",
[1] = "׳‘",
[2] = "׳’",
[3] = "׳“",
[4] = "׳”",
[5] = "׳•",
[6] = "׳–",
[7] = "׳—",
[8] = "׳˜",
[9] = "׳™",
[10] = "׳›",
[11] = "׳œ",
[12] = "׳ž",
[14] = "ס",
[13] = "׳*",
[15] = "׳¢",
[16] = "׳₪",
[17] = "׳¦",
[18] = "׳§",
[19] = "׳¨",
[20] = "׳©",
[21] = "׳×",
[22] = "A",
[23] = "H",
[24] = "S",
[25] = "Z"}
local l_10_1 = LetterArray[l_10_0]
if l_10_1 == nil then
l_10_1 = "A"
end

And it crashed.... not even opened the contacts page.

but after I changed each file with his l_*_*, for example:

for

local [b]l_16_1[/b] = string.char(l_10_0 + 65)

i changed your code to

local [b]l_16_1[/b] = LetterArray[l_10_0]
if [b]l_16_1[/b] == nil then
[b]l_16_1[/b] = "A"
end

It shows me the slider and handle the press/release as always but no effect on the list itself...

maybe I didn't understand your instruction correctly, can you change one of those files in a way you think it should work so i'll understand it better?

:)
[Windows Mobile Development and Hacking General] avimak:
can be deleted, I posted it again...
[Windows Mobile Development and Hacking General] sztupy:
No, it simply does not work. I'll look at it someday, but a bit later :)
[Windows Mobile Development and Hacking General] avimak:
Good news!

I just found out that if i'm changing the right pointer too the English part of the Array is working.

for example:

local l_16_1 = LetterArray[l_16_0]

and in another file:

local l_12_1 = LetterArray[l_12_0]

Etc...

and then, the:

[22] = "A",
[23] = "H",
[24] = "S",
[25] = "Z"}

part of my array is working great!

even if i'm deleting the

if l_16_1 == nil then
l_16_1 = "A"
end

part...

Still, no luck with the Hebrew letters.
[Windows Mobile Development and Hacking General] sztupy:
Try replacing this:

local l_10_2 = ContactObj.ContactList:GetLetterIndex(tostring(l_10_1)) + ContactObj.offset

with this:

local l_10_2 = ContactObj.ContactList:GetLetterIndex(l_10_1) + ContactObj.offset

maybe...
[Windows Mobile Development and Hacking General] avimak:
Nope :(

only the

[22] = "A",
[23] = "H",
[24] = "S",
[25] = "Z"}

of my Array is working while scrolling...

The Hebrew letters only kick it to the head of the contacts..

any other Idea? maybe I can write it "one by one" and not through array?

thanks for helping man :)

I'm sure it'll be helpful for a lot of users (probably any Unicode user) :)
[Windows Mobile Development and Hacking General] sztupy:
You might be out of luck, GetLetterIndex is a non-lua function, and if that function can't handle unicode characters then you can't use it to determine the starting position. There might be workarounds (like getting all contacts and seardching through them), but I don't know if this is possible.
[Windows Mobile Development and Hacking General] avimak:
I can't believe it's not an Unicode supporter...

What about the Arabic/Russian/German/Chinese devices? they always have solution for them, even for the RandomAccess in the old contacts screen - they had sliders in Russian or Arabic...

What's that second thing you said? I didn't get it...
[Windows Mobile Development and Hacking General] sztupy:
Advertisement

I've made some tools that will display mode9 files on the computer.

Topic

I've also set up a wiki with a lot of autogenerated content regarding mode9 development (and maybe lua later on):

http://msdn.winmo.sztupy.hu/
[Windows Mobile Development and Hacking General] sztupy:
As I see the letterpicker part of rhodium2 is not unicode aware...

I meant read all of the contacts one by one (dunno how to do this, but should be possible), and check whether it starts with the character you specified.
[Windows Mobile Development and Hacking General] smotrs:
Nice, very very nice. :)
[Windows Mobile Development and Hacking General] mun_rus:
this is an example of russian letter picker

if string.lower(_application.Store:GetStringValue(Lifetime_Permanent, "Locale")) == "ru-ru" then
LetterCount = 33
LetterOffset = 1040
LetterFontSize = 16
else
LetterCount = 26
LetterOffset = 65
LetterFontSize = 20
end

...
LetterPicker.ItemCreated = function(l_3_0, l_3_1, l_3_2) l_3_2.Namespace:FindName("Letter").onRelease:connect(l_3_0.HandleMouseReleaseInList, l_3_0) l_3_2.Namespace:FindName("Letter").onReleaseOutside:connect(l_3_0.HandleMouseReleaseInList, l_3_0) l_3_2.Namespace:FindName("Letter").onPress:connect(l_3_0.HandleMousePressInList, l_3_0)
l_3_2.Namespace:FindName("Letter").onRollOver:connect(l_3_0.HandleRollOver, l_3_0)
l_3_2.Namespace:FindName("Letter").String = string.char(l_3_1 + LetterOffset)
l_3_2.Namespace:FindName("Letter").FontSize = l_3_0.LetterFontSize
l_3_2.Namespace:FindName("Letter").Size.height = l_3_0.itemhight
l_3_2.Tag = l_3_1
end
....
LetterPicker.HandleRollOver = function(l_5_0, l_5_1)
l_5_0.ListViewInstance:GetGenerator():SelectObject(l_5_1)
l_5_0:SetLetter(l_5_1.String)
end

LetterPicker.HandleMousePressInList = function(l_6_0, l_6_1, l_6_2)
trace("[LetterPicker] : HandleMousePressInList")
l_6_0.ListViewInstance:GetGenerator():SelectObject(l_6_1)
l_6_2.value = true
l_6_0:SetLetter(l_6_1.String)
l_6_0:ShowCharacterDialog(true)
l_6_0.ListViewInstance:GetLayout().SelectionNode.Opacity.value = 100
end

LetterPicker.SetLetter = function(l_9_0, l_9_1)
l_9_0.Letter_Char.String = l_9_1
end

LetterPicker.Reset = function(l_10_0)
trace("[LetterPicker] : Reset")
l_10_0.ListViewInstance:GetGenerator().SelectedIndex = 0
end
.....

I got a russian letters line in contacts and changed all offsets to 1040 but it's dont work for me either.

I think we missed smth important but unnoticable for 1st view
[Windows Mobile Development and Hacking General] avimak:
maybe if we had a way to skip the "GetLetterIndex" and create a different way to check the first letters in contacts it would work, as sztupy just wrote to me.

do you have any Idea?
[Windows Mobile Development and Hacking General] sztupy:
And what if you use lowercase letters (decimal offset 1072 for cyrillic)? Just a guess
[Windows Mobile Development and Hacking General] avimak:
something else, mun_rus, did you change this + 65 value in the rest of the files?

I got the control of the slider - just read it above - but it doesn't recognize my Hebrew letter (the unicode part).
[Windows Mobile Development and Hacking General] hallatore:
Hi, I hope this is the right place to ask. Have't found a good lua thread yet.

Just started playing around with the lua and mode9 files.

Pretty easy syntax, but the data sure is spread across alot of files :rolleyes:

So far i have made this no call history in today tab mod.

I've been wondering about a couple of things.

Q: How can I get the Notifications (call history, appointments) higher up?

Q: where can I edit the 3D clocks size?

Q: Where does the 3D render of the clock come from? (The one that has the animation, can't find it in the source.

I've edited every single setting in home.mode9 and I got the clock to get smaller, but the overlay animated (3D?) clock still has the same size. Is it's size set by the clock's image-files maybe?

I've also played around with the lua that sets most of the stuff in home.mode9. but there are't alot of settings there to change.
[Windows Mobile Development and Hacking General] avimak:
If you want to play with the clock size, I believe you'll need to play with the PNG files too..

look through "mode9 editor" to find out which ones are the clock image files...

BTW, can you help us with the contact scroll bar? :)
[Windows Mobile Development and Hacking General] hallatore:
It's still scrolling too far?

I will try, my first day with mode9 and lua stuff today. Need some sleep before school, and then maybe i get some time tomorrow :)

PS: I see there are alot of .lua files that still contain the 480x800 sizes. might affect the child objects?

Examples:

- layoutinfo.lua

- manila.lua
[Windows Mobile Development and Hacking General] hallatore:
I have no idea how to cook the whole manila, but why not try this.

Use Visual studio to replace "800 and "-800 with "640 and "-640 in all the decompiled lua files?

I just did a quick search and I found 33 entries.

Ofcourse there are alot of entries like 788 etc, those are a bit worse to find.
[Windows Mobile Development and Hacking General] avimak:
I'm not sure you understood my request :)

Just read from 263 message, the whole conversation between me, sztupy and mun_rus...

thanks ;)
[Windows Mobile Development and Hacking General] mun_rus:
No need to do that:) already tried. Just got lowercase letters in my scroll list.

yeah) i think our problem is with getting selected index
[Windows Mobile Development and Hacking General] avimak:
I'm coming from Java world, so I'm not sure about Lua...

but can we override methods? maybe we can create a brand new method like "selected index" and use it in each script from the above? do you guys have some doc about this letter index method?
[Windows Mobile Development and Hacking General] sztupy:
the fact that LetterArray[l_10_0] works with latin characters means that the index is fine, but something gets broken after sending the character to the getcontanct method
[Windows Mobile Development and Hacking General] sztupy:
size doesn't depend on the png files, it depends on the mode9 and lua files. Mode9 files are just an initialization for objects that the lua scripts will initialize further. The 3D clock images are defined in the mode9 files at the end of LibraryID 12, inside two "3d Camera" objects that have a strange viewport setting (not 0,0,width,height but something like -48,90,?,?). This setting will make the center of the clock objects in the middle, so they will be rotated around that axis in the lua files.
[Windows Mobile Development and Hacking General] sztupy:
lua is a dynamic language with first class functions (so functions are types too). You can reassign fnctions too in lua, but actually you shouldn't bother external functions (that are written in C)
[Windows Mobile Development and Hacking General] hallatore:
Yes the 3d clock is quite wierd.

I've been looking to find the animation that occurs when you go from large to small clock, I don't think it's in the lua files attached to the home.mode9 file.

My reason for this is that I can't find the code that moves the Arrows (up and down) when the clock resizes from big to small. I also have't seen a single mod that got the 3d clock space any smaller.
[Windows Mobile Development and Hacking General] mun_rus:
I agree. got some thoughts about it) will try smth this evening
[Windows Mobile Development and Hacking General] sztupy:
According to this image and the mode9 file behind them the 3D clocks are handled in a very strange way. BTW I don't think the arrows are moved anywhere, they just (dis)appear. The code for that is in home/1.lua:

down_arrow._visible = true
up_arrow._visible = false

and the down_arrow is pushed:

if l_15_10 == 2 then
down_arrow.Position.y = downPosition2
elseif l_15_10 == 3 then
down_arrow.Position.y = downPosition3
elseif l_15_10 == 4 then
down_arrow.Position.y = downPosition4
elseif l_15_10 == 5 then
down_arrow.Position.y = downPosition5
end
[Windows Mobile Development and Hacking General] hallatore:
Yes and no. The arrows does not move, but the group holding the arrows\appointments\missed calls\etc is moved when you switch clocks.

It's the code that does the switch that i'm looking for as i think that is the code that sets the height of the 3Dclock group window. Is it hardcoded into the manila.exe or in some file that has't been decompiled yet? (I see no reference to it in the home.lua, and removing digitalclock.lua only disables the time (the clock says 00:00).
[Windows Mobile Development and Hacking General] sztupy:
All scripts are decompiled, and manila.exe has no hardcoding (except for the _svc requires). Let's trace it: RTabTopFlip is the name of the group. A search drops out only digitalclock.lua. There it is assigned to a TabHalf object and to TobTabFlip:

local tab3 = TabHalf:new()
...
tab3.Tab = RTabTopFlip
...
l_14_0.MinuteFlip.TopTabFlip = tab3

It is set:

l_6_0.TopTabFlip.Tab.Rotation:ClearInterpolate()
l_6_0.TopTabFlip.Tab.Rotation.x = 0
l_6_0.TopTabFlip.Tab._visible = true

and rotated:

l_7_0.TopTabFlip.Tab.Rotation:Interpolate(Vector3(0, l_7_0.TopTabFlip.Tab.Rotation.y, l_7_0.TopTabFlip.Tab.Rotation.z), Vector3(90, l_7_0.TopTabFlip.Tab.Rotation.y, l_7_0.TopTabFlip.Tab.Rotation.z), l_7_0:getDuration(), 0, Interpolate_EaseInQuad, l_7_0.onTopFlipComplete, l_7_0)

and after rotation it is deleted:

l_8_0.TopTabFlip.Tab._visible = false

I think this is all it does, and this is enough. I don!t think the height and other things should be changed, they are in the mode9 files, and it will rotated through its bottom axis, so actually the rotation animation is quite easy to implement.
[Windows Mobile Development and Hacking General] sztupy:
And the arrows and the appointments are in a different group in home.mode9 There are a lot of separate groups for the appointments/etc, and the get assigned to a "InitializeFullAnimation" function, which does the moving in home/1.lua
[Windows Mobile Development and Hacking General] hallatore:
hmm, wierd.

I removed 4.lua (the file including the digitalclock) from home.mode9 and it seemed like it was still there. I need to check it again.

Takes some time getting used to this mode9\lua stuff :)
[Windows Mobile Development and Hacking General] 12aon:
Could be because when there is no lua code telling it different it just uses the portrait mode9 info, I don't know if that applies here though, 12
[Windows Mobile Development and Hacking General] hallatore:
Here is an example of what i'm going to do.

I have seen smaller and different clocks, but none that takes up less space vertically. Will contine to play with it as soon as my mobile is done flashing :p

PS: How do you guyes test these files? right now i compile,then connect my phone and copy the file to the storage card and then using file explorer to copy it into the windows folder.. and ofcourse restart manila.

Is there a faster way? :D
[Windows Mobile Development and Hacking General] sztupy:
digitalclock is in a separate lua (at least in rhodium manila)
[Windows Mobile Development and Hacking General] sztupy:
what do you mean by less space vertically?

I usually copy them to a separate "windows" directory on the sd card, and copy the complete windows directory using pocket total commander. This way I don't have to enter the real windows directory, which is slow. But speaking of this, I should create an automation tool for this stuff :D