[UTILITY] Lua 5.1 tools: compiler, decompiler, snippets & extendable lua.dll with SDK

Search This thread

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
877
Edinburgh
sztupy.hu
That's it! That's the only error I get. Here's the file:confused:

:D:D:D:D

I just found out that I'm working on 09a70371_manila.luac at the moment too :)

Code:
-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;;

but it might crash older luadec (the latest one I didn't upload yet)

btw If that's the only error you get then there might be some path errors...
 

12aon

Retired Senior Moderator
Mar 24, 2008
2,437
483

Thanks hombre, I'm helping xboxmod a bit with resizing the TP2 manila, but that guy is a machine he had already resized the weather tab when I last talked to him (I needed it decompiled for that :)). But you are really pioneering all this man. We are going to love you for phone generations to come, 12
 

smotrs

Senior Member
Nov 16, 2008
632
0
So. Calif.
Would one of you with the TP2 files post the 27a13690_manila file for me? or PM me where the ROM is and I can extract it. I've been trying to find where the ROM is and haven't had any luck finding it.
 

12aon

Retired Senior Moderator
Mar 24, 2008
2,437
483
Sure hombre, why do you need it?
 

Attachments

  • 27a13690_manila.zip
    13.3 KB · Views: 7

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
877
Edinburgh
sztupy.hu
LuaDec 0.6

Hi!

Don't worry about me being slower, I am going from the hardest scripts to the easier ones now. 251 done. New additions:
  1. Weather
  2. CalendarPicker
  3. stock_quote
  4. WorldClock/ClockView
  5. People/peopleDetail
  6. Messaging
  7. Internetportal

Also there is LuaDec 0.6

  • Less crashing when encountering booleans
  • New luadecguess with "fast guess" mode
  • More happy faces :)

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.
 

Attachments

  • touchpro2_manila3d_declua.zip
    533.8 KB · Views: 164

smotrs

Senior Member
Nov 16, 2008
632
0
So. Calif.
Hi!

Don't worry about me being slower, I am going from the hardest scripts to the easier ones now. 251 done. New additions:

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. :D
 

12aon

Retired Senior Moderator
Mar 24, 2008
2,437
483
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)[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

Now the code in red is the only code that seems to make a difference but when I change to code it automatically changes portrait as well as landscape. The question is can this be separated or the there a factor somewhere that give the information on how these two rely on one another? 12
 
Last edited:

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
877
Edinburgh
sztupy.hu
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

What do you mean by dependent? (btw. use 0 as the first number in your LDS)
 

smotrs

Senior Member
Nov 16, 2008
632
0
So. Calif.
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.

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.
 

12aon

Retired Senior Moderator
Mar 24, 2008
2,437
483
What do you mean by dependent? (btw. use 0 as the first number in your LDS)

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
 

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
877
Edinburgh
sztupy.hu
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.

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.
 

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
877
Edinburgh
sztupy.hu
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

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:

Code:
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
 

12aon

Retired Senior Moderator
Mar 24, 2008
2,437
483
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:

In my case I should change the l_0_0 and l_1_0 etc right? You added an entire landscape function set that the original didn't have, that's because it's an example or is this the actual code I should use?

Code:
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)

Xboxmod found a way to edit landscape by editing landscape by editing the red line in the script, so I might fool around with that a bit too. Thanks for the info. Are getting the decompile sickness yet :), 12

Code:
      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
 

smotrs

Senior Member
Nov 16, 2008
632
0
So. Calif.
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.

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
 

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
877
Edinburgh
sztupy.hu
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

you have to disassemble it using luadisasm :)
 

sztupy

Inactive Recognized Developer
Dec 21, 2008
1,061
877
Edinburgh
sztupy.hu
Here are the additions for today:

  • 1 embedded script from home.mode9
  • 1 embedded script from settings.mode9
  • 1 embedded script from musicsonglist.mode9
  • stock_sublayer
  • people/peoplecallhistoryglobal
  • people/peopleupdatepage
  • people/peopleupdateviewpage

enjoy.
 

Attachments

  • touchpro2_manila3d_declua.zip
    607.2 KB · Views: 30

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    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. :confused:

    They are dialogs (as their name suggests). They are defined in manila.xml (26948339_manila). They seem to be like some kind of "embedded mode9" files

    Example:
    Code:
    <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>