Function at 0x4165ab
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 0x416f6d
cmp dword [ebp + 0xc], 0
je 0x416f6d
mov ecx, dword [ebp + 0x14]
test ecx, ecx
je 0x416f6d
cmp byte [ecx], 0
je 0x416f6d
test word [esi + 0x16c], 0x8000
jne 0x4165ef
push 5
jmp 0x416f6f
xor eax, eax
inc eax
test byte [ebp + 0x18], al
je 0x4165fc
xor dword [ebp + 0x18], eax
jmp 0x4165fe
xor eax, eax
push eax
push dword [0x46d630]
push ecx
push esi
call fcn.00415104
add esp, 0x10
test eax, eax
mov dword [ebp - 0x40], eax
je 0x416f75
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 0x416644
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 0x41665e
test word [ebp + 0x18], 0x100
je 0x41666b
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.00437ceb
add esp, 0xc
test eax, eax
lea eax, [edi + ebx]
mov dword [ebp - 0x20], eax
jne 0x4166eb
add eax, 0x144
push eax
mov dword [ebp - 0x38], 1
call fcn.00413f20
mov edi, eax
test edi, edi
mov dword [ebp - 0x34], edi
je 0x416f75
push dword [ebp + 0x14]
mov byte [edi], 0x44
mov byte [edi + 1], 1
call fcn.00437c60
pop ecx
mov ecx, 0x104
cmp eax, ecx
ja 0x4166d3
push eax
push dword [ebp + 0x14]
lea eax, [edi + 0x40]
push eax
call fcn.004378f0
jmp 0x4166e0
push ecx
push dword [ebp + 0x14]
lea eax, [edi + 0x40]
push eax
call fcn.00439580
add esp, 0xc
lea eax, [edi + 0x144]
jmp 0x4166f4
push eax
call fcn.00413f20
mov edi, dword [ebp - 0x34]
test eax, eax
mov dword [ebp + 8], eax
mov ecx, 0x10000
mov edx, 0x20000
jne 0x41675f
test ebx, ebx
jne 0x416f75
cmp dword [ebp - 0x24], 0
je 0x41671a
xor dword [ebp + 0x18], 0x200
mov eax, pe_nt_image_headers32
test dword [ebp + 0x18], eax
je 0x416727
xor dword [ebp + 0x18], eax
test dword [ebp + 0x18], ecx
je 0x41672f
xor dword [ebp + 0x18], ecx
test dword [ebp + 0x18], edx
je 0x416737
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.00413f20
test eax, eax
mov dword [ebp - 0x10], eax
jne 0x416774
push dword [ebp + 8]
call fcn.00417ab1
jmp 0x416f75
test ebx, ebx
je 0x41670d
push ebx
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.004378f0
add esp, 0xc
jmp 0x416737
mov eax, dword [ebp + 0x18]
and eax, 0x200
mov dword [ebp - 0x24], eax
jne 0x4167bb
test word [ebp + 0x18], 0x100
jne 0x4167bb
lea edx, [ebx + 1]
xor eax, eax
test edx, edx
jbe 0x416a28
xor ecx, ecx
cmp eax, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x10]
jae 0x4167a5
mov dword [ebx + eax*4], ecx
jmp 0x4167ae
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 0x416798
jmp 0x416a28
and dword [ebp - 8], 0
test byte [ebp + 0x1c], 0xc0
push 8
pop ebx
je 0x41680a
mov edi, dword [ebp + 8]
push 4
push dword [0x468018]
push edi
call fcn.00437ceb
add esp, 0xc
test eax, eax
jne 0x416803
push ebx
push dword [0x46801c]
lea eax, [edi + 8]
push eax
call fcn.00437ceb
add esp, 0xc
test eax, eax
jne 0x416803
cmp byte [edi + 0x14], 1
jne 0x416803
cmp byte [edi + 0x22], 0x10
je 0x41680a
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 0x416844
test al, al
js 0x416844
test al, 9
jne 0x41683c
cmp dword [ebp - 0x24], 0x200
je 0x41682f
test word [ebp + 0x18], 0x100
jne 0x41683c
test al, 2
je 0x416863
mov dword [ebp - 8], 1
jmp 0x416863
mov eax, dword [ebp + 0x20]
mov dword [ebp - 8], eax
jmp 0x41684d
mov eax, dword [ebp + 0x20]
dec eax
je 0x41685c
dec eax
je 0x416853
and dword [ebp + 0x20], 0
jmp 0x416863
mov dword [ebp + 0x20], 3
jmp 0x416863
mov dword [ebp + 0x20], 1
push dword [ebp - 4]
mov edi, dword [ebp - 0x2c]
call fcn.00413f20
mov ebx, eax
test ebx, ebx
jne 0x416881
push dword [ebp - 0x10]
call fcn.00417ab1
jmp 0x416752
push dword [ebp - 4]
call fcn.00413f20
test eax, eax
mov dword [ebp - 0xc], eax
jne 0x416898
push ebx
call fcn.00417ab1
jmp 0x416874
push dword [ebp - 0x20]
call fcn.00413f20
test eax, eax
mov dword [ebp - 0x20], eax
jne 0x4168b1
push dword [ebp - 0xc]
call fcn.00417ab1
jmp 0x416890
mov eax, dword [ebp - 0x14]
and dword [ebp - 0x18], 0
and dword [ebp - 0x1c], 0
test eax, eax
jbe 0x4169e5
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x10]
dec eax
cmp ecx, eax
mov dword [edx + ecx*4], edi
jne 0x4168e1
mov eax, dword [ebp + 0x10]
xor edx, edx
div dword [ebp - 4]
test edx, edx
je 0x4168e1
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.004378f0
add esp, 0xc
cmp dword [ebp - 0x24], 0
je 0x41696b
cmp dword [ebp - 0x1c], 0
jne 0x41691a
cmp dword [ebp - 0x30], 0
jne 0x416912
test byte [ebp + 0x1c], 0x80
je 0x41691a
push 0
push 0
push 8
jmp 0x41694f
test byte [ebp + 0x1c], 0x34
je 0x416946
call fcn.00413eb4
mov eax, dword [0x46d660]
test eax, eax
je 0x41699c
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 0x41695f
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.00417380
test eax, eax
jne 0x41699c
mov eax, dword [ebp - 4]
mov dword [ebp + 0xc], eax
jmp 0x41699c
test word [ebp + 0x18], 0x100
je 0x41699c
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.00417380
test eax, eax
jne 0x416996
mov eax, dword [ebp - 4]
mov dword [ebp + 0xc], eax
jmp 0x4169a4
inc dword [ebp - 0xc]
dec dword [ebp + 0xc]
mov eax, dword [ebp + 0xc]
cmp eax, dword [ebp - 4]
jb 0x4169bb
push dword [ebp - 4]
mov eax, dword [ebp - 0x20]
add eax, edi
push ebx
push eax
call fcn.004378f0
add esp, 0xc
add edi, dword [ebp - 4]
jmp 0x4169d0
push eax
mov eax, dword [ebp - 0x20]
push dword [ebp - 0xc]
add eax, edi
push eax
call fcn.004378f0
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 0x4168c4
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.004378f0
add esp, 0xc
push dword [ebp - 0xc]
call fcn.00417ab1
push ebx
call fcn.00417ab1
push edi
push dword [ebp - 0x20]
push dword [ebp + 8]
call fcn.004378f0
add esp, 0xc
push dword [ebp - 0x20]
call fcn.00417ab1
mov edi, dword [ebp - 0x34]
cmp dword [ebp - 0x38], 1
jne 0x416a38
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 0x416aaa
add eax, 0x10
push eax
call fcn.00413f20
mov edi, eax
test edi, edi
je 0x416752
mov eax, dword [esi + 0x11c]
test eax, eax
je 0x416a87
mov ecx, dword [esi + 0x13c]
shl ecx, 4
push ecx
push eax
push edi
call fcn.004378f0
add esp, 0xc
mov eax, dword [esi + 0x11c]
inc dword [esi + 0x13c]
test eax, eax
je 0x416a9d
push eax
call fcn.00417ab1
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 0x416af6
push 1
push dword [ebp + 0x14]
call fcn.00413cca
push 2
push dword [ebp + 0x14]
mov dword [ebx + 8], eax
call fcn.00413cca
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 0x416af8
mov edi, eax
mov eax, dword [esi + 0x11c]
shl edi, 4
add eax, edi
mov ecx, dword [eax]
test ecx, ecx
je 0x416b15
mov ecx, dword [ebp - 8]
cmp dword [eax + 8], ecx
jae 0x416c14
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 0x416ba1
mov ebx, dword [eax + 8]
add ebx, dword [eax]
mov edx, dword [esi + 0x130]
cmp ebx, edx
jne 0x416b82
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 0x416c14
add ecx, 0x10
mov dword [esi + 0x12c], ecx
jmp 0x416c14
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 0x416c05
mov edx, dword [esi + 0x134]
add ebx, edx
cmp ebx, ecx
jne 0x416bd7
mov ecx, dword [eax + 8]
add ecx, dword [eax]
cmp ecx, edx
jne 0x416bd0
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 0x416b99
mov dword [eax], edx
mov eax, dword [ebp - 8]
jmp 0x416b8d
mov edx, dword [eax + 8]
add edx, dword [eax]
cmp edx, ecx
jne 0x416be4
mov eax, dword [eax]
jmp 0x416bef
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 0x416c14
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 0x416d36
push 3
push dword [ebp + 0x14]
call fcn.00413cca
test dword [ebp + 0x18], 0x20000
pop ecx
pop ecx
mov dword [ebp + 0x20], eax
je 0x416cbb
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 0x416ce4
inc dword [ebp + 0x1c]
cmp dword [ebp - 0x24], 0x200
je 0x416cf5
test word [ebp + 0x18], 0x100
je 0x416d08
mov eax, dword [ebp + 0x20]
dec eax
push eax
push dword [ebp - 0x2c]
push dword [ebp + 8]
call fcn.00413d53
add esp, 0xc
xor edi, edi
cmp dword [ebp + 0x1c], edi
jbe 0x416d36
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.00413d53
add esp, 0xc
inc dword [ebp + 0x20]
inc edi
cmp edi, dword [ebp + 0x1c]
jb 0x416d0f
push dword [ebp - 0x10]
call fcn.00417ab1
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.00417ab1
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
call fcn.00413f20
mov dword [ebp + 8], eax
test eax, eax
mov eax, dword [esi + 0x138]
je 0x416dfc
shl eax, 4
push eax
push dword [esi + 0x118]
push dword [ebp + 8]
call fcn.004378f0
push dword [0x46d520]
mov eax, dword [esi + 0x138]
shl eax, 4
push eax
push dword [ebp + 8]
call fcn.00413d53
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.00417ab1
jmp 0x416e69
push dword [0x46d520]
shl eax, 4
push eax
push dword [esi + 0x118]
call fcn.00413d53
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.00413db6
add esp, 0xc
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
call fcn.00413f20
mov dword [ebp + 8], eax
test eax, eax
mov eax, dword [esi + 0x13c]
je 0x416ef0
shl eax, 4
push eax
push dword [esi + 0x11c]
push dword [ebp + 8]
call fcn.004378f0
push dword [0x46d524]
mov eax, dword [esi + 0x13c]
shl eax, 4
push eax
push dword [ebp + 8]
call fcn.00413d53
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.00417ab1
jmp 0x416f5d
push dword [0x46d524]
shl eax, 4
push eax
push dword [esi + 0x11c]
call fcn.00413d53
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.00413db6
add esp, 0xc
push dword [ebp + 0x14]
push esi
call fcn.004156ce
pop ecx
xor eax, eax
pop ecx
inc eax
jmp 0x416f77
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x1c