Function at 0x412033
Capabilities:
Delete file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x460
mov edx, dword [ebp + 0x28]
push edi
xor edi, edi
mov eax, edx
dec eax
mov dword [ebp - 8], edi
je 0x412065
sub eax, 3
je 0x412065
sub eax, 4
je 0x412065
sub eax, 0x10
je 0x412065
sub eax, 8
je 0x412065
xor eax, eax
jmp 0x412444
push ebx
push esi
cmp edx, 8
jg 0x4120c0
xor eax, eax
inc eax
mov ecx, edx
shl eax, cl
mov dword [ebp - 0xc], eax
lea ecx, [eax*4 + 0x36]
mov eax, edx
dec eax
je 0x41209c
sub eax, 3
je 0x412091
sub eax, 4
jne 0x4120ad
mov eax, dword [ebp + 0x14]
jmp 0x4120b0
mov eax, dword [ebp + 0x14]
inc eax
cdq
sub eax, edx
sar eax, 1
jmp 0x4120b0
mov eax, dword [ebp + 0x14]
add eax, 7
cdq
and edx, 7
add eax, edx
sar eax, 3
jmp 0x4120b0
mov eax, dword [ebp - 0x14]
lea ebx, [eax + 3]
and ebx, 0xfffffffc
mov dword [ebp - 0x14], ebx
jne 0x4120dc
push 4
pop ebx
jmp 0x4120d9
mov eax, edx
cdq
and edx, 7
lea ebx, [edx + eax]
sar ebx, 3
imul ebx, dword [ebp + 0x14]
push 0x36
add ebx, 3
pop ecx
and ebx, 0xfffffffc
mov dword [ebp - 0x14], ebx
mov eax, dword [ebp + 0x18]
push edi
mov esi, ebx
imul esi, eax
push pe_nt_image_headers32
push 2
mov dword [ebp - 0x58], eax
push edi
mov edx, 0x4d42
xor eax, eax
mov word [ebp - 0x38], dx
lea edx, [esi + ecx]
push 1
inc eax
push 0xc0000000
push dword [ebp + 8]
mov dword [ebp - 0x36], edx
xor edx, edx
mov dword [ebp - 0x2e], ecx
mov ecx, dword [ebp + 0x14]
mov word [ebp - 0x54], ax
mov ax, word [ebp + 0x28]
mov word [ebp - 0x32], dx
mov word [ebp - 0x30], dx
mov dword [ebp - 0x60], 0x28
mov dword [ebp - 0x5c], ecx
mov word [ebp - 0x52], ax
mov dword [ebp - 0x50], edi
mov dword [ebp - 0x4c], esi
mov dword [ebp - 0x48], edi
mov dword [ebp - 0x44], edi
mov dword [ebp - 0x40], edi
mov dword [ebp - 0x3c], edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x10], eax
cmp eax, 0xffffffff
je 0x41243f
push edi
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea ecx, [ebp - 4]
push ecx
push 0xe
lea ecx, [ebp - 0x38]
push ecx
push eax
call edi
test eax, eax
je 0x412427
cmp dword [ebp - 4], 0xe
jne 0x412427
push 0
lea eax, [ebp - 4]
push eax
push 0x28
lea eax, [ebp - 0x60]
push eax
push dword [ebp - 0x10]
call edi
test eax, eax
je 0x412427
cmp dword [ebp - 4], 0x28
jne 0x412427
mov eax, dword [ebp + 0x28]
cmp eax, 1
je 0x412342
cmp eax, 4
je 0x412342
cmp eax, 8
je 0x412342
cmp dword [ebp + 0x1c], 0x18
je 0x4121c9
cmp dword [ebp + 0x1c], 0x20
jne 0x412200
test byte [ebp + 0x20], 2
je 0x412200
cmp dword [ebp + 0x10], ebx
jne 0x412200
push 0
lea eax, [ebp - 4]
push eax
push esi
push dword [ebp + 0xc]
push dword [ebp - 0x10]
call edi
test eax, eax
je 0x412427
cmp dword [ebp - 4], esi
jne 0x412427
mov dword [ebp - 8], 1
jmp 0x412427
push ebx
push 8
push dword [0x43f0b0]
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x412427
mov esi, dword [ebp + 0x18]
and dword [ebp - 0x1c], 0
mov dword [ebp - 8], 1
test esi, esi
jle 0x41232c
mov eax, dword [ebp + 0x20]
mov ecx, dword [ebp + 0x10]
and eax, 2
neg ecx
dec esi
imul esi, dword [ebp + 0x10]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x28], ecx
add esi, eax
cmp dword [ebp - 0x24], 0
mov edi, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x18]
jne 0x41225c
mov ecx, esi
mov eax, dword [ebp + 0x14]
test eax, eax
jle 0x4122f2
mov dword [ebp - 0x20], eax
cmp dword [ebp + 0x1c], 0x20
jne 0x4122c4
movzx eax, byte [ecx + 2]
movzx edx, byte [ecx + 3]
sub eax, 0xff
imul eax, edx
add eax, 0xfe01
cdq
mov ebx, 0xff
idiv ebx
mov byte [edi + 2], al
movzx eax, byte [ecx + 1]
movzx edx, byte [ecx + 3]
sub eax, ebx
imul eax, edx
add eax, 0xfe01
cdq
idiv ebx
mov byte [edi + 1], al
movzx eax, byte [ecx]
movzx edx, byte [ecx + 3]
sub eax, ebx
imul eax, edx
add eax, 0xfe01
cdq
idiv ebx
mov ebx, dword [ebp - 0x14]
add ecx, 4
jmp 0x4122d5
mov al, byte [ecx + 2]
mov byte [edi + 2], al
mov al, byte [ecx + 1]
mov byte [edi + 1], al
mov al, byte [ecx]
add ecx, 3
cmp dword [ebp + 0x28], 0x20
mov byte [edi], al
jne 0x4122e6
mov byte [edi + 3], 0
add edi, 4
jmp 0x4122e9
add edi, 3
dec dword [ebp - 0x20]
jne 0x41226a
push 0
lea eax, [ebp - 4]
push eax
push ebx
push dword [ebp - 0xc]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x412328
cmp dword [ebp - 4], ebx
jne 0x412328
mov eax, dword [ebp + 0x10]
inc dword [ebp - 0x1c]
add dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x1c]
add esi, dword [ebp - 0x28]
cmp eax, dword [ebp + 0x18]
jl 0x41224e
jmp 0x41232c
and dword [ebp - 8], 0
push dword [ebp - 0xc]
push 0
push dword [0x43f0b0]
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x412427
push dword [ebp + 0x24]
push eax
push dword [ebp + 0x10]
push dword [ebp + 0x1c]
push dword [ebp + 0x18]
push dword [ebp + 0x14]
push dword [ebp + 0xc]
call fcn.0041261d
xor esi, esi
add esp, 0x1c
mov dword [ebp + 0x28], eax
cmp dword [ebp - 0xc], esi
jle 0x412390
add eax, 0x51
mov cl, byte [eax + 1]
mov byte [ebp + esi*4 - 0x45e], cl
mov cl, byte [eax]
mov byte [ebp + esi*4 - 0x45f], cl
mov cl, byte [eax - 1]
mov byte [ebp + esi*4 - 0x460], cl
inc esi
add eax, 4
cmp esi, dword [ebp - 0xc]
jl 0x41236a
mov esi, dword [ebp - 0xc]
push 0
lea eax, [ebp - 4]
push eax
shl esi, 2
push esi
lea eax, [ebp - 0x460]
push eax
push dword [ebp - 0x10]
call edi
test eax, eax
je 0x4123b9
cmp dword [ebp - 4], esi
jne 0x4123b9
mov dword [ebp - 8], 1
test byte [ebp + 0x20], 2
je 0x4123ef
xor esi, esi
cmp dword [ebp + 0x18], esi
jle 0x41241e
push 0
lea eax, [ebp - 4]
push eax
push ebx
push esi
push dword [ebp + 0x28]
call fcn.00412c4c
pop ecx
pop ecx
push eax
push dword [ebp - 0x10]
call edi
test eax, eax
je 0x41241a
cmp dword [ebp - 4], ebx
jne 0x41241a
inc esi
cmp esi, dword [ebp + 0x18]
jl 0x4123c6
jmp 0x41241e
mov esi, dword [ebp + 0x18]
jmp 0x412415
push 0
lea eax, [ebp - 4]
push eax
push ebx
push esi
push dword [ebp + 0x28]
call fcn.00412c4c
pop ecx
pop ecx
push eax
push dword [ebp - 0x10]
call edi
test eax, eax
je 0x41241a
cmp dword [ebp - 4], ebx
jne 0x41241a
dec esi
jns 0x4123f4
jmp 0x41241e
and dword [ebp - 8], 0
push dword [ebp + 0x28]
call fcn.004127cb
pop ecx
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 8], 0
jne 0x41243f
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
mov eax, dword [ebp - 8]
pop esi
pop ebx
pop edi
leave
ret