asdasasdasd hpe this works and doesnt fuck everythign up
Merge branch 'master' of ssh://play.qtechofficial.com:9940/ZNG_Zombie-Not-GNU/zombie-core-utils
This commit is contained in:
commit
b5946dc338
8 changed files with 19 additions and 90 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "lib/zombie-lib"]
|
||||
path = lib/zombie-lib
|
||||
url = ssh://git@play.qtechofficial.com:9940/ZNG_Zombie-Not-GNU/zombie-lib.git
|
|
@ -1,5 +1,5 @@
|
|||
cmake_minimum_required(VERSION 3.14)
|
||||
project (yes)
|
||||
project (zombie-core-utils)
|
||||
|
||||
#set(CMAKE_ASM_NASM_LINK_EXECUTABLE ld)
|
||||
|
||||
|
@ -13,6 +13,7 @@ set(CMAKE_ASM_NASM_LINK_EXECUTABLE "gcc <CMAKE_ASM_NASM_LINK_FLAGS> <LINK_FLAGS>
|
|||
|
||||
add_compile_options(-g)
|
||||
|
||||
add_subdirectory(lib/zombie-lib)
|
||||
|
||||
add_link_options(-fno-pie -m64 -no-pie -pedantic-errors)
|
||||
|
||||
|
@ -21,4 +22,7 @@ add_executable(length length.asm)
|
|||
add_executable(yes yes.asm)
|
||||
add_executable(case case.asm)
|
||||
add_executable(diff diff.asm)
|
||||
#add_executable(3x+1 3x+1.asm)
|
||||
|
||||
target_link_libraries(length z)
|
||||
target_link_libraries(case z)
|
||||
target_link_libraries(diff z)
|
||||
|
|
5
case.asm
5
case.asm
|
@ -1,6 +1,5 @@
|
|||
extern puts
|
||||
%include "../inc/case_func.inc"
|
||||
global case_func
|
||||
extern libz_tolower
|
||||
|
||||
|
||||
section .data
|
||||
|
@ -23,7 +22,7 @@ main:
|
|||
|
||||
|
||||
mov rdi, [tempstore]
|
||||
call case_func ;case_func modifies the text you send it
|
||||
call libz_tolower ;libz_tolower modifies the text you send it
|
||||
|
||||
mov rdi, [tempstore]
|
||||
cld
|
||||
|
|
11
diff.asm
11
diff.asm
|
@ -1,6 +1,5 @@
|
|||
extern puts
|
||||
|
||||
%include "../inc/diff_func.inc"
|
||||
extern libz_strcmp
|
||||
|
||||
section .data
|
||||
tempstore db 0
|
||||
|
@ -28,12 +27,12 @@ main:
|
|||
|
||||
mov rdi, [tempstore]
|
||||
mov rsi, [tempstore2]
|
||||
call diff_func
|
||||
call libz_strcmp
|
||||
|
||||
cmp r10b, 1 ;why tf did i make ut r10b as the return like tf?!?!?!?
|
||||
jz _notdiffer
|
||||
|
||||
|
||||
|
||||
_differ:
|
||||
mov rdi, differ
|
||||
cld
|
||||
|
@ -48,10 +47,10 @@ _notdiffer:
|
|||
_end:
|
||||
add rsp, 8 ;exit
|
||||
ret
|
||||
|
||||
|
||||
_argument_error:
|
||||
mov rdi, argument_error
|
||||
cld
|
||||
call puts
|
||||
|
||||
|
||||
jmp _end
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
%include "../inc/length_func.inc"
|
||||
|
||||
case_func:
|
||||
mov r11, rdi
|
||||
|
||||
;length_funcx accepts r8
|
||||
call length_func
|
||||
mov r10, rax
|
||||
|
||||
|
||||
xor rcx, rcx ;we do this to clear rcx incase it had garbage in it before
|
||||
_loop:
|
||||
;do loop things
|
||||
|
||||
mov r9, r11
|
||||
add r9, rcx
|
||||
|
||||
mov r8b, [r9] ;this block here makes sure that our character is a capital letter and if its not a capital letter do nothing and return
|
||||
cmp r8b, 90
|
||||
ja _endloop
|
||||
cmp r8b, 65
|
||||
jb _endloop
|
||||
|
||||
add r8b, 32 ;make the letter capital
|
||||
mov [r9], r8b
|
||||
|
||||
_endloop:
|
||||
;end loop
|
||||
inc rcx
|
||||
cmp rcx, r10
|
||||
jle _loop
|
||||
|
||||
ret
|
|
@ -1,42 +0,0 @@
|
|||
|
||||
diff_func:
|
||||
xor rcx, rcx ;we do this to clear garbage in rcx (i have had garbage in it before)
|
||||
mov r8, rdi
|
||||
mov r9, rsi
|
||||
_loopwasp12bsharknado:
|
||||
;loop tings
|
||||
|
||||
mov rdi, r8
|
||||
mov rsi, r9
|
||||
|
||||
|
||||
add rdi, rcx
|
||||
add rsi, rcx
|
||||
|
||||
mov r10b, [rdi]
|
||||
mov r11b, [rsi]
|
||||
|
||||
|
||||
|
||||
cmp r10b, r11b
|
||||
jne _differiwikeassembwy
|
||||
cmp r10b, 0
|
||||
je _notdifferiwikeassembwy
|
||||
cmp r11b, 0
|
||||
je _notdifferiwikeassembwy
|
||||
|
||||
|
||||
inc rcx
|
||||
jmp _loopwasp12bsharknado
|
||||
|
||||
|
||||
|
||||
|
||||
_differiwikeassembwy:
|
||||
mov r10b, 1
|
||||
jmp _end123432345
|
||||
|
||||
_notdifferiwikeassembwy:
|
||||
mov r10b, 0
|
||||
_end123432345:
|
||||
ret
|
|
@ -1,9 +1,7 @@
|
|||
extern puts
|
||||
extern printf
|
||||
extern libz_strlen
|
||||
default rel
|
||||
%include "../inc/length_func.inc"
|
||||
|
||||
|
||||
|
||||
|
||||
section .rodata
|
||||
|
@ -30,7 +28,7 @@ main:
|
|||
|
||||
|
||||
mov rdi, [tempstore]
|
||||
call length_func
|
||||
call libz_strlen
|
||||
mov [testasd], rax
|
||||
|
||||
|
||||
|
|
1
lib/zombie-lib
Submodule
1
lib/zombie-lib
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit b5e1d53f010a65710144608018bd0274315988a5
|
Loading…
Reference in a new issue