That's it! That's the only error I get. Here's the file
-l ;;;;;2,4;0,11;;0,0,13;0,9,77,80;;;;;;;;;;;1;;0,0,0,4,15;0,6;;;;;;;0,0,16,20;;0,0,9,20;0,3,13;;;;;;0,0,0,4;0,9;;;;;0,0,0,4;0,9;;;;24,41;;;;;;;;;;;;;;30;;
luadecguess -fg 1 filename
12, thanks, I was hoping to see how close it was to the HD version compared to the regular TP version. It looks like it follows the regular TP version. When I insert it into the Weather Tab CAB, it doesn the same thing the standard TP version does.
Hi!
Don't worry about me being slower, I am going from the hardest scripts to the easier ones now. 251 done. New additions:
-- Decompiled using luadec 0.4 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l 14;0;; 35a10783_manila.luac
trace("Album Landscape")
require("Common\\LayoutInfo")
_LayoutInfo = LayoutInfo()
Album_ScreenRotation = class(RotationTemplate)
local l_0_0 = Album_ScreenRotation
l_0_0.__init = function(l_1_0, l_1_1)
l_1_0._ResetLayoutCallback = l_1_1
trace("Album_ScreenRotation:__init later")
RotationTemplate.__init(l_1_0)
end
l_0_0 = Album_ScreenRotation
l_0_0.OnScreenRotation = function(l_2_0)
Camera2DBegin.Viewport.value = RectF(0, 0, screenWidth, screenHeight - 2 * SystemTitlebarHeight)
Camera2DBegin.ViewLeft.value = 0
Camera2DBegin.ViewRight.value = screenWidth
Camera2DBegin.ViewTop.value = 0
Camera2DBegin.ViewButtom.value = -(screenHeight - 2 * SystemTitlebarHeight)
Listview3DCamera.Viewport.value = RectF(0, 0, screenWidth, screenHeight - 2 * SystemTitlebarHeight)
Listview3DCamera.ViewLeft.value = 0
Listview3DCamera.ViewRight.value = screenWidth
Listview3DCamera.ViewTop.value = 0
Listview3DCamera.ViewButtom.value = screenHeight - 2 * SystemTitlebarHeight
if _application.Orientation == ScreenOrientation_Portrait then
trace("Album_ScreenRotation_Portrait")
Listview3DCamera.CameraPosition.value = Vector3(0, 50, 415)
ControlPanel2D.Position.x = 0
ControlPanel2D.Position.y = 0
ArrowGroups.Position.y = -322
KeyUpSprit.Position.y = 60
KeyUpSprit.Size.height = 130
InitPortraitConstant()
else
if _application.Orientation == ScreenOrientation_Landscape then
trace("Album_ScreenRotation_Landscape")
Listview3DCamera.CameraPosition.value = Vector3(0, 50, 224)
ControlPanel2D.Position.x = 307
ControlPanel2D.Position.y = SystemTitlebarHeight
ArrowGroups.Position.y = -272
KeyUpSprit.Position.y = 10
KeyUpSprit.Size.height = 80
RightBound = 674
PanoramaWidth = 344
PanoramaHeight = 120
PanoramaVWidth = 108
PanoramaVHeight = 176
PortraitWidth = 132
PortraitHeight = 176
LandscapeWidth = 200
LandscapeHeight = 150
WideLandscapeWidth = 250
WideLandscapeHeight = 150
ParaOff = 0
LOff = -5
WLOff = 0
POff = -7
VParaOff = -7
PhotoHitTarget.Position.x = 212
PhotoHitTarget.Position.y = -36
PhotoHitTarget.Size.width = 360
PhotoHitTarget.Size.height = 300
-- Decompiled using luadec 0.4 by sztupy (http://winmo.sztupy.hu)
-- Command line was: -l 14;0;; 35a10783_manila.luac
trace("Album Landscape")
require("Common\\LayoutInfo")
_LayoutInfo = LayoutInfo()
Album_ScreenRotation = class(RotationTemplate)
local l_0_0 = Album_ScreenRotation
l_0_0.__init = function(l_1_0, l_1_1)
l_1_0._ResetLayoutCallback = l_1_1
trace("Album_ScreenRotation:__init later")
RotationTemplate.__init(l_1_0)
end
l_0_0 = Album_ScreenRotation
l_0_0.OnScreenRotation = function(l_2_0)[B]
Camera2DBegin.Viewport.value = RectF(0, 0, 640, 480 - 2 * 50)[/B]
Camera2DBegin.ViewLeft.value = 0
[B] Camera2DBegin.ViewRight.value = 640[/B]
Camera2DBegin.ViewTop.value = 0
[B] Camera2DBegin.ViewButtom.value = -(480 - 2 * 50)[/B]
[B] [COLOR="Red"]Listview3DCamera.Viewport.value = RectF(0, 0, 480, 640 - 2 * 50)[/COLOR][/B]
Listview3DCamera.ViewLeft.value = 0
[B][COLOR="Red"]Listview3DCamera.ViewRight.value = 480[/COLOR][/B]
Listview3DCamera.ViewTop.value = 0
[B] [COLOR="Red"] Listview3DCamera.ViewButtom.value = 640 - 2 * 50[/COLOR][/B]
if _application.Orientation == ScreenOrientation_Portrait then
trace("Album_ScreenRotation_Portrait")
Listview3DCamera.CameraPosition.value = Vector3(0, 50, 415)
ControlPanel2D.Position.x = 0
ControlPanel2D.Position.y = 0
ArrowGroups.Position.y = -322
KeyUpSprit.Position.y = 60
KeyUpSprit.Size.height = 130
InitPortraitConstant()
else
if _application.Orientation == ScreenOrientation_Landscape then
trace("Album_ScreenRotation_Landscape")
Listview3DCamera.CameraPosition.value = Vector3(0, 50, 224)
ControlPanel2D.Position.x = 307
ControlPanel2D.Position.y = SystemTitlebarHeight
ArrowGroups.Position.y = -272
KeyUpSprit.Position.y = 10
KeyUpSprit.Size.height = 80
[B] RightBound = 539[/B]
PanoramaWidth = 344
PanoramaHeight = 120
PanoramaVWidth = 108
PanoramaVHeight = 176
PortraitWidth = 132
PortraitHeight = 176
LandscapeWidth = 200
LandscapeHeight = 150
WideLandscapeWidth = 250
WideLandscapeHeight = 150
ParaOff = 0
LOff = -5
WLOff = 0
POff = -7
VParaOff = -7
PhotoHitTarget.Position.x = 212
PhotoHitTarget.Position.y = -36
PhotoHitTarget.Size.width = 360
PhotoHitTarget.Size.height = 300
end
end
Wow, you are just awesome. I'm just trying to decomp one file and your pumping them out left and right. Gonna try some of your newly posted tips and see how much further I can get on the HD version of that file.
Keep up the good work.
Ok problem: I'm trying to change the landscape and portrait phototab but tehy are somehow dependent on one another
here''s the original:
Code:-- Decompiled using luadec 0.4 by sztupy (http://winmo.sztupy.hu) -- Command line was: -l 14;0;; 35a10783_manila.luac trace("Album Landscape") require("Common\\LayoutInfo") _LayoutInfo = LayoutInfo() Album_ScreenRotation = class(RotationTemplate) local l_0_0 = Album_ScreenRotation l_0_0.__init = function(l_1_0, l_1_1) l_1_0._ResetLayoutCallback = l_1_1 trace("Album_ScreenRotation:__init later") RotationTemplate.__init(l_1_0) end l_0_0 = Album_ScreenRotation l_0_0.OnScreenRotation = function(l_2_0) Camera2DBegin.Viewport.value = RectF(0, 0, screenWidth, screenHeight - 2 * SystemTitlebarHeight) Camera2DBegin.ViewLeft.value = 0 Camera2DBegin.ViewRight.value = screenWidth Camera2DBegin.ViewTop.value = 0 Camera2DBegin.ViewButtom.value = -(screenHeight - 2 * SystemTitlebarHeight) Listview3DCamera.Viewport.value = RectF(0, 0, screenWidth, screenHeight - 2 * SystemTitlebarHeight) Listview3DCamera.ViewLeft.value = 0 Listview3DCamera.ViewRight.value = screenWidth Listview3DCamera.ViewTop.value = 0 Listview3DCamera.ViewButtom.value = screenHeight - 2 * SystemTitlebarHeight if _application.Orientation == ScreenOrientation_Portrait then trace("Album_ScreenRotation_Portrait") Listview3DCamera.CameraPosition.value = Vector3(0, 50, 415) ControlPanel2D.Position.x = 0 ControlPanel2D.Position.y = 0 ArrowGroups.Position.y = -322 KeyUpSprit.Position.y = 60 KeyUpSprit.Size.height = 130 InitPortraitConstant() else if _application.Orientation == ScreenOrientation_Landscape then trace("Album_ScreenRotation_Landscape") Listview3DCamera.CameraPosition.value = Vector3(0, 50, 224) ControlPanel2D.Position.x = 307 ControlPanel2D.Position.y = SystemTitlebarHeight ArrowGroups.Position.y = -272 KeyUpSprit.Position.y = 10 KeyUpSprit.Size.height = 80 RightBound = 674 PanoramaWidth = 344 PanoramaHeight = 120 PanoramaVWidth = 108 PanoramaVHeight = 176 PortraitWidth = 132 PortraitHeight = 176 LandscapeWidth = 200 LandscapeHeight = 150 WideLandscapeWidth = 250 WideLandscapeHeight = 150 ParaOff = 0 LOff = -5 WLOff = 0 POff = -7 VParaOff = -7 PhotoHitTarget.Position.x = 212 PhotoHitTarget.Position.y = -36 PhotoHitTarget.Size.width = 360 PhotoHitTarget.Size.height = 300
which I have changed into:
Code:-- Decompiled using luadec 0.4 by sztupy (http://winmo.sztupy.hu) -- Command line was: -l 14;0;; 35a10783_manila.luac trace("Album Landscape") require("Common\\LayoutInfo") _LayoutInfo = LayoutInfo() Album_ScreenRotation = class(RotationTemplate) local l_0_0 = Album_ScreenRotation l_0_0.__init = function(l_1_0, l_1_1) l_1_0._ResetLayoutCallback = l_1_1 trace("Album_ScreenRotation:__init later") RotationTemplate.__init(l_1_0) end l_0_0 = Album_ScreenRotation l_0_0.OnScreenRotation = function(l_2_0) Camera2DBegin.Viewport.value = RectF(0, 0, 640, 480 - 2 * 50) Camera2DBegin.ViewLeft.value = 0 Camera2DBegin.ViewRight.value = 640 Camera2DBegin.ViewTop.value = 0 Camera2DBegin.ViewButtom.value = -(480 - 2 * 50) Listview3DCamera.Viewport.value = RectF(0, 0, 480, 640 - 2 * 50) Listview3DCamera.ViewLeft.value = 0 Listview3DCamera.ViewRight.value = 480 Listview3DCamera.ViewTop.value = 0 Listview3DCamera.ViewButtom.value = 640 - 2 * 50 if _application.Orientation == ScreenOrientation_Portrait then trace("Album_ScreenRotation_Portrait") Listview3DCamera.CameraPosition.value = Vector3(0, 50, 415) ControlPanel2D.Position.x = 0 ControlPanel2D.Position.y = 0 ArrowGroups.Position.y = -322 KeyUpSprit.Position.y = 60 KeyUpSprit.Size.height = 130 InitPortraitConstant() else if _application.Orientation == ScreenOrientation_Landscape then trace("Album_ScreenRotation_Landscape") Listview3DCamera.CameraPosition.value = Vector3(0, 50, 224) ControlPanel2D.Position.x = 307 ControlPanel2D.Position.y = SystemTitlebarHeight ArrowGroups.Position.y = -272 KeyUpSprit.Position.y = 10 KeyUpSprit.Size.height = 80 RightBound = 539 PanoramaWidth = 344 PanoramaHeight = 120 PanoramaVWidth = 108 PanoramaVHeight = 176 PortraitWidth = 132 PortraitHeight = 176 LandscapeWidth = 200 LandscapeHeight = 150 WideLandscapeWidth = 250 WideLandscapeHeight = 150 ParaOff = 0 LOff = -5 WLOff = 0 POff = -7 VParaOff = -7 PhotoHitTarget.Position.x = 212 PhotoHitTarget.Position.y = -36 PhotoHitTarget.Size.width = 360 PhotoHitTarget.Size.height = 300 end end
The new "fast guess" mode usually works very fine with _large_ scripts (more than 10k). For smaller ones the original mode usually gets better results, but smaller scripts have already been decompiled
Usage:
Code:luadecguess -fg 1 filename
the last line it outputs will be the LDS string. Sometimes (well around 50% of the cases) this LDS string will make luadec crash, which means the fast guessed LDS wasn't fine.
To solve this issue one have to run luadec with the -d option set (and with the LDS), and check on where it crashed (which function, which opcode). Then you have to manually modify the LDS string (usually putting a smaller number in the appropriate place should do the job) To get the appropriate "smaller number", luadecguess with fg mode on will list out useful informations about where locals can be defined.
----------------------------------------------
5 LOADK 0 3
next bool: 1
locals(1): 0{l_11_0}
vpend(0):
tpend(1): 0{l_11_0}
()
-- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them
local l_11_0 = ""
----------------------------------------------
6 GETGLOBAL 1 4
Exps(0): at 3 dest 6 neg 1 (cityListSize < 10) cpd -1
Stored at endif list: <6>
What do you mean by dependent? (btw. use 0 as the first number in your LDS)
Great information, I put everything into a debug file so I can look at the relevant information and see what's there. What I don't see though is where the crash occurred.
It spewed out a whole bunch of lines and then finished with the following on the screen
Code:---------------------------------------------- 5 LOADK 0 3 next bool: 1 locals(1): 0{l_11_0} vpend(0): tpend(1): 0{l_11_0} () -- DECOMPILER ERROR: Overwrote pending register. Missing locals? Creating them local l_11_0 = "" ---------------------------------------------- 6 GETGLOBAL 1 4 Exps(0): at 3 dest 6 neg 1 (cityListSize < 10) cpd -1 Stored at endif list: <6>
I think it's referring to function 5, but I'm not sure. Also, I got the same output with and without a 0 as the first LDS number.
Could you explain a little more, about how to add th numbers in the locals (that's what LDS is right?). I don't understand yet. As for the script, when I change the red values in the script it changes landscape size as well as portrait size. In that way dependent, and now I'm wondering how to change the landscape independently, so I hoped any of the more experienced scripters would know what I'm doing wrong, 12
SetSomeValues
if Portrait then
SetSomeValuesForPortrait
else if Landscape
SetSomeValuesForLandscape
end
Album_ScreenRotation.OnScreenRotation = function(l_2_0)
if _application.Orientation == ScreenOrientation_Portrait then
trace("Album_ScreenRotation_Portrait")
Camera2DBegin.Viewport.value = RectF(0, 0, 640, 480 - 2 * 50)
Camera2DBegin.ViewLeft.value = 0
Camera2DBegin.ViewRight.value = 640
Camera2DBegin.ViewTop.value = 0
Camera2DBegin.ViewButtom.value = -(480 - 2 * 50)
Listview3DCamera.Viewport.value = RectF(0, 0, 480, 640 - 2 * 50)
Listview3DCamera.ViewLeft.value = 0
Listview3DCamera.ViewRight.value = 480
Listview3DCamera.ViewTop.value = 0
Listview3DCamera.ViewButtom.value = 640 - 2 * 50
Listview3DCamera.CameraPosition.value = Vector3(0, 50, 415)
ControlPanel2D.Position.x = 0
ControlPanel2D.Position.y = 0
ArrowGroups.Position.y = -322
KeyUpSprit.Position.y = 60
KeyUpSprit.Size.height = 130
InitPortraitConstant()
elseif _application.Orientation == ScreenOrientation_Landscape then
trace("Album_ScreenRotation_Landscape")
Camera2DBegin.Viewport.value = RectF(0, 0, 640, 480 - 2 * 50)
Camera2DBegin.ViewLeft.value = 0
Camera2DBegin.ViewRight.value = 640
Camera2DBegin.ViewTop.value = 0
Camera2DBegin.ViewButtom.value = -(480 - 2 * 50)
Listview3DCamera.Viewport.value = RectF(0, 0, 480, 640 - 2 * 50)
Listview3DCamera.ViewLeft.value = 0
Listview3DCamera.ViewRight.value = 480
Listview3DCamera.ViewTop.value = 0
Listview3DCamera.ViewButtom.value = 640 - 2 * 50
Listview3DCamera.CameraPosition.value = Vector3(0, 50, 224)
ControlPanel2D.Position.x = 307
ControlPanel2D.Position.y = SystemTitlebarHeight
ArrowGroups.Position.y = -272
KeyUpSprit.Position.y = 10
KeyUpSprit.Size.height = 80
RightBound = 539
PanoramaWidth = 344
PanoramaHeight = 120
PanoramaVWidth = 108
PanoramaVHeight = 176
PortraitWidth = 132
PortraitHeight = 176
LandscapeWidth = 200
LandscapeHeight = 150
WideLandscapeWidth = 250
WideLandscapeHeight = 150
ParaOff = 0
LOff = -5
WLOff = 0
POff = -7
VParaOff = -7
PhotoHitTarget.Position.x = 212
PhotoHitTarget.Position.y = -36
PhotoHitTarget.Size.width = 360
PhotoHitTarget.Size.height = 300
end
end
That code looks like:
Code:SetSomeValues if Portrait then SetSomeValuesForPortrait else if Landscape SetSomeValuesForLandscape end
what you want to change is in the "SetSomeValues" section. You have to put in both of the "SetSomeValuesForPortrait" and "SetSomeValuesForLandscape" and than change them there:
trace("Album Landscape")
require("Common\\LayoutInfo")
_LayoutInfo = LayoutInfo()
Album_ScreenRotation = class(RotationTemplate)
local l_0_0 = Album_ScreenRotation
l_0_0.__init = function(l_1_0, l_1_1)
l_1_0._ResetLayoutCallback = l_1_1
trace("Album_ScreenRotation:__init later")
RotationTemplate.__init(l_1_0)
end
l_0_0 = Album_ScreenRotation
l_0_0.OnScreenRotation = function(l_2_0)
Camera2DBegin.Viewport.value = RectF(0, 0, screenWidth, screenHeight - 2 * SystemTitlebarHeight)
Camera2DBegin.ViewLeft.value = 0
Camera2DBegin.ViewRight.value = screenWidth
Camera2DBegin.ViewTop.value = 0
Camera2DBegin.ViewButtom.value = -(screenHeight - 2 * SystemTitlebarHeight)
if _application.Orientation == ScreenOrientation_Landscape then
trace("Album_ScreenRotation_Landscape")
[COLOR="Red"]Listview3DCamera.CameraPosition.value = Vector3(0, 50, 224)[/COLOR]
ControlPanel2D.Position.x = 307
ControlPanel2D.Position.y = SystemTitlebarHeight
ArrowGroups.Position.y = -272
KeyUpSprit.Position.y = 10
KeyUpSprit.Size.height = 80
RightBound = 674
No, unfortunately the debug output of luadec doesn't write out the function number. only the opcode number (should fix that). The opcode number it crashed was 6 (it's the number before GETGLOBAL). For the function number, you have to turn back before the 1st opcode, where you find something like this: "121 CLOSURE", which means this function was defined at the 121th opcode in the main body. Now look ad the luadisasm'd output, where you find at the 121th opcode which function this was (0 based, so the 1st function will be Function #0... luadec is 1st based, so the first function will be #1 just to confuse everyone )
After that you'll want to only decompile this particular function. For example if this was the 5th function, then write for example
luadec -f 5 -l ;;;;;0,0,5 lua.luac
(as you see I've put 5 semicolons before the first number). You always have to put as many 0's as parameters the function have, then a number for each opcode where a local is defined as the appropriate register.
Main Block
Parameters: 0
Last relevant lines:
379 [-]: CLOSURE R0 49 ; R0 := closure(Function #49)
380 [-]: SETGLOBAL R0 K171 ; OnMenuExit := R0
Last register: 0
Register assignment dump:
R0: 0,1,4,7,10,13,15,18,22,24,26,28,30,32,34,36,38,40,42,44,46,48,51,53,55,57,59,61,63,65,67,69,71,75,80,84,87,89,91,94,97,100,102,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,172,182,192,195,198,201,203,205,207,209,212,214,216,219,223,226,231,233,240,242,245,247,249,255,258,262,265,268,271,273,275,277,279,281,283,285,287,289,292,294,300,304,308,310,316,320,323,327,329,333,335,339
R1: 0,2,5,8,11,85,92,95,98,103,196,199,215,224,227,234,237,266,269,305,321,324,330,336
R2: 0,20,77,82,174
R3: 0,21,175,178
R4: 0,179,189,230,298,314
R5: 0,177,187
So when I look for the line similar to the "121 closure" is this in the output of the luadec or luadecguess? I couldn't find anything like that at the begining of the luadec output, but found this at the begining of the luadecguess output,
Code:Main Block Parameters: 0 Last relevant lines: 379 [-]: CLOSURE R0 49 ; R0 := closure(Function #49) 380 [-]: SETGLOBAL R0 K171 ; OnMenuExit := R0 Last register: 0 Register assignment dump: R0: 0,1,4,7,10,13,15,18,22,24,26,28,30,32,34,36,38,40,42,44,46,48,51,53,55,57,59,61,63,65,67,69,71,75,80,84,87,89,91,94,97,100,102,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,172,182,192,195,198,201,203,205,207,209,212,214,216,219,223,226,231,233,240,242,245,247,249,255,258,262,265,268,271,273,275,277,279,281,283,285,287,289,292,294,300,304,308,310,316,320,323,327,329,333,335,339 R1: 0,2,5,8,11,85,92,95,98,103,196,199,215,224,227,234,237,266,269,305,321,324,330,336 R2: 0,20,77,82,174 R3: 0,21,175,178 R4: 0,179,189,230,298,314 R5: 0,177,187
I still haven't been able to figure out where this is actually referring too. I see similar situation in other lua files. But in each case, I've been unable to locate where or what it's actually trying to do.
<PageGroup Name="settings">
(...)
<PageGroup Name="updatesanddata">
<Page Order="0" Name="updatesanddata.page" PackageName="HTC" Title="[[IDS_UPDATESANDDATA]]" Default="true" >
<ComponentReference Name="page" Mode9Path="HTC\settings.mode9" Component="UpdatesAndDataPageComponent" SmartComponent="true" />
</Page>
</PageGroup>
(...)
</PageGroup>