Function at 0x404947
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, ecx
push edi
mov edi, ebx
cmp dword [esi + 0x3c], 7
jge 0x404962
push 7
call fcn.0040434a
cmp dword [esi + 0x3c], 9
jge 0x404c03
mov eax, dword [ebp + 8]
dec dword [ebp + 8]
test eax, eax
je 0x404b69
cmp byte [edi], 0xa
jne 0x404ab8
cmp dword [esi + 0x1a4], 0
je 0x404a40
mov eax, dword [esi + 0x1a8]
sub eax, ebx
add eax, edi
push eax
call sub.MFC42.DLL_operatornew
push dword [esi + 0x1a8]
mov dword [ebp + 0xc], eax
push dword [esi + 0x1a4]
push eax
call sub.MSVCRT.dll_memcpy
mov eax, edi
sub eax, ebx
push eax
mov eax, dword [esi + 0x1a8]
add eax, dword [ebp + 0xc]
push ebx
push eax
call sub.MSVCRT.dll_memcpy
mov eax, dword [esi + 0x1a8]
add esp, 0x1c
sub eax, ebx
mov ebx, dword [ebp + 0xc]
add eax, ebx
push ebx
mov ecx, esi
and byte [eax + edi - 1], 0
cmp dword [esi + 0x3c], 8
jge 0x404a00
call fcn.00404c7b
test eax, eax
je 0x404abe
push 8
mov ecx, esi
call fcn.0040434a
jmp 0x404a1d
call fcn.00404d95
cmp eax, 0x17
jne 0x404a1d
push dword [esi + 0x188]
call dword [sym.imp.MSVCRT.dll_atoi]
pop ecx
mov dword [esi + 0x1ac], eax
push ebx
call sub.MFC42.DLL_operatordelete
push dword [esi + 0x1a4]
call sub.MFC42.DLL_operatordelete
and dword [esi + 0x1a4], 0
and dword [esi + 0x1a8], 0
pop ecx
pop ecx
jmp 0x404ab5
mov eax, edi
sub eax, ebx
cmp eax, 1
mov dword [ebp - 4], eax
jle 0x404aec
push eax
call sub.MFC42.DLL_operatornew
push dword [ebp - 4]
mov dword [ebp + 0xc], eax
push ebx
push eax
call sub.MSVCRT.dll_memcpy
mov eax, dword [ebp + 0xc]
add esp, 0x10
sub eax, ebx
mov ecx, esi
push dword [ebp + 0xc]
and byte [eax + edi - 1], 0
cmp dword [esi + 0x3c], 8
jge 0x404a8f
call fcn.00404c7b
test eax, eax
je 0x404adc
push 8
mov ecx, esi
call fcn.0040434a
jmp 0x404aac
call fcn.00404d95
cmp eax, 0x17
jne 0x404aac
push dword [esi + 0x188]
call dword [sym.imp.MSVCRT.dll_atoi]
pop ecx
mov dword [esi + 0x1ac], eax
push dword [ebp + 0xc]
call sub.MFC42.DLL_operatordelete
pop ecx
lea ebx, [edi + 1]
inc edi
jmp 0x40496c
push ebx
call sub.MFC42.DLL_operatordelete
push dword [esi + 0x1a4]
lea edi, [esi + 0x1a4]
call sub.MFC42.DLL_operatordelete
and dword [edi], 0
pop ecx
pop ecx
jmp 0x404ae5
push dword [ebp + 0xc]
call sub.MFC42.DLL_operatordelete
pop ecx
push 0xa
jmp 0x404c6a
push 9
mov ecx, esi
call fcn.0040434a
mov eax, dword [esi + 0x40]
lea ebx, [edi + 1]
test eax, eax
je 0x404b69
cmp dword [esi + 0x44], 0
jne 0x404b69
push 0x40e3f4
push eax
call sub.MSVCRT.dll_strcmp
pop ecx
test eax, eax
pop ecx
jne 0x404b42
mov eax, dword [esi + 0x1ac]
test eax, eax
je 0x404b69
cmp dword [esi + 0x30], 0
jne 0x404b69
push eax
call sub.MFC42.DLL_operatornew
push dword [esi + 0x1ac]
mov dword [esi + 0x30], eax
push 0
push eax
call sub.MSVCRT.dll_memset
add esp, 0x10
jmp 0x404b69
push 0
push 0x80
push 2
push 0
push 3
push 0x40000000
push dword [esi + 0x40]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [esi + 0x44], eax
jne 0x404b69
and dword [esi + 0x44], 0
cmp dword [esi + 0x3c], 9
jge 0x404c03
mov dword [ebp - 4], edi
sub dword [ebp - 4], ebx
je 0x404c03
cmp dword [esi + 0x1a4], 0
je 0x404be1
mov eax, dword [esi + 0x1a8]
sub eax, ebx
add eax, edi
push eax
call sub.MFC42.DLL_operatornew
push dword [esi + 0x1a8]
mov dword [ebp + 0xc], eax
push dword [esi + 0x1a4]
push eax
call sub.MSVCRT.dll_memcpy
mov eax, dword [esi + 0x1a8]
push dword [ebp - 4]
add eax, dword [ebp + 0xc]
push ebx
push eax
call sub.MSVCRT.dll_memcpy
push dword [esi + 0x1a4]
call sub.MFC42.DLL_operatordelete
mov eax, dword [ebp + 0xc]
sub edi, ebx
add esp, 0x20
add dword [esi + 0x1a8], edi
mov dword [esi + 0x1a4], eax
jmp 0x404c03
push dword [ebp - 4]
call sub.MFC42.DLL_operatornew
mov edi, dword [ebp - 4]
mov dword [esi + 0x1a4], eax
push edi
push ebx
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0x10
mov dword [esi + 0x1a8], edi
mov eax, dword [esi + 0x3c]
cmp eax, 0xb
je 0x404c10
cmp eax, 9
jne 0x404c71
mov eax, dword [esi + 0x30]
test eax, eax
je 0x404c2c
push dword [ebp + 8]
mov ecx, dword [esi + 0x1b0]
add ecx, eax
push ebx
push ecx
call sub.MSVCRT.dll_memcpy
add esp, 0xc
mov eax, dword [ebp + 8]
push 0xb
add dword [esi + 0x1b0], eax
mov ecx, esi
call fcn.0040434a
mov eax, dword [esi + 0x44]
test eax, eax
je 0x404c5a
lea ecx, [ebp + 0xc]
and dword [ebp + 0xc], 0
push 0
push ecx
push dword [ebp + 8]
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esi + 0x1b0]
cmp eax, dword [esi + 0x1ac]
jne 0x404c71
push 0xc
mov ecx, esi
call fcn.0040434a
pop edi
pop esi
pop ebx
leave
ret 8