Function at 0x415130
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.00420300
mov edi, ecx
push edx
call sub.KERNEL32.dll_GetStdHandle
xor esi, esi
test eax, eax
je 0x41515d
cmp eax, 0xffffffff
jne 0x415176
call sub.KERNEL32.dll_GetLastError
jmp 0x415162
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 0x4151fc
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.00409220
add esp, 4
cmp dword [esp + 0x14], 1
jne 0x415228
cmp dword [esp + 0x18], 0
je 0x4154e5
mov eax, dword [esp + 0x18]
cmp eax, ebx
ja 0x4155bd
lea ecx, [esp + 0x34]
mov edx, esi
push eax
call fcn.00409220
add esp, 4
cmp dword [esp + 0x34], 1
je 0x4155c8
mov esi, dword [esp + 0x38]
mov edi, dword [esp + 0x3c]
jmp 0x415230
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 0x4154c8
mov ecx, dword [esp + 0x34]
xor eax, eax
xor edx, edx
jmp 0x4154d4
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
lea eax, [esp + 0x34]
push 0x2000
push 0
push eax
call fcn.00420e00
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 0x415270
xor eax, eax
test ecx, ecx
jne 0x415380
jmp 0x415399
cmp esi, edi
je 0x415399
mov al, byte [esi]
lea edi, [esi + 1]
movzx edx, al
test al, al
js 0x415299
mov esi, edi
mov edi, dword [esp + 4]
xor eax, eax
test ecx, ecx
jne 0x415380
jmp 0x415399
mov dword [esp + 0xc], esi
mov esi, dword [esp + 4]
cmp edi, esi
je 0x4152ef
mov esi, dword [esp + 0xc]
movzx edi, byte [esi + 1]
add esi, 2
and edi, 0x3f
and edx, 0x1f
cmp al, 0xdf
jbe 0x4152f8
cmp esi, dword [esp + 4]
je 0x4152fd
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 0x415314
cmp esi, dword [esp + 4]
je 0x41532b
movzx eax, byte [esi]
inc esi
and eax, 0x3f
jmp 0x41532d
xor edi, edi
and edx, 0x1f
cmp al, 0xdf
ja 0x4152ba
shl edx, 6
jmp 0x415317
mov esi, dword [esp + 4]
mov dword [esp + 0xc], 0
shl edi, 6
add edi, dword [esp + 0xc]
cmp al, 0xf0
jae 0x4152e0
shl edx, 0xc
or edx, edi
mov edi, dword [esp + 4]
cmp edx, 0xffff
jbe 0x415260
jmp 0x415354
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 0x415399
cmp edx, 0xffff
jbe 0x415260
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 0x415399
nop dword [eax]
mov word [esp + ebx*2 + 0x34], dx
inc ebx
add ecx, 0xfffffffe
mov edx, eax
test dx, dx
jne 0x415260
jmp 0x415270
cmp ebx, 0x1001
jae 0x41559e
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 0x4154aa
mov esi, dword [esp + 0x14]
lea edx, [esp + 0x34]
cmp esi, ebx
je 0x415588
jae 0x4155f2
movzx eax, word [esp + esi*2 + 0x34]
add eax, 0x2312
movzx eax, ax
cmp eax, 0x311
ja 0x415422
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 0x41541d
call sub.KERNEL32.dll_GetLastError
inc esi
lea edx, [esp + 0x34]
cmp ebx, esi
jb 0x415604
test esi, esi
je 0x415580
add esi, esi
mov dword [esp + 0x10], 0
movzx eax, word [edx]
mov ecx, 1
cmp eax, 0x80
jae 0x41546f
nop dword [eax + eax]
add dword [esp + 0x10], ecx
add edx, 2
add esi, 0xfffffffe
je 0x415588
movzx eax, word [edx]
mov ecx, 1
cmp eax, 0x80
jb 0x415450
mov edi, edx
movzx edx, ax
mov ecx, 2
cmp edx, 0x800
mov edx, edi
jb 0x415450
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 0x415460
jmp 0x415588
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 0x41516e
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 0x41516e
call sub.KERNEL32.dll_GetProcessHeap
push 0x4f
push 0
push eax
call sub.KERNEL32.dll_HeapAlloc
test eax, eax
je 0x41560f
mov esi, eax
push 0x4f
push 0x43177c
push eax
call fcn.00421f00
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 0x4155ac
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 0x4155ac
mov dword [eax], edi
mov dword [eax + 4], 0x431724
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 0x41516e
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 0x41516e
mov ecx, ebx
mov edx, 0x1000
call fcn.00406d70
ud2
mov ecx, 0xc
mov edx, 4
call fcn.00404cd0
ud2
mov ecx, eax
mov edx, ebx
call fcn.00406d70
ud2
movsd xmm0, qword [esp + 0x38]
lea eax, [esp + 0x28]
mov ecx, 0x4313d3
mov edx, 0x2b
movsd qword [esp + 0x28], xmm0
push 0x4317cc
push eax
call fcn.00408870
add esp, 8
ud2
mov ecx, 0x4317dc
mov edx, esi
push ebx
call fcn.00406dd0
add esp, 4
ud2
mov ecx, esi
mov edx, ebx
call fcn.00406d70
ud2
mov ecx, 0x4f
mov edx, 1
call fcn.00404cd0
ud2