Function at 0x40d4dc
Capabilities:
Write file on windows

Disassembly:
mov al, byte [ebp - 0x1ac1]
test al, al
jne 0x40d4a1
mov cl, byte [ebx]
mov esi, dword [ebp - 0x1adc]
xor eax, eax
cmp cl, 0xa
sete al
mov dword [ebp - 0x1ae4], eax
mov eax, dword [esi]
add eax, edi
cmp dword [eax + 0x38], 0
je 0x40d36f
invalid
mov dl, byte [eax + 0x34]
mov byte [ebp - 0xc], dl
mov byte [ebp - 0xb], cl
and dword [eax + 0x38], 0
push 2
lea eax, [ebp - 0xc]
push eax
jmp 0x40d3ba
movsx eax, cl
push eax
call 0x419765
pop ecx
test eax, eax
je 0x40d3b7
mov ecx, dword [ebp - 0x1acc]
sub ecx, ebx
add ecx, dword [ebp + 0x10]
xor eax, eax
inc eax
cmp ecx, eax
jbe 0x40d538
push 2
lea eax, [ebp - 0x1abc]
push ebx
push eax
call 0x41973d
add esp, 0xc
cmp eax, 0xffffffff
je 0x40d840
inc ebx
inc dword [ebp - 0x1ac0]
jmp 0x40d3d2
push 1
push ebx
lea eax, [ebp - 0x1abc]
push eax
call 0x419761
add esp, 0xc
cmp eax, 0xffffffff
je 0x40d840
xor eax, eax
push eax
push eax
push 5
lea ecx, [ebp - 0xc]
push ecx
push 1
lea ecx, [ebp - 0x1abc]
push ecx
push eax
push dword [ebp - 0x1ae0]
inc ebx
inc dword [ebp - 0x1ac0]
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, eax
test esi, esi
je 0x40d840
push 0
lea eax, [ebp - 0x1ad4]
push eax
push esi
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax]
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40d834
mov eax, dword [ebp - 0x1ac0]
mov ecx, dword [ebp - 0x1ad0]
add eax, ecx
mov dword [ebp - 0x1ac8], eax
cmp dword [ebp - 0x1ad4], esi
jl 0x40d840
cmp dword [ebp - 0x1ae4], 0
je 0x40d524
push 0
lea eax, [ebp - 0x1ad4]
push eax
push 1
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax]
mov byte [ebp - 0xc], 0xd
push dword [edi + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40d834
cmp dword [ebp - 0x1ad4], 1
jl 0x40d840
inc dword [ebp - 0x1ad0]
inc dword [ebp - 0x1ac8]
jmp 0x419dc5
cmp al, 1
je 0x40d4a9
cmp al, 2
jne 0x40d4ca
movzx esi, word [ebx]
xor ecx, ecx
cmp esi, 0xa
sete cl
add ebx, 2
add dword [ebp - 0x1ac0], 2
inc dword [edx]
mov dword [ebp - 0x1abc], esi
mov dword [ebp - 0x1ae4], ecx
cmp al, 1
je 0x40d4d2
cmp al, 2
jne 0x40d524
push dword [ebp - 0x1abc]
call 0x41e2f4
add byte [ecx + 0x66], bl
cmp eax, dword [ebp - 0x1abc]
jne 0x40d834
add dword [ebp - 0x1ac8], 2
cmp dword [ebp - 0x1ae4], 0
je 0x40d524
push 0xd
pop eax
push eax
mov dword [ebp - 0x1abc], eax
call 0x41e321
pop ecx
cmp ax, word [ebp - 0x1abc]
jne 0x40d834
inc dword [ebp - 0x1ac8]
inc dword [ebp - 0x1ad0]
mov eax, dword [ebp + 0x10]
cmp dword [ebp - 0x1ac0], eax
jb 0x40d32c
jmp 0x41a178
mov ecx, dword [esi]
mov dl, byte [ebx]
inc dword [ebp - 0x1ac8]
mov byte [edi + ecx + 0x34], dl
mov ecx, dword [esi]
mov dword [edi + ecx + 0x38], eax
jmp 0x41a191
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1abc], eax
cmp dword [ebp - 0x1ac8], 0
jne 0x40d8b5
cmp dword [ebp - 0x1abc], 0
je 0x40d87f
push 5
pop esi
cmp dword [ebp - 0x1abc], esi
jne 0x40d871
call 0x413f79
mov dword [eax], 9
call 0x413f97
mov dword [eax], esi
jmp 0x40d8b0
push dword [ebp - 0x1abc]
call 0x413fb9
pop ecx
jmp 0x40d8b0
mov eax, dword [ebp - 0x1adc]
mov eax, dword [eax]
test byte [edi + eax + 4], 0x40
je 0x40d89d
mov eax, dword [ebp - 0x1acc]
cmp byte [eax], 0x1a
jne 0x40d89d
xor eax, eax
jmp 0x40d8c1
call 0x413fb9
mov dword [eax], 0x1c
call 0x413fd7
and dword [eax], 0
or eax, 0xffffffff
jmp 0x40d8c1
mov eax, dword [ebp - 0x1ac8]
sub eax, dword [ebp - 0x1ad0]
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.00412151
leave
ret