rebible
May 5th, 2012, 21:48
I am trying to find the offset of some code. I can see the output string tables that the compiler left. How do C compilers normally access the strings.
thanks
robert
thanks
robert
View Full Version : How are C strings accessed???
.rdata:10042334 aComments db 'comments',0 ; DATA XREF: sub_100049AA+CDo
.rdata:1004233D align 10h
.rdata:10042340 aAProgramForDra db 'A program for drawing structured diagrams.',0
.rdata:10042340 ; DATA XREF: sub_100049AA+BFo
.rdata:1004236B align 4
.rdata:10042330 44 69 61 00 63 6F 6D 6D 65 6E 74 73 00 00 00 00 Dia.comments....
.rdata:10042340 41 20 70 72 6F 67 72 61 6D 20 66 6F 72 20 64 72 A program for dr
.rdata:10042350 61 77 69 6E 67 20 73 74 72 75 63 74 75 72 65 64 awing structured
.rdata:10042360 20 64 69 61 67 72 61 6D 73 2E 00 00 63 6F 70 79 diagrams...copy
.text:10004A3C push offset aTranslatorCred ; "translator-credits"
.text:10004A41 push offset off_1005F3D0
.text:10004A46 push offset aDocumenters ; "documenters"
.text:10004A4B push offset off_1005F330
.text:10004A50 push offset aAuthors ; "authors"
.text:10004A55 push offset aHttpLive_gnome ; "http://live.gnome.org/Dia"
.text:10004A5A push offset aWebsite ; "website"
.text:10004A5F push offset aC19982009TheFr ; "(C) 1998-2009 The Free Software Foundat"...
.text:10004A64 push offset aCopyright ; "copyright"
.text:10004A69 push offset aAProgramForDra ; "A program for drawing structured diagra"...
.text:10004A6E call libintl_gettext
.text:10004A73 add esp, 4
.text:10004A76 push eax
.text:10004A77 push offset aComments ; "comments"
.text:10004A7C push offset a0_97_2 ; "0.97.2"
.text:10004A81 push offset aVersion ; "version"
.text:10004A86 push offset aDia_0 ; "Dia"
.text:10004A8B push offset aName ; "name"
.text:10004A90 mov ecx, [ebp+var_C]
.text:10004A93 push ecx
.text:10004A94 push offset aLogo ; "logo"
.text:10004A99 push 0
.text:10004A9B call gtk_show_about_dialog
.text:10004A60 78 23 04 10 68 6C 23 04 10 68 40 23 04 10 E8 65 x#hl#h@#Fe
.text:10004A70 AA 03 00 83 C4 04 50 68 34 23 04 10 68 CC 19 04 ¬.â-Ph4#h¦
68 40 23 04 10
[Originally Posted by TBone;92544]Starting at address 0x1004A69 we have this instruction: Code:
The first byte (0x68) is an x86 opcode that means to push a 4-byte value on the stack. The following 4 bytes are the data pushed onto the stack. The contain the address: 0x10042340 (Intel is big-endian). |
The string starts at virtual address 0x10032340. |