Function at 0x41dfab
Capabilities:
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x518]
sub esp, 0x594
mov eax, dword [0x42eb5c]
xor eax, ebp
mov dword [ebp + 0x514], eax
mov eax, dword [ebp + 0x524]
push esi
xor esi, esi
cmp dword [ebp + 0x528], esi
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], esi
mov dword [ebp - 0x64], esi
jne 0x41dfe7
xor eax, eax
jmp 0x41e550
cmp eax, esi
jne 0x41e012
call fcn.00412fd3
mov dword [eax], esi
call fcn.00412fc0
push esi
push esi
push esi
push esi
push esi
mov dword [eax], 0x16
call fcn.00416599
add esp, 0x14
or eax, 0xffffffff
jmp 0x41e550
mov esi, dword [ebp + 0x520]
push ebx
mov ebx, esi
and ebx, 0x1f
imul ebx, ebx, 0x28
mov eax, esi
sar eax, 5
push edi
lea edi, [eax*4 + 0x4337e0]
mov eax, dword [edi]
add eax, ebx
mov cl, byte [eax + 0x24]
add cl, cl
sar cl, 1
cmp cl, 2
mov dword [ebp - 0x6c], edi
mov byte [ebp - 0x55], cl
je 0x41e049
cmp cl, 1
jne 0x41e07c
mov ecx, dword [ebp + 0x528]
not ecx
test cl, 1
jne 0x41e07c
call fcn.00412fd3
xor esi, esi
mov dword [eax], esi
call fcn.00412fc0
push esi
push esi
push esi
push esi
push esi
mov dword [eax], 0x16
call fcn.00416599
add esp, 0x14
jmp 0x41e546
test byte [eax + 4], 0x20
je 0x41e091
push 2
push 0
push 0
push esi
call fcn.0041fafc
add esp, 0x10
push esi
call fcn.0041e683
test eax, eax
pop ecx
je 0x41e296
mov eax, dword [edi]
test byte [ebx + eax + 4], 0x80
je 0x41e296
call fcn.0041796b
mov eax, dword [eax + 0x6c]
xor ecx, ecx
cmp dword [eax + 0x14], ecx
lea eax, [ebp - 0x7c]
sete cl
push eax
mov eax, dword [edi]
push dword [ebx + eax]
mov esi, ecx
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x41e296
test esi, esi
je 0x41e0e4
cmp byte [ebp - 0x55], 0
je 0x41e296
call dword [sym.imp.KERNEL32.dll_GetConsoleCP]
and dword [ebp - 0x70], 0
cmp dword [ebp + 0x528], 0
mov esi, dword [ebp - 0x60]
mov dword [ebp - 0x7c], eax
mov dword [ebp - 0x74], esi
jbe 0x41e4f8
and dword [ebp - 0x50], 0
jmp 0x41e10d
mov esi, dword [ebp - 0x74]
mov al, byte [ebp - 0x55]
test al, al
jne 0x41e21e
mov al, byte [esi]
xor ecx, ecx
cmp al, 0xa
sete cl
movsx eax, al
push eax
mov dword [ebp - 0x78], ecx
call fcn.0041ea4b
test eax, eax
pop ecx
jne 0x41e14c
push 1
lea eax, [ebp - 0x54]
push esi
push eax
call fcn.0041ec26
add esp, 0xc
cmp eax, 0xffffffff
je 0x41e4ee
jmp 0x41e17c
mov eax, dword [ebp - 0x60]
sub eax, esi
add eax, dword [ebp + 0x528]
cmp eax, 1
jbe 0x41e4ee
push 2
lea eax, [ebp - 0x54]
push esi
push eax
call fcn.0041ec26
add esp, 0xc
cmp eax, 0xffffffff
je 0x41e4ee
inc esi
inc dword [ebp - 0x50]
xor eax, eax
push eax
push eax
push 5
lea ecx, [ebp + 0x50c]
push ecx
push 1
lea ecx, [ebp - 0x54]
push ecx
push eax
push dword [ebp - 0x7c]
inc esi
inc dword [ebp - 0x50]
mov dword [ebp - 0x74], esi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov esi, eax
test esi, esi
je 0x41e4ee
push 0
lea eax, [ebp - 0x70]
push eax
push esi
lea eax, [ebp + 0x50c]
push eax
mov eax, dword [edi]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x41e4e5
mov eax, dword [ebp - 0x70]
add dword [ebp - 0x5c], eax
cmp eax, esi
jl 0x41e4ee
cmp dword [ebp - 0x78], 0
je 0x41e282
push 0
lea eax, [ebp - 0x70]
push eax
push 1
lea eax, [ebp + 0x50c]
push eax
mov eax, dword [edi]
mov byte [ebp + 0x50c], 0xd
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x41e4e5
cmp dword [ebp - 0x70], 1
jl 0x41e4ee
inc dword [ebp - 0x64]
inc dword [ebp - 0x5c]
jmp 0x41e282
cmp al, 1
je 0x41e226
cmp al, 2
jne 0x41e241
movzx ecx, word [esi]
xor edx, edx
cmp cx, 0xa
sete dl
inc esi
inc esi
add dword [ebp - 0x50], 2
mov dword [ebp - 0x54], ecx
mov dword [ebp - 0x74], esi
mov dword [ebp - 0x78], edx
cmp al, 1
je 0x41e249
cmp al, 2
jne 0x41e282
push dword [ebp - 0x54]
call fcn.0041fa3a
cmp ax, word [ebp - 0x54]
pop ecx
jne 0x41e4e5
inc dword [ebp - 0x5c]
cmp dword [ebp - 0x78], 0
je 0x41e282
push 0xd
pop eax
push eax
mov dword [ebp - 0x54], eax
call fcn.0041fa3a
cmp ax, word [ebp - 0x54]
pop ecx
jne 0x41e4e5
inc dword [ebp - 0x5c]
inc dword [ebp - 0x64]
mov eax, dword [ebp + 0x528]
cmp dword [ebp - 0x50], eax
jb 0x41e10a
jmp 0x41e4ee
mov eax, dword [edi]
add eax, ebx
test byte [eax + 4], 0x80
je 0x41e4be
mov eax, dword [ebp - 0x60]
xor esi, esi
cmp byte [ebp - 0x55], 0
mov dword [ebp - 0x54], esi
mov dword [ebp - 0x50], eax
jne 0x41e343
cmp dword [ebp + 0x528], esi
jbe 0x41e51f
mov ecx, dword [ebp - 0x50]
xor esi, esi
sub ecx, dword [ebp - 0x60]
lea eax, [ebp - 0x4c]
cmp ecx, dword [ebp + 0x528]
jae 0x41e2fd
mov edx, dword [ebp - 0x50]
inc dword [ebp - 0x50]
mov dl, byte [edx]
inc ecx
cmp dl, 0xa
jne 0x41e2ee
inc dword [ebp - 0x64]
mov byte [eax], 0xd
inc eax
inc esi
mov edi, dword [ebp - 0x6c]
mov byte [eax], dl
inc eax
inc esi
cmp esi, 0x400
jb 0x41e2d0
mov esi, eax
lea eax, [ebp - 0x4c]
sub esi, eax
push 0
lea eax, [ebp - 0x68]
push eax
push esi
lea eax, [ebp - 0x4c]
push eax
mov eax, dword [edi]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x41e4e5
mov eax, dword [ebp - 0x68]
add dword [ebp - 0x5c], eax
cmp eax, esi
jl 0x41e4ee
mov eax, dword [ebp - 0x50]
sub eax, dword [ebp - 0x60]
cmp eax, dword [ebp + 0x528]
jb 0x41e2c5
jmp 0x41e4ee
cmp byte [ebp - 0x55], 2
jne 0x41e3e7
cmp dword [ebp + 0x528], esi
jbe 0x41e51f
mov ecx, dword [ebp - 0x50]
xor esi, esi
sub ecx, dword [ebp - 0x60]
lea eax, [ebp - 0x4c]
cmp ecx, dword [ebp + 0x528]
jae 0x41e39d
mov edx, dword [ebp - 0x50]
add dword [ebp - 0x50], 2
movzx edx, word [edx]
inc ecx
inc ecx
cmp dx, 0xa
jne 0x41e38b
add dword [ebp - 0x64], 2
mov word [eax], 0xd
inc eax
inc eax
inc esi
inc esi
mov edi, dword [ebp - 0x6c]
mov word [eax], dx
inc eax
inc eax
inc esi
inc esi
cmp esi, 0x3ff
jb 0x41e364
mov esi, eax
lea eax, [ebp - 0x4c]
sub esi, eax
push 0
lea eax, [ebp - 0x68]
push eax
push esi
lea eax, [ebp - 0x4c]
push eax
mov eax, dword [edi]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x41e4e5
mov eax, dword [ebp - 0x68]
add dword [ebp - 0x5c], eax
cmp eax, esi
jl 0x41e4ee
mov eax, dword [ebp - 0x50]
sub eax, dword [ebp - 0x60]
cmp eax, dword [ebp + 0x528]
jb 0x41e359
jmp 0x41e4ee
cmp dword [ebp + 0x528], esi
jbe 0x41e51f
mov ecx, dword [ebp - 0x50]
xor esi, esi
sub ecx, dword [ebp - 0x60]
lea eax, [ebp + 0x3b8]
cmp ecx, dword [ebp + 0x528]
jae 0x41e437
mov edx, dword [ebp - 0x50]
add dword [ebp - 0x50], 2
movzx edx, word [edx]
inc ecx
inc ecx
cmp dx, 0xa
jne 0x41e428
add dword [ebp - 0x64], 2
mov word [eax], 0xd
inc eax
inc eax
inc esi
inc esi
mov word [eax], dx
inc eax
inc eax
inc esi
inc esi
cmp esi, 0x152
jb 0x41e401
xor esi, esi
push esi
push esi
push 0x2ab
lea ecx, [ebp + 0x108]
push ecx
lea ecx, [ebp + 0x3b8]
sub eax, ecx
cdq
sub eax, edx
sar eax, 1
push eax
mov eax, ecx
push eax
push esi
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov edi, eax
cmp edi, esi
je 0x41e4e5
push 0
lea eax, [ebp - 0x68]
push eax
mov eax, edi
sub eax, esi
push eax
lea eax, [ebp + esi + 0x108]
push eax
mov eax, dword [ebp - 0x6c]
mov eax, dword [eax]
push dword [ebx + eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x41e49d
mov eax, dword [ebp - 0x68]
add dword [ebp - 0x5c], eax
add esi, eax
cmp edi, esi
jg 0x41e46a
jmp 0x41e4a6
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x54], eax
cmp edi, esi
jg 0x41e4ee
mov eax, dword [ebp - 0x50]
sub eax, dword [ebp - 0x60]
cmp eax, dword [ebp + 0x528]
jb 0x41e3f3
jmp 0x41e4ee
push 0
lea ecx, [ebp - 0x68]
push ecx
push dword [ebp + 0x528]
push dword [ebp - 0x60]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x41e4e5
mov eax, dword [ebp - 0x68]
and dword [ebp - 0x54], 0
mov dword [ebp - 0x5c], eax
jmp 0x41e4ee
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x54], eax
mov eax, dword [ebp - 0x5c]
test eax, eax
jne 0x41e54b
mov edi, dword [ebp - 0x6c]
xor esi, esi
cmp dword [ebp - 0x54], esi
je 0x41e51f
push 5
pop esi
cmp dword [ebp - 0x54], esi
jne 0x41e514
call fcn.00412fc0
mov dword [eax], 9
jmp 0x41e53f
push dword [ebp - 0x54]
call fcn.00412fe6
pop ecx
jmp 0x41e546
mov eax, dword [edi]
test byte [ebx + eax + 4], 0x40
je 0x41e534
mov eax, dword [ebp - 0x60]
cmp byte [eax], 0x1a
jne 0x41e534
xor eax, eax
jmp 0x41e54e
call fcn.00412fc0
mov dword [eax], 0x1c
call fcn.00412fd3
mov dword [eax], esi
or eax, 0xffffffff
jmp 0x41e54e
sub eax, dword [ebp - 0x64]
pop edi
pop ebx
mov ecx, dword [ebp + 0x514]
xor ecx, ebp
pop esi
call fcn.00411aba
add ebp, 0x518
leave
ret