flat assembler
Message board for the users of flat assembler.

Index > Main > what's wrong with relative jump?

Author
Thread Post new topic Reply to topic
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 21 Dec 2005, 06:07
here is a part of code (proc/endp)
Code:
@@:    
    push 0
    push edx
    invoke GetPrivateProfileInt,[ebx + S_CH.sect],\
             [ebx + S_CH.var],[ebx + S_CH.default],[ecx]
    and [esp],eax
    invoke SendMessage,[ebx + S_CH.hWnd],edi
    jmp .next    

.check:
    mov edx,1
    mov edi,BM_SETCHECK
    mov ecx,[ebx + S_CH.ini]
    test ecx,ecx
    jne @B
    mov eax,[S_CH.default]
    jmp .r_noini
    

this is from olly (starts from .check:):
Code:
004011F5   > BA 01000000    MOV EDX,1
004011FA   . BF F1000000    MOV EDI,0F1
004011FF   . 8B4B 10        MOV ECX,DWORD PTR DS:[EBX+10]
00401202   . 85C9           TEST ECX,ECX
00401204   .^75 C9          JNZ SHORT install.004011CF
00401206     A1             DB A1
00401207     1C             DB 1C
00401208     00             DB 00
00401209     00             DB 00
0040120A   . 00EB           ADD BL,CH
0040120C   . 55             PUSH EBP
0040120D   > 31C0           XOR EAX,EAX
0040120F   . 8945 FC        MOV DWORD PTR SS:[EBP-4],EAX
00401212   . 8B53 10        MOV EDX,DWORD PTR DS:[EBX+10]
00401215   . 8955 F8        MOV DWORD PTR SS:[EBP-8],EDX
00401218   . 85D2           TEST EDX,EDX
0040121A   . 74 18          JE SHORT install.00401234    

_________________
UNICODE forever!


Last edited by shoorick on 21 Dec 2005, 06:15; edited 1 time in total
Post 21 Dec 2005, 06:07
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 21 Dec 2005, 06:14
oh! just saw: it is not same. i tried move instructions here/there and use different registers, but got same result after jmp @B.
i'll update it.
Post 21 Dec 2005, 06:14
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 21 Dec 2005, 06:24
before was like this:
Code:
.check:
    mov edx,1
    mov edi,BM_SETCHECK
    jmp @B    

and everything was right. maybe it is because of distance?

while messing i found dramatically another way to make this part, but think this report will be interesting. thanks!
Post 21 Dec 2005, 06:24
View user's profile Send private message Visit poster's website Reply with quote
shoorick



Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 21 Dec 2005, 06:28
it seems i found error:
Code:
    mov eax,[S_CH.default]     

should be
Code:
    mov eax,[ebx + S_CH.default]     
Post 21 Dec 2005, 06:28
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:  


< 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.