Function at 0x416469
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push ebx
push esi
mov esi, dword [ebp + 8]
test esi, esi
push edi
je 0x416e2b
cmp dword [ebp + 0xc], 0
je 0x416e2b
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x416e2b
cmp byte [ecx], 0
je 0x416e2b
test word [esi + 0x16c], 0x8000
jne 0x4164ad
push 5
jmp 0x416e2d
xor eax, eax
inc eax
test byte [ebp + 0x18], al
je 0x4164ba
xor dword [ebp + 0x18], eax
jmp 0x4164bc
xor eax, eax
push eax
push dword [0x46d630]
push ecx
push esi
call fcn.00414fc2
add esp, 0x10
test eax, eax
mov dword [ebp - 0x40], eax
je 0x416e33
mov cl, byte [esi + 0x142]
mov ebx, dword [ebp + 0x10]
mov edi, 0x200
shl edi, cl
xor edx, edx
mov eax, ebx
and dword [ebp - 0x38], 0
div edi
mov dword [ebp - 8], ebx
mov dword [ebp - 4], edi
test edx, edx
mov dword [ebp - 0x14], eax
je 0x416502
inc dword [ebp - 0x14]
mov eax, dword [ebp + 0x18]
xor edi, edi
and eax, 0x200
mov dword [ebp - 0x2c], edi
mov dword [ebp - 0x24], eax
jne 0x41651c
test word [ebp + 0x18], 0x100
je 0x416529
mov edi, dword [ebp - 0x14]
lea edi, [edi*4 + 4]
mov dword [ebp - 0x2c], edi
push 4
push dword [0x468014]
lea eax, [esi + 0x124]
push eax
call fcn.00437bcb
add esp, 0xc
test eax, eax
lea eax, [edi + ebx]
mov dword [ebp - 0x20], eax
jne 0x4165a9
add eax, 0x144
push eax
mov dword [ebp - 0x38], 1
call fcn.00413dde
mov edi, eax
test edi, edi
mov dword [ebp - 0x34], edi
je 0x416e33
push dword [ebp + 0x14]
mov byte [edi], 0x44
mov byte [edi + 1], 1
call fcn.00437b40
pop ecx
mov ecx, 0x104
cmp eax, ecx
ja 0x416591
push eax
push dword [ebp + 0x14]
lea eax, [edi + 0x40]
push eax
call fcn.004377d0
jmp 0x41659e
push ecx
push dword [ebp + 0x14]
lea eax, [edi + 0x40]
push eax
call fcn.00439460
add esp, 0xc
lea eax, [edi + 0x144]
jmp 0x4165b2
push eax
call fcn.00413dde
mov edi, dword [ebp - 0x34]
test eax, eax
mov dword [ebp + 8], eax
mov ecx, 0x10000
mov edx, 0x20000
jne 0x41661d
test ebx, ebx
jne 0x416e33
cmp dword [ebp - 0x24], 0
je 0x4165d8
xor dword [ebp + 0x18], 0x200
mov eax, pe_nt_image_headers32
test dword [ebp + 0x18], eax
je 0x4165e5
xor dword [ebp + 0x18], eax
test dword [ebp + 0x18], ecx
je 0x4165ed
xor dword [ebp + 0x18], ecx
test dword [ebp + 0x18], edx
je 0x4165f5
xor dword [ebp + 0x18], edx
mov ebx, dword [ebp - 0x14]
mov eax, ebx
shl eax, 2
mov dword [ebp - 0x3c], eax
add eax, 4
push eax
call fcn.00413dde
test eax, eax
mov dword [ebp - 0x10], eax
jne 0x416632
push dword [ebp + 8]
call fcn.004136f6
jmp 0x416e33
test ebx, ebx
je 0x4165cb
push ebx
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.004377d0
add esp, 0xc
jmp 0x4165f5
mov eax, dword [ebp + 0x18]
and eax, 0x200
mov dword [ebp - 0x24], eax
jne 0x416679
test word [ebp + 0x18], 0x100
jne 0x416679
lea edx, [ebx + 1]
xor eax, eax
test edx, edx
jbe 0x4168e6
xor ecx, ecx
cmp eax, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x10]
jae 0x416663
mov dword [ebx + eax*4], ecx
jmp 0x41666c
mov edi, dword [ebp + 0x10]
mov dword [ebx + eax*4], edi
mov edi, dword [ebp - 0x34]
add ecx, dword [ebp - 4]
inc eax
cmp eax, edx
jb 0x416656
jmp 0x4168e6
and dword [ebp - 8], 0
test byte [ebp + 0x1c], 0xc0
push 8
pop ebx
je 0x4166c8
mov edi, dword [ebp + 8]
push 4
push dword [0x468018]
push edi
call fcn.00437bcb
add esp, 0xc
test eax, eax
jne 0x4166c1
push ebx
push dword [0x46801c]
lea eax, [edi + 8]
push eax
call fcn.00437bcb
add esp, 0xc
test eax, eax
jne 0x4166c1
cmp byte [edi + 0x14], 1
jne 0x4166c1
cmp byte [edi + 0x22], 0x10
je 0x4166c8
and dword [ebp + 0x20], 0
mov dword [ebp + 0x1c], ebx
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x30], eax
and dword [ebp - 0x30], 0x40
jne 0x416702
test al, al
js 0x416702
test al, 9
jne 0x4166fa
cmp dword [ebp - 0x24], 0x200
je 0x4166ed
test word [ebp + 0x18], 0x100
jne 0x4166fa
test al, 2
je 0x416721
mov dword [ebp - 8], 1
jmp 0x416721
mov eax, dword [ebp + 0x20]
mov dword [ebp - 8], eax
jmp 0x41670b
mov eax, dword [ebp + 0x20]
dec eax
je 0x41671a
dec eax
je 0x416711
and dword [ebp + 0x20], 0
jmp 0x416721
mov dword [ebp + 0x20], 3
jmp 0x416721
mov dword [ebp + 0x20], 1
push dword [ebp - 4]
mov edi, dword [ebp - 0x2c]
call fcn.00413dde
mov ebx, eax
test ebx, ebx
jne 0x41673f
push dword [ebp - 0x10]
call fcn.004136f6
jmp 0x416610
push dword [ebp - 4]
call fcn.00413dde
test eax, eax
mov dword [ebp - 0xc], eax
jne 0x416756
push ebx
call fcn.004136f6
jmp 0x416732
push dword [ebp - 0x20]
call fcn.00413dde
test eax, eax
mov dword [ebp - 0x20], eax
jne 0x41676f
push dword [ebp - 0xc]
call fcn.004136f6
jmp 0x41674e
mov eax, dword [ebp - 0x14]
and dword [ebp - 0x18], 0
and dword [ebp - 0x1c], 0
test eax, eax
jbe 0x4168a3
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x10]
dec eax
cmp ecx, eax
mov dword [edx + ecx*4], edi
jne 0x41679f
mov eax, dword [ebp + 0x10]
xor edx, edx
div dword [ebp - 4]
test edx, edx
je 0x41679f
mov dword [ebp - 4], edx
mov eax, dword [ebp - 4]
mov ecx, dword [ebp + 8]
push eax
mov dword [ebp + 0xc], eax
mov eax, dword [ebp - 0x18]
add eax, ecx
push eax
push ebx
call fcn.004377d0
add esp, 0xc
cmp dword [ebp - 0x24], 0
je 0x416829
cmp dword [ebp - 0x1c], 0
jne 0x4167d8
cmp dword [ebp - 0x30], 0
jne 0x4167d0
test byte [ebp + 0x1c], 0x80
je 0x4167d8
push 0
push 0
push 8
jmp 0x41680d
test byte [ebp + 0x1c], 0x34
je 0x416804
call fcn.00413d72
mov eax, dword [0x46d660]
test eax, eax
je 0x41685a
push dword [ebp + 0x20]
lea ecx, [ebp + 0xc]
push dword [ebp - 8]
push dword [ebp + 0x1c]
push dword [ebp - 4]
push ebx
push ecx
push dword [ebp - 0xc]
call eax
jmp 0x41681d
push dword [ebp + 0x20]
push dword [ebp - 8]
push dword [ebp + 0x1c]
push dword [ebp - 4]
lea eax, [ebp + 0xc]
push ebx
push eax
push dword [ebp - 0xc]
call fcn.0041723e
test eax, eax
jne 0x41685a
mov eax, dword [ebp - 4]
mov dword [ebp + 0xc], eax
jmp 0x41685a
test word [ebp + 0x18], 0x100
je 0x41685a
push 0
push dword [ebp - 8]
lea eax, [ebp + 0xc]
push 8
push dword [ebp - 4]
push ebx
push eax
push dword [ebp - 0xc]
call fcn.0041723e
test eax, eax
jne 0x416854
mov eax, dword [ebp - 4]
mov dword [ebp + 0xc], eax
jmp 0x416862
inc dword [ebp - 0xc]
dec dword [ebp + 0xc]
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp - 4]
jb 0x416879
push dword [ebp - 4]
mov eax, dword [ebp - 0x20]
add eax, edi
push ebx
push eax
call fcn.004377d0
add esp, 0xc
add edi, dword [ebp - 4]
jmp 0x41688e
push eax
mov eax, dword [ebp - 0x20]
push dword [ebp - 0xc]
add eax, edi
push eax
call fcn.004377d0
add esp, 0xc
add edi, dword [ebp + 0xc]
mov eax, dword [ebp - 4]
add dword [ebp - 0x18], eax
inc dword [ebp - 0x1c]
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 0x1c], eax
jb 0x416782
mov eax, dword [ebp - 0x10]
push dword [ebp - 0x2c]
mov ecx, dword [ebp - 0x3c]
push eax
push dword [ebp - 0x20]
mov dword [ebp - 8], edi
mov dword [ecx + eax], edi
call fcn.004377d0
add esp, 0xc
push dword [ebp - 0xc]
call fcn.004136f6
push ebx
call fcn.004136f6
push edi
push dword [ebp - 0x20]
push dword [ebp + 8]
call fcn.004377d0
add esp, 0xc
push dword [ebp - 0x20]
call fcn.004136f6
mov edi, dword [ebp - 0x34]
cmp dword [ebp - 0x38], 1
jne 0x4168f6
add dword [ebp - 8], 0x144
mov dword [ebp + 8], edi
mov ebx, dword [ebp - 0x40]
mov ecx, dword [ebx + 4]
mov eax, dword [esi + 0x13c]
and dword [ebp + 0x20], 0
shl eax, 4
and ecx, 0xfffffffe
cmp ecx, 0xfffffffe
mov dword [ebp + 0x1c], eax
jne 0x416968
add eax, 0x10
push eax
call fcn.00413dde
mov edi, eax
test edi, edi
je 0x416610
mov eax, dword [esi + 0x11c]
test eax, eax
je 0x416945
mov ecx, dword [esi + 0x13c]
shl ecx, 4
push ecx
push eax
push edi
call fcn.004377d0
add esp, 0xc
mov eax, dword [esi + 0x11c]
inc dword [esi + 0x13c]
test eax, eax
je 0x41695b
push eax
call fcn.004136f6
mov dword [esi + 0x11c], edi
mov dword [ebp + 0x20], 1
mov eax, dword [ebx + 4]
mov edi, dword [esi + 0x13c]
mov ecx, eax
and ecx, 0xfffffffe
dec edi
cmp ecx, 0xfffffffe
jne 0x4169b4
push 1
push dword [ebp + 0x14]
call fcn.00413b88
push 2
push dword [ebp + 0x14]
mov dword [ebx + 8], eax
call fcn.00413b88
mov dword [ebx + 0xc], eax
mov eax, dword [0x46d630]
mov dword [ebx], eax
mov dword [ebx + 4], edi
mov ecx, dword [esi + 0x11c]
mov eax, edi
shl eax, 4
add esp, 0x10
and dword [eax + ecx], 0
jmp 0x4169b6
mov edi, eax
mov eax, dword [esi + 0x11c]
shl edi, 4
add eax, edi
mov ecx, dword [eax]
test ecx, ecx
je 0x4169d3
mov ecx, dword [ebp - 8]
cmp dword [eax + 8], ecx
jae 0x416ad2
mov ebx, dword [esi + 0x138]
mov edx, dword [esi + 0x130]
mov ecx, dword [esi + 0x12c]
shl ebx, 4
add ebx, edx
mov edx, ebx
mov ebx, dword [ebp + 0x1c]
add edx, ebx
cmp edx, ecx
jne 0x416a5f
mov ebx, dword [eax + 8]
add ebx, dword [eax]
mov edx, dword [esi + 0x130]
cmp ebx, edx
jne 0x416a40
sub edx, dword [eax + 8]
mov ebx, dword [ebp - 8]
add edx, ebx
mov dword [esi + 0x130], edx
mov edx, ebx
sub edx, dword [eax + 8]
add dword [esi + 0x134], edx
sub ecx, dword [eax + 8]
add ecx, ebx
cmp dword [ebp + 0x20], 1
mov dword [esi + 0x12c], ecx
jne 0x416ad2
add ecx, 0x10
mov dword [esi + 0x12c], ecx
jmp 0x416ad2
mov dword [eax], edx
mov eax, dword [ebp - 8]
add dword [esi + 0x130], eax
add dword [esi + 0x134], eax
add dword [esi + 0x12c], eax
mov eax, dword [esi + 0x12c]
jmp 0x416ac3
mov edx, dword [esi + 0x134]
add ebx, edx
cmp ebx, ecx
jne 0x416a95
mov ecx, dword [eax + 8]
add ecx, dword [eax]
cmp ecx, edx
jne 0x416a8e
sub edx, dword [eax + 8]
mov ecx, dword [ebp - 8]
add edx, dword [ebp - 8]
mov dword [esi + 0x134], edx
sub ecx, dword [eax + 8]
add dword [esi + 0x12c], ecx
jmp 0x416a57
mov dword [eax], edx
mov eax, dword [ebp - 8]
jmp 0x416a4b
mov edx, dword [eax + 8]
add edx, dword [eax]
cmp edx, ecx
jne 0x416aa2
mov eax, dword [eax]
jmp 0x416aad
mov dword [eax], ecx
mov eax, dword [esi + 0x11c]
mov eax, dword [eax + edi]
mov ecx, dword [ebp - 8]
add eax, ecx
mov ecx, dword [ebp + 0x1c]
mov dword [esi + 0x134], eax
add eax, ecx
mov dword [esi + 0x12c], eax
cmp dword [ebp + 0x20], 1
jne 0x416ad2
add eax, 0x10
mov dword [esi + 0x12c], eax
mov eax, dword [esi + 0x11c]
mov ecx, dword [ebp - 8]
mov ebx, dword [sym.imp.KERNEL32.DLL_SetFilePointer]
mov dword [eax + edi + 8], ecx
mov eax, dword [esi + 0x11c]
mov ecx, dword [ebp + 0x10]
mov dword [eax + edi + 0xc], ecx
mov eax, dword [ebp + 0x18]
mov ecx, dword [esi + 0x11c]
push 0
or eax, 0x80000000
mov dword [ecx + edi + 4], eax
mov eax, dword [esi + 0x11c]
mov eax, dword [edi + eax]
push 0
push dword [esi + 0x15c]
mov dword [ebp + 0x10], eax
push dword [esi + 0x120]
call ebx
push 0
lea eax, [ebp - 0x28]
push eax
push dword [esi + 0x128]
lea eax, [esi + 0x124]
push eax
push dword [esi + 0x120]
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test dword [ebp + 0x18], 0x10000
je 0x416bf4
push 3
push dword [ebp + 0x14]
call fcn.00413b88
test dword [ebp + 0x18], 0x20000
pop ecx
pop ecx
mov dword [ebp + 0x20], eax
je 0x416b79
mov eax, dword [esi + 0x11c]
add eax, edi
mov ecx, dword [eax]
add ecx, dword [ebp + 0x20]
xor ecx, dword [eax + 0xc]
mov dword [ebp + 0x20], ecx
mov cl, byte [esi + 0x142]
mov eax, 0x200
shl eax, cl
xor edx, edx
mov dword [ebp + 0x1c], eax
mov eax, dword [esi + 0x11c]
mov eax, dword [eax + edi + 0xc]
div dword [ebp + 0x1c]
test edx, edx
mov dword [ebp + 0x1c], eax
je 0x416ba2
inc dword [ebp + 0x1c]
cmp dword [ebp - 0x24], 0x200
je 0x416bb3
test word [ebp + 0x18], 0x100
je 0x416bc6
mov eax, dword [ebp + 0x20]
dec eax
push eax
push dword [ebp - 0x2c]
push dword [ebp + 8]
call fcn.00413c11
add esp, 0xc
xor edi, edi
cmp dword [ebp + 0x1c], edi
jbe 0x416bf4
mov ecx, dword [ebp - 0x10]
mov eax, dword [ecx + edi*4]
mov ecx, dword [ecx + edi*4 + 4]
push dword [ebp + 0x20]
sub ecx, eax
push ecx
mov ecx, dword [ebp + 8]
add eax, ecx
push eax
call fcn.00413c11
add esp, 0xc
inc dword [ebp + 0x20]
inc edi
cmp edi, dword [ebp + 0x1c]
jb 0x416bcd
push dword [ebp - 0x10]
call fcn.004136f6
mov eax, dword [esi + 0x15c]
add eax, dword [ebp + 0x10]
xor edi, edi
push edi
push edi
push eax
push dword [esi + 0x120]
call ebx
push edi
mov edi, dword [sym.imp.KERNEL32.DLL_WriteFile]
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 8]
push dword [ebp + 8]
push dword [esi + 0x120]
call edi
push dword [ebp + 8]
call fcn.004136f6
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
call fcn.00413dde
mov dword [ebp + 8], eax
test eax, eax
mov eax, dword [esi + 0x138]
je 0x416cba
shl eax, 4
push eax
push dword [esi + 0x118]
push dword [ebp + 8]
call fcn.004377d0
push dword [0x46d520]
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [ebp + 8]
call fcn.00413c11
mov eax, dword [esi + 0x130]
add eax, dword [esi + 0x15c]
add esp, 0x18
push 0
push 0
push eax
push dword [esi + 0x120]
call ebx
push 0
lea eax, [ebp - 0x28]
push eax
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [ebp + 8]
push dword [esi + 0x120]
call edi
push dword [ebp + 8]
call fcn.004136f6
jmp 0x416d27
push dword [0x46d520]
shl eax, 4
push eax
push dword [esi + 0x118]
call fcn.00413c11
mov eax, dword [esi + 0x130]
add eax, dword [esi + 0x15c]
add esp, 0xc
push 0
push 0
push eax
push dword [esi + 0x120]
call ebx
push 0
lea eax, [ebp - 0x28]
push eax
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [esi + 0x118]
push dword [esi + 0x120]
call edi
push dword [0x46d520]
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [esi + 0x118]
call fcn.00413c74
add esp, 0xc
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
call fcn.00413dde
mov dword [ebp + 8], eax
test eax, eax
mov eax, dword [esi + 0x13c]
je 0x416dae
shl eax, 4
push eax
push dword [esi + 0x11c]
push dword [ebp + 8]
call fcn.004377d0
push dword [0x46d524]
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [ebp + 8]
call fcn.00413c11
mov eax, dword [esi + 0x134]
add eax, dword [esi + 0x15c]
add esp, 0x18
push 0
push 0
push eax
push dword [esi + 0x120]
call ebx
push 0
lea eax, [ebp - 0x28]
push eax
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [ebp + 8]
push dword [esi + 0x120]
call edi
push dword [ebp + 8]
call fcn.004136f6
jmp 0x416e1b
push dword [0x46d524]
shl eax, 4
push eax
push dword [esi + 0x11c]
call fcn.00413c11
mov eax, dword [esi + 0x134]
add eax, dword [esi + 0x15c]
add esp, 0xc
push 0
push 0
push eax
push dword [esi + 0x120]
call ebx
push 0
lea eax, [ebp - 0x28]
push eax
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [esi + 0x11c]
push dword [esi + 0x120]
call edi
push dword [0x46d524]
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [esi + 0x11c]
call fcn.00413c74
add esp, 0xc
push dword [ebp + 0x14]
push esi
call fcn.0041558c
pop ecx
xor eax, eax
pop ecx
inc eax
jmp 0x416e35
push 0x57
call dword [sym.imp.KERNEL32.DLL_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x1c