mirror of
https://github.com/shijimasoft/cia-unix.git
synced 2025-06-19 06:45:41 -04:00
added .3ds support
This commit is contained in:
parent
059a79f7ed
commit
4b7033142e
@ -20,7 +20,7 @@ cia-unix/
|
|||||||
- [x] Decrypt .cia
|
- [x] Decrypt .cia
|
||||||
- [x] Games
|
- [x] Games
|
||||||
- [x] Patch and DLCs
|
- [x] Patch and DLCs
|
||||||
- [ ] Decrypt .3ds
|
- [x] Decrypt .3ds
|
||||||
- [ ] Rust 'decrypt.py' rewrite
|
- [ ] Rust 'decrypt.py' rewrite
|
||||||
|
|
||||||
## ⚡️ Build from source
|
## ⚡️ Build from source
|
||||||
|
48
cia-unix.cr
48
cia-unix.cr
@ -39,6 +39,47 @@ tools.each do |tool|
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
args : String = ""
|
||||||
|
|
||||||
|
# 3ds decrypting
|
||||||
|
Dir["*.3ds"].each do |ds|
|
||||||
|
if ds.includes? "decrypted"
|
||||||
|
next
|
||||||
|
end
|
||||||
|
args = ""
|
||||||
|
i : UInt8 = 0
|
||||||
|
dsn : String = ds.chomp ".3ds"
|
||||||
|
|
||||||
|
puts "Decrypting: #{ds.colorize.mode :bold}..."
|
||||||
|
log.puts %x[python2.7 decrypt.py '#{ds}']
|
||||||
|
|
||||||
|
Dir["#{dsn}.*.ncch"].each do |ncch|
|
||||||
|
case ncch
|
||||||
|
when "#{dsn}.Main.ncch"
|
||||||
|
i = 0
|
||||||
|
when "#{dsn}.Manual.ncch"
|
||||||
|
i = 1
|
||||||
|
when "#{dsn}.DownloadPlay.ncch"
|
||||||
|
i = 2
|
||||||
|
when "#{dsn}.Partition4.ncch"
|
||||||
|
i = 3
|
||||||
|
when "#{dsn}.Partition5.ncch"
|
||||||
|
i = 4
|
||||||
|
when "#{dsn}.Partition6.ncch"
|
||||||
|
i = 5
|
||||||
|
when "#{dsn}.N3DSUpdateData.ncch"
|
||||||
|
i = 6
|
||||||
|
when "#{dsn}.UpdateData.ncch"
|
||||||
|
i = 7
|
||||||
|
end
|
||||||
|
args += "-i '#{ncch}:#{i}:#{i}' "
|
||||||
|
end
|
||||||
|
puts "Building decrypted #{dsn} 3DS..."
|
||||||
|
log.puts %x[./makerom -f cci -ignoresign -target p -o '#{dsn}-decrypted.3ds' #{args}]
|
||||||
|
check_decrypt(dsn, "3ds")
|
||||||
|
end
|
||||||
|
|
||||||
|
# cia decrypting
|
||||||
Dir["*.cia"].each do |cia|
|
Dir["*.cia"].each do |cia|
|
||||||
if cia.includes? "decrypted"
|
if cia.includes? "decrypted"
|
||||||
next
|
next
|
||||||
@ -46,9 +87,10 @@ Dir["*.cia"].each do |cia|
|
|||||||
|
|
||||||
puts "Decrypting: #{cia.colorize.mode :bold}..."
|
puts "Decrypting: #{cia.colorize.mode :bold}..."
|
||||||
cutn : String = cia.chomp ".cia"
|
cutn : String = cia.chomp ".cia"
|
||||||
args : String = ""
|
args = ""
|
||||||
content = %x[./ctrtool -tmd '#{cia}']
|
content = %x[./ctrtool -tmd '#{cia}']
|
||||||
|
|
||||||
|
# game
|
||||||
if content.match /T.*D.*00040000/
|
if content.match /T.*D.*00040000/
|
||||||
puts "CIA Type: Game"
|
puts "CIA Type: Game"
|
||||||
log.puts %x[python2.7 decrypt.py '#{cia}']
|
log.puts %x[python2.7 decrypt.py '#{cia}']
|
||||||
@ -59,7 +101,7 @@ Dir["*.cia"].each do |cia|
|
|||||||
i += 1
|
i += 1
|
||||||
end
|
end
|
||||||
log.puts %x[./makerom -f cia -ignoresign -target p -o '#{cutn}-decfirst.cia' #{args}]
|
log.puts %x[./makerom -f cia -ignoresign -target p -o '#{cutn}-decfirst.cia' #{args}]
|
||||||
|
# patch
|
||||||
elsif content.match /T.*D.*0004000E/
|
elsif content.match /T.*D.*0004000E/
|
||||||
puts "CIA Type: #{"Patch".colorize.mode :bold}"
|
puts "CIA Type: #{"Patch".colorize.mode :bold}"
|
||||||
log.puts %x[python2.7 decrypt.py '#{cia}']
|
log.puts %x[python2.7 decrypt.py '#{cia}']
|
||||||
@ -69,7 +111,7 @@ Dir["*.cia"].each do |cia|
|
|||||||
|
|
||||||
log.puts %x[./makerom -f cia -ignoresign -target p -o '#{cutn} (Patch)-decrypted.cia' #{args}]
|
log.puts %x[./makerom -f cia -ignoresign -target p -o '#{cutn} (Patch)-decrypted.cia' #{args}]
|
||||||
check_decrypt("#{cutn} (Patch)", "cia")
|
check_decrypt("#{cutn} (Patch)", "cia")
|
||||||
|
# dlc
|
||||||
elsif content.match /T.*D.*0004008C/
|
elsif content.match /T.*D.*0004008C/
|
||||||
puts "CIA Type: #{"DLC".colorize.mode :bold}"
|
puts "CIA Type: #{"DLC".colorize.mode :bold}"
|
||||||
log.puts %x[python2.7 decrypt.py '#{cia}']
|
log.puts %x[python2.7 decrypt.py '#{cia}']
|
||||||
|
Loading…
Reference in New Issue
Block a user