Function at 0x406750
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x344
mov eax, dword [0x47bcc8]
xor eax, esp
mov dword [esp + 0x340], eax
mov eax, dword [esp + 0x348]
push esi
mov esi, dword [esp + 0x354]
test eax, eax
jne 0x406781
mov eax, 0x10000
jmp 0x406a30
cmp dword [eax], 1
je 0x406790
mov eax, 0x80000
jmp 0x406a30
push ebx
push ebp
push edi
mov edi, dword [eax + 4]
or ebx, 0xffffffff
cmp dword [edi + 4], ebx
je 0x4067a9
mov eax, dword [edi]
push eax
call fcn.004041e0
add esp, 4
mov eax, dword [edi]
mov ebp, dword [esp + 0x35c]
mov dword [edi + 4], ebx
cmp ebp, dword [eax + 4]
jl 0x4067c4
mov eax, 0x10000
jmp 0x406a2d
cmp ebp, dword [eax + 0x10]
jge 0x4067d2
push eax
call fcn.00403f40
add esp, 4
mov ecx, dword [edi]
cmp dword [ecx + 0x10], ebp
jge 0x4067f2
lea esp, [esp]
mov edx, dword [edi]
push edx
call fcn.00403f90
mov eax, dword [edi]
add esp, 4
cmp dword [eax + 0x10], ebp
jl 0x4067e0
lea ecx, [esp + 0x1c]
push ecx
push ebp
mov ecx, edi
call fcn.00404390
test byte [esp + 0x124], 0x10
mov al, byte [esi]
je 0x406846
cmp al, 0x2f
je 0x40681d
cmp al, 0x5c
je 0x40681d
test al, al
je 0x40682f
cmp byte [esi + 1], 0x3a
jne 0x40682f
push esi
push 0
call fcn.004048d0
add esp, 8
xor eax, eax
jmp 0x406a2d
push esi
add edi, 0x140
push edi
call fcn.004048d0
add esp, 8
xor eax, eax
jmp 0x406a2d
mov ebp, esi
mov ecx, esi
test al, al
je 0x406863
mov edi, edi
cmp al, 0x2f
je 0x406858
cmp al, 0x5c
jne 0x40685b
lea ebp, [ecx + 1]
mov al, byte [ecx + 1]
inc ecx
test al, al
jne 0x406850
lea edx, [esp + 0x148]
mov eax, esi
sub edx, esi
mov edi, edi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x406870
cmp ebp, esi
jne 0x4068ec
mov byte [esp + 0x148], cl
push ebp
lea eax, [esp + 0x14c]
push eax
lea esi, [edi + 0x140]
push esi
lea ecx, [esp + 0x258]
push 0x468280
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
lea edx, [esp + 0x15c]
push edx
push esi
call fcn.004048d0
add esp, 0x1c
mov eax, dword [esp + 0x124]
push 0
push eax
push 2
push 0
push 0
push 0x40000000
lea ecx, [esp + 0x264]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, eax
cmp ebp, ebx
jne 0x406950
mov eax, 0x200
jmp 0x406a2d
mov edx, ebp
sub edx, esi
mov byte [esp + edx + 0x148], 0
mov al, byte [esp + 0x148]
cmp al, 0x2f
je 0x40691d
cmp al, 0x5c
je 0x40691d
test al, al
je 0x406885
cmp byte [esp + 0x149], 0x3a
jne 0x406885
push ebp
lea eax, [esp + 0x14c]
push eax
lea ecx, [esp + 0x254]
push str._s_s
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
lea edx, [esp + 0x158]
push edx
push 0
call fcn.004048d0
add esp, 0x18
jmp 0x4068b9
mov edx, dword [edi + 0x138]
mov eax, dword [edi]
push edx
push eax
call fcn.00406150
add esp, 8
cmp dword [edi + 0x13c], 0
jne 0x40697e
push 0x4000
call fcn.00407174
add esp, 4
mov dword [edi + 0x13c], eax
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x14], 0
lea esp, [esp]
mov edx, dword [edi + 0x13c]
mov eax, dword [edi]
lea ecx, [esp + 0x13]
push ecx
push 0x4000
push edx
push eax
call fcn.004062e0
mov esi, eax
add esp, 0x10
cmp esi, 0xffffff96
je 0x4069e4
test esi, esi
jl 0x4069da
jle 0x4069cf
mov edx, dword [edi + 0x13c]
push 0
lea ecx, [esp + 0x1c]
push ecx
push esi
push edx
push ebp
call ebx
test eax, eax
je 0x4069ee
cmp byte [esp + 0x13], 0
jne 0x4069f8
test esi, esi
jne 0x406990
mov dword [esp + 0x14], 0x5000000
jmp 0x406a17
mov dword [esp + 0x14], 0x1000
jmp 0x406a17
mov dword [esp + 0x14], 0x400
jmp 0x406a17
lea eax, [esp + 0x138]
push eax
lea ecx, [esp + 0x12c]
push ecx
lea edx, [esp + 0x138]
push edx
push ebp
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [edi]
push eax
call fcn.004041e0
mov eax, dword [esp + 0x18]
add esp, 4
pop edi
pop ebp
pop ebx
mov ecx, dword [esp + 0x344]
pop esi
xor ecx, esp
mov dword [0x47d2e4], eax
call fcn.0041399b
add esp, 0x344
ret