Function at 0x40a2d0
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x228
mov eax, dword [0x41b140]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0xc]
push edi
xor edi, edi
mov dword [ebp - 0x218], ecx
mov dword [ebp - 0x214], eax
mov dword [ebp - 0x21c], edi
mov dword [ebp - 0x220], edi
mov dword [ebp - 0x228], edi
test esi, esi
je 0x4104ca
mov ecx, esi
lea edx, [ecx + 2]
jmp 0x40a320
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x40a320
sub ecx, edx
sar ecx, 1
lea ebx, [esi + ecx*2]
mov dword [ebp - 0x210], ebx
test ebx, ebx
je 0x410638
cmp esi, ebx
ja 0x410638
lea eax, [ecx + 0xa]
mov ecx, 2
mov dword [ebp - 0x21c], eax
mul ecx
mov edi, eax
test edx, edx
jb 0x40a36d
ja 0x41062e
cmp edi, 0xffffffff
ja 0x41062e
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push edi
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x224], eax
mov dword [ebp - 0x220], 0
test eax, eax
je 0x4104e4
xor ecx, ecx
mov word [eax], cx
lea ebx, [ebx]
cmp esi, ebx
jae 0x40a3e6
movzx eax, word [esi]
add esi, 2
mov edi, eax
mov ebx, eax
cmp edi, 0xa
je 0x40a59a
push 1
lea eax, [ebp - 0x208]
mov word [ebp - 0x208], bx
push eax
lea ecx, [ebp - 0x224]
call fcn.00409ad0
mov ebx, eax
test ebx, ebx
js 0x41051e
mov ebx, dword [ebp - 0x210]
mov ecx, edi
jmp 0x40a3a0
mov eax, 0xd
lea ecx, [ebp - 0x224]
mov word [ebp - 0x208], ax
lea eax, [ebp - 0x208]
push 1
push eax
call fcn.00409ad0
mov ebx, eax
test ebx, ebx
js 0x41051e
mov eax, 0xa
lea ecx, [ebp - 0x224]
mov word [ebp - 0x208], ax
lea eax, [ebp - 0x208]
push 1
push eax
call fcn.00409ad0
mov ebx, eax
test ebx, ebx
js 0x41051e
cmp byte [0x41b514], 0
mov edi, dword [ebp - 0x224]
mov ecx, edi
mov esi, dword [ebp - 0x220]
mov dword [ebp - 0x208], ecx
je 0x40a482
mov eax, dword [ebp - 0x218]
cmp byte [eax + 0x35], 0
jne 0x40a552
lea eax, [ebp - 0x218]
push eax
push dword [ebp - 0x214]
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
jne 0x40a550
push 0
push 0
push 0
push 0
push esi
push edi
push 0
push 1
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 0x218], eax
test eax, eax
je 0x410597
cmp eax, 0x200
jae 0x4105b5
lea esi, [ebp - 0x204]
push 0
push 0
push eax
push esi
push dword [ebp - 0x220]
push edi
push 0
push 1
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov ecx, eax
mov dword [ebp - 0x210], ecx
test ecx, ecx
je 0x4105f0
lea esp, [esp]
push 0
lea eax, [ebp - 0x20c]
push eax
push ecx
push esi
push dword [ebp - 0x214]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x410602
mov ecx, dword [ebp - 0x210]
add esi, dword [ebp - 0x20c]
sub ecx, dword [ebp - 0x20c]
mov dword [ebp - 0x210], ecx
jne 0x40a4e0
mov eax, dword [ebp - 0x228]
test eax, eax
jne 0x410620
test edi, edi
je 0x40a53b
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push edi
push 0
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov eax, ebx
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040b820
mov esp, ebp
pop ebp
ret 8
mov ecx, edi
test esi, esi
je 0x40a527
cmp esi, 0x3fff
ja 0x40a5a8
mov eax, esi
push 0
lea edx, [ebp - 0x20c]
push edx
push eax
push ecx
push dword [ebp - 0x214]
call dword [sym.imp.KERNEL32.dll_WriteConsoleW]
test eax, eax
je 0x410529
mov eax, dword [ebp - 0x20c]
mov ecx, dword [ebp - 0x208]
lea ecx, [ecx + eax*2]
mov dword [ebp - 0x208], ecx
sub esi, eax
je 0x40a527
jmp 0x40a556
cmp ecx, 0xd
je 0x40a3b7
jmp 0x4104ee
mov eax, 0x3fff
jmp 0x40a560
mov esi, 0x4021a4
mov ecx, esi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4104d4
jmp 0x40a32b
mov eax, 0x8007000e
jmp 0x40a53d
mov eax, 0xd
lea ecx, [ebp - 0x224]
mov word [ebp - 0x208], ax
lea eax, [ebp - 0x208]
push 1
push eax
call fcn.00409ad0
mov dword [ebp - 0x208], eax
test eax, eax
jns 0x40a3b7
mov ebx, eax
mov edi, dword [ebp - 0x224]
jmp 0x40a527
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 6
jne 0x41057e
mov ecx, dword [ebp - 0x208]
push 0
lea eax, [ebp - 0x20c]
push eax
lea eax, [esi + esi]
push eax
push ecx
push dword [ebp - 0x214]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x410597
mov eax, dword [ebp - 0x20c]
mov ecx, dword [ebp - 0x208]
shr eax, 1
mov dword [ebp - 0x20c], eax
lea ecx, [ecx + eax*2]
mov dword [ebp - 0x208], ecx
sub esi, eax
jne 0x41053a
jmp 0x40a527
test eax, eax
jg 0x410589
mov ebx, eax
jmp 0x40a527
movzx ebx, ax
or ebx, 0x80070000
jmp 0x40a527
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test ebx, ebx
jle 0x40a527
movzx ebx, bx
or ebx, 0x80070000
jmp 0x40a527
lea ecx, [eax + 1]
cmp ecx, eax
jae 0x4105c6
mov ebx, 0x8007000e
jmp 0x40a527
push ecx
call fcn.0040b7e3
add esp, 4
mov dword [ebp - 0x228], eax
test eax, eax
jne 0x4105e3
mov ebx, 0x8007000e
jmp 0x40a527
mov esi, eax
mov eax, dword [ebp - 0x218]
jmp 0x40a4b5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test ebx, ebx
jle 0x40a519
jmp 0x410612
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test ebx, ebx
jle 0x40a519
movzx ebx, bx
or ebx, 0x80070000
jmp 0x40a519
push eax
call fcn.0040b812
add esp, 4
jmp 0x40a527
mov eax, 0x80070216
jmp 0x40a53d
mov ebx, 0x80070057
jmp 0x40a527