D
Deleted member 308010
Guest
@kralle
lese und verstehe..
lese und verstehe..
std__operator___std__char_traits_char_(std__cout, "Please enter the code: \n");
v1 = std__basic_ios_char_std__char_traits_char____widen((_DWORD)
std__cin + (_DWORD)*(&std__cin + 1), 10);
std__getline_char_std__char_traits_char__std__allocator_char_(v1);
v0 = (int *)&v13;
if ( v15 >= 0x10 )
v0 = v13;
v2 = 5;
if ( v14 < 5 )
v2 = v14;
if ( !v2 )
goto LABEL_21;
v3 = (int)"82634";
v5 = (unsigned int)v2 < 4;
v4 = v2 - 4;
if ( v5 )
{
LABEL_10:
if ( v4 == -4 )
goto LABEL_19;
}
else
{
while ( *v0 == *(_DWORD *)v3 )
{
++v0;
v3 += 4;
v6 = (unsigned int)v4 < 4;
v4 -= 4;
if ( v6 )
goto LABEL_10;
}
}
v7 = *(_BYTE *)v0 < *(_BYTE *)v3;
if ( *(_BYTE *)v0 != *(_BYTE *)v3
|| v4 != -3
&& ((v8 = *((_BYTE *)v0 + 1), v7 = v8 < *(_BYTE *)(v3 + 1), v8 != *(_BYTE *)(v3 + 1))
|| v4 != -2
&& ((v9 = *((_BYTE *)v0 + 2), v7 = v9 < *(_BYTE *)(v3 + 2), v9 != *(_BYTE *)(v3 + 2))
|| v4 != -1 && (v10 = *((_BYTE *)v0 + 3), v7 = v10 < *(_BYTE *)(v3 + 3),
v10 != *(_BYTE *)(v3 + 3)))) )
{
v11 = -v7 | 1;
goto LABEL_20;
}
LABEL_19:
v11 = 0;
LABEL_20:
if ( v11 )
goto LABEL_23;
LABEL_21:
if ( v14 >= 5 && v14 == 5 )
break;
LABEL_23:
std__operator___std__char_traits_char_(std__cout, "\nTry again.\n");
}
std__operator___std__char_traits_char_(std__cout, "Code accepted");
result = std__basic_istream_char_std__char_traits_char____operator__(std__cin, &v16);
if ( v15 >= 0x10 )
result = operator delete(v13);
return result;
}
$ gdb -q ./a.out
Reading symbols from ./a.out...(no debugging symbols found)...done.
(gdb) info functions
All defined functions:
Non-debugging symbols:
0x00000000004003a8 _init
0x00000000004003e0 __libc_start_main@plt
0x00000000004003f0 __gmon_start__@plt
0x0000000000400400 _start
0x0000000000400430 deregister_tm_clones
0x0000000000400460 register_tm_clones
0x00000000004004a0 __do_global_dtors_aux
0x00000000004004c0 frame_dummy
0x00000000004004f0 fce
0x00000000004004fb main
0x0000000000400510 __libc_csu_init
0x0000000000400580 __libc_csu_fini
0x0000000000400584 _fini
(gdb) disassemble main
Dump of assembler code for function main:
0x00000000004004fb <+0>: push %rbp
0x00000000004004fc <+1>: mov %rsp,%rbp
0x00000000004004ff <+4>: sub $0x10,%rsp
0x0000000000400503 <+8>: callq 0x4004f0 <fce>
0x0000000000400508 <+13>: mov %eax,-0x4(%rbp)
0x000000000040050b <+16>: mov -0x4(%rbp),%eax
0x000000000040050e <+19>: leaveq
0x000000000040050f <+20>: retq
End of assembler dump.
(gdb) disassemble fce
Dump of assembler code for function fce:
0x00000000004004f0 <+0>: push %rbp
0x00000000004004f1 <+1>: mov %rsp,%rbp
0x00000000004004f4 <+4>: mov $0x2a,%eax
0x00000000004004f9 <+9>: pop %rbp
0x00000000004004fa <+10>: retq
End of assembler dump.
(gdb)
(from /lib/x86_64-linux-gnu/libc.so.6)
; Filling space: 0FH
; Filler type: Multi-byte NOP
; db 0FH, 1FH, 44H, 00H, 00H, 66H, 2EH, 0FH
; db 1FH, 84H, 00H, 00H, 00H, 00H, 00H
ALIGN 16
foo: ; Function begin
cmp rdi, 1 ; 00400620 _ 48: 83. FF, 01
jbe ?_026 ; 00400624 _ 0F 86, 00000084
mov r11d, 1 ; 0040062A _ 41: BB, 00000001
?_020: mov r8, r11 ; 00400630 _ 4D: 89. D8
imul r8, r11 ; 00400633 _ 4D: 0F AF. C3
add r8, rdi ; 00400637 _ 49: 01. F8
cmp r8, 3 ; 0040063A _ 49: 83. F8, 03
jbe ?_029 ; 0040063E _ 0F 86, 00000097
mov esi, 1 ; 00400644 _ BE, 00000001
; Filling space: 7H
; Filler type: Multi-byte NOP
; db 0FH, 1FH, 80H, 00H, 00H, 00H, 00H
ALIGN 8
?_021: add rsi, rsi ; 00400650 _ 48: 01. F6
mov rax, rsi ; 00400653 _ 48: 89. F0
imul rax, rsi ; 00400656 _ 48: 0F AF. C6
shl rax, 2 ; 0040065A _ 48: C1. E0, 02
cmp r8, rax ; 0040065E _ 49: 39. C0
jnc ?_021 ; 00400661 _ 73, ED
lea rcx, [rsi+rsi] ; 00400663 _ 48: 8D. 0C 36
SECTION .plt align=16 execute ; section number 11, code
?_00001:; Local function
push qword [rel ?_37996] ; 0001F420 _ FF. 35, 003A4BE2(rel)
jmp near [rel ?_37997] ; 0001F426 _ FF. 25, 003A4BE4(rel)
...
ALIGN 8
?_00002:jmp near [rel ?_37998] ; 0001F430 _ FF. 25, 003A4BE2(rel)
; Note: Immediate operand could be made smaller by sign extension
push 11 ; 0001F436 _ 68, 0000000B
; Note: Immediate operand could be made smaller by sign extension
jmp ?_00001 ; 0001F43B _ E9, FFFFFFE0
v1 = std__basic_ios_char_std__char_traits_char____widen((_DWORD)
std__cin + (_DWORD)*(&std__cin + 1), 10);
std__getline_char_std__char_traits_char__std__allocator_char_(v1);
v0 = (int *)&v13;
if ( v15 >= 0x10 )
v0 = v13;
v2 = 5;
if ( v14 < 5 )
v2 = v14;
if ( !v2 )
goto LABEL_21;
v3 = (int)"82634";
v5 = (unsigned int)v2 < 4;
v4 = v2 - 4;
if ( v5 )
{
LABEL_10:
if ( v4 == -4 )
goto LABEL_19;
}
else
{
while ( *v0 == *(_DWORD *)v3 )
{
++v0;
v3 += 4;
v6 = (unsigned int)v4 < 4;
v4 -= 4;
if ( v6 )
goto LABEL_10;
}
}
v7 = *(_BYTE *)v0 < *(_BYTE *)v3;
if ( *(_BYTE *)v0 != *(_BYTE *)v3
|| v4 != -3
&& ((v8 = *((_BYTE *)v0 + 1), v7 = v8 < *(_BYTE *)(v3 + 1), v8 != *(_BYTE *)(v3 + 1))
|| v4 != -2
&& ((v9 = *((_BYTE *)v0 + 2), v7 = v9 < *(_BYTE *)(v3 + 2), v9 != *(_BYTE *)(v3 + 2))
|| v4 != -1 && (v10 = *((_BYTE *)v0 + 3), v7 = v10 < *(_BYTE *)(v3 + 3),
v10 != *(_BYTE *)(v3 + 3)))) )
{
v11 = -v7 | 1;
goto LABEL_20;
}
LABEL_19:
v11 = 0;
LABEL_20:
if ( v11 )
goto LABEL_23;
LABEL_21:
if ( v14 >= 5 && v14 == 5 )
break;
LABEL_23:
std__operator___std__char_traits_char_(std__cout, "\nTry again.\n");
}
std__operator___std__char_traits_char_(std__cout, "Code accepted");
result = std__basic_istream_char_std__char_traits_char____operator__(std__cin, &v16);
if ( v15 >= 0x10 )
result = operator delete(v13);
return result;
}
$ gdb -q ./a.out
Reading symbols from ./a.out...(no debugging symbols found)...done.
(gdb) info functions
All defined functions:
Non-debugging symbols:
0x00000000004003a8 _init
0x00000000004003e0 __libc_start_main@plt
0x00000000004003f0 __gmon_start__@plt
0x0000000000400400 _start
0x0000000000400430 deregister_tm_clones
0x0000000000400460 register_tm_clones
0x00000000004004a0 __do_global_dtors_aux
0x00000000004004c0 frame_dummy
0x00000000004004f0 fce
0x00000000004004fb main
0x0000000000400510 __libc_csu_init
0x0000000000400580 __libc_csu_fini
0x0000000000400584 _fini
(gdb) disassemble main
Dump of assembler code for function main:
0x00000000004004fb <+0>: push %rbp
0x00000000004004fc <+1>: mov %rsp,%rbp
0x00000000004004ff <+4>: sub $0x10,%rsp
0x0000000000400503 <+8>: callq 0x4004f0 <fce>
0x0000000000400508 <+13>: mov %eax,-0x4(%rbp)
0x000000000040050b <+16>: mov -0x4(%rbp),%eax
0x000000000040050e <+19>: leaveq
0x000000000040050f <+20>: retq
End of assembler dump.
(gdb) disassemble fce
Dump of assembler code for function fce:
0x00000000004004f0 <+0>: push %rbp
0x00000000004004f1 <+1>: mov %rsp,%rbp
0x00000000004004f4 <+4>: mov $0x2a,%eax
0x00000000004004f9 <+9>: pop %rbp
0x00000000004004fa <+10>: retq
End of assembler dump.
(gdb)
(from /lib/x86_64-linux-gnu/libc.so.6)
; Filling space: 0FH
; Filler type: Multi-byte NOP
; db 0FH, 1FH, 44H, 00H, 00H, 66H, 2EH, 0FH
; db 1FH, 84H, 00H, 00H, 00H, 00H, 00H
ALIGN 16
foo: ; Function begin
cmp rdi, 1 ; 00400620 _ 48: 83. FF, 01
jbe ?_026 ; 00400624 _ 0F 86, 00000084
mov r11d, 1 ; 0040062A _ 41: BB, 00000001
?_020: mov r8, r11 ; 00400630 _ 4D: 89. D8
imul r8, r11 ; 00400633 _ 4D: 0F AF. C3
add r8, rdi ; 00400637 _ 49: 01. F8
cmp r8, 3 ; 0040063A _ 49: 83. F8, 03
jbe ?_029 ; 0040063E _ 0F 86, 00000097
mov esi, 1 ; 00400644 _ BE, 00000001
; Filling space: 7H
; Filler type: Multi-byte NOP
; db 0FH, 1FH, 80H, 00H, 00H, 00H, 00H
ALIGN 8
?_021: add rsi, rsi ; 00400650 _ 48: 01. F6
mov rax, rsi ; 00400653 _ 48: 89. F0
imul rax, rsi ; 00400656 _ 48: 0F AF. C6
shl rax, 2 ; 0040065A _ 48: C1. E0, 02
cmp r8, rax ; 0040065E _ 49: 39. C0
jnc ?_021 ; 00400661 _ 73, ED
lea rcx, [rsi+rsi] ; 00400663 _ 48: 8D. 0C 36
SECTION .plt align=16 execute ; section number 11, code
?_00001:; Local function
push qword [rel ?_37996] ; 0001F420 _ FF. 35, 003A4BE2(rel)
jmp near [rel ?_37997] ; 0001F426 _ FF. 25, 003A4BE4(rel)
...
ALIGN 8
?_00002:jmp near [rel ?_37998] ; 0001F430 _ FF. 25, 003A4BE2(rel)
; Note: Immediate operand could be made smaller by sign extension
push 11 ; 0001F436 _ 68, 0000000B
; Note: Immediate operand could be made smaller by sign extension
jmp ?_00001 ; 0001F43B _ E9, FFFFFFE0