flat assembler
Message board for the users of flat assembler.

Index > Non-x86 architectures > FASMARM v1.44 - Cross assembler for ARM CPUs

Goto page Previous  1, 2, 3 ... 20, 21, 22 ... 31, 32, 33  Next
Author
Thread Post new topic Reply to topic
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 30 Jul 2011, 19:13
den_po wrote:
Code:
format ELF dwarf executable
nop    

it fails when i add 10 or more bytes to any place before include '..\armv7.inc'. try to add 10 characters to copyright string.
I assume you are talking about editing FASMARM.ASM file? If so then I am not seeing your problem:
Code:
C:\Documents and Settings\We are the Borg\Our Documents>fasm FASMARMtest.ASM
flat assembler  version 1.69.25  (88423 kilobytes memory)
5 passes, 0.2 seconds, 181248 bytes.

C:\Documents and Settings\We are the Borg\Our Documents>FASMARMtest.EXE testdp.asm
flat assembler for ARM 1234567890 version 1.69.25  (88420 kilobytes memory)
4 passes, 752 bytes.

C:\Documents and Settings\We are the Borg\Our Documents>type testdp.asm
format ELF dwarf executable
nop
C:\Documents and Settings\We are the Borg\Our Documents>    
I added 10 characters to the logo string. I can add more characters also without any problem.

Please clarify your problem with the exact changes you have made to all files.
Post 30 Jul 2011, 19:13
View user's profile Send private message Visit poster's website Reply with quote
den_po



Joined: 17 Jul 2006
Posts: 23
Location: Russia, Cheboksary
den_po 30 Jul 2011, 19:45
ok, the problem occurs in windows 7 and not in winxp

edit:
patch finish_elf_segment, <<mov ebx,[number_of_sections]>>, <jmp ARM_finish_elf_segment,nop>, 0

fixup table contains an item for original command and it shouldn't be placed there for the new one.

3441 Offset: 0000B441 Type: HighLow

40B43F: E906150000 1jmp .00040C94A
40B444: 90 nop
Post 30 Jul 2011, 19:45
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
den_po



Joined: 17 Jul 2006
Posts: 23
Location: Russia, Cheboksary
den_po 30 Jul 2011, 21:03
solution:
Code:
        patch finish_elf_segment, <<mov ebx,[number_of_sections]>,dec ebx>, <nop, push ARM_finish_elf_segment,ret>, 0

 finish_elf_exe_patch_length     = 7
 macro finish_elf_exe_patch_code 
    {
              mov ebx,[number_of_sections]
                dec ebx
     }
    
Post 30 Jul 2011, 21:03
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 31 Jul 2011, 03:34
Version 1.23 now available:
Quote:
v1.23 2011-Jul-31
  • Fixed a bug with relocations corrupting patch code
Thanks to den_po for identifying the problem and the solution.
Post 31 Jul 2011, 03:34
View user's profile Send private message Visit poster's website Reply with quote
Dex4u



Joined: 08 Feb 2005
Posts: 1601
Location: web
Dex4u 17 Sep 2011, 21:27
This as good info on using Arm asm on a Android phone.
http://www.eggwall.com/2011/09/android-arm-assembly-device-set-up-part.html
Post 17 Sep 2011, 21:27
View user's profile Send private message Reply with quote
asmhack



Joined: 01 Feb 2008
Posts: 431
asmhack 17 Sep 2011, 23:23
Windows 8 will have ARM support.
Revolution, how you got involed btw to all this ARM stuff ?
Doesn't seems like just a hobby project.
Post 17 Sep 2011, 23:23
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 18 Sep 2011, 02:51
asmhack wrote:
Revolution, how you got involed btw to all this ARM stuff ?
Doesn't seems like just a hobby project.
It has always been a personal interest of mine to build small CPU boards for various things. Later it evolved into building high-performance and low-power computing platforms (with ARM of course, x86 can't do it) in my job. But fasmarm is 100% my personal project. I now use it in my job but it has never been my job to write or update it. I have never received any remuneration of any kind for fasmarm. I will never ask for donations. I will never post advertisements on the webpage. It will be free forever.
Post 18 Sep 2011, 02:51
View user's profile Send private message Visit poster's website Reply with quote
ndt



Joined: 18 Sep 2011
Posts: 5
ndt 23 Sep 2011, 18:05
Code:
ldr r0, [test]
bx lr

align 4
test dw 0xdeadbeef
    

ok

Code:
ldr r0, [=0xdeadbeef] ; or [=test]
bx lr

align 4

test dw 0xdeadbeef
    


fasmarm crashes
Post 23 Sep 2011, 18:05
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 29 Sep 2011, 15:30
Thanks for the report.

Of course, the syntax with = is not a valid form so even if it doesn't crash it should just generate an error message.

I will look into it later next month when I am back at my desk.
Post 29 Sep 2011, 15:30
View user's profile Send private message Visit poster's website Reply with quote
ndt



Joined: 18 Sep 2011
Posts: 5
ndt 25 Oct 2011, 18:59
im stuck - what about endianness on ARMv4T?
for my arm7tdmi based phone
Code:
;For ARM7TDMI CPUs:
processor 0xfe
coprocessor 0x0

CODE16
nop    

fasmarm generate C0 46 bytes but my devices require big endian - 46 C0...[/b]
Post 25 Oct 2011, 18:59
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 25 Oct 2011, 19:05
ndt: What is your device?

From what has been documented for all ARM CPUs to date the code is always required to be in little endian format. I seriously doubt that your ARM device really does need big endian.

Perhaps you can check again for some other reason why it might not be working for you. Remember that to use THUMB code you have to make a branch with the lowest bit of PC set to switch to THUMB mode.
Post 25 Oct 2011, 19:05
View user's profile Send private message Visit poster's website Reply with quote
ndt



Joined: 18 Sep 2011
Posts: 5
ndt 25 Oct 2011, 19:09
it's nokia dct-3 based phone - 3310 alike. Nokia FW's code and data is big endian - i usually use gnu as (with be option) but fasmarm would be much better for patches
Post 25 Oct 2011, 19:09
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 25 Oct 2011, 19:24
ndt: I posted some instructions for how to modify fasmarm to generate BE code in this thread (here).

ndt: Is it possible that the programming hardware/software for your phone is doing a BE-to-LE conversion on the fly before programming the ROM/FLASH/whatever? I ask because the CPU will always need to see LE code, there is no ARM CPU made that can run BE code.
Post 25 Oct 2011, 19:24
View user's profile Send private message Visit poster's website Reply with quote
ndt



Joined: 18 Sep 2011
Posts: 5
ndt 25 Oct 2011, 19:37
thanks for the workaround, thanks!

as I said nokia firmware which i want to patch is in BE format so hacking should be BE too Smile

gas with -mbig-endian option just work fine

according to http://nokix.sourceforge.net/help/blacksphere/sub_100hardware/sub_arm/sub_gcc.htm boot ROM code is BE itself. maybe it's somethig specific to flash memory used...
Post 25 Oct 2011, 19:37
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 25 Oct 2011, 19:49
Well it appears as though this is the reason (assuming I understand that site correctly):
Code:
60                 LDRB    R0, [R7,#0x1A]
62                 LSL     R3, R0, #8      ; store in R3, upper halfword
64
64 loc_64                                  ; CODE XREF: sub_58+10j
64                 BL      sub_70
68                 BEQ     loc_64          ; wait for another byte available
6A                 LDRB    R0, [R7,#0x1A]
6C                 ADD     R0, R3, R0      ; store in R0, lower halfword    
Notice that the booter reads the high byte first and then the low byte. It is doing on-the-fly BE-to-LE conversion at boot up.
Post 25 Oct 2011, 19:49
View user's profile Send private message Visit poster's website Reply with quote
ndt



Joined: 18 Sep 2011
Posts: 5
ndt 25 Oct 2011, 21:07
yes, you're right. And as it's read only i will modify fasmarm for my own purposes as you posted above.

thanks for your help
Post 25 Oct 2011, 21:07
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 28 Oct 2011, 02:28
http://www.arm.com/files/downloads/ARMv8_Architecture.pdf

No actual details as yet, just an overview.

Looks a lot like more the x86-64 than ever before. 64 bit is a new operating mode that can only be switched on/off by an exception. 48 bit physical addressing. 31 GPRs. AES and SHA crypto instructions. Hypervisor to support multiple OSes. Seems that ARM have been reading the Intel and AMD manuals and starting to copy some of the things they liked the look of.
Post 28 Oct 2011, 02:28
View user's profile Send private message Visit poster's website Reply with quote
Alphonso



Joined: 16 Jan 2007
Posts: 295
Alphonso 28 Oct 2011, 09:49
What's happening with W8 and ARM?
Post 28 Oct 2011, 09:49
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 28 Oct 2011, 16:03
Alphonso wrote:
What's happening with W8 and ARM?
I wonder if it will include a translation layer to run x86 programs? I'm guessing that keeping compatibility with the bajillion existing x86 applications will be quite an important criterion?
Post 28 Oct 2011, 16:03
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 19869
Location: In your JS exploiting you and your system
revolution 29 Oct 2011, 07:20
ndt wrote:
Code:
ldr r0, [test]
bx lr

align 4
test dw 0xdeadbeef
    

ok

Code:
ldr r0, [=0xdeadbeef] ; or [=test]
bx lr

align 4

test dw 0xdeadbeef
    


fasmarm crashes
This is now fixed:

Version 1.24 now available:
Quote:
v1.24 2011-Oct-29
  • Fixed a bug with crashes during expression parsing
Post 29 Oct 2011, 07:20
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3 ... 20, 21, 22 ... 31, 32, 33  Next

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.