Function at 0x412340
Capabilities:
Write file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x2028
call fcn.004508c0
mov ebx, ecx
push edx
call dword [sym.imp.kernel32.dll_GetStdHandle]
test eax, eax
je 0x41236a
mov ebp, eax
cmp eax, 0xffffffff
jne 0x41238a
call dword [sym.imp.kernel32.dll_GetLastError]
jmp 0x41236f
mov eax, 6
mov dword [ebx + 4], 0
mov dword [ebx + 8], eax
mov dword [ebx], 1
add esp, 0x2028
pop esi
pop edi
pop ebx
pop ebp
ret
mov edi, dword [esp + 0x2040]
mov esi, dword [esp + 0x203c]
lea eax, [esp + 0x28]
mov dword [esp + 0x28], 0
push eax
push ebp
call dword [sym.imp.kernel32.dll_GetConsoleMode]
test eax, eax
je 0x412417
cmp edi, 0x1000
mov eax, 0x1000
lea ecx, [esp + 4]
cmovb eax, edi
push eax
push esi
push ecx
call fcn.00419050
add esp, 0xc
cmp dword [esp + 4], 1
jne 0x412444
cmp dword [esp + 8], 0
je 0x4126f1
mov eax, dword [esp + 8]
cmp eax, edi
ja 0x412729
mov dword [esp + 0x14], ebp
mov dword [esp + 0x10], ebx
lea ecx, [esp + 0x28]
push eax
push esi
push ecx
call fcn.00419050
add esp, 0xc
cmp dword [esp + 0x28], 1
je 0x412732
mov esi, dword [esp + 0x2c]
mov edi, dword [esp + 0x30]
jmp 0x412454
mov dword [esp + 0x28], 0
lea eax, [esp + 0x28]
push 0
push eax
push edi
push esi
push ebp
call dword [sym.imp.kernel32.dll_WriteFile]
test eax, eax
je 0x4126d7
mov ecx, dword [esp + 0x28]
xor eax, eax
xor edx, edx
jmp 0x4126e4
mov esi, dword [esp + 8]
mov edi, dword [esp + 0xc]
mov dword [esp + 0x14], ebp
mov dword [esp + 0x10], ebx
lea eax, [esp + 0x28]
push 0x2000
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
mov dword [esp + 0x18], edi
push edi
push esi
lea eax, [esp + 0xc]
push eax
call fcn.0040d060
add esp, 0xc
mov ebx, dword [esp + 8]
mov edx, dword [esp + 4]
movzx edi, word [esp + 0xc]
xor esi, esi
mov ecx, 0x2000
mov dword [esp], ebx
test di, di
je 0x4124b0
nop word [eax + eax]
xor eax, eax
test ecx, ecx
jne 0x4125a0
jmp 0x4125b9
cmp edx, ebx
je 0x4125c0
mov bl, byte [edx]
lea eax, [edx + 1]
movzx edi, bl
test bl, bl
js 0x4124d8
mov ebx, dword [esp]
mov edx, eax
xor eax, eax
test ecx, ecx
jne 0x4125a0
jmp 0x4125b9
mov ebp, dword [esp]
cmp eax, ebp
je 0x412522
movzx eax, byte [edx + 1]
add edx, 2
and eax, 0x3f
and edi, 0x1f
cmp bl, 0xdf
jbe 0x41252e
mov ebp, dword [esp]
cmp edx, ebp
je 0x412533
movzx ebp, byte [edx]
inc edx
and ebp, 0x3f
mov dword [esp + 0x1c], ebp
mov ebp, edx
shl eax, 6
add eax, dword [esp + 0x1c]
cmp bl, 0xf0
jb 0x412547
cmp ebp, dword [esp]
je 0x412551
movzx ebx, byte [ebp]
inc ebp
mov edx, ebp
and ebx, 0x3f
jmp 0x412553
xor eax, eax
mov edx, ebp
and edi, 0x1f
cmp bl, 0xdf
ja 0x4124f1
shl edi, 6
jmp 0x41254a
mov dword [esp + 0x1c], 0
shl eax, 6
add eax, dword [esp + 0x1c]
cmp bl, 0xf0
jae 0x412511
shl edi, 0xc
mov ebx, dword [esp]
or edi, eax
jmp 0x41256c
xor ebx, ebx
and edi, 7
shl eax, 6
shl edi, 0x12
or eax, edi
or eax, ebx
mov ebx, dword [esp]
cmp eax, 0x110000
mov edi, eax
je 0x4125c0
cmp edi, 0xffff
jbe 0x4124a0
add edi, 0xffff0000
mov ebx, edi
and edi, 0x3ff
shr ebx, 0xa
or edi, 0xdc00
or ebx, 0xd800
mov eax, edi
mov edi, ebx
mov ebx, dword [esp]
test ecx, ecx
je 0x4125b9
mov word [esp + esi*2 + 0x28], di
inc esi
add ecx, 0xfffffffe
mov edi, eax
test di, di
jne 0x4124a0
jmp 0x4124b0
mov esi, 0x1000
jmp 0x4125cc
cmp esi, 0x1001
jae 0x41275e
mov ebx, dword [esp + 0x18]
lea eax, [esp + 0x28]
mov dword [esp + 4], 0
push 0
lea ecx, [esp + 8]
push ecx
push esi
push eax
push dword [esp + 0x24]
call dword [sym.imp.kernel32.dll_WriteConsoleW]
test eax, eax
je 0x4126b8
mov edi, dword [esp + 4]
lea edx, [esp + 0x28]
cmp edi, esi
je 0x412706
jae 0x412718
movzx eax, word [esp + edi*2 + 0x28]
mov ecx, dword [esp + 0x14]
add eax, 0x2312
movzx eax, ax
cmp eax, 0x312
jae 0x412651
lea eax, [esp + edi*2 + 0x28]
inc edi
mov dword [esp + 4], 0
push 0
lea edx, [esp + 8]
push edx
push 1
push eax
push ecx
call dword [sym.imp.kernel32.dll_WriteConsoleW]
test eax, eax
jne 0x41264d
call dword [sym.imp.kernel32.dll_GetLastError]
lea edx, [esp + 0x28]
cmp edi, esi
ja 0x41276b
test edi, edi
je 0x412704
add edi, edi
xor ebx, ebx
jmp 0x41267e
add ebx, ecx
add edx, 2
add edi, 0xfffffffe
je 0x412706
movzx eax, word [edx]
mov ecx, 1
cmp ax, 0x7f
jbe 0x412670
mov esi, edx
movzx edx, ax
mov ecx, 2
cmp edx, 0x800
mov edx, esi
jb 0x412670
add eax, 0x2312
xor ecx, ecx
movzx eax, ax
cmp eax, 0x311
seta cl
lea ecx, [ecx + ecx + 1]
jmp 0x412670
call dword [sym.imp.kernel32.dll_GetLastError]
mov ecx, dword [esp + 0x10]
mov dword [ecx + 8], eax
mov dword [ecx + 4], 0
mov dword [ecx], 1
jmp 0x41237f
call dword [sym.imp.kernel32.dll_GetLastError]
xor ecx, ecx
mov edx, 1
mov dword [ebx], edx
mov dword [ebx + 4], ecx
mov dword [ebx + 8], eax
jmp 0x41237f
mov dword [ebx + 8], 0x45ea00
mov dword [ebx + 4], 0x1502
jmp 0x412379
xor ebx, ebx
mov eax, dword [esp + 0x10]
mov dword [eax + 4], ebx
mov dword [eax], 0
jmp 0x41237f
push 0x45ea18
push esi
push edi
call fcn.004598e0
add esp, 0xc
ud2
push 0x45e990
push edi
push eax
jmp 0x412772
movsd xmm0, qword [esp + 0x2c]
lea eax, [esp + 0x20]
movsd qword [esp + 0x20], xmm0
push 0x45e9a0
push 0x45d384
push eax
push 0x2b
push 0x45d348
call fcn.00458b30
add esp, 0x14
ud2
push 0x45ea08
push 0x1000
push esi
jmp 0x412772
push 0x45ea28
push esi
push edi
call fcn.00458700
add esp, 0xc
ud2