Function at 0x421250
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
mov eax, 0x2038
call fcn.00436ff0
mov edi, ecx
push edx
call sub.KERNEL32.dll_GetStdHandle
xor esi, esi
test eax, eax
je 0x42127d
cmp eax, 0xffffffff
jne 0x421296
call sub.KERNEL32.dll_GetLastError
jmp 0x421282
mov eax, 6
mov dword [edi + 4], esi
mov dword [edi + 8], eax
mov dword [edi], 1
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov ebx, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
lea ecx, [esp + 0x34]
mov dword [esp + 8], edi
mov dword [esp + 0x34], 0
push ecx
push eax
mov edi, eax
call sub.KERNEL32.dll_GetConsoleMode
test eax, eax
je 0x42131c
cmp ebx, 0x1000
mov eax, 0x1000
mov dword [esp + 0x20], edi
lea ecx, [esp + 0x14]
mov edx, esi
cmovb eax, ebx
push eax
call fcn.004121d0
add esp, 4
cmp dword [esp + 0x14], 1
jne 0x421348
cmp dword [esp + 0x18], 0
je 0x421605
mov eax, dword [esp + 0x18]
cmp eax, ebx
ja 0x4216dd
lea ecx, [esp + 0x34]
mov edx, esi
push eax
call fcn.004121d0
add esp, 4
cmp dword [esp + 0x34], 1
je 0x4216e8
mov esi, dword [esp + 0x38]
mov edi, dword [esp + 0x3c]
jmp 0x421350
mov dword [esp + 0x34], 0
lea eax, [esp + 0x34]
push 0
push eax
push ebx
push esi
push edi
call sub.KERNEL32.dll_WriteFile
test eax, eax
je 0x4215e8
mov ecx, dword [esp + 0x34]
xor eax, eax
xor edx, edx
jmp 0x4215f4
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
lea eax, [esp + 0x34]
push 0x2000
push 0
push eax
call fcn.00439140
add esp, 0xc
mov eax, esi
mov dword [esp + 0x10], edi
xor edx, edx
mov ecx, 0x2000
xor ebx, ebx
add eax, edi
mov edi, eax
mov dword [esp + 4], eax
test dx, dx
je 0x421390
xor eax, eax
test ecx, ecx
jne 0x4214a0
jmp 0x4214b9
cmp esi, edi
je 0x4214b9
mov al, byte [esi]
lea edi, [esi + 1]
movzx edx, al
test al, al
js 0x4213b9
mov esi, edi
mov edi, dword [esp + 4]
xor eax, eax
test ecx, ecx
jne 0x4214a0
jmp 0x4214b9
mov dword [esp + 0xc], esi
mov esi, dword [esp + 4]
cmp edi, esi
je 0x42140f
mov esi, dword [esp + 0xc]
movzx edi, byte [esi + 1]
add esi, 2
and edi, 0x3f
and edx, 0x1f
cmp al, 0xdf
jbe 0x421418
cmp esi, dword [esp + 4]
je 0x42141d
mov dword [esp + 0x24], edi
movzx edi, byte [esi]
inc esi
mov dword [esp + 0xc], edi
mov edi, dword [esp + 0x24]
and dword [esp + 0xc], 0x3f
shl edi, 6
add edi, dword [esp + 0xc]
cmp al, 0xf0
jb 0x421434
cmp esi, dword [esp + 4]
je 0x42144b
movzx eax, byte [esi]
inc esi
and eax, 0x3f
jmp 0x42144d
xor edi, edi
and edx, 0x1f
cmp al, 0xdf
ja 0x4213da
shl edx, 6
jmp 0x421437
mov esi, dword [esp + 4]
mov dword [esp + 0xc], 0
shl edi, 6
add edi, dword [esp + 0xc]
cmp al, 0xf0
jae 0x421400
shl edx, 0xc
or edx, edi
mov edi, dword [esp + 4]
cmp edx, 0xffff
jbe 0x421380
jmp 0x421474
xor eax, eax
and edx, 7
shl edi, 6
shl edx, 0x12
or edi, edx
or edi, eax
cmp edi, 0x110000
mov edx, edi
mov edi, dword [esp + 4]
je 0x4214b9
cmp edx, 0xffff
jbe 0x421380
add edx, 0xffff0000
mov edi, edx
and edx, 0x3ff
shr edi, 0xa
or edx, 0xdc00
or edi, 0xd800
mov eax, edx
mov edx, edi
mov edi, dword [esp + 4]
test ecx, ecx
je 0x4214b9
nop dword [eax]
mov word [esp + ebx*2 + 0x34], dx
inc ebx
add ecx, 0xfffffffe
mov edx, eax
test dx, dx
jne 0x421380
jmp 0x421390
cmp ebx, 0x1001
jae 0x4216be
mov dword [esp + 0x14], 0
push 0
lea eax, [esp + 0x18]
push eax
push ebx
lea eax, [esp + 0x40]
push eax
push dword [esp + 0x30]
call sub.KERNEL32.dll_WriteConsoleW
test eax, eax
je 0x4215ca
mov esi, dword [esp + 0x14]
lea edx, [esp + 0x34]
cmp esi, ebx
je 0x4216a8
jae 0x421712
movzx eax, word [esp + esi*2 + 0x34]
add eax, 0x2312
movzx eax, ax
cmp eax, 0x311
ja 0x421542
lea eax, [esp + esi*2 + 0x34]
mov dword [esp + 0x14], 0
push 0
lea ecx, [esp + 0x18]
push ecx
push 1
push eax
push dword [esp + 0x30]
call sub.KERNEL32.dll_WriteConsoleW
test eax, eax
jne 0x42153d
call sub.KERNEL32.dll_GetLastError
inc esi
lea edx, [esp + 0x34]
cmp ebx, esi
jb 0x421724
test esi, esi
je 0x4216a0
add esi, esi
mov dword [esp + 0x10], 0
movzx eax, word [edx]
mov ecx, 1
cmp eax, 0x80
jae 0x42158f
nop dword [eax + eax]
add dword [esp + 0x10], ecx
add edx, 2
add esi, 0xfffffffe
je 0x4216a8
movzx eax, word [edx]
mov ecx, 1
cmp eax, 0x80
jb 0x421570
mov edi, edx
movzx edx, ax
mov ecx, 2
cmp edx, 0x800
mov edx, edi
jb 0x421570
add eax, 0x2312
xor ecx, ecx
movzx eax, ax
cmp eax, 0x311
seta cl
lea ecx, [ecx + ecx + 1]
add dword [esp + 0x10], ecx
add edx, 2
add esi, 0xfffffffe
jne 0x421580
jmp 0x4216a8
call sub.KERNEL32.dll_GetLastError
mov ecx, dword [esp + 8]
mov dword [ecx + 8], eax
mov dword [ecx + 4], 0
mov dword [ecx], 1
jmp 0x42128e
call sub.KERNEL32.dll_GetLastError
xor ecx, ecx
mov edx, 1
mov esi, dword [esp + 8]
mov dword [esi], edx
mov dword [esi + 4], ecx
mov dword [esi + 8], eax
jmp 0x42128e
call sub.KERNEL32.dll_GetProcessHeap
push 0x4f
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x42172f
mov esi, eax
push 0x4f
push 0x4482f0
push eax
call fcn.00438b50
add esp, 0xc
call sub.KERNEL32.dll_GetProcessHeap
push 0xc
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
mov ebx, dword [esp + 8]
test eax, eax
je 0x4216cc
mov dword [eax], esi
mov dword [eax + 4], 0x4f
mov edi, eax
mov dword [eax + 8], 0x4f
call sub.KERNEL32.dll_GetProcessHeap
push 0xc
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x4216cc
mov dword [eax], edi
mov dword [eax + 4], 0x448294
mov byte [eax + 8], 0xc
movzx ecx, word [esp + 0x34]
mov word [eax + 9], cx
mov cl, byte [esp + 0x36]
mov byte [eax + 0xb], cl
mov dword [ebx + 4], 2
mov dword [ebx + 8], eax
mov dword [ebx], 1
jmp 0x42128e
mov dword [esp + 0x10], 0
mov eax, dword [esp + 8]
mov ecx, dword [esp + 0x10]
mov dword [eax + 4], ecx
mov dword [eax], 0
jmp 0x42128e
mov ecx, ebx
mov edx, 0x1000
call fcn.0040ff00
ud2
mov ecx, 0xc
mov edx, 4
call fcn.0040dcf0
ud2
mov ecx, eax
mov edx, ebx
call fcn.0040ff00
ud2
movsd xmm0, qword [esp + 0x38]
lea eax, [esp + 0x28]
mov ecx, 0x447fab
mov edx, 0x2b
movsd qword [esp + 0x28], xmm0
push 0x448340
push eax
call fcn.00411a20
add esp, 8
ud2
mov ecx, 0x448350
mov edx, esi
push ebx
call fcn.0040ff60
add esp, 4
ud2
mov ecx, esi
mov edx, ebx
call fcn.0040ff00
ud2
mov ecx, 0x4f
mov edx, 1
call fcn.0040dcf0
ud2