Function at 0x41958e
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
push ebx
push esi
push edi
xor edi, edi
push dword [ebp + 8]
mov dword [0x421540], edi
mov dword [ebp - 0x18], edi
mov dword [ebp - 4], edi
call fcn.00419b07
test eax, eax
pop ecx
je 0x419ad6
movzx esi, word [0x421746]
mov eax, dword [0x421768]
mov ecx, dword [0x4217c0]
xor edx, edx
mov dword [0x421570], eax
mov eax, dword [0x421540]
cmp esi, edi
mov dword [ebp - 0x30], esi
mov dword [0x42155c], ecx
jle 0x419603
lea edi, [eax + 0xc]
mov ebx, dword [edi + 4]
add ebx, dword [edi]
cmp ebx, ecx
ja 0x4195f7
inc edx
add edi, 0x28
cmp edx, esi
jl 0x4195e4
jmp 0x419603
lea ecx, [edx + edx*4]
or byte [eax + ecx*8 + 0x27], 0x80
lea ecx, [eax + ecx*8 + 0x24]
mov ecx, dword [0x4217e0]
lea ebx, [esi + esi*4]
shl ebx, 3
xor edi, edi
mov edx, dword [ebx + eax - 0x1c]
mov dword [ebp - 0x24], edi
cmp ecx, edx
jne 0x419684
mov eax, dword [0x4217e4]
mov dword [ebp - 0x20], edx
push eax
push 0x40
mov dword [ebp - 0x24], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
cmp eax, edi
mov dword [ebp - 0x18], eax
je 0x419ad6
mov eax, dword [0x421540]
dec esi
push edi
push edi
lea ebx, [esi + esi*4]
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
shl ebx, 3
mov dword [ebp - 0x30], esi
push dword [ebx + eax + 0x14]
push dword [ebp + 8]
call edi
lea eax, [ebp - 0x10]
push 0
push eax
push dword [ebp - 0x24]
push dword [ebp - 0x18]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [0x421540]
push 0
push 0
push dword [ebx + eax + 0x14]
push dword [ebp + 8]
call edi
jmp 0x4196a1
cmp ecx, edi
jne 0x419adb
mov eax, dword [0x421790]
push 2
push edi
push edi
push dword [ebp + 8]
mov dword [ebp - 0x20], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [0x421548]
mov dword [0x421544], esi
mov esi, dword [0x42183c]
lea ecx, [eax + eax*4]
mov eax, dword [0x421540]
shl ecx, 3
lea edi, [ebx + eax]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov eax, dword [0x421564]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x1000
cmp eax, ecx
ja 0x4196de
mov eax, ecx
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edx, eax
test edx, edx
mov dword [ebp - 0x1c], edx
je 0x419ab8
mov eax, dword [0x421554]
mov ecx, dword [0x42183c]
mov edi, edx
mov dword [ebp - 0x28], edx
lea eax, [eax + eax*4]
add edx, 8
mov dword [ebp - 8], edx
xor edx, edx
mov esi, dword [ecx + eax*8 + 0xc]
lea eax, [ecx + eax*8]
mov ecx, dword [0x421564]
mov dword [ebp - 0x14], edx
add esi, dword [eax + 8]
sub esi, ecx
mov eax, ecx
add esi, dword [0x421838]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [0x421548]
cmp ecx, edx
jle 0x419afa
mov eax, dword [0x421540]
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0xc], ebx
jmp 0x419755
xor edx, edx
mov ecx, dword [ebp - 0xc]
push 1
push edx
push edx
push dword [ebp + 8]
lea esi, [ecx + eax]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, dword [ebp - 0x2c]
mov ebx, dword [ebp - 0x20]
mov dword [esi + 0x14], eax
mov eax, dword [0x42183c]
mov dword [esi + 0xc], ebx
mov ecx, dword [ecx + eax + 0x10]
mov eax, dword [0x42177c]
mov dword [ebp - 0x20], eax
neg dword [ebp - 0x20]
lea edx, [ecx + eax - 1]
and edx, dword [ebp - 0x20]
mov dword [esi + 0x10], edx
mov edx, dword [ebp - 0x14]
cmp edx, dword [0x421554]
jne 0x419823
mov ecx, dword [0x421564]
mov edi, dword [ebp - 0x24]
add eax, ecx
push 0
lea edx, [ecx + edi]
mov dword [0x4217e0], ebx
lea eax, [eax + edi - 1]
mov dword [esi + 8], edx
and eax, dword [ebp - 0x20]
mov dword [0x4217e4], edx
mov dword [esi + 0x10], eax
lea eax, [ebp - 0x10]
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
push eax
push edi
push dword [ebp - 0x18]
push dword [ebp + 8]
call esi
mov edi, dword [ebp - 0x1c]
lea eax, [ebp - 0x10]
push 0
push eax
push dword [0x421564]
push edi
push dword [ebp + 8]
call esi
mov ecx, 0x400
xor eax, eax
rep stosd dword es:[edi], eax
mov ecx, dword [ebp - 0xc]
push eax
lea eax, [ebp - 0x10]
push eax
mov eax, dword [0x421540]
mov eax, dword [ecx + eax + 0x10]
sub eax, dword [0x421564]
sub eax, dword [ebp - 0x24]
push eax
push dword [ebp - 0x1c]
push dword [ebp + 8]
call esi
jmp 0x419972
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
test edi, edi
mov dword [ebp - 4], edi
je 0x419ab8
mov eax, dword [0x42183c]
mov ecx, dword [ebp - 0x2c]
add eax, ecx
mov ecx, dword [eax + 0x10]
mov edx, dword [eax + 0xc]
mov eax, dword [0x421838]
mov dword [ebp - 0x20], ecx
lea esi, [edx + eax]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [0x421720]
lea ecx, [edx + eax]
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x38], ecx
mov eax, dword [eax]
cmp ecx, eax
jbe 0x4198fb
mov ecx, dword [0x421560]
mov edi, dword [ebp - 0x1c]
add ecx, edi
mov dword [ebp - 0x34], ecx
mov ecx, dword [ebp - 0x34]
cmp dword [ebp - 8], ecx
jae 0x4198fb
mov ecx, eax
mov eax, dword [ebp - 0x28]
sub ecx, edx
mov eax, dword [eax + 4]
sub eax, 8
shr eax, 1
mov edi, eax
dec eax
test edi, edi
je 0x4198e3
inc eax
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 8]
mov ax, word [eax]
mov edi, eax
and di, 0xf000
cmp di, 0x3000
jne 0x4198da
mov edi, dword [ebp - 4]
and eax, 0xfff
add eax, ecx
add eax, edi
mov edi, dword [0x421774]
sub edi, dword [esi + 0x34]
sub edi, edx
add edi, ebx
add dword [eax], edi
add dword [ebp - 8], 2
dec dword [ebp - 0x20]
jne 0x4198ab
mov eax, dword [ebp - 0x28]
add ecx, ebx
mov dword [eax], ecx
mov eax, dword [ebp - 8]
add dword [ebp - 8], 8
mov dword [ebp - 0x28], eax
mov eax, dword [eax]
cmp dword [ebp - 0x38], eax
ja 0x419889
mov eax, dword [ebp - 0x14]
cmp eax, dword [0x421550]
jne 0x419947
mov eax, dword [esi + 0x80]
mov ecx, ebx
sub eax, edx
sub ecx, edx
add eax, dword [ebp - 4]
mov esi, dword [eax]
test esi, esi
je 0x419947
and dword [eax + 8], 0
and dword [eax + 4], 0
add dword [eax + 0xc], ecx
add dword [eax + 0x10], ecx
add esi, ecx
mov dword [eax], esi
sub esi, ebx
add esi, dword [ebp - 4]
mov edx, dword [esi]
add edx, ecx
mov dword [esi], edx
mov edx, dword [esi + 4]
add esi, 4
test edx, edx
jne 0x419934
add eax, 0x14
jmp 0x419915
mov ecx, dword [ebp - 0xc]
lea eax, [ebp - 0x10]
push 0
push eax
mov eax, dword [0x421540]
push dword [ecx + eax + 0x10]
push dword [ebp - 4]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
and dword [ebp - 4], 0
mov eax, dword [0x421540]
mov ecx, dword [ebp - 0xc]
add dword [ebp - 0x2c], 0x28
add dword [ebp - 0xc], 0x28
mov edx, dword [ecx + eax + 8]
mov ecx, dword [0x421778]
lea edx, [edx + ecx - 1]
neg ecx
and edx, ecx
mov ecx, dword [0x421548]
add ebx, edx
inc dword [ebp - 0x14]
cmp dword [ebp - 0x14], ecx
mov dword [ebp - 0x20], ebx
jl 0x419753
xor edx, edx
mov esi, dword [ebp - 0x30]
mov dword [0x421810], edx
mov dword [0x421814], edx
mov dword [0x421818], edx
mov dword [0x42181c], edx
mov edx, dword [0x42154c]
mov edi, dword [0x421558]
add edx, esi
add ecx, esi
xor esi, esi
lea edx, [edx + edx*4]
mov word [0x421746], cx
movzx ecx, cx
mov edx, dword [eax + edx*8 + 0xc]
mov dword [0x421790], ebx
add edi, edx
mov dword [0x421760], esi
mov dword [0x4217c0], edi
mov edi, dword [0x421720]
mov edi, dword [edi + 0x84]
mov dword [0x4217c4], edi
mov edi, dword [0x42156c]
add edx, edi
xor edi, edi
mov dword [0x421768], edx
xor edx, edx
test ecx, ecx
mov dword [0x42175c], edi
mov dword [0x421764], edx
jle 0x419a66
add eax, 0x10
mov ebx, dword [eax + 0x14]
test bl, 0x20
je 0x419a40
add edi, dword [eax]
test bl, 0x40
je 0x419a47
add esi, dword [eax]
test bl, 0x80
je 0x419a4e
add edx, dword [eax]
add eax, 0x28
dec ecx
jne 0x419a36
mov dword [0x421764], edx
mov dword [0x421760], esi
mov dword [0x42175c], edi
mov eax, dword [0x421568]
push 0
add eax, 0xffffff08
push 0
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
lea eax, [ebp - 0x10]
push 0
push eax
push 0xf8
push 0x421740
push dword [ebp + 8]
call esi
lea eax, [ebp - 0x10]
push 0
push eax
movzx eax, word [0x421746]
lea eax, [eax + eax*4]
shl eax, 3
push eax
push dword [0x421540]
push dword [ebp + 8]
call esi
cmp dword [ebp - 0x18], 0
je 0x419ac7
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp dword [ebp - 0x1c], 0
je 0x419ad6
push dword [ebp - 0x1c]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [0x421540]
pop edi
pop esi
test eax, eax
pop ebx
je 0x419ae9
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
cmp dword [ebp - 4], 0
je 0x419af8
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
leave
ret
mov eax, dword [0x421540]
mov ebx, dword [ebp - 0x20]
jmp 0x4199ad