Function at 0x6621354d
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov eax, 0x1ae4
mov ebp, esp
call fcn.66215260
mov eax, dword [0x6621cd88]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push esi
xor esi, esi
mov dword [ebp - 0x1acc], eax
mov dword [ebp - 0x1ac8], esi
mov dword [ebp - 0x1ad0], esi
cmp dword [ebp + 0x10], esi
jne 0x6621358a
xor eax, eax
jmp 0x66213c73
cmp eax, esi
jne 0x662135b5
call fcn.6621004f
mov dword [eax], esi
call fcn.6621003c
push esi
push esi
push esi
push esi
push esi
mov dword [eax], 0x16
call fcn.6620cd87
sub esp, 0xffffffec
or eax, 0xffffffff
jmp 0x66213c73
push ebx
push edi
mov esi, dword [ebp + 8]
mov eax, esi
sar eax, 5
and esi, 0x1f
shl esi, 6
lea edi, [eax*4 + 0x6621f8a0]
mov eax, dword [edi]
add eax, esi
mov bl, byte [eax + 0x24]
add bl, bl
sar bl, 1
cmp bl, 2
mov dword [ebp - 0x1ad8], edi
mov byte [ebp - 0x1ad9], bl
je 0x662135ed
cmp bl, 1
jne 0x6621361d
mov ecx, dword [ebp + 0x10]
not ecx
test cl, 1
jne 0x6621361d
call fcn.6621004f
xor esi, esi
mov dword [eax], esi
call fcn.6621003c
push esi
push esi
push esi
push esi
push esi
mov dword [eax], 0x16
call fcn.6620cd87
add esp, 0x14
jmp 0x66213c60
test byte [eax + 4], 0x20
je 0x66213634
push 2
push 0
push 0
push dword [ebp + 8]
call fcn.662133af
add esp, 0x10
push dword [ebp + 8]
call fcn.66213da5
or eax, eax
pop ecx
je 0x662138e2
mov eax, dword [edi]
test byte [esi + eax + 4], 0x80
je 0x662138e2
call fcn.6620d17b
xor ecx, ecx
mov eax, dword [eax + 0x6c]
cmp dword [eax + 0x14], ecx
sete cl
lea eax, [ebp - 0x1ae4]
push eax
mov eax, dword [edi]
push dword [esi + eax]
mov dword [ebp - 0x1ae0], ecx
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x662138e2
xor ecx, ecx
cmp dword [ebp - 0x1ae0], ecx
je 0x66213694
test bl, bl
je 0x662138e4
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
mov edi, dword [ebp - 0x1acc]
mov dword [ebp - 0x1ae4], eax
xor eax, eax
mov dword [ebp - 0x1ac4], eax
cmp dword [ebp + 0x10], eax
jbe 0x66213bf9
mov dword [ebp - 0x1abc], eax
mov al, byte [ebp - 0x1ad9]
or al, al
jne 0x66213832
mov ebx, dword [ebp - 0x1ad8]
xor eax, eax
mov cl, byte [edi]
cmp cl, 0xa
sete al
mov dword [ebp - 0x1ae0], eax
mov eax, dword [ebx]
add eax, esi
cmp dword [eax + 0x38], 0
je 0x66213700
mov dl, byte [eax + 0x34]
mov byte [ebp - 0xc], dl
lea ebx, [ebp - 0xc]
mov byte [ebp - 0xb], cl
and dword [eax + 0x38], 0
push 2
push ebx
jmp 0x6621374b
movsx eax, cl
push eax
call fcn.6620c2e1
pop ecx
or eax, eax
je 0x66213748
mov ecx, dword [ebp - 0x1acc]
sub ecx, edi
add ecx, dword [ebp + 0x10]
xor eax, eax
inc eax
cmp ecx, eax
jbe 0x662138c9
push 2
push edi
lea eax, [ebp - 0x1ac0]
push eax
call fcn.662142a4
sub esp, 0xfffffff4
cmp eax, 0xffffffff
je 0x66213bf0
inc edi
inc dword [ebp - 0x1abc]
jmp 0x66213763
push 1
push edi
lea eax, [ebp - 0x1ac0]
push eax
call fcn.662142a4
sub esp, 0xfffffff4
cmp eax, 0xffffffff
je 0x66213bf0
lea ebx, [ebp - 0xc]
lea ecx, [ebp - 0x1ac0]
xor eax, eax
inc edi
push eax
push eax
push 5
push ebx
push 1
push ecx
push eax
push dword [ebp - 0x1ae4]
inc dword [ebp - 0x1abc]
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ebx, eax
or ebx, ebx
je 0x66213bf0
lea eax, [ebp - 0x1ac4]
push 0
push eax
lea eax, [ebp - 0xc]
push ebx
push eax
mov eax, dword [ebp - 0x1ad8]
mov eax, dword [eax]
push dword [esi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x66213be4
mov eax, dword [ebp - 0x1abc]
mov ecx, dword [ebp - 0x1ad0]
add eax, ecx
cmp dword [ebp - 0x1ac4], ebx
mov dword [ebp - 0x1ac8], eax
jl 0x66213bf0
cmp dword [ebp - 0x1ae0], 0
je 0x662138b5
lea ebx, [ebp - 0x1ac4]
push 0
push ebx
lea ebx, [ebp - 0xc]
push 1
push ebx
mov eax, dword [ebp - 0x1ad8]
mov eax, dword [eax]
mov byte [ebp - 0xc], 0xd
push dword [esi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x66213be4
cmp dword [ebp - 0x1ac4], 1
jl 0x66213bf0
inc dword [ebp - 0x1ad0]
inc dword [ebp - 0x1ac8]
jmp 0x662138b5
cmp al, 1
je 0x6621383a
cmp al, 2
jne 0x6621385b
movzx ebx, word [edi]
xor ecx, ecx
cmp bx, 0xa
sete cl
inc edi
inc edi
sub dword [ebp - 0x1abc], 0xfffffffe
mov dword [ebp - 0x1ac0], ebx
mov dword [ebp - 0x1ae0], ecx
cmp al, 1
je 0x66213863
cmp al, 2
jne 0x662138b5
push dword [ebp - 0x1ac0]
call fcn.66215199
cmp ax, word [ebp - 0x1ac0]
pop ecx
jne 0x66213be4
sub dword [ebp - 0x1ac8], 0xfffffffe
cmp dword [ebp - 0x1ae0], 0
je 0x662138b5
push 0xd
pop eax
push eax
mov dword [ebp - 0x1ac0], eax
call fcn.66215199
pop ecx
cmp ax, word [ebp - 0x1ac0]
jne 0x66213be4
inc dword [ebp - 0x1ac8]
inc dword [ebp - 0x1ad0]
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x1abc], eax
jb 0x662136bd
jmp 0x66213bf0
mov dl, byte [edi]
mov ecx, dword [ebx]
inc dword [ebp - 0x1ac8]
mov byte [esi + ecx + 0x34], dl
mov ecx, dword [ebx]
mov dword [esi + ecx + 0x38], eax
jmp 0x66213bf0
xor ecx, ecx
mov eax, dword [edi]
add eax, esi
test byte [eax + 4], 0x80
je 0x66213bb1
or bl, bl
mov eax, dword [ebp - 0x1acc]
mov dword [ebp - 0x1ac0], ecx
jne 0x662139d0
mov dword [ebp - 0x1ac4], eax
cmp dword [ebp + 0x10], ecx
jbe 0x66213c35
jmp 0x6621391d
mov edi, dword [ebp - 0x1ad8]
lea eax, [ebp - 0x1ab8]
mov ecx, dword [ebp - 0x1ac4]
and dword [ebp - 0x1abc], 0
sub ecx, dword [ebp - 0x1acc]
cmp ecx, dword [ebp + 0x10]
jae 0x66213974
mov edx, dword [ebp - 0x1ac4]
inc dword [ebp - 0x1ac4]
mov dl, byte [edx]
inc ecx
cmp dl, 0xa
jne 0x6621395f
inc dword [ebp - 0x1ad0]
mov byte [eax], 0xd
inc eax
inc dword [ebp - 0x1abc]
mov byte [eax], dl
inc eax
inc dword [ebp - 0x1abc]
cmp dword [ebp - 0x1abc], 0x13ff
jb 0x66213936
push 0
mov ebx, eax
lea eax, [ebp - 0x1ab8]
sub ebx, eax
lea eax, [ebp - 0x1ad4]
push eax
lea eax, [ebp - 0x1ab8]
push ebx
push eax
mov eax, dword [edi]
push dword [esi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x66213be4
mov eax, dword [ebp - 0x1ad4]
add dword [ebp - 0x1ac8], eax
cmp eax, ebx
jl 0x66213bf0
mov eax, dword [ebp - 0x1ac4]
sub eax, dword [ebp - 0x1acc]
cmp eax, dword [ebp + 0x10]
jb 0x66213917
jmp 0x66213bf0
mov dword [ebp - 0x1abc], eax
cmp bl, 2
jne 0x66213ab0
cmp dword [ebp + 0x10], ecx
jbe 0x66213c35
jmp 0x662139f0
mov edi, dword [ebp - 0x1ad8]
lea eax, [ebp - 0x1ab8]
mov ecx, dword [ebp - 0x1abc]
and dword [ebp - 0x1ac4], 0
sub ecx, dword [ebp - 0x1acc]
cmp ecx, dword [ebp + 0x10]
jae 0x66213a54
mov edx, dword [ebp - 0x1abc]
sub dword [ebp - 0x1abc], 0xfffffffe
movzx edx, word [edx]
inc ecx
inc ecx
cmp dx, 0xa
jne 0x66213a3c
sub dword [ebp - 0x1ad0], 0xfffffffe
push 0xd
pop ebx
mov word [eax], bx
inc eax
inc eax
add dword [ebp - 0x1ac4], 2
add dword [ebp - 0x1ac4], 2
mov word [eax], dx
inc eax
inc eax
cmp dword [ebp - 0x1ac4], 0x13fe
jb 0x66213a09
mov ebx, eax
lea eax, [ebp - 0x1ab8]
sub ebx, eax
lea eax, [ebp - 0x1ad4]
push 0
push eax
push ebx
lea eax, [ebp - 0x1ab8]
push eax
mov eax, dword [edi]
push dword [esi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x66213be4
mov eax, dword [ebp - 0x1ad4]
add dword [ebp - 0x1ac8], eax
cmp eax, ebx
jl 0x66213bf0
mov eax, dword [ebp - 0x1abc]
sub eax, dword [ebp - 0x1acc]
cmp eax, dword [ebp + 0x10]
jb 0x662139ea
jmp 0x66213bf0
cmp dword [ebp + 0x10], ecx
jbe 0x66213c35
lea eax, [ebp - 0x6b8]
mov ebx, dword [ebp - 0x1abc]
and dword [ebp - 0x1ac4], 0
sub ebx, dword [ebp - 0x1acc]
push 2
pop edi
cmp ebx, dword [ebp + 0x10]
jae 0x66213b16
mov edx, dword [ebp - 0x1abc]
movzx edx, word [edx]
add dword [ebp - 0x1abc], edi
add ebx, edi
cmp dx, 0xa
jne 0x66213aff
push 0xd
pop ecx
mov word [eax], cx
add eax, edi
add dword [ebp - 0x1ac4], edi
add dword [ebp - 0x1ac4], edi
mov word [eax], dx
add eax, edi
cmp dword [ebp - 0x1ac4], 0x6a8
jb 0x66213ad5
lea ecx, [ebp - 0x6b8]
lea edx, [ebp - 0x1410]
xor edi, edi
push edi
sub eax, ecx
push edi
push 0xd55
push edx
cdq
sub eax, edx
sar eax, 1
push eax
mov eax, ecx
push eax
push edi
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ebx, eax
cmp ebx, edi
je 0x66213be4
lea eax, [ebp - 0x1ad4]
push 0
push eax
mov eax, ebx
sub eax, edi
push eax
lea eax, [ebp + edi - 0x1410]
push eax
mov eax, dword [ebp - 0x1ad8]
mov eax, dword [eax]
push dword [esi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
or eax, eax
je 0x66213b84
add edi, dword [ebp - 0x1ad4]
cmp ebx, edi
jg 0x66213b4d
jmp 0x66213b90
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1ac0], eax
cmp ebx, edi
jg 0x66213bf0
mov eax, dword [ebp - 0x1abc]
sub eax, dword [ebp - 0x1acc]
mov dword [ebp - 0x1ac8], eax
cmp eax, dword [ebp + 0x10]
jb 0x66213ab9
jmp 0x66213bf0
push 0
lea ecx, [ebp - 0x1ad4]
push ecx
push dword [ebp + 0x10]
push dword [ebp - 0x1acc]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x66213be4
mov eax, dword [ebp - 0x1ad4]
and dword [ebp - 0x1ac0], 0
mov dword [ebp - 0x1ac8], eax
jmp 0x66213bf0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1ac0], eax
cmp dword [ebp - 0x1ac8], 0
jne 0x66213c65
cmp dword [ebp - 0x1ac0], 0
je 0x66213c2f
push 5
pop edi
cmp dword [ebp - 0x1ac0], edi
jne 0x66213c21
call fcn.6621003c
mov dword [eax], 9
call fcn.6621004f
mov dword [eax], edi
jmp 0x66213c60
push dword [ebp - 0x1ac0]
call fcn.66210062
pop ecx
jmp 0x66213c60
mov edi, dword [ebp - 0x1ad8]
mov eax, dword [edi]
test byte [esi + eax + 4], 0x40
je 0x66213c4d
mov eax, dword [ebp - 0x1acc]
cmp byte [eax], 0x1a
jne 0x66213c4d
xor eax, eax
jmp 0x66213c71
call fcn.6621003c
mov dword [eax], 0x1c
call fcn.6621004f
and dword [eax], 0
or eax, 0xffffffff
jmp 0x66213c71
mov eax, dword [ebp - 0x1ac8]
sub eax, dword [ebp - 0x1ad0]
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop esi
call fcn.6620ed9b
leave
ret